//
add event for this place"; tekst1 = ""+tekst+"
"+cm_city; tabs.push(new GInfoWindowTab('Place', tekst1)); tabs.push(new GInfoWindowTab('Events', tekstx)); //tabs.push(new GInfoWindowTab('Zoom', marker.showMapBlowup())); marker.openInfoWindowTabsHtml(tabs); // marker.openInfoWindowHtml("" + tekst + "
" + tekstx); // document.getElementById("uitleg").innerHTML = ""+tekst+"
"+tekstx + "
The GPoint value is: " + map.fromLatLngToDivPixel(point) + " at zoom level " + map.getZoom();; }); GEvent.addListener(marker, "mouseover", function() { document.getElementById("uitleg").innerHTML = ""+tekst+", "+cm_city+""; }); return marker; } // end of createmarker /*---------------------------------------------------------------------------------- define variables IMPORTANT : BEFORE LOAD FUNCTION !!! ----------------------------------------------------------------------------------*/ var map = null var geocoder = null; /*---------------------------------------------------------------------------------- function load() start googlemap ----------------------------------------------------------------------------------*/ function load() { if (GBrowserIsCompatible()) { // *********************************************** define variables map = new GMap2(document.getElementById("map")); geocoder = null; // *********************************************** add map listener for move : show center, bounds, zoom GEvent.addListener(map, "moveend", function() { var center = map.getCenter(); // TO ADD : select only markers in visible area // TO ADD : cluster per zoomlevel // bounds : bounds = []; bounds.x1 = map.getBounds().getSouthWest().lng(); bounds.x2 = map.getBounds().getNorthEast().lng(); bounds.y1 = map.getBounds().getSouthWest().lat(); bounds.y2 = map.getBounds().getNorthEast().lat(); rangex = bounds.x2 - bounds.x1; rangey = bounds.y2 - bounds.y1; var p_topleft = new GLatLng(bounds.x1,bounds.y1); var p_botright = new GLatLng(bounds.x2,bounds.y2); var p_topright = new GLatLng(bounds.x2,bounds.y1); // document.getElementById("message").innerHTML = "centrum : " + center.toString() + " // x1y1 : " + bounds.x1 + " " + bounds.y1 + " x2y2 : " + bounds.x2 + " " +bounds.y2 + " rangex : " + rangex + " rangey : " + rangey + " zoom : " + map.getZoom() + "
distance center-p1 : " + Math.round(center.distanceFrom(p_topleft)/1000) + "
distance topleft - topright : " + Math.round(p_topleft.distanceFrom(p_topright)/1000); }); // *********************************************** add map controls geocoder = new GClientGeocoder(); map_setcontrols(map); if (php_country!="") { //center_countryx(php_country); map.setCenter(new GLatLng(20,20), 2); } else { map.setCenter(new GLatLng(20,20), 2); } var punten = ""; var markers = []; for (var i = 0; i < points.length; i++) { if (points[i] != null) { var pointe = new GLatLng(points[i][2],points[i][3]); var markere = createMarker(pointe, points[i][0], points[i][1], i, points[i][4]); //map.addOverlay(markere); punten += points[i][0] + ", "; markers.push(markere); } } var markerCluster = new MarkerClusterer(map, markers); } // sluit if } // end of function "load" //]]>