var x1200912610232 = ""; var x1200912610233 = 13; var x1200912610234; var x1200912610235; var x1200912610236; var x1200912610237; var x1200912610238; var x1200912610239 = new Array(); var x1200912610240 = new Array(); var x1200912610241 = 46.159; var x1200912610242 = 8.7458; var x1200912610243 = ""; var x1200912610244 = navigator.userAgent.toLowerCase(); x1200912610243 = (x1200912610244.indexOf("msie")>-1); function setHost(x1200912610245) { x1200912610232 = x1200912610245; } function doInit() { initArray(); x1200912610281(); } function objCapanna(x1200912610246, x1200912610247, x1200912610248, x1200912610249, x1200912610250, x1200912610251, x1200912610252, x1200912610253, x1200912610254, x1200912610255, x1200912610256, x1200912610257, x1200912610258, x1200912610259) { var x1200912610260 = new Date(); var x1200912610261 = x1200912610260.getDate(); this.x1200912610262 = x1200912610246; this.x1200912610263 = x1200912610247; this.x1200912610264 = x1200912610248; this.x1200912610265 = x1200912610249; this.x1200912610266 = x1200912610250; var x1200912610267 = parseInt(x1200912610251 / x1200912610259 / x1200912610261); this.x1200912610268 = x1200912610267; var x1200912610269 = parseInt((x1200912610252 / x1200912610259) - x1200912610261); this.x1200912610270 = x1200912610269; var x1200912610271 = x1200912610253 * x1200912610261 / x1200912610259; var x1200912610272; var x1200912610272 = Math.round(x1200912610271 * 10000); x1200912610271 = x1200912610272 / 10000; this.x1200912610273 = x1200912610271; var x1200912610274 = Math.sqrt(x1200912610254 * x1200912610261 / x1200912610259); var x1200912610272 = Math.round(x1200912610274 * 10000); x1200912610274 = x1200912610272 / 10000; this.x1200912610275 = x1200912610274; this.x1200912610276 = x1200912610255; this.x1200912610277 = x1200912610256; this.x1200912610278 = x1200912610257; this.x1200912610279 = x1200912610258; this.x1200912610280 = x1200912610259; } function x1200912610281() { buildTable(); if (x1200912610232 != 'localhost') { x1200912610237 = new GMap2(document.getElementById("id_map")); x1200912610237.setCenter(new GLatLng (x1200912610241, x1200912610242), x1200912610233, G_HYBRID_MAP); x1200912610237.addControl(new GLargeMapControl()); x1200912610237.addControl(new GMapTypeControl()); x1200912610237.addControl(new GScaleControl()); x1200912610237.addControl(new GOverviewMapControl()); GEvent.addListener(x1200912610237, "zoomend", x1200912610282 ); GEvent.addListener(x1200912610237, "moveend", x1200912610282 ); x1200912610282(); } else { x1200912610233 = 14; x1200912610234 = 46.1933; x1200912610235 = 9.018; x1200912610236 = "H"; alert("Prefs simuliert - ZL: " + x1200912610233 + " Lat/Lon: " + x1200912610234 + " / " + x1200912610235 + " MapType: " + x1200912610236); x1200912610282(); } } function unloadMap() { if (x1200912610232 != 'localhost') { GUnload(); } } function x1200912610282() { var x1200912610283=document.getElementById('id_showmarker').checked; if (x1200912610283 == false) { x1200912610321(); return; } if (x1200912610232 != 'localhost') { var x1200912610284 = x1200912610237.getZoom(); gZoomLevelOld = x1200912610284; var x1200912610285 = x1200912610237.getCenter(); var x1200912610286 = x1200912610285.lat(); var x1200912610287 = x1200912610285.lng(); var x1200912610288 = Math.round(x1200912610286 * 10000) / 10000; var x1200912610289 = Math.round(x1200912610287 * 10000) / 10000; gSearchLat = x1200912610288; gSearchLon = x1200912610289; document.getElementById('id_1').innerHTML = "Center : " + x1200912610288 + " / " + x1200912610289 + " - Zoomlevel: " + x1200912610284 ; var x1200912610290 = x1200912610237.getBounds(); var x1200912610291 = x1200912610290.getSouthWest(); var x1200912610292 = x1200912610291.lng(); var x1200912610293 = x1200912610291.lat(); var x1200912610294 = x1200912610290.getNorthEast(); var x1200912610295 = x1200912610294.lng(); var x1200912610296 = x1200912610294.lat(); var x1200912610297 = 0; var x1200912610298 = 0; if (x1200912610293 == x1200912610296) { x1200912610297 = 0.02; x1200912610298 = 0.02; } else { } x1200912610293 = x1200912610293 - x1200912610297; x1200912610292 = x1200912610292 - x1200912610298; x1200912610296 = x1200912610296 + x1200912610297; x1200912610295 = x1200912610295 + x1200912610298; } else { x1200912610288 = parseFloat(x1200912610234); x1200912610289 = parseFloat(x1200912610235); alert("x1200912610282: geht teilweise nicht, " + x1200912610232 + ", MinMax: " + x1200912610288 + " / " + x1200912610289 ); x1200912610297 = 0.1; x1200912610298 = 0.1; x1200912610293 = x1200912610288 - x1200912610297; x1200912610292 = x1200912610289 - x1200912610298; x1200912610296 = x1200912610288 + x1200912610297; x1200912610295 = x1200912610289 + x1200912610298; alert(x1200912610293 + "/" + x1200912610292 + " -> " + x1200912610296 + "/" + x1200912610295); } var x1200912610299 = new Array(); var x1200912610300 = gCAPANNAarray.length; x = 0; for (var x1200912610301=0; x1200912610301 < x1200912610300; x1200912610301++) { x1200912610352 = gCAPANNAarray[x1200912610301]; if (x1200912610352.x1200912610273 > x1200912610293 && x1200912610352.x1200912610273 < x1200912610296 && x1200912610352.x1200912610275 > x1200912610292 && x1200912610352.x1200912610275 < x1200912610295) { x1200912610299[x] = gCAPANNAarray[x1200912610301]; x++; } } var x1200912610302 = x1200912610239; var x1200912610303 = x1200912610240; x1200912610239 = new Array(); x1200912610240 = new Array(); var x1200912610304 = x1200912610299.length; var x1200912610305 = x1200912610302.length; var x1200912610306; var x1200912610307; var x1200912610308; for (var x1200912610301=0; x1200912610301 < x1200912610304; ++x1200912610301) { x1200912610307 = x1200912610299[x1200912610301].x1200912610262; x1200912610306 = ""; for (var x1200912610309=0; x1200912610309 < x1200912610305; ++x1200912610309) { x1200912610308 = x1200912610302[x1200912610309].x1200912610262; if (x1200912610307 == x1200912610308) { x1200912610306 = "y"; x1200912610240.push(x1200912610303[x1200912610309]); x1200912610239.push(x1200912610302[x1200912610309]); x1200912610309 = x1200912610305; } } if (x1200912610306 == "") { x1200912610352 = x1200912610299[x1200912610301]; x1200912610316(x1200912610352, x1200912610301); } } for (var x1200912610301=0; x1200912610301 < x1200912610305; ++x1200912610301) { x1200912610308 = x1200912610302[x1200912610301].x1200912610262; x1200912610306 = ""; for (x1200912610309=0; x1200912610309 < x1200912610304; ++x1200912610309) { x1200912610307 = x1200912610299[x1200912610309].x1200912610262; if (x1200912610308 == x1200912610307) { x1200912610306 = "y"; x1200912610309 = x1200912610304; } } if (x1200912610306 == "") { x1200912610320 = x1200912610303[x1200912610301]; x1200912610322(x1200912610320); } } var x1200912610310; var x1200912610311; var x1200912610300; var x1200912610312; var x1200912610313; var x1200912610310 = ''; var x1200912610314 = ''; var x1200912610315 = ''; if (x1200912610310 == 'y') { x1200912610311 = ""; x1200912610300 = x1200912610302.length; for (var x1200912610301=0; x1200912610301 < x1200912610300; ++x1200912610301) { x1200912610315 = x1200912610302[x1200912610301].x1200912610262; x1200912610314 = x1200912610302[x1200912610301].x1200912610265; x1200912610311 = x1200912610311 + x1200912610315 + " " + x1200912610314 + "\n"; } alert("Alte Obj " + x1200912610300 + "\n\n" + x1200912610311); } x1200912610310 = ''; if (x1200912610310 == 'y') { x1200912610311 = ""; x1200912610300 = x1200912610299.length; for (x1200912610301=0; x1200912610301 < x1200912610300; ++x1200912610301) { x1200912610315 = x1200912610299[x1200912610301].x1200912610262; x1200912610314 = x1200912610299[x1200912610301].x1200912610265; x1200912610311 = x1200912610311 + x1200912610315 + " " + x1200912610314 + "\n"; } alert("Neue Obj Input: " + x1200912610300 + "\n\n" + x1200912610311); } x1200912610310 = ''; if (x1200912610310 == 'y') { x1200912610311 = ""; x1200912610300 = x1200912610239.length; for (var x1200912610301=0; x1200912610301 < x1200912610300; ++x1200912610301) { x1200912610315 = x1200912610239[x1200912610301].x1200912610262; x1200912610313 = x1200912610239[x1200912610301].x1200912610265; x1200912610311 = x1200912610311 + x1200912610312 + " " + x1200912610314 + "\n"; } alert("Neue ObjS Array: " + x1200912610300 + "\n\n" + x1200912610311); } } function x1200912610316(x1200912610317, x1200912610318) { if (x1200912610232 != 'localhost') { x1200912610284 = x1200912610237.getZoom(); } else { x1200912610284 = 13; } if (x1200912610232 != 'localhost') { x1200912610288 = parseFloat(x1200912610317.x1200912610273); x1200912610289 = parseFloat(x1200912610317.x1200912610275); var x1200912610319 = new GLatLng (x1200912610288, x1200912610289); var x1200912610320 = x1200912610332(x1200912610317, x1200912610319, x1200912610318); x1200912610237.addOverlay(x1200912610320); } else { x1200912610320 = x1200912610332(x1200912610317, '', x1200912610318); } x1200912610240.push(x1200912610320); x1200912610239.push(x1200912610317); return; } function x1200912610321() { if (x1200912610232 != 'localhost') { x1200912610237.clearOverlays(); } x1200912610240 = new Array(); x1200912610239 = new Array(); return; } function x1200912610322(x1200912610323) { if (x1200912610232 != 'localhost') { x1200912610237.removeOverlay(x1200912610323); } return; } function buildTable() { var x1200912610324 = document.getElementById("id_index"); x1200912610324.innerHTML = ""; var x1200912610325 = document.getElementById("id_filter"); var x1200912610326 = x1200912610325.value; x1200912610291 = ""; if (x1200912610326 != '') { x1200912610326 = x1200912610326.toUpperCase(); x1200912610291 = "n"; } var x1200912610327 = ""; x1200912610327 = x1200912610327 + ""; x1200912610300 = gCAPANNAarray.length; var x1200912610328 = ''; var x1200912610329; var x1200912610330 = 0; for (var x1200912610301=0; x1200912610301 < x1200912610300; ++x1200912610301) { x1200912610328 = gCAPANNAarray[x1200912610301].x1200912610265.toUpperCase(); x1200912610329 = x1200912610328.indexOf(x1200912610326, 0); if (x1200912610329 > -1) { x1200912610291 = ""; } else { x1200912610291 = "n"; } if (x1200912610291 == "") { x1200912610330++; x1200912610327 = x1200912610327 + " "; x1200912610327 = x1200912610327 + ""; x1200912610327 = x1200912610327 + ""; x1200912610327 = x1200912610327 + ""; } } x1200912610327 = x1200912610327 + "
" + gCAPANNAarray[x1200912610301].x1200912610262 + "" + gCAPANNAarray[x1200912610301].x1200912610265 + "
"; x1200912610324.innerHTML = x1200912610324.innerHTML + x1200912610327; document.getElementById("id_total").innerHTML = x1200912610330; } function setNewCenter(x1200912610331) { if (x1200912610232 == 'localhost') { alert("new Center: " + x1200912610331 + " " + gCAPANNAarray[x1200912610331].x1200912610265 + " " + gCAPANNAarray[x1200912610331].x1200912610273 + " / " + gCAPANNAarray[x1200912610331].x1200912610275); } else { x1200912610288 = parseFloat(gCAPANNAarray[x1200912610331].x1200912610273); x1200912610289 = parseFloat(gCAPANNAarray[x1200912610331].x1200912610275); x1200912610237.setCenter(new GLatLng (x1200912610288, x1200912610289)); } } function x1200912610332(x1200912610317, x1200912610333, x1200912610334) { if (x1200912610232 == 'localhost') { x1200912610320 = x1200912610334 + " " + x1200912610317.x1200912610262 + " " + x1200912610317.x1200912610265 + " "; return x1200912610320; } var x1200912610335 = new GIcon(); x1200912610335.iconAnchor = new GPoint(12, 20); x1200912610335.infoWindowAnchor = new GPoint(9, 2); var x1200912610336; if (x1200912610334 == 0) { x1200912610336 = 'a'; } else { x1200912610336 = x1200912610334; } var x1200912610337 = new GIcon(x1200912610335); x1200912610337.image = "images/mm_20_yellow.png"; var x1200912610320 = new PdMarker(x1200912610333); var x1200912610338 = new GMarker(x1200912610333, x1200912610337); GEvent.addListener(x1200912610320, "click", function() { var x1200912610339 = ""; x1200912610339 = x1200912610339 + "
"; var x1200912610340 = ""; if (x1200912610317.x1200912610277 != '') { x1200912610340 = "Capanne TI"; } var x1200912610341 = ""; if (x1200912610317.x1200912610278 != '') { if (x1200912610340 != '') { x1200912610341 = " / "; } x1200912610340 = x1200912610340 + x1200912610341 + "Link"; } var x1200912610342 = "Mapplus"; var x1200912610343 = "Panoramio"; if (x1200912610317.x1200912610263 != "") { var x1200912610344 = ""; var x1200912610345 = [ new GInfoWindowTab("Info", "" + x1200912610317.x1200912610265 + "

" + x1200912610317.x1200912610268 + " / " + x1200912610317.x1200912610270 + "

" + x1200912610317.x1200912610276 + "m" + "

" + x1200912610342 + "

" + x1200912610343 + "

" + x1200912610340) ,new GInfoWindowTab("Zoom", x1200912610339) ,new GInfoWindowTab("Bild", x1200912610344) ]; } else { var x1200912610345 = [ new GInfoWindowTab("Info", "" + x1200912610317.x1200912610265 + "

" + x1200912610317.x1200912610268 + " / " + x1200912610317.x1200912610270 + "

" + x1200912610317.x1200912610276 + "m" + "

" + x1200912610342 + "

" + x1200912610343 + "

"+ x1200912610340) ,new GInfoWindowTab("Zoom", x1200912610339) ]; } x1200912610320.openInfoWindowTabsHtml(x1200912610345); var x1200912610346 = document.getElementById("id_maptab" + x1200912610334); var x1200912610347 = new GMap2(x1200912610346); x1200912610347.addControl(new GSmallZoomControl(),new GControlPosition(G_ANCHOR_TOP_LEFT, new GSize(10, 40))); x1200912610347.addControl(new GMapTypeControl(1)); x1200912610347.setCenter(x1200912610333 , 17, G_HYBRID_MAP); var x1200912610348 = x1200912610346.firstChild.nextSibling; var x1200912610349 = x1200912610346.firstChild.nextSibling.nextSibling; x1200912610348.style.display = "none"; x1200912610349.style.display = "none"; x1200912610347.addOverlay(x1200912610338); if (x1200912610320.getTooltipHiding()) { x1200912610320.setTooltipHiding(false); x1200912610320.setOpacity(100); x1200912610320.setTooltipClass("markerTooltipAlternate"); } else { x1200912610320.setTooltipHiding(true); x1200912610320.setOpacity(80); x1200912610320.resetTooltipClass(); } } ); x1200912610320.setTooltip(x1200912610317.x1200912610265); GEvent.addListener(x1200912610320, "mouseover", function() { x1200912610320.setImage("images/markeryellow.png"); showInfo(x1200912610317,''); } ); GEvent.addListener(x1200912610320, "mouseout", function() { x1200912610320.restoreImage(); showInfo(x1200912610317, 'C'); } ); return x1200912610320; } function showInfo (x1200912610317, x1200912610350){ if (x1200912610350 == 'C') { document.getElementById('id_info').innerHTML = "Info"; return; } var x1200912610351 = ""; x1200912610351 = x1200912610351 + "" + x1200912610317.x1200912610265 + ""; x1200912610351 = x1200912610351 + "
" + x1200912610317.x1200912610268 + " / " + x1200912610317.x1200912610270; x1200912610351 = x1200912610351 + "
N " + x1200912610317.x1200912610273 + "° / E " + x1200912610317.x1200912610275 + "°"; x1200912610351 = x1200912610351 + "
" + x1200912610317.x1200912610276 + "m"; document.getElementById('id_info').innerHTML = x1200912610351; } function showInfo2 (x1200912610246, x1200912610350) { var x1200912610352 = gCAPANNAarray[x1200912610246]; if (x1200912610232 != 'localhost') { var x1200912610315 = x1200912610352.x1200912610262; var x1200912610353 = -1; var x1200912610300; var x1200912610354; x1200912610300 = x1200912610239.length; for (var x1200912610301=0; x1200912610301 < x1200912610300; x1200912610301++) { x1200912610354 = x1200912610239[x1200912610301]; if (x1200912610354.x1200912610262 == x1200912610315) { x1200912610353 = x1200912610301; x1200912610301 = x1200912610300; } } if (x1200912610353 > -1) { x1200912610320 = x1200912610240[x1200912610353]; if (x1200912610350 == 'C') { x1200912610320.restoreImage(); } else { x1200912610320.setImage("images/markeryellow.png"); } } } showInfo(x1200912610352, x1200912610350); }/* PdMarker Purpose: extends Google Map API GMap and GMarker (hover effects, image swapping, moving) Details: http://www.pixeldevelopment.com/pdmarker.asp Updated: [see getPdMarkerRevisionInfo] Author: Peter Jones Notes: Relies on undocumented features of the Google Map API which may change. Based on my own PJToolTip and ideas from GxMarker, TLabel and the Google Maps API forum. Contact http://www.pixeldevelopment.com for your custom Google Map needs */ function getPdMarkerRevisionInfo() { var cr = "
"; var s = "2.03 10/02/07 - fixed zindex bug (setMarkerZIndex, topMarkerZIndex)" + cr + "2.02 05/22/07 - fixed minor issues (blink, initDetailWin)" + cr + "2.01 04/29/07 - improved left hand side detail window positioning, uses new Google setImage & show " + "routines for added reliability, fixed zoomToMarkers for single marker case." + cr + "2.00 04/22/07 - fix for setImage when using Explorer 7." + cr + "1.99f 07/09/06 - zoomToMarkers now takes into account markers not displayed." + cr + "1.99e 05/05/06 - fixed zoomed tooltip positioning & non-centered marker graphics." + cr + "1.99d 05/01/06 - fixed display & blink when defining .transparent." + cr + "1.99c 04/25/06 - added display and blink." + cr + "1.99b 04/21/06 - added 'Powered By' version & marker count display." + cr + "1.99a 04/18/06 - revised for Google Maps API Version 2, GMap2 required." + cr + "0.99c 01/30/06 - added setDetailWinClass and resetDetailWinClass." + cr + "0.99a 10/12/05 - now handles maps in containers with undefined widths" + cr + "define a div with id 'pdmarkerwork' to reduce flicker" + cr + "0.99 10/03/05 - added setImageEnabled, allowLeftTooltips (global)" + cr + "0.98 09/30/05 - fixed zoomToMarkers" + cr + "0.97 09/24/05 - added setHoverImage, setShowDetailOnClick, setDetailWinHTML, showDetailWin, closeDetailWin" + cr + "0.96 09/22/05 - added setTooltipHiding, getTooltipHiding" + cr + "0.95 09/20/05 - handle zoom for lingering tooltips mouseOutEnabled(false) " + "disables setImage and restoreImage" + cr + "0.94 09/20/05 - added setTooltipClass and resetTooltipClass" + cr + "0.93 09/19/05 - added slopPercentage [optional] parameter to zoomToMarkers" + cr + "0.92 09/18/05 - added getMouseOutEnabled, setMouseOutEnabled" + cr + "0.91 09/17/05 - fixed setOpacity"; return s; } function getPdMarkerVersion() { return getPdMarkerRevisionInfo().substring(0,15); } function getPdMarkerShortVersion() { return getPdMarkerRevisionInfo().substring(0,5); } var APIkey = ""; function getGoogleMapsVersion() { var i, a, b, c; var v = "unknown"; if (document.getElementsByTagName) for(i=0; (a = document.getElementsByTagName("script")[i]); i++) if(a.getAttribute("src")) { b = a.getAttribute("src"); c = b.indexOf("/mapfiles/maps"); // /mapfiles/maps d = b.indexOf("http://maps.google.com/maps?file=api"); e = b.indexOf("key="); f = b.indexOf("/mapfiles/"); g = b.indexOf("/maps"); if (c > 0) v = parseFloat(b.substring(c+14)); else if (f > 0) v = "2." + b.substring(f+10,g); if (d >= 0) if (e > 0) APIkey = b.substring(e+4); } return v; } function latLongToPixel(map,coord,zoom) { return map.fromLatLngToDivPixel(coord); } var pdMarkerExtList = []; function PdMarkerAddToExtList(marker) { pdMarkerExtList.push(marker); } function PdMarkerRemoveFromExtList(id) { for (var i=0; i 0) if (this.cursor >= 0) for (var i = this.cursor+1; i < count; i++) if (isPdMarker(this.pdMarkers[i])) { this.cursor = i; return this.pdMarkers[i]; } return null; } GMap2.prototype.getNthMarker = function(nTh) { var count = getPdMarkerCount(this); for (var i = 0; i < count; i++) if (isPdMarker(this.pdMarkers[i])) { nTh--; if (nTh == 0) { this.cursor = i; return this.pdMarkers[i]; } } return null; } GMap2.prototype.getMarkerCount = function() { return getPdMarkerCount(this); } GMap2.prototype.boxMap = function(center, span) { var spec = this.spec; var zoom = spec.getLowestZoomLevel(center, span, this.viewSize); this.centerAndZoom(new GPoint(center.x, center.y), zoom); } GMap2.prototype.zoomToMarkers = function(slopPercentage, heightOffsetPct) { var count = 0; var thePoint, x, y, minX, maxX, minY, maxY, span; var marker = this.getFirstMarker(); while (marker != null) { if (!marker.isHidden()) { thePoint = marker.getPoint(); // x = thePoint.x; y = thePoint.y; x = thePoint.lat(); y = thePoint.lng(); if (count == 0) { minX = x; maxX = x; minY = y; maxY = y; } else { if (x < minX) minX = x; if (x > maxX) maxX = x; if (y < minY) minY = y; if (y > maxY) maxY = y; } count++; } marker = this.getNextMarker(); } if (count == 1) this.setCenter(new GLatLng(x,y), this.getZoom()); else if (count > 1) { var center = new GLatLng((minX + maxX) / 2, (minY + maxY) / 2) span = new GSize(Math.abs(maxX - minX), Math.abs(maxY - minY)); slopWid = 0; slopHgt = 0; if (typeof slopPercentage != "undefined") { slopWid = span.width * slopPercentage / 200; slopHgt = span.height * slopPercentage / 200; span.width *= 1 + slopPercentage / 100; span.height *= 1 + slopPercentage / 100; } deltaHgt = 0; if (typeof heightOffsetPct != "undefined") { deltaHgt = span.height * heightOffsetPct / 100; center = new GLatLng(center.lat() + deltaHgt, center.lng()); } // needs slop var bounds = new GLatLngBounds(new GLatLng(minX-slopHgt, minY-slopWid), new GLatLng(maxX+slopHgt, maxY+slopWid)); // sw, ne var zoom = this.getBoundsZoomLevel(bounds); this.setCenter(center, zoom); } } function shorten(x) { var factor = 1000000 return Math.round(x * factor) / factor; } function poweredByClick(map) { var center = map.getCenter(); var span = map.getBounds().toSpan(); var zoom = map.getZoom(); var url = "http://maps.google.com/maps?ll=" + center.lat() + "," + center.lng() + "&spn=" + shorten(span.lat()) + "," + shorten(span.lng()) + "&z=" + zoom + "&key=" + APIkey; document.location = url; } function poweredByMouseover(map) { var marker = map.getFirstMarker(); var bounds = map.getBounds(); var visibleCount = 0; var totalCount = 0; while (marker != null) { if (!marker.isHidden()) { var point = marker.getPoint(); if (bounds.contains(point)) visibleCount++; totalCount = totalCount + 1; } marker = map.getNextMarker(); } var title = map.poweredByTitle + " (" + visibleCount + " markers of " + totalCount + " visible)" map.poweredByObj.setAttribute("title",title); map.poweredByObj.setAttribute("alt",title); } function getPoweredBy(map) { try { var tooltip = "GMap " + getGoogleMapsVersion() + " & PdMarker " + getPdMarkerShortVersion(); map.poweredByTitle = tooltip; var b = document.createElement("img"); b.setAttribute("src","http://www.google.com/intl/en_ALL/mapfiles/transparent.gif"); b.setAttribute("width",62); b.setAttribute("alt",tooltip); b.setAttribute("title",tooltip); b.setAttribute("height",30); b.style.display = "block"; b.style.position = "absolute"; b.style.left = "2px"; b.style.bottom = "0px"; b.style.width = "62px"; b.style.height = "30px"; b.style.cursor = "pointer"; b.style.zIndex = 600001; b.onclick = function() { poweredByClick(map); }; b.onmouseover = function() { poweredByMouseover(map); }; map.getPane(G_MAP_FLOAT_PANE).parentNode.parentNode.appendChild(b); return b; } catch (e) { } return true; } function setPoweredBy(map) { if (!map.poweredByObj) { getGoogleMapsVersion(); // possibly reduce IE memory leak, unchecked map.poweredByObj = getPoweredBy(map); } } // PdMarker code function PdMarkerNamespace() { var userAgent = navigator.userAgent.toLowerCase(); var n4=(document.layers); var n6=(document.getElementById&&!document.all); var ie=(document.all); var o6=(userAgent.indexOf("opera") != -1); var safari=(userAgent.indexOf("safari") != -1); var msie = (userAgent.indexOf("msie") != -1) && (userAgent.indexOf("opera") == -1); var msiePre7 = false; if (msie) msiePre7 = userAgent.substr(userAgent.indexOf("msie")+5,2) < 7; var nextMarkerId = 10; var permitLeft = true; var icon = new GIcon(); icon.shadow = "http://www.google.com/mapfiles/shadow50.png"; icon.iconSize = new GSize(20, 34); icon.shadowSize = new GSize(37, 34); icon.iconAnchor = new GPoint(9, 34); icon.infoWindowAnchor = new GPoint(9, 2); icon.infoShadowAnchor = new GPoint(18, 25); icon.image = "http://www.google.com/mapfiles/marker.png"; // Globals - careful of multiple maps function PdMarker(a, b, tooltip) { this.inheritFrom = GMarker; if (typeof b == "undefined") // pmj oct 23, 2005 b = icon; this.inheritFrom(a,b); if (typeof tooltip != "undefined") this.pendingTitle = tooltip; else this.pendingTitle = ""; if (typeof b != "undefined") this.oldImagePath = b.image; else this.oldImagePath = "http://www.google.com/mapfiles/marker.png"; this.internalId = nextMarkerId; nextMarkerId += 1; this.zIndexSaved = false; this.pendingCursor = ""; this.percentOpacity = 70; this.mouseOutEnabled = true; this.setImageOn = true; this.hidingEnabled = true; this.showDetailOnClick = true; this.detailOpen = false; this.userData = ""; this.displayed = true; } // PdMarker.prototype = new GMarker; PdMarker.prototype = new GMarker(new GLatLng(1, 1)); function addMarkerToMapList(map,marker) { try { if (map.pdMarkers.length) ; } catch(e) { map.pdMarkers = new Array(); } // add to list map.pdMarkers.push(marker); } function removeMarkerFromMapList(map,marker) { var id = marker.internalId; for (var i=0; i 0) this.setTitle(this.pendingTitle); if (this.pendingCursor.length > 0) this.setCursor(this.pendingCursor); this.map = a; setPoweredBy(a); GEvent.bindDom(this, "mouseover", this, this.onMouseOver); GEvent.bindDom(this, "mouseout", this, this.onMouseOut); GEvent.bindDom(this, "click", this, this.onClick); GEvent.bind(this.map, "zoomend", this, this.reZoom); } catch(e) { alert("PdMarker initialize error: " + e); } } PdMarker.prototype.allowLeftTooltips = function(a){ permitLeft = a; } PdMarker.prototype.reZoom = function(){ var didSet = false; if (this.tooltipObject) if (this.tooltipObject.style.display == "block") { setTTPosition(this); didSet = true; } if (this.detailObject) { if (!didSet) setTTPosition(this); setDetailPosition(this); } } PdMarker.prototype.setId = function(id) { this.internalId = id; } PdMarker.prototype.getId = function() { return this.internalId; } PdMarker.prototype.setName = function(a) { this.name = a; } PdMarker.prototype.getName = function() { if (this.name) return this.name; else return null; } PdMarker.prototype.setUserData = function(a) { this.userData = a; } PdMarker.prototype.getUserData = function() { if (this.userData) return this.userData; else // return null; return ""; } PdMarker.prototype.setUserData2 = function(a) { this.userData2 = a; } PdMarker.prototype.getUserData2 = function() { if (this.userData2) return this.userData2; else return ""; } PdMarker.prototype.setImageEnabled = function(a) { this.setImageOn = a; } var PdMIN = ""; var PdMIA = ""; function PdCompPdMIN(marker) { if (PdMIN.length == 0) for (var i in marker) if (eval("typeof marker." + i) == "object") try { if (eval("typeof marker." + i + "[0].src") != "undefined") { PdMIA = "this." + i; PdMIN = PdMIA + "[0]"; } } catch (e) {} } PdMarker.prototype.setImageOld = function(a) { // GMarker.prototype.initialize.call(this, a); var msFilter = 'progid:DXImageTransform.Microsoft.AlphaImageLoader(src="' + a + '")'; if (this.mouseOutEnabled && this.setImageOn) { PdCompPdMIN(this); try { if (this.oldImagePath.length == 0) eval("this.oldImagePath = " + PdMIN + ".src"); if (msie && msiePre7) eval(PdMIN + ".style.filter = msFilter"); else eval(PdMIN + ".src = a"); } catch (e) {} } } PdMarker.prototype.setImage = function(a) { if (this.mouseOutEnabled && this.setImageOn) GMarker.prototype.setImage.call(this, a); } PdMarker.prototype.restoreImage = function() { if (this.mouseOutEnabled && this.setImageOn && this.oldImagePath.length > 0) this.setImage(this.oldImagePath); } PdMarker.prototype.display = function(a) { if (a) this.show(); else this.hide(); } PdMarker.prototype.blink = function(a,b) { if (a) { this.blinkOn = true; this.blinkSpeed = b; if (!this.blinking) { this.blinking = a; PdMarkerAddToExtList(this); PdMarkerBlinkOnOff(this.getId()); } } else { this.blinking = a; this.display(true); PdMarkerRemoveFromExtList(this); } } PdMarker.prototype.setIcon = function(a) { this.remove(); this.icon = a; this.initialize(this.map); this.redraw(true); } PdMarker.prototype.setMarkerZIndex = function(a) { PdCompPdMIN(this); if (!this.zIndexSaved) { this.zIndexSaved = true; this.oldZIndex = eval(PdMIN + ".style.zIndex"); } eval(PdMIN + ".style.zIndex = a") this.redraw(true); } PdMarker.prototype.topMarkerZIndex = function() { this.setMarkerZIndex (600000); } PdMarker.prototype.restoreMarkerZIndex = function() { PdCompPdMIN(this); if (this.zIndexSaved) { this.zIndexSaved = false; eval(PdMIN + ".style.zIndex = this.oldZIndex") this.redraw(true); } } PdMarker.prototype.onInfoWindowOpen = function() { this.hideTooltip(); GMarker.prototype.onInfoWindowOpen.call(this); } PdMarker.prototype.setHoverImage = function(a) { this.hoverImage = a; } var inMouseOver = false; PdMarker.prototype.onMouseOver = function() { if (inMouseOver) return; inMouseOver = true; if (this.hoverImage) this.setImage(this.hoverImage); if (!this.detailOpen) this.showTooltip(); inMouseOver = false; } PdMarker.prototype.onMouseOut = function() { if (this.hoverImage) this.restoreImage(); if (!this.detailOpen) if (this.mouseOutEnabled) this.hideTooltip(); } PdMarker.prototype.setMouseOutEnabled = function(a) { this.mouseOutEnabled = a; } PdMarker.prototype.getMouseOutEnabled = function() { return this.mouseOutEnabled; } PdMarker.prototype.setTooltipHiding = function(a) { this.hidingEnabled = a; } PdMarker.prototype.getTooltipHiding = function() { return this.hidingEnabled; } PdMarker.prototype.setTitle = function(a) { this.tooltipText = ""; PdCompPdMIN(this); try { eval(PdMIN + ".title = a"); } catch (e) { this.pendingTitle = a; } } PdMarker.prototype.setCursor = function(a) { PdCompPdMIN(this); try { eval(PdMIN + ".style.cursor = a"); } catch (e) { this.pendingCursor = a; } } PdMarker.prototype.setTooltipClass = function(a) { this.pendingClassName = a; if (this.tooltipObject) { var showing = (this.tooltipObject.style.display != "none"); this.deleteObjects(); if (this.tooltipRaw) this.setTooltipNoResize(this.tooltipRaw); if (showing) this.showTooltip(); } else if (this.tooltipRaw) this.setTooltipNoResize(this.tooltipRaw); } PdMarker.prototype.resetTooltipClass = function() { this.setTooltipClass("markerTooltip"); } PdMarker.prototype.getTooltip = function() { try { return this.tooltipRaw; } catch (e) { return ""; } } PdMarker.prototype.setTooltipNoResize = function(a) { this.setTitle(""); var ttClass = "markerTooltip"; if (this.pendingClassName) ttClass = this.pendingClassName; this.tooltipRaw = a; this.tooltipText = "
" + a + "
"; if (this.tooltipObject) this.tooltipObject.innerHTML = this.tooltipText; } PdMarker.prototype.setTooltip = function(a) { this.setTooltipNoResize(a); this.deleteObjects(); } PdMarker.prototype.showTooltip = function() { if (this.tooltipText) { if (!this.tooltipObject) initTooltip(this); setTTPosition(this); this.tooltipObject.style.display = "block"; } } PdMarker.prototype.hideTooltip = function() { if (this.tooltipObject) if (this.hidingEnabled) this.tooltipObject.style.display = "none"; } PdMarker.prototype.onClick = function(a) { if (this.showDetailOnClick && this.detailWinHTML) this.showDetailWin(); } PdMarker.prototype.setShowDetailOnClick = function(a) { this.showDetailOnClick = a; } PdMarker.prototype.setDetailWinHTML = function(a) { this.detailWinHTML = a; } PdMarker.prototype.setDetailWinClass = function(a) { this.pendingDetailClassName = a; } PdMarker.prototype.resetDetailWinClass = function() { this.setDetailWinClass("markerDetail"); } PdMarker.prototype.showDetailWin = function() { if (this.detailOpen) { this.closeDetailWin(); return; } this.hideTooltip(); this.setMouseOutEnabled(false); var winClass = "markerDetail"; if (this.pendingWinClassName) winClass = this.pendingWinClassName; var html = "
" + this.detailWinHTML + "<\/td><\/a><\/td><\/tr><\/table>"; html = "
" + html + "
"; this.detailOpen = true; if (!this.tooltipText) { this.ttWidth = 150; this.ttHeight = 30; setTTPosition(this); // compute ttTop, ttLeft } initDetailWin(this, this.ttTop, this.ttLeft, html); PdMarkerAddToExtList(this); } PdMarker.prototype.closeDetailWin = function() { this.detailOpen = false; if (this.detailObject) { this.setMouseOutEnabled(true); this.onMouseOut(); // GEvent.trigger(this, "mouseout"); this.map.getPane(G_MAP_FLOAT_PANE).removeChild(this.detailObject); this.detailObject = null; } } PdMarker.prototype.deleteObjects = function() { if (this.tooltipObject) { this.map.getPane(G_MAP_FLOAT_PANE).removeChild(this.tooltipObject); this.tooltipObject = null; } if (this.detailObject) { this.map.getPane(G_MAP_FLOAT_PANE).removeChild(this.detailObject); this.detailObject = null; } } PdMarker.prototype.remove = function(a) { removeMarkerFromMapList(this.map, this); PdMarkerRemoveFromExtList(this.getId()); GMarker.prototype.remove.call(this); this.deleteObjects(); } PdMarker.prototype.setOpacity = function(b) { if (b < 0) b=0; if (b >= 100) b=100; var c = b / 100; this.percentOpacity = b; var d = document.getElementById(this.objId); if (d) { if(typeof(d.style.filter)=='string'){d.style.filter='alpha(opacity:'+b+')';} if(typeof(d.style.KHTMLOpacity)=='string'){d.style.KHTMLOpacity=c;} if(typeof(d.style.MozOpacity)=='string'){d.style.MozOpacity=c;} if(typeof(d.style.opacity)=='string'){d.style.opacity=c;} } } PdMarker.prototype.setOpacityNew = function(b) { setObjOpacity(this.objId); this.percentOpacity = b; } // ***** Private routines ***** function setObjOpacity(objId, b) { if (b < 0) b=0; if (b >= 100) b=100; var c = b / 100; var d = document.getElementById(objId); if (d) { if(typeof(d.style.filter)=='string'){d.style.filter='alpha(opacity:'+b+')';} if(typeof(d.style.KHTMLOpacity)=='string'){d.style.KHTMLOpacity=c;} if(typeof(d.style.MozOpacity)=='string'){d.style.MozOpacity=c;} if(typeof(d.style.opacity)=='string'){d.style.opacity=c;} } } function idToElemId(id) { return "ttobj" + id; } function initTooltip(theObj) { theObj.objId = idToElemId(theObj.internalId); theObj.anchorLatLng = theObj.point; var b = document.createElement('span'); theObj.tooltipObject = b; b.setAttribute('id',theObj.objId); b.innerHTML = theObj.tooltipText; // append to body for size calculations var c = document.body; var d = document.getElementById("pdmarkerwork"); if (d) c = d; c.appendChild(b); b.style.position = "absolute"; b.style.bottom = "5px"; b.style.left = "5px"; b.style.zIndex = 1; if (theObj.percentOpacity) theObj.setOpacity(theObj.percentOpacity); var tempObj = document.getElementById(theObj.objId); theObj.ttWidth = tempObj.offsetWidth; theObj.ttHeight = tempObj.offsetHeight; c.removeChild(b); b.style.zIndex = 600000; b.style.bottom = ""; b.style.left = ""; theObj.map.getPane(G_MAP_FLOAT_PANE).appendChild(b); } function initDetailWin(theObj, top, left, html) { theObj.detailId = "detail" + theObj.internalId; var b = document.createElement('span'); theObj.detailObject = b; b.setAttribute('id',theObj.detailId); b.innerHTML = html; b.style.display = "block"; b.style.position = "absolute"; b.style.top = top + "px"; if (theObj.rightSide) b.style.left = left + "px"; else b.style.right = -left + "px"; b.style.zIndex = 600001; theObj.map.getPane(G_MAP_FLOAT_PANE).appendChild(b); } function setTTPosition(theObj) { var gap = 5; var map = theObj.map; var pt = theObj.getPoint(); var ttPos = latLongToPixel(map, pt, map.getZoom()); var theIcon = theObj.getIcon(); ttPos.y -= Math.floor(theIcon.iconAnchor.y/2); var rightSide = true; var bounds = map.getBounds(); var boundsSpan = bounds.toSpan(); var longSpan = boundsSpan.lng(); var mapWidth = map.getSize().width; var tooltipWidthInDeg = (theObj.ttWidth + theIcon.iconSize.width + 6) / mapWidth * longSpan; if (pt.lng() + tooltipWidthInDeg > bounds.getNorthEast().lng() && permitLeft) rightSide = false; ttPos.y -= Math.floor(theObj.ttHeight/2); delta = (theIcon.iconSize.width - theIcon.iconAnchor.x) + gap; if (rightSide) ttPos.x += delta; else ttPos.x -= delta theObj.rightSide = rightSide; theObj.ttLeft = ttPos.x; theObj.ttTop = ttPos.y; if (theObj.tooltipObject) { if (rightSide) { theObj.tooltipObject.style.left = ttPos.x + "px"; theObj.tooltipObject.style.right = null; } else { theObj.tooltipObject.style.left = null; theObj.tooltipObject.style.right = -ttPos.x + "px"; } theObj.tooltipObject.style.top = ttPos.y + "px"; } } function makeInterface(a) { var b = a || window; b.PdMarker = PdMarker; } makeInterface(); } PdMarkerNamespace();