var layers=new Array(); var layersVisibility=new Array(); var gMap; function showHideLayer(name) { if (layersVisibility[name]) { hideLayer(name); return 'off'; } else { showLayer(name); return 'on'; } } function showLayer(name) { if (layers[name]==undefined) return; layersVisibility[name]=true; for (i=0;i0) { html += '
'; } html += '

'; //"+url.replace(/^http:\/\//g,'')+" if (url.length > 0) html += "" + caption + ""; else html += caption; html += '

'; if (address.length>1) html+="

Adresa: " + address + "

"; html += "

" + perex; if (url.length > 0) html += " Detail >>"; html += "

"; if (thumbnail.length>0) { html += '
'; } var close = new Element('a', { href: '#', "html": "(x) zavřít", "class": "close" } ); close.addEvent('click', function() { if ($('kjhgg')!=null) $('kjhgg').dispose(); return false; }); if ($('kjhgg')==null) { var div = new Element('div', { "id":"kjhgg", "styles": { "background": 'url("http://www.borovice.cz/skin/borovice/img/layout/bg_map_popup.png?up=")' } }); div.set('html', html); close.inject(div,'top'); div.inject($('mapa'),'after'); } else { $('kjhgg').set('html', html); close.inject($('kjhgg'),'top'); } //marker.openInfoWindowHtml(html, {maxWidth : 300, maxHeight : 130}); }); return marker; } GEvent.addListener(gMap, "click", function(overlay, point) { if (overlay){ //marker clicked! } else document.getElementById('coordinates').value = point.x + ',' + point.y; }); showLayer('default'); updateStatusBar(); // Mouse wheel zoom - Attach event handlers ----- gMap.enableDoubleClickZoom(); gMap.enableContinuousZoom(); GEvent.addDomListener(container, "DOMMouseScroll", wheelZoom); GEvent.addDomListener(container, "mousewheel", wheelZoom); // ---------------------------------------------- } } // Mouse wheel zoom - Event handler ----- function wheelZoom(event) { if (wheelZooming) { return; } wheelZooming = true; // zoomRect and rectIcon are global variables!!! zoomRect = new GMarker(mouseLatLng,{icon:rectIcon}); gMap.addOverlay(zoomRect); if (event.cancelable) { event.preventDefault(); } gMap.closeInfoWindow(); if((event.detail || -event.wheelDelta) < 0) { window.setTimeout(function(){ gMap.removeOverlay(zoomRect); gMap.zoomIn(mouseLatLng,true,true); wheelZooming = false; },200); } else { window.setTimeout(function(){ gMap.removeOverlay(zoomRect); gMap.zoomOut(mouseLatLng,true); wheelZooming = false; },200); } return false; } // End event handler ----- // Nothing related to mouse wheel zoom below this line --------------------------- function moveEnd() { updateStatusBar(); } function zoomEnd(oldZ,zoom) { updateStatusBar(); } function updateStatusBar() { var center = gMap.getCenter(); var zoom = gMap.getZoom(); var bounds = gMap.getBounds(); var SW = bounds.getSouthWest(); var NE = bounds.getNorthEast(); var oCoords = document.getElementById("coords"); } function resizeMap() { if (gMap) { gMap.checkResize(); } } function mouseMove(mousePt) { mouseLatLng = mousePt; var zoom = gMap.getZoom(); var oStatusDiv = document.getElementById("mouseTrack") var mousePx = normalProj.fromLatLngToPixel(mousePt, zoom); } window.addEvent('load', function() { initialize(); }); window.addEvent('unload', function() { GUnload(); });