Hello Friends,

Are you looking to implement Google Map in your website ?? Do you have a Real estate property website ? If yes, the you must implement(integrate) Google map using API key into your website. Recently i have implemented the Google map into one of my client's website and it is very easy to implement.  Here i am showing you the step by step way to integrate the Google map into your website.

Below are the steps.

 

<?php

require(‘GoogleMapAPI.class.php’);

$map = new GoogleMapAPI(‘map’);

$map->setAPIKey(‘APIKEYHERE’);

$map->addMarkerByAddress(‘London SW66HX’,'Our Address’,'<b>London <br />SW66HX</b>’);

?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns:v="urn:schemas-microsoft-com:vml">

<head>

<?php $map->printHeaderJS(); ?>

<?php $map->printMapJS(); ?>

<!– necessary for google maps polyline drawing in IE –>

<style type="text/css">

v\:* {

behavior:url(#default#VML);

}

</style>

</head>

<body onLoad="onLoad();">

<?php $map->printMap(); ?>

</body>

</html>

 

1) If you don't have Google map API than
Create the one from here. (Its a free)
2) Download GoogleMapAPI.class.php Class.

3) Include GoogleMapAPI.class.php file in your web page.

<?php
    require('GoogleMapAPI.class.php');
?>

4) Add these three statement. Change your Google Map API key in second statement and provide address for which you want to show Google Map in third statement.

<?php
    $gmap = new GoogleMapAPI('map');
    $gmap->setAPIKey('APIKEYHERE');
    $gmap->addMarkerByAddress('Ahmedabad India','Address','<b>Ahmedabad <br />Gujarat <br /> India</b>');
?>

5) Write below code in <head></head> tags.

<head>
<?php $gmap->printHeaderJS(); ?>
<?php $gmap->printMapJS(); ?>
<!– necessary for google maps polyline drawing in IE –>
<style type="text/css">
  v\\:* {
    behavior:url(#default#VML);
  }
</style>
</head>

6) Call onLoad() function in body tag.
<body onLoad="onLoad();">
7) Write below statement to show the Google map as per provided address.

<?php $gmap->printMap(); ?>

Thats it.

 

If you find any problem in this than let me know by comment.

To know more about programming,JavaScript issues,jQuery,Expression Engine,MYSQL database and Open-source, enter your email address below. We will send you free tutorials.

Enter your email address:
 
Feel free to ask any question. Just leave your comment below and we will answer your comment with in 24 hours.
rax rss Implementing Google Maps using API on your website  rax twitter Implementing Google Maps using API on your website  rax facebook Implementing Google Maps using API on your website  rax myspace Implementing Google Maps using API on your website