Rss Feed
Tweeter button
Facebook button
Linkedin button
2010
01.28

I was searching in google map that how to display marker first. So i find out that google map display marker with help of latitude and longnitude. With help of that i have made one basic application for my customer. Now problem arise when customer asks me to make it working with address stored in database. Initially i thought it will be easy to make it but i was stuck when i found that with help of Address to get latitude and longnitude is not easy. So here is a brief tutorial what i have gone throught and make it working.

First Sign Up for the Google Maps API link

Now goto http://code.google.com/apis/maps/documentation/overlays.html and find Custom Icons in Markers section. Understand this example properly. This is example of creating markers at random place with Text on it.

google_map

Now we will use GClientGeocoder method of google to find address. First we add our addresses in one single dimension array and after that we call one function which get Latitude and Longnitude of those address and place marker in google map.

I have uploaded one file here. You can download it from here. This is working example with 2 different addresses of London. You have to just change your API key in this example.

This is how it looks.

final_map

2 comments so far

Add Your Comment
  1. I think you can do from address.
    We have done this for below website.
    http://www.bestbidvacationrentals.com/rental-details-BY-THE-SEA-255.aspx
    Check its HTML source code.

  2. Drupal has in-built modules for gmap and its customization. SO if you choose drupal as development poaltform then it will be more easy. if in case you can do that in drupal. We have done this for songline.nl site.