//0 && nocookie == 0 ) { cookieStart = document.cookie.indexOf(cookiename + "="); if (cookieStart!=-1) { cookieStart += cookiename.length+1; cookieEnd=document.cookie.indexOf(";",cookieStart); if (cookieEnd==-1) { cookieEnd=document.cookie.length; }; cookietext = document.cookie.substring(cookieStart,cookieEnd); // == split the cookie text and create the variables == bits = cookietext.split("|"); lat = parseFloat(bits[0]); lng = parseFloat(bits[1]); zoom = parseInt(bits[2]); maptype = parseInt(bits[3]); }; }; if(gcnummer) { setCenteret(lat,lng,gcnummer); } else { map.setCenter(new GLatLng(lat,lng),zoom,map.getMapTypes()[maptype]); } if (!nopic) { var mymap = new GTileLayer(new GCopyrightCollection("geo-map"), tileZoomLevel, markerZoomLevel-1); mymap.getTileUrl = function (a,z) { if (z < tileZoomLevel || z >= (markerZoomLevel)) { xmloff = 10; } else { xmloff = 0; } if (z <= (outerZoomLevel)) { return; } var showxml = document.getElementById('showXML'); if (showxml.checked == false) { xmloff = 0; } var padding = 7; var paddingD = 30; var t = (a.x+a.y)%3; var proj = map.getCurrentMapType().getProjection(); // Coordinate for dot tiles var p1 = proj.fromPixelToLatLng(new GPoint(a.x*256-padding,a.y*256-padding),z); var p2 = proj.fromPixelToLatLng(new GPoint((a.x+1)*256+padding,(a.y+1)*256+padding),z); // coordinate for icon tiles var D1 = proj.fromPixelToLatLng(new GPoint(a.x*256-paddingD,a.y*256-paddingD),z); var D2 = proj.fromPixelToLatLng(new GPoint((a.x+1)*256+paddingD,(a.y+1)*256+paddingD),z); // t=0 t = t+xmloff; if (t == 0) { pageTracker._trackPageview('/tiles/get_cache.php'); return "/get_teile.php?x1="+p1.x+"&y1="+p1.y+"&x2="+p2.x+"&y2="+p2.y+"&z="+z+"&ax="+a.x+"&ay="+a.y+"&cacher="+cacher+"&showfound="+showfound+"&land=denmark"; } else if (t == 1) { pageTracker._trackPageview('/tiles/xmx_get_cache.php'); return "http://xmx2.neonet.dk/kim/get_teile.php?x1="+p1.x+"&y1="+p1.y+"&x2="+p2.x+"&y2="+p2.y+"&z="+z+"&ax="+a.x+"&ay="+a.y+"&cacher="+cacher+"&showfound="+showfound+"&land=denmark"; } else if (t == 2) { pageTracker._trackPageview('/tiles/get_cache.php'); return "/get_teile.php?x1="+p1.x+"&y1="+p1.y+"&x2="+p2.x+"&y2="+p2.y+"&z="+z+"&ax="+a.x+"&ay="+a.y+"&cacher="+cacher+"&showfound="+showfound+"&land=denmark"; serv = 1; } else if (t == 3) { pageTracker._trackPageview('/tiles/xmx_get_cache.php'); return "Http://212.99.226.28/kim/get_teile.php?x1="+p1.x+"&y1="+p1.y+"&x2="+p2.x+"&y2="+p2.y+"&z="+z+"&ax="+a.x+"&ay="+a.y+"&cacher="+cacher+"&showfound="+showfound+"&land=denmark"; } else if (t == 10) { pageTracker._trackPageview('/tiles/get_icon_caches.php'); return "/get_icon_caches.php?x1="+D1.x+"&y1="+D1.y+"&x2="+D2.x+"&y2="+D2.y+"&z="+z+"&ax="+a.x+"&ay="+a.y+"&cacher="+cacher+"&showfound="+showfound+"&land=denmark"; serv = 1; } else if (t == 11) { pageTracker._trackPageview('/tiles/get_icon_caches.php'); return "Http://212.99.226.28/kim/get_icon_caches.php?x1="+D1.x+"&y1="+D1.y+"&x2="+D2.x+"&y2="+D2.y+"&z="+z+"&ax="+a.x+"&ay="+a.y+"&cacher="+cacher+"&showfound="+showfound+"&land=denmark"; serv = 1; } else if (t == 12) { pageTracker._trackPageview('/tiles/get_icon_caches.php'); return "/get_icon_caches.php?x1="+D1.x+"&y1="+D1.y+"&x2="+D2.x+"&y2="+D2.y+"&z="+z+"&ax="+a.x+"&ay="+a.y+"&cacher="+cacher+"&showfound="+showfound+"&land=denmark"; serv = 1; } else if (t == 13) { pageTracker._trackPageview('/tiles/get_icon_caches.php'); return "http://xmx2.neonet.dk/kim/get_icon_caches.php?x1="+D1.x+"&y1="+D1.y+"&x2="+D2.x+"&y2="+D2.y+"&z="+z+"&ax="+a.x+"&ay="+a.y+"&cacher="+cacher+"&showfound="+showfound+"&land=denmark"; serv = 1; } } mymap.isPng = function() { return true; } var overlay = new GTileLayerOverlay(mymap); map.addOverlay(overlay); } map.addControl(new GLargeMapControl()); map.addControl(new GMapTypeControl()); map.addControl(new GScaleControl()); map.addControl(ov_map); map.enableDoubleClickZoom(); map.enableContinuousZoom(); map.enableScrollWheelZoom(); map.addMapType(G_PHYSICAL_MAP); map.setMapType(G_SATELLITE_MAP); new GKeyboardHandler(map); GEvent.addListener(map,"click", function(overlay,latlng) { if (map.getZoom() < markerZoomLevel ) { return false; }; var pixels = map.fromLatLngToDivPixel(latlng); var top = map.fromDivPixelToLatLng(new GPoint(pixels.x-16,pixels.y-16)); var bot = map.fromDivPixelToLatLng(new GPoint(pixels.x+16,pixels.y+16)); // Send kords til script, find cache. GDownloadUrl("/get_cache_details.php?x1="+top.x+"&y1="+top.y+"&x2="+bot.x+"&y2="+bot.y+"&cacher="+cacher+"&showfound="+showfound, function(data, responseCode) { if (data != '') { pageTracker._trackPageview('cache_click.php'); bits = data.split("|"); bit = bits[0].split("~"); bis = bits[1].split("~"); if(bit.length == 1) { map.openInfoWindowHtml(latlng, bit[0]); } if(bit.length > 5) { tabnum = 5; } else { tabnum = bit.length; } if(bit.length > 1) { var tabs = []; for (var i=0; i' + bit[i] + '<\/div>'; tabs.push(new GInfoWindowTab(bis[i],bit[i])); } map.openInfoWindowTabsHtml(latlng,tabs); } } }); }); markerManager = new GMarkerManager(map); }; }; function setCenteret(lat, lng, id) { map.setCenter(new GLatLng(lat,lng), 15); GDownloadUrl("/get_cache_details.php?id="+id+"&cacher="+cacher, function(data, responseCode) { bits = data.split("|"); map.openInfoWindowHtml(new GLatLng(lat,lng),bits[0]); }); return false; } function showLoc(lat, lng, id) { if (map.getZoom() == 7) { GDownloadUrl("/get_cache_details.php?id="+id+"&cacher="+cacher, function(data, responseCode) { if (data.length > 10) { bits = data.split("|"); map.openInfoWindowHtml(new GLatLng(lat,lng), bits[0]); } }); } } function switchBlock(id,initialblock) { var myblock = document.getElementById(id); if (myblock.style.display == 'none') { myblock.style.display = 'block'; } else if (myblock.style.display == 'block') { myblock.style.display = 'none'; } else if (initialblock == 0) { myblock.style.display = 'none'; } else { myblock.style.display = 'block'; } if (id == 'main_menu') { var block = document.getElementById('menu'); if (myblock.style.display == 'none') { block.style.hight = 50; } else { block.style.hight = ''; } } } function BlockOnOff(id,OnOff) { var myblock = document.getElementById(id); if (OnOff == 1) { myblock.style.display = 'block'; } if (OnOff == 0) { myblock.style.display = 'none'; } } function BlockOff(id) { var myblock = document.getElementById(id); myblock.style.display = 'none'; } function BlockOn(id) { var myblock = document.getElementById(id); myblock.style.display = 'block'; } function toggleGroup(type) { for (var i = 0; i < markerGroups[type].length; i++) { var marker = markerGroups[type][i]; if (marker.isHidden()) { marker.show(); forcefetch = ''; } else { marker.hide(); } } } function redirectCacher(redir) { document.location = "/"+redir; return false; } function showAddress(address) { if (geocoder) { geocoder.getLatLng( address, function(point) { if (!point) { alert(address + " Not Found"); } else { map.setCenter(point, 15); map.openInfoWindow(point, address); } } ) } } function getCenter(navn) { html1 = "
Så kan du linke direkte til denne position
Hvis du linker i en iframe, vil kortet være statisk, og vil blive et link til positionen."; html = "http://www.geo-map.dk/"+navn+"/"+map.getCenter().lat()+"/"+map.getCenter().lng()+"/"+map.getZoom()+"
Så kan du linke direkte til denne position
Hvis du linker i en iframe, vil kortet være statisk, og vil blive et link til positionen."; var ss = document.getElementById('perm_link_content'); ss.innerHTML = html1; switchBlock('perm_link',1) } function setGlov(id,onoff) { var menu = document.getElementById(id); if(onoff == 0) { menu.style.opacity = 0.3; menu.style.filter = 'alpha(opacity=30)'; } else { menu.style.opacity = 1.0; menu.style.filter = 'alpha(opacity=100)'; } } function setCookie(navn) { maptype = 0; for (var i=0;i 12) { mapzoom = 12; } else { mapzoom = map.getZoom(); } var cookietext = cookiename+"="+map.getCenter().lat()+"|"+map.getCenter().lng()+"|"+mapzoom+"|"+maptype+"|"+navn+"|"+map.getCurrentMapType(); if (expiredays) { var exdate=new Date(); exdate.setDate(exdate.getDate()+expiredays); cookietext += ";expires="+exdate.toGMTString(); } document.cookie=cookietext; BlockOff('cookie'); alert('Start position er gemt.'); } function delCookie() { var cookietext = cookiename+"="; if (expiredays) { var exdate=new Date(); exdate.setDate(exdate.getDate()-expiredays); cookietext += ";expires="+exdate.toGMTString(); } document.cookie=cookietext; BlockOff('cookie'); alert('Start position er slettet'); } /** * helper functions to disable/enable buttons */ function disable(id){ document.getElementById(id).disabled = true; } function enable(id){ document.getElementById(id).disabled = false; } function checkFindMe() { disable('knap'); window.locateME = function(){ if(locatortype == "FF") { navigator.geolocation.getCurrentPosition(showPosition, report); } else { geo.getCurrentPosition(updatePosition, handleError); } } /** * test amd functions for FF3.5+ **/ if((typeof navigator.geolocation != "undefined")){ enable('knap'); //button if(typeof navigator.geolocation == "undefined") { var locatortype = "Chrome"; } else { var locatortype = "FF"; } function showPosition(position) { var location = new google.maps.LatLng(position.coords.latitude, position.coords.longitude); geoReverse(location); // map.setCenter(location, 15); } function report(error){ alert('Du har afvist at give mig din position'); } } /** * test and functions for Google Gears */ if (!window.google || !google.gears) { } else { enable('knap'); //button var geo = google.gears.factory.create('beta.geolocation'); function updatePosition(position) { var location = new google.maps.LatLng(position.latitude, position.longitude); geoReverse(location); } function handleError(error) { alert('Du har afvist at give mig din position'); } } } function geoReverseX(latlng) { if (latlng) { geocoder.getLocations(latlng, function(addresses) { if(addresses.Status.code != 200) { var geoaddress = 'Desværre kunne jeg ikke finde adressen'; } else { var geoaddress = address.address; } address = addresses.Placemark[0]; var myHtml = geoaddress; // var myHtml = 'Her mener google at du er.'; map.setCenter(location, 15); map.openInfoWindow(latlng, myHtml); }); } } function geoReverse(address) { if (geocoder) { geocoder.getLatLng(address, function(point) { if (!point) { alert(address + " not found"); } else { map.setCenter(point, 15); var marker = new GMarker(point); map.addOverlay(marker); map.openInfoWindowHtml(point, address); } } ); } } function openSide(loc) { URL = loc; BROW = 'toolbar=no,location=no,menubar=no,scrollbars=1,width=640'; window.open(URL, "show500", BROW); } function openpage(loc) { URL = loc; BROW = 'toolbar=no,location=0,menubar=no,scrollbars=1,resizable=1,width=625,height=220'; window.open(URL, "showallstats", BROW); } function openHWpage(loc,w,h,b,n) { URL = loc; BROW = 'toolbar=no,location=0,menubar=no,scrollbars='+b+',resizable=1,width='+w+',height='+h; window.open(URL, n, BROW); } //]]>