/ Published in: PHP

Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<script src="http://maps.google.com/maps?file=api&v=2&key=ApiKeyinizBurayaYazılacak&sensor=true" type="text/javascript"></script> <script type="text/javascript"> var geocoder; var map; function initialize() { var geocoder = new GClientGeocoder(); var map = new GMap2(document.getElementById("map_canvas")); geocoder.getLocations("Istanbul , TURKEY", function(result){ if (result.Status.code != 200) { alert('Could not geocode "' + result.name + '"'); return; } place = result.Placemark[0]; point = new GLatLng(place.Point.coordinates[1], place.Point.coordinates[0]); map.setMapType(G_HYBRID_MAP); map.setCenter(point, 8); marker = new GMarker(point); map.addOverlay(marker); alert("OK"); marker.openInfoWindowHtml(place.address); }); } $(document).ready(function(){ initialize(); });
Comments
