Tuesday 5 March 2013

Google Maps Javascript API

According to Google website
(http://code.google.com/apis/maps/documentation/javascript/),
the JavaScript Maps API v3 is a free service, available for any web site that
is free to consumers. If you have any concern, read the above sentence again….  Or check the terms, clause 9.1 if not
clear.

So, what it is? Interactive map with more controls on the map and particularly about the
flexibilities on what you can do and you want do with the map? Yup, this is pretty much what the API allow you to do with. 
However, it is not really straightforward. But it is straightforward only if you are familiar with JavaScript, as well as
the meaning of callback or asynchronous. No worry, it is not the end of the world.

It is pretty helpful to start with the basic samples under
the developer’s guide. Of course, if you prefer to do something quick, just need a
map and some markers on the map to pin-point your location or some of your favourite
locations, then I would suggest you jump into ‘Using Closures in Event
Listeners’ – Event topic,  and ‘Geocoding’.

The 1st one covered the codes on how to create
location, and more importantly the Markers. And, the second topic will be all
about ‘the convertor’ convert location name into geographic coordinates. You
need something like latitude and longitude for the position on the map. A
marker needs it. (just refer to the sample code about how to geocode an address
(either from user input or from db) and place a marker at the returned latitude
and longitude values. http://code.google.com/apis/maps/documentation/javascript/services.html#Geocoding)

Yup, before I close the topic, one thing I need to emphasis
here is the :

<!DOCTYPE html> tag.
Makesure you change your default doc type to this one. Else, you  can’t see the map.

JL

No comments:

Post a Comment

How to run unit test for your Xamarin Application in AppCenter?

How to run unit test for your Xamarin application in AppCenter?  When we talk about Building and Distributing your Xamarin app, you m...