var geocoder; var map; var side_bar_html = ""; var gmarkers = []; var i = 0; /// icons // On page load, call this function function load() { map = new GMap2(document.getElementById("map")); map.setCenter(new GLatLng(39.809874, -98.560706), 3); map.setMapType(G_HYBRID_MAP); map.addControl(new GLargeMapControl()); map.addControl(new GMapTypeControl()); map.addMapType(G_PHYSICAL_MAP); if(myMarkers!='none') { loadMyMarkers(); } document.getElementById('map_center').value=map.getCenter(); document.getElementById('map_zoom').value=map.getZoom(); /// get center info... GEvent.addListener(map, "moveend", function() { //alert(map.getZoom()+'\n'+document.getElementById('map_zoom').value); if(document.getElementById('map_zoom').value!=map.getZoom()) { document.getElementById('map_zoom').value=map.getZoom(); // clear markers and reload for new zoom\\ map.clearOverlays(); if(myMarkers!='none') { loadMyMarkers(); } } document.getElementById('map_center').value=map.getCenter(); }); } function addToMap(response) { place = response.Placemark[0]; point = new GLatLng(place.Point.coordinates[1], place.Point.coordinates[0]); marker = new GMarker(point); map.addOverlay(marker); GEvent.addListener(marker, "click", function() { marker.openInfoWindowHtml('need some info here!!'); }); } function addNewMarker() { var lat=document.getElementById('lat').value; var lon=document.getElementById('lon').value; if(lat=='') { place = map.getCenter(); lat = place.y; lon = place.x; } point = new GLatLng(lat,lon); //alert(point) if(document.getElementById('newlatlon').value=='') { newMarker(point); } else { alert('Please save your changes\nbefore adding a new marker'); } } function loadMyMarkers() { if(myMarkers) { for (var i = 0; i < myMarkers.length; i++) { if(map.getZoom()>=myMarkers[i][16]) { var point = new GLatLng(myMarkers[i][2],myMarkers[i][3]); var html = '
'; html += ''; html += ''; html += ''; //html += ''; if(myMarkers[i][7]!='') { html += ''; } html += '
'; html += myMarkers[i][4]; html += '
'; if(myMarkers[i][6]!='') { if(myMarkers[i][7]!='') { var imageDimensions=myMarkers[i][7].split("X"); if(Number(imageDimensions[0])!='NaN') { var imageWidth=imageDimensions[0]; } if(Number(imageDimensions[1])!='NaN') { var imageHeight=imageDimensions[1]; } } html += '0) { html += ' width="'+imageWidth+'"'; } if(imageHeight>0) { html += ' height="'+imageHeight+'"'; } html += ' hspace="10" vspace="0" align="left">'; //html += ' '; } else { //html += ' '; } html += myMarkers[i][5]; html += '
'; html += ''+myMarkers[i][9]+''; html += '
'; // create the marker var marker = createMarker(point,myMarkers[i][4],html,icon[myMarkers[i][14]],myMarkers[i][15]); map.addOverlay(marker); if(myMarkers[i][15]=='Y') { GEvent.trigger(marker,"click"); } if(markerOpenID==myMarkers[i][1]) { if(document.getElementById('map_center').value=='') { GEvent.trigger(marker,"click"); } } } } } } // A function to create the marker and set up the event window function createMarker(point,name,html,icon,draggable) { var marker = new GMarker(point,{icon: icon, title: name}); GEvent.addListener(marker, "click", function() { marker.openInfoWindowHtml(html); }); return marker; } function myclick(i) { GEvent.trigger(gmarkers[i], "click"); } function mapLink(url) { if(url.indexOf('?')=='-1') { url += '?'; } else { url += '&'; } url += 'sml='+document.getElementById('sml').value; url += '&map_zoom='+document.getElementById('map_zoom').value; url += '&map_center='+document.getElementById('map_center').value; window.open(url, '_top') } //

Reduslim Kaufen