var currentViewMode=0; var processing=0; var MapImg; var mapX=0; var mapY=0; var clickcounter=1; var MOUSEOVER=0; var companylist=''; var companylist_title=''; var printcompanylist=''; var mapbranches=''; var maxZoom=16; var maxMapWidth=250*Math.pow(maxZoom,2)-250*maxZoom+500; var activespot=-1; var windowWidth=-1; var windowHeight=-1; var MapServer = Object.extend({}, Ausgangspunkt); var currentZoom=getCurrentZoom(); function getCurrentZoom() { var MapWidth=MapServer.x2-MapServer.x1; var zoomStufe=0; if (MapWidth>=500&&MapWidth<=maxMapWidth) { zoomStufe=(maxZoom+1)-Math.floor(0.5+Math.sqrt(MapWidth/250-7/4)); } else if (MapWidth>maxMapWidth) { zoomStufe=1; } else { zoomStufe=5; } return zoomStufe; } function updateShow() { if (MapServer.viewMode != currentViewMode) { if (MapServer.viewMode==0) { toggleViewMode('Karte', 'on'); toggleViewMode('Luftbild', 'out'); } else { toggleViewMode('Karte', 'out'); toggleViewMode('Luftbild', 'on'); } currentViewMode=MapServer.viewMode; } if (typeof(MapImg)=='object' && MapImg.complete==true && processing) { document.getElementById('Map').src=MapImg.src; processing=0; var obj=document.getElementsByClassName('spot',document.getElementById('ajaxdiv')); for(var i=0;i4000) { roundfactor=1000; } Massstab=Math.floor(Massstab/roundfactor)*roundfactor; document.getElementById('massstab_wert').innerHTML=Massstab+' m'; } if (MOUSEOVER==0) { hideinfo(); if (document.getElementById('basisiframe').src!="//web02.city-map.de/blank.html") { document.getElementById('basisiframe').src="//web02.city-map.de/blank.html"; } if (document.getElementById('plusiframe').src!="//web02.city-map.de/blank.html") { document.getElementById('plusiframe').src="//web02.city-map.de/blank.html"; } } } setInterval("updateShow()", 100); function toggleViewMode(mode, set) { document.getElementById('li'+mode).className=set; document.getElementById('a'+mode).className=set; } function setBranchenfilter(br,brname) { branchenfilter=br; companylist_title=brname; move(MapServer, 'F'); } function move(coords, direction) { if (!processing) { if (clickcounter>50) { alert(clicklimitreached); } else { processing=1; var query='x1='+coords.x1+'&x2='+coords.x2+'&y1='+coords.y1+'&y2='+coords.y2+'&viewMode='+coords.viewMode; if (direction) { query+='&direction='+direction; } else if (coords.clickX) { query+='&x='+coords.clickX+'&y='+coords.clickY; } else if (coords.cityId) { query+='&cityId='+coords.cityId; } else if (coords.streetId) { query+='&streetId='+coords.streetId; } query+='&t='+time+'&xid='+xid+'&r='+r+'&kgs='+kgs+'&lg='+lg+'&br='+branchenfilter+'&k='+k+'&poix='+poix+'&poiy='+poiy+'&routeid='+routeid+'&showx='+showx+'&showy='+showy+'&routeextent='+routeextent; new Ajax.Updater('ajaxdiv', ajaxurl+'mapserver/ajaxserver.pl?'+query, {method: 'get', asynchronouse: true, evalScripts: true}); } } } function setZoomSlider(moveabs) { var zoomValuecount=document.getElementById('zoomLevel').getAttribute('valuecount'); var zoomDistance=document.getElementById('sliderId').getAttribute('distance')*1; var zoomStep=(14+zoomDistance)/(zoomValuecount); var sliderPos=Math.round(zoomStep*currentZoom-14); carpeLeft('sliderId', sliderPos) document.getElementById('zoomLevel').value=currentZoom; if (!moveabs) { move(MapServer, currentZoom); } } function mouseUpSlider(evnt) { if (document.getElementById('zoomLevel').value!=currentZoom) { currentZoom=document.getElementById('zoomLevel').value; move(MapServer, currentZoom); } sliderMouseUp(evnt); } function modifyZoom(change) { if (!processing) { if (change==-1 && currentZoom>1) { currentZoom--; } else if (change==1 && currentZoom'; infotext+='
'+clickinfo+''; document.getElementById('info').onclick=function(){b(no,kdnr,eintragtyp,cox,coy);}; document.getElementById('info').innerHTML=infotext; var layerwidth=document.getElementById('info').offsetWidth; if (cox+layerwidth+mapX>windowWidth) { cox=windowWidth-layerwidth-mapX-10; } document.getElementById('info').style.left=cox+'px'; document.getElementById('info').style.top=coy+'px'; document.getElementById('info').style.visibility='visible'; activespot=no; MOUSEOVER=1; } function hideinfo() { document.getElementById('info').style.visibility='hidden'; document.getElementById('basisiframe').style.visibility='hidden'; document.getElementById('plusiframe').style.visibility='hidden'; var tempactivespot=activespot; activespot=-1; coff(tempactivespot); } function b(no,kdnr,eintragtyp,cox,coy) { hideinfo(); con(no); var layername=(eintragtyp==3)?'basis':'plus'; var layerwidth=(eintragtyp==3)?614:298; var layerheight=(eintragtyp==3)?210:100; if (cox+layerwidth+mapX>windowWidth) { cox=windowWidth-layerwidth-mapX-10; } var scrollPosY=getScrollPos('y'); if (coy+layerheight+mapY-scrollPosY>windowHeight) { coy=windowHeight-layerheight-mapY+scrollPosY; } document.getElementById(layername+'iframe').src=ajaxurl+'city/basisiframe/'+kdnr+lg+'.html'; document.getElementById(layername+'eintrag').style.left=cox+'px'; document.getElementById(layername+'eintrag').style.top=coy+'px'; document.getElementById(layername+'iframe').style.visibility='visible'; activespot=no; MOUSEOVER=1; } function getWindowWidth() { windowWidth=window.innerWidth; windowHeight=window.innerHeight; if (!windowWidth) { windowWidth=document.documentElement.clientWidth; windowHeight=document.documentElement.clientHeight; } } function con(i) { document.getElementById('c'+i).className='spotactive'; document.getElementById('d'+i).className='spotactive'; } function coff(i) { if (activespot!=i) { document.getElementById('c'+i).className='spot'; document.getElementById('d'+i).className='spot'; } } function streets(ort,kgs,offset,limit,ortid,lg,cha) { new Ajax.Updater('streetinner', ajaxurl+'mapserver/ajaxstreets.pl?ort='+ort+'&kgs='+kgs+'&offset='+offset+'&limit='+limit+'&ortid='+ortid+'&lg='+lg+'&char='+cha, {method: 'get', asynchronouse: true, evalScripts: true}); } function onBlurCompany() { if (MOUSEOVER!=2) { hideinfo(); } } window.onload = function() { getWindowWidth(); getMapPos(); move(Ausgangspunkt, ''); document.getElementById('sliderId').onmousedown=mouseDownSlider; document.getElementById('Map').onclick=mouseDownMap; setZoomSlider(0); } window.onresize = getWindowWidth;