|
|
|
новичок
      
участник
Last Login: 20.02.2007 10:12
Сообщ.: 2,
Visits: 5
|
|
| Не могу поставить маркеры со своими координатами на карту Google на своем сайте. Читаю Google Maps API, но не получается. На форумах такая простая проблема не обсуждается (может быть не нашел), три дня пробую - и никак. Помогите новичку!
|
|
|
|
|
новичок
      
участник
Last Login: 20.02.2007 10:12
Сообщ.: 2,
Visits: 5
|
|
| Нашел! if (GBrowserIsCompatible()) { // A function to create the marker and set up the event window // Dont try to unroll this function. It has to be here for the function closure // Each instance of the function preserves the contends of a different instance // of the "marker" and "html" variables which will be needed later when the event triggers. function createMarker(point,html) { var marker = new GMarker(point); GEvent.addListener(marker, "click", function() { marker.openInfoWindowHtml(html); }); return marker; } // Display the map, with some controls and set the initial location var map = new GMap2(document.getElementById("map")); map.addControl(new GLargeMapControl()); map.addControl(new GMapTypeControl()); map.setCenter(new GLatLng(43.907787,-79.359741),8); // Set up three markers with info windows var point = new GLatLng(43.65654,-79.90138); var marker = createMarker(point,'<div style="width:240px">Some stuff to display in the First Info Window</div>') map.addOverlay(marker); var point = new GLatLng(43.91892,-78.89231); var marker = createMarker(point,'Some stuff to display in the<br>Second Info Window') map.addOverlay(marker); var point = new GLatLng(43.82589,-79.10040); var marker = createMarker(point,'Some stuff to display in the<br>Third Info Window') map.addOverlay(marker); }
|
|
|
|