https://google-developers.appspot.com/maps/documentation/javascript/v2/examples/marker-simple
Quando você exibe o código fonte aparece o código abaixo:
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="utf-8" /> | |
| <title>Google Maps JavaScript API Example: Simple Markers</title> | |
| <script src="//maps.google.com/maps?file=api&v=2&key=AIzaSyD4iE2xVSpkLLOXoyqT-RuPwURN3ddScAI" | |
| type="text/javascript"></script> | |
| <script type="text/javascript"> | |
| function initialize() { | |
| if (GBrowserIsCompatible()) { | |
| var map = new GMap2(document.getElementById("map_canvas")); | |
| map.setCenter(new GLatLng(37.4419, -122.1419), 13); | |
| // Add 10 markers to the map at random locations | |
| var bounds = map.getBounds(); | |
| var southWest = bounds.getSouthWest(); | |
| var northEast = bounds.getNorthEast(); | |
| var lngSpan = northEast.lng() - southWest.lng(); | |
| var latSpan = northEast.lat() - southWest.lat(); | |
| for (var i = 0; i < 10; i++) { | |
| var latlng = new GLatLng(southWest.lat() + latSpan * Math.random(), | |
| southWest.lng() + lngSpan * Math.random()); | |
| map.addOverlay(new GMarker(latlng)); | |
| } | |
| } | |
| } | |
| </script> | |
| </head> | |
| <body onload="initialize()" onunload="GUnload()"> | |
| <div id="map_canvas" style="width: 500px; height: 300px"></div> | |
| </body> | |
| </html> Testarei hoje às 21:00 horas. Parece promissor. PS: Trabalhar com mapas é cansativo, mas o resultado compensa. |
Nenhum comentário:
Postar um comentário