Use first number for the latitude (without a letter

Use Google Maps API to add a google map to your site.

Google will recommend you to get an API key to use the maps.You are not compelled to get an API key just to use Google Maps API v3 but is very helpful as it lets you watch your usage and spend for further access. Google Maps API v3 holds a quota of 1 request per second to a max of 25,000 requests per day. When your web page exceeds those boundaries, you will have to allow billing to get more.GETTING GOOGLE MAPS API KEY1.    Use your google account to log in2.

Best services for writing your paper according to Trustpilot

Premium Partner
From $18.00 per page
4,8 / 5
4,80
Writers Experience
4,80
Delivery
4,90
Support
4,70
Price
Recommended Service
From $13.90 per page
4,6 / 5
4,70
Writers Experience
4,70
Delivery
4,60
Support
4,60
Price
From $20.00 per page
4,5 / 5
4,80
Writers Experience
4,50
Delivery
4,40
Support
4,10
Price
* All Partners were chosen among 50+ writing services by our Customer Satisfaction Team

    Go to Google Developers Console3.    Scroll into the list to find the Google Maps API v3, click the “OFF” switch to turn it on4.    Agree to the terms5.    Go to the APIs console and select “API Access” from the left-hand menu6.    In the “Simple API Access” section, click on the “Create new Server key” button.7.

    Enter IP address of your web server in which your Maps requests will be coming. If you don’t know your IP address, look it up.8.

    Copy the given text on the “API key:” line which does not include that title. This is the API key for the maps.02of 05Transform Your Address to CoordinatesUse the designated numbers for longitude and latitude. To use Google Maps on the web pages, you will have to have the longitude and latitude for the location. Online tools like Geocoder.us can be used to get or GPS can be used.1.

    Type in your address in Geocoder.us in the search box. 2.    Copy the first number for the latitude (without a letter in front) and paste it into a text file.

You do not need the degree (º) indicator.3.    Copy the primary number for every longitude and paste it into the text file.Your longitude and latitude will look something like this:40.756076-73.990838Geocoder.us only works for U.S.

addresses. If needed to get the coordinates in different countries, search for a similar tool in the region.03of 05Adding the Map to Your Web PageFIRST, ADD THE MAP SCRIPT TO THEof Your DocumentOpen up your page and to the head of the document, add the following. Change the highlighted portion of the latitude and longitude numbers you wrote down in step two.SECOND, ADD THE MAP ELEMENT TO YOUR PAGEOnce you hold all the script elements attached to the HEAD of your document, you need to position your map on the page. You can do this by joining a DIV element with the id=”map-canvas” attribute. I recommend you also style this div with the width and height that will fit on your page:FINALLY, UPLOAD AND TESTThe last thing you do is upload your page and test that your map displays. Here is an instance of a Google map on the page.

Note: You need to click a link to get the map to appear because of the way the About.com CMS works. This is not the case on your page.If your map doesn’t show up, try initializing it with a BODY attribute:onload=”initialize()”>Another thing is to see if your map isn’t loading include:•    Look for typos in your JavaScript, including case.

JavaScript is case sensitive.•    Make sure that you have the zoom and center options set.•    Make sure that your DIV element is on the page with the correct ID.

•    Make sure that your DIV element has a height.04of 05Add a Marker to Your MapWhat better is a map of your area if there is no label telling people where they should go?To add a standard Google Maps red marker add the following to your script below the var map = ..

. line:var myLatlng = new google.maps.

LatLng(latitude,longitude);var marker = new google.maps.Marker({  position: myLatlng,  map: map,  title:”Former About.com Headquarters”});Amend the highlighted text to your longitude and latitude and the title you would like to arrive when people hover over the marker.You may add as many markers to the page as you like, just add new variables with new titles and coordinates, but if the map is too small to display all the markers, they won’t show unless the reader zooms out.var latlng2 = new google.

maps.LatLng(37.3316591,-122.0301778 );var myMarker2 = new google.maps.Marker({  position: latlng2,  map: map,  title:”Apple Computer”});An example of a  map with a marker is below. Note: because of the way the About.

com CMS works, you have to click a link to get the map to appear. This is not the case on your page.05of 05Add a Second (or More) Map to Your PageIf you’ve looked at my example Google maps page you’ll notice that I have more than one map displayed on the page. This is very easy to do. Here’s how.1.

    Get the longitude and latitude of all the maps you want to display as we learned in step 2 of this tutorial.2.    Insert the first map as we learned in step 3 of this tutorial.

For the map have a marker, add the marker as in step 4.3.    For another map, you will need to add three new lines to your initialize() script:var latlng2 = new google.maps.LatLng(second coordinates);var myOptions2 = { zoom: 18, center: latlng2, mapTypeId: google.maps.MapTypeId.

ROADMAP };var map2 = new google.maps.Map(document.getElementById(“map_canvas_2″), myOptions2);4.   For adding a marker to the new map too, add a second marker pointing at the second coordinates and the second map:var myMarker2 = new google.maps.Marker({ position: latlng2, map: map2, title:”Your Marker Title” });5.

    Then add the secondwhere you want the second map. And make sure to give it an id=”map_canvas_2″ ID.6.    When your page loads, two maps will displayHere is the code of a page with two Google maps on it: