Let us begin with our first example using Google Maps API v3. Even before a marker - the most basic element of a map, appears, the map should be seen on the screen. Let us have a look at the following javascript code first. We will then have a look at the elements in the code.
Ta-da a map in action! This map is centred at the Sansad Bhavan, New Delhi, India.
In the above code the head of the document contains a critical script element. Its src attribute points to the location of the API on Google's server. In API v3 there is no need to obtain a key for the API. The remaining is simple Javascript.
Happy mapping!!!
I need to use this, please help me regarding this
ReplyDeletewhat is the requestUrl and what is the response...is response is just an image!
requesturl="http://www.maps.google.com/_some format_/searchstring/_some format_"
Firstly....response is not an image...It is a map like you can see on Google Maps home page http://maps.google.com/. You can copy paste my code in a simple file and save it as a html and view it in your browser.
ReplyDeleteSecondly about the requestUrl...Go to google maps home page and search for anything you like. Search criteria could be latitude-longitude value or a place. You will find the URL at the top of the screen.