// JavaScript Document if (GBrowserIsCompatible()) { // this variable will collect the html which will eventualkly be placed in the sidebar var sidebar_html = ""; // arrays to hold copies of the markers and html used by the sidebar // because the function closure trick doesnt work there var gmarkers = []; var htmls = []; var i = 0; // A function to create the marker and set up the event window function createMarker(point,name,html) { var marker = new GMarker(point); GEvent.addListener(marker, "click", function() { marker.openInfoWindowHtml(html); }); // save the info we need to use later for the sidebar gmarkers[i] = marker; htmls[i] = html; // add a line to the sidebar html sidebar_html += '' + name + '
'; i++; return marker; } // This function picks up the click and opens the corresponding info window function myclick(i) { gmarkers[i].openInfoWindowHtml(htmls[i]); } // create the map var map = new GMap2(document.getElementById("map")); map.addControl(new GLargeMapControl()); map.addControl(new GMapTypeControl()); map.setCenter(new GLatLng(42.564000, 27.63116), 15, G_SATELLITE_MAP); // add the points var point = new GLatLng(42.564120, 27.62750); var marker = createMarker(point,"*Showroom ZOI KLIMA POMORIE","
Showroom ZOI KLIMA
Adress:
Pomorie 8200,
kv.Svoboda 30
Tel./Fax:0596/22627
") map.addOverlay(marker); var point = new GLatLng(42.66477, 27.71804); var marker = createMarker(point,"*Office gr. Nessebar","
ZOI KLIMA NESEBAR
Adress:
Nesebar 8230,
ul. Izgrev
Tel./Fax:0554/43590
") map.addOverlay(marker); // put the assembled sidebar_html contents into the sidebar div document.getElementById("sidebar").innerHTML = sidebar_html; } else { alert("Sorry, the Google Maps API is not compatible with this browser"); }