D3
OG
Old school D3 from simpler times
All examples
By author
By category
About
zross
Full window
Github gist
Example of Google Places Library (get place details if you have place ID)
<!DOCTYPE html> <html> <head> <title>Place details</title> <meta name="viewport" content="initial-scale=1.0, user-scalable=no"> <meta charset="utf-8"> <style> html, body, #map-canvas { height: 100%; margin: 0px; padding: 0px } </style> <script src="https://maps.googleapis.com/maps/api/js?v=3.exp&libraries=places"></script> <script> function initialize() { var map = new google.maps.Map(document.getElementById('map-canvas'), { center: new google.maps.LatLng(42.444508,-76.499491), zoom: 15 }); var request = { placeId: "ChIJT_x1AIOB0IkRhcd1YOHXJXk" }; var infowindow = new google.maps.InfoWindow(); var service = new google.maps.places.PlacesService(map); service.getDetails(request, function(place, status) { console.log(status) if (status == google.maps.places.PlacesServiceStatus.OK) { console.log(place) var marker = new google.maps.Marker({ map: map, position: place.geometry.location }); google.maps.event.addListener(marker, 'click', function() { infowindow.setContent(place.name); infowindow.open(map, this); }); } }); } google.maps.event.addDomListener(window, 'load', initialize); </script> </head> <body> <div id="map-canvas"></div> </body> </html>
https://maps.googleapis.com/maps/api/js?v=3.exp&libraries=places