this code found in google developer, , try compile it, not work @ all. want know wrong code, if follow step sample source code.
<!doctype html> <html> <head> <title>place details</title> <meta name="viewport" content="initial-scale=1.0, user-scalable=no"> <meta charset="utf-8"> <link href="/maps/documentation/javascript/examples/default.css" rel="stylesheet"> <script src="https://maps.googleapis.com/maps/api/js? v=3.exp&sensor=false&libraries=places"></script> <script> function initialize() { var map = new google.maps.map(document.getelementbyid('map-canvas'), { maptypeid: google.maps.maptypeid.roadmap, center: new google.maps.latlng(-33.8665433, 151.1956316), zoom: 15 }); var request = { reference: 'cnrkaaaagnbvnfdeqooqhzgdopoqjnv7k9-c5iqrwfuyd9tnhumz5- ahhfqykh0zmaculkqvcrpakcv8zjgqkzb6gxxtzuycp-muhafgsmw- 1cwjtpbcmk43azpaww0frtqdqadj3h2bzwwhvixlqaiccm7r4xiqmjt_oqm2fejwpbxlws3l_roubharabi5fmnknzm rl2tgju6ua4k' }; var infowindow = new google.maps.infowindow(); var service = new google.maps.places.placesservice(map); service.getdetails(request, function(place, status) { if (status == google.maps.places.placesservicestatus.ok) { 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>
any appreciate.
Comments
Post a Comment