/** * Namespace: Util.OSM */ OpenLayers.Util.OSM = {}; /** * Constant: MISSING_TILE_URL * {String} URL of image to display for missing tiles */ OpenLayers.Util.OSM.MISSING_TILE_URL = "http://openstreetmap.org/openlayers/img/404.png"; /** * Property: originalOnImageLoadError * {Function} Original onImageLoadError function. */ OpenLayers.Util.OSM.originalOnImageLoadError = OpenLayers.Util.onImageLoadError; /** * Function: onImageLoadError */ OpenLayers.Util.onImageLoadError = function() { if (this.src.match(/^http:\/\/[abc]\.[a-z]+\.openstreetmap\.org\//)) { this.src = OpenLayers.Util.OSM.MISSING_TILE_URL; } else if (this.src.match(/^http:\/\/[def]\.tah\.openstreetmap\.org\//)) { // do nothing - this layer is transparent } else { OpenLayers.Util.OSM.originalOnImageLoadError; } }; /** * @requires OpenLayers/Layer/TMS.js * * Class: OpenLayers.Layer.OSM * * Inherits from: * - */ OpenLayers.Layer.OSM = OpenLayers.Class(OpenLayers.Layer.TMS, { /** * Constructor: OpenLayers.Layer.OSM * * Parameters: * name - {String} * url - {String} * options - {Object} Hashtable of extra options to tag onto the layer */ initialize: function(name, url, options) { options = OpenLayers.Util.extend({ attribution: "Data by OpenStreetMap", maxExtent: new OpenLayers.Bounds(-20037508.34,-20037508.34,20037508.34,20037508.34), maxResolution: 156543.0339, units: "m", projection: "EPSG:900913", transitionEffect: "resize" }, options); var newArguments = [name, url, options]; OpenLayers.Layer.TMS.prototype.initialize.apply(this, newArguments); }, /** * Method: getUrl * * Parameters: * bounds - {} * * Returns: * {String} A string with the layer's url and parameters and also the * passed-in bounds and appropriate tile size specified as * parameters */ getURL: function (bounds) { var res = this.map.getResolution(); var x = Math.round((bounds.left - this.maxExtent.left) / (res * this.tileSize.w)); var y = Math.round((this.maxExtent.top - bounds.top) / (res * this.tileSize.h)); var z = this.map.getZoom(); var limit = Math.pow(2, z); if (y < 0 || y >= limit) { return OpenLayers.Util.OSM.MISSING_TILE_URL; } else { x = ((x % limit) + limit) % limit; var url = this.url; var path = z + "/" + x + "/" + y + ".png"; if (url instanceof Array) { url = this.selectUrl(path, url); } return url + path; } }, CLASS_NAME: "OpenLayers.Layer.OSM" }); /** * Class: OpenLayers.Layer.OSM.Mapnik * * Inherits from: * - */ OpenLayers.Layer.OSM.Mapnik = OpenLayers.Class(OpenLayers.Layer.OSM, { /** * Constructor: OpenLayers.Layer.OSM.Mapnik * * Parameters: * name - {String} * options - {Object} Hashtable of extra options to tag onto the layer */ initialize: function(name, options) { var url = [ "http://a.tile.openstreetmap.org/", "http://b.tile.openstreetmap.org/", "http://c.tile.openstreetmap.org/" ]; options = OpenLayers.Util.extend({ numZoomLevels: 19 }, options); var newArguments = [name, url, options]; OpenLayers.Layer.OSM.prototype.initialize.apply(this, newArguments); }, CLASS_NAME: "OpenLayers.Layer.OSM.Mapnik" }); /** * Class: OpenLayers.Layer.OSM.Osmarender * * Inherits from: * - */ OpenLayers.Layer.OSM.Osmarender = OpenLayers.Class(OpenLayers.Layer.OSM, { /** * Constructor: OpenLayers.Layer.OSM.Osmarender * * Parameters: * name - {String} * options - {Object} Hashtable of extra options to tag onto the layer */ initialize: function(name, options) { var url = [ "http://a.tah.openstreetmap.org/Tiles/tile/", "http://b.tah.openstreetmap.org/Tiles/tile/", "http://c.tah.openstreetmap.org/Tiles/tile/" ]; options = OpenLayers.Util.extend({ numZoomLevels: 18 }, options); var newArguments = [name, url, options]; OpenLayers.Layer.OSM.prototype.initialize.apply(this, newArguments); }, CLASS_NAME: "OpenLayers.Layer.OSM.Osmarender" }); /** * Class: OpenLayers.Layer.OSM.CycleMap * * Inherits from: * - */ OpenLayers.Layer.OSM.CycleMap = OpenLayers.Class(OpenLayers.Layer.OSM, { /** * Constructor: OpenLayers.Layer.OSM.CycleMap * * Parameters: * name - {String} * options - {Object} Hashtable of extra options to tag onto the layer */ initialize: function(name, options) { var url = [ "http://a.andy.sandbox.cloudmade.com/tiles/cycle/", "http://b.andy.sandbox.cloudmade.com/tiles/cycle/", "http://c.andy.sandbox.cloudmade.com/tiles/cycle/" ]; options = OpenLayers.Util.extend({ numZoomLevels: 19 }, options); var newArguments = [name, url, options]; OpenLayers.Layer.OSM.prototype.initialize.apply(this, newArguments); }, CLASS_NAME: "OpenLayers.Layer.OSM.CycleMap" }); /** * Class: OpenLayers.Layer.OSM.Maplint * * Inherits from: * - */ OpenLayers.Layer.OSM.Maplint = OpenLayers.Class(OpenLayers.Layer.OSM, { /** * Constructor: OpenLayers.Layer.OSM.Maplint * * Parameters: * name - {String} * options - {Object} Hashtable of extra options to tag onto the layer */ initialize: function(name, options) { var url = [ "http://d.tah.openstreetmap.org/Tiles/maplint/", "http://e.tah.openstreetmap.org/Tiles/maplint/", "http://f.tah.openstreetmap.org/Tiles/maplint/" ]; options = OpenLayers.Util.extend({ numZoomLevels: 18, isBaseLayer: false, visibility: false }, options); var newArguments = [name, url, options]; OpenLayers.Layer.OSM.prototype.initialize.apply(this, newArguments); }, CLASS_NAME: "OpenLayers.Layer.OSM.Maplint" }); /* * * Purpose: extends OpenLayers API (toolTips) * Add New Control ToolTips * Author: Van De Casteele Arnaud * * Date: November 2008 * Version: 0.1 * */ /** * @requires OpenLayers/Control.js */ /** * Class: OpenLayers.Control.MousePosition * * Inherits from: * - */ OpenLayers.Control.ToolTips = OpenLayers.Class(OpenLayers.Control, { /** * Property: element * {DOMElement} The DOM element that contains the toolTips Element */ element: null, /** * Property: text color * Can be a text as black or hexadecimal color as #000000 * {String} */ textColor: "black", /** * Property: bold text * {String} */ bold : false, /** * Property: Opacity * {String} */ opacity : 100, /** * Property: background color * Can be a text as white or hexadecimal color as #FFFFFF * {String} */ bgColor: "white", /** * Property: Padding of the div * {String} */ paddingValue : "2px", /** * Property: lastXy * {} */ lastXy: null, html : null, /** * Constructor: OpenLayers.Control.MousePosition * * Parameters: * options - {DOMElement} Options for control. */ initialize: function(options) { //Extend with new arguments var newArguments = []; OpenLayers.Util.extend(this, options); OpenLayers.Control.prototype.initialize.apply(this, arguments); }, /** * Method: destroy */ destroy: function() { if (this.map) { this.map.events.unregister('mousemove', this, this.redraw); } OpenLayers.Control.prototype.destroy.apply(this, arguments); }, /** * Method: draw * Used with the mapadd.Control * {DOMElement} */ draw: function() { OpenLayers.Control.prototype.draw.apply(this, arguments); // Create the Div in the DOM // Div background this.divBgTtips = document.createElement("div"); this.divBgTtips.id = OpenLayers.Util.createUniqueID("divBgTtips"); this.divBgTtips.className = this.displayClass + 'ToolTipsElement'; this.divBgTtips.style.backgroundColor = this.bgColor; this.divBgTtips.style.display = "none"; this.divBgTtips.style.position = "absolute"; this.divBgTtips.style.zIndex = "100000"; this.divBgTtips.style.padding = "2px 5px 2px 5px"; this.divBgTtipsTx = document.createElement("span"); if(this.bold){this.divBgTtipsTx.style.fontWeight="bold";} this.divBgTtips.appendChild(this.divBgTtipsTx); //BG Opacity this.divBgTtips.style.filter="alpha(opacity="+this.opacity*100+")"; this.divBgTtips.style.opacity=this.opacity; //document.getElementById(this.map.div.id).appendChild(this.divBgTtips); document.body.appendChild(this.divBgTtips); // Div for the text // Hack to have a transparent background and a 100 opacity text this.divTxTtips = document.createElement("div"); this.divTxTtips.id = OpenLayers.Util.createUniqueID("divTxTtips"); this.divTxTtips.style.color = this.textColor; this.divTxTtips.style.display = "none"; this.divTxTtips.style.position = "absolute"; this.divTxTtips.style.zIndex = "100001"; this.divTxTtips.style.padding = "2px 5px 2px 5px"; if(this.bold){this.divTxTtips.style.fontWeight="bold";} document.getElementById(this.map.div.id).appendChild(this.divTxTtips); //this.divTxTtips = this.clone(this.divBgTtips); document.body.appendChild(this.divTxTtips); this.map.events.register('mousemove', this, this.redraw); }, /** * Method: show * Show the tooltips on the map */ show : function(valueHTML){ this.divBgTtipsTx.innerHTML = valueHTML.html; this.divBgTtipsTx.style.visibility = "hidden"; this.divTxTtips.innerHTML = valueHTML.html; this.divTxTtips.style.display = "block"; this.divBgTtips.style.display = "block"; }, /** * Method: hide * hide the tooltips on the map */ hide : function(){ this.divBgTtips.style.display = "none"; this.divTxTtips.style.display = "none"; }, /** * Method: findXYmap * To Know the position of the map in the HTML */ findXYMap : function(obj){ var x=0,y=0; while (obj!=null){ x+=obj.offsetLeft-obj.scrollLeft; y+=obj.offsetTop-obj.scrollTop; obj=obj.offsetParent; } return {x:x,y:y}; }, /** * Method: redraw the div * with new position params */ redraw: function(evt) { marginPos = this.findXYMap(document.getElementById(this.map.div.id)); this.divBgTtips.style.left = ((evt.xy.x+marginPos.x)+22)+"px"; this.divBgTtips.style.top = ((evt.xy.y+marginPos.y)-12)+"px"; this.divTxTtips.style.left = ((evt.xy.x+marginPos.x)+22)+"px"; this.divTxTtips.style.top = ((evt.xy.y+marginPos.y)-12)+"px"; }, CLASS_NAME: "OpenLayers.Control.ToolTips" }); var BrowserDetect = { init: function () { this.browser = this.searchString(this.dataBrowser) || "An unknown browser"; this.version = this.searchVersion(navigator.userAgent) || this.searchVersion(navigator.appVersion) || "an unknown version"; this.OS = this.searchString(this.dataOS) || "an unknown OS"; }, searchString: function (data) { for (var i=0;ifacility list<\/a>."; MapLangData["en"]["BuildingWLAN"]="There are WiTUC hotspots<\/a> in this building."; MapLangData["en"]["HomepageNewWindow"]="Opens the homepage in a new window."; MapLangData["en"]["ImageNewWindow"]="Show a bigger version of the image in a new window."; MapLangData["en"]["LernortTyp"]="Typ"; MapLangData["en"]["LernortOeffnungszeiten"]="Business hours"; MapLangData["en"]["LernortUmfeld"]="Peripherals"; MapLangData["en"]["LernortSchliessanlage"]="Locking system installed."; MapLangData["en"]["LernortArbeitsplaetze"]="working spaces"; MapLangData["en"]["LernortRaumgroesse"]="Room size"; MapLangData["en"]["LernortPCs"]="Computers"; MapLangData["en"]["LernortTische"]="Tables"; MapLangData["en"]["LernortStuehle"]="Chairs"; MapLangData["en"]["LernortSofa"]="Couch"; MapLangData["en"]["LernortWhteboard"]="Whiteboard"; MapLangData["en"]["LernortTafel"]="Board"; MapLangData["en"]["LernortBeamer"]="Beamer"; MapLangData["en"]["LernortFlipchart"]="Flipchart"; MapLangData["de"]=new Object(); MapLangData["de"]["Lon"]="Länge"; MapLangData["de"]["Lat"]="Breite"; MapLangData["de"]["Photo"]="Foto"; MapLangData["de"]["Phone"]="Telefon"; MapLangData["de"]["Fax"]="Fax"; MapLangData["de"]["Mail"]="E-Mail"; MapLangData["de"]["Nav"]="Navigation"; MapLangData["de"]["NavHere"]="hier hin"; MapLangData["de"]["NavOr"]="oder"; MapLangData["de"]["NavFromHere"]="ab hier"; MapLangData["de"]["WLAN"]="WiTUC WLAN-Hotspot"; MapLangData["de"]["WLANInfo"]="Weitere Informationen zum WiTUC"; MapLangData["de"]["ZoomFoto"]="Anklicken vergrößert das Foto."; MapLangData["de"]["LayerArea"]="Gebiete"; MapLangData["de"]["LayerFacility"]="Gebäude"; MapLangData["de"]["LayerWLAN"]="WiTUC WLAN-Hotspots"; MapLangData["de"]["LayerPhoto"]="Fotos"; MapLangData["de"]["LayerCampus"]="Campus"; MapLangData["de"]["LayerWeltData"]="Interessante Orte"; MapLangData["de"]["LayerLernorte"]="Lernorte"; MapLangData["de"]["OnlyOneBuliding1"]="Momentan wird in der Karte nur die Einrichtung"; MapLangData["de"]["OnlyOneBuliding2"]="angezeigt."; MapLangData["de"]["OnlyOneBuliding3"]="Um alle Einrichtungen angezeigt zu bekommen, klicken Sie bitte den Link"; MapLangData["de"]["OnlyOneBuliding4"]="vollständige Campuskarte"; MapLangData["de"]["OnlyOneBuliding5"]="an."; MapLangData["de"]["FacilityList"]="Gebäudeverzeichnis"; MapLangData["de"]["SearchResults"]="Suchergebnisse"; MapLangData["de"]["SearchResults1"]="Ergebnisse der Suche nach"; MapLangData["de"]["SearchResults2"]="Es konnten leider keine Ergebnisse, die zu"; MapLangData["de"]["SearchResults3"]="passen würden, gefunden werden."; MapLangData["de"]["SearchResults4"]="Sie können versuchen, nach einem anderen Begriff zu suchen oder sich das Gebäudeverzeichnis<\/a> anzeigen lassen."; MapLangData["de"]["BuildingWLAN"]="In dem Gebäude sind WiTUC-Hotspots<\/a> vorhanden."; MapLangData["de"]["HomepageNewWindow"]="Öffnet die Homepage auf einer neuen Seite."; MapLangData["de"]["ImageNewWindow"]="Zeigt das Foto groß auf einer neuen Seite an."; MapLangData["de"]["LernortTyp"]="Typ"; MapLangData["de"]["LernortOeffnungszeiten"]="Öffnungszeiten"; MapLangData["de"]["LernortUmfeld"]="Umfeld"; MapLangData["de"]["LernortSchliessanlage"]="Schließanlage vorhanden."; MapLangData["de"]["LernortArbeitsplaetze"]="Arbeitsplätze"; MapLangData["de"]["LernortRaumgroesse"]="Raumgröße"; MapLangData["de"]["LernortPCs"]="PCs"; MapLangData["de"]["LernortTische"]="Tische"; MapLangData["de"]["LernortStuehle"]="Stühle"; MapLangData["de"]["LernortSofa"]="Sofa"; MapLangData["de"]["LernortWhteboard"]="Whiteboard"; MapLangData["de"]["LernortTafel"]="Tafel"; MapLangData["de"]["LernortBeamer"]="Beamer"; MapLangData["de"]["LernortFlipchart"]="Flipchart"; /* Tools */ function SetPosition(lo,la,zo) {map.setCenter(new OpenLayers.LonLat(lo,la).transform(Projection,map.getProjectionObject()),zo);} function SetPositionClausthal() {SetPosition(10.34,51.805,14);} function SetPositionDeutschland() {SetPosition(10.95,51.2,5);} function SetPositionFromPermaLink(Lon,Lat,Zoom) {if (Zoom=="") Zoom=14; LonLat=new OpenLayers.LonLat(Lon,Lat).transform(map.getProjectionObject(),Projection); SetPosition(LonLat.lon,LonLat.lat,Zoom);} function SetLayersFromPermaLink(Layers) {for (var i=0; i"+Gebaeude["Name"]+"<\/a><\/b>"; else Text=""+Gebaeude["Name"]+"<\/b>"; if (Gebaeude["FotoKlein"] && (Gebaeude["FotoKlein"]!="")) { Text+='
'; if (Gebaeude["FotoGross"] && (Gebaeude["FotoGross"]!="")) Text+=''; Text+=''; if (Gebaeude["FotoGross"] && (Gebaeude["FotoGross"]!="")) Text+='<\/a>'; if (Gebaeude["Fotograf"] && (Gebaeude["Fotograf"]!="")) Text+='
'+MapLangData[MapLang]["Photo"]+': '+Gebaeude["Fotograf"]+'<\/div>'; Text+='<\/div>'; } Text+=""; if (Gebaeude["Nr"] && (Gebaeude["Nr"]!="")) Text+="
\n(Gebäudenummer: "+Gebaeude["Nr"]+')'; if (Gebaeude["Strasse"] && (Gebaeude["Strasse"]!="")) Text+="
\n"+Gebaeude["Strasse"]; if (Gebaeude["Ort"] && (Gebaeude["Ort"]!="")) Text+="
\n"+Gebaeude["Ort"]; if (Gebaeude["Telefon"] && (Gebaeude["Telefon"]!="")) Text+="
\n"+MapLangData[MapLang]["Phone"]+": "+Gebaeude["Telefon"]; if (Gebaeude["Fax"] && (Gebaeude["Fax"]!="")) Text+="
\n"+MapLangData[MapLang]["Fax"]+": "+Gebaeude["Fax"]; if (Gebaeude["Mail"] && (Gebaeude["Mail"]!="")) Text+="
\n"+MapLangData[MapLang]["Mail"]+":
"+Gebaeude["Mail"]+"<\/a>"; if (Gebaeude["Einrichtung"]) for (var i=0;i"+Einrichtung["Name"]+"<\/b><\/a>"; else Text+="
\n"+Einrichtung["Name"]+"<\/b>"; if (Einrichtung["Telefon"] && (Einrichtung["Telefon"]!="")) Text+="
\n  "+MapLangData[MapLang]["Phone"]+": "+Einrichtung["Telefon"]; if (Einrichtung["Fax"] && (Einrichtung["Fax"]!="")) Text+="
\n  "+MapLangData[MapLang]["Fax"]+": "+Einrichtung["Fax"]; if (Einrichtung["Mail"] && (Einrichtung["Mail"]!="")) Text+="
\n  "+MapLangData[MapLang]["Mail"]+":
"+Einrichtung["Mail"]+"<\/a>"; } if (Gebaeude["WLAN"]) Text+='

'+MapLangData[MapLang]["BuildingWLAN"]+'<\/span>'; Nav1='http://maps.google.de/maps?f=q&hl=de&q=to:+%40'+Gebaeude["Lat"]+',+'+Gebaeude["Lon"]+'&z=16'; Nav2='http://maps.google.de/maps?f=q&hl=de&q=from:+%40'+Gebaeude["Lat"]+',+'+Gebaeude["Lon"]+'&z=16'; Text+='

('+MapLangData[MapLang]["Nav"]+'
'+MapLangData[MapLang]["NavHere"]+'<\/a> '+MapLangData[MapLang]["NavOr"]+' '+MapLangData[MapLang]["NavFromHere"]+'<\/a>)<\/span>'; Text+="<\/span>"; return Text; } function AddGebaeude(Nr,Big) { var Gebaeude=GebaeudeDB[Nr]; var Text=BuildGebaeudeText(Gebaeude); size=1; if (Gebaeude["Einrichtung"]) {if (Gebaeude["Einrichtung"].length>3) size=3; else size=2;} if (Big==true) { marker=addMarkerSizePopup(layer_Gebaeude,Gebaeude["Lon"],Gebaeude["Lat"],Gebaeude["Name"],Text,MarkerIconPointBig,size); } else { marker=addMarkerSizePopup(layer_Gebaeude,Gebaeude["Lon"],Gebaeude["Lat"],Gebaeude["Name"],Text,MarkerIconPoint,size); } setMarkerCursorPointer(marker); GebaeudeMarker[Nr]=marker; } function AddCampus(Nr,Big) { var Campus=CampusDB[Nr]; Text=BuildGebaeudeText(Campus); size=1; if (Campus["Einrichtung"]) {if (Campus["Einrichtung"].length>3) size=3; else size=2;} if (Big==true) { marker=addMarkerSizePopup(layer_Campus,Campus["Lon"],Campus["Lat"],Campus["Name"],Text,MarkerIconPointBig,size); } else { marker=addMarkerSizePopup(layer_Campus,Campus["Lon"],Campus["Lat"],Campus["Name"],Text,MarkerIconPointBlue,size); } setMarkerCursorPointer(marker); CampusMarker[Nr]=marker; } function AddWLAN(Nr) { var WLAN=WLANDB[Nr]; Text=""+MapLangData[MapLang]["WLAN"]+"<\/b>
"; Text+="
"; Text+=MapLangData[MapLang]["Lon"]+": "+WLAN["Lon"]+"
"+MapLangData[MapLang]["Lat"]+": "+WLAN["Lat"]+"
"; if (WLAN["Beschreibung"] && (WLAN["Beschreibung"]!="")) Text+=WLAN["Beschreibung"]+"
"; Text+="
"+MapLangData[MapLang]["WLANInfo"]+"<\/a>"; Text+="<\/div>"; marker=addMarker(layer_WLAN,WLAN["Lon"],WLAN["Lat"],"",Text,MarkerIconWLAN); setMarkerCursorCross(marker); } function AddGebiet(Nr) { var Gebiet=GebieteDB[Nr]; var LonLat1=new OpenLayers.LonLat(Gebiet["X1"],Gebiet["Y1"]).transform(Projection,map.getProjectionObject()); var LonLat2=new OpenLayers.LonLat(Gebiet["X2"],Gebiet["Y2"]).transform(Projection,map.getProjectionObject()); bounds=new OpenLayers.Bounds(LonLat1.lon,LonLat1.lat,LonLat2.lon,LonLat2.lat); box=new OpenLayers.Feature.Vector(bounds.toGeometry()); box.attributes={name: Gebiet["Name"]}; layer_Gebiete.addFeatures(box); } function AddFotoInt(Foto,Layer,Marker) { Text='

'+Foto["Name"]+'<\/strong><\/p>'; Text+='

'; if (Foto["FotoGross"] && (Foto["FotoGross"]!="")) Text+=''; Text+=''; if (Foto["FotoGross"] && (Foto["FotoGross"]=!"")) Text+='<\/a>'; if (Foto["Fotograf"] && (Foto["Fotograf"]!="")) Text+='
'+MapLangData[MapLang]["Photo"]+': '+Foto["Fotograf"]+'<\/div>'; if (Foto["FotoGross"] && (Foto["FotoGross"]!="")) Text+='
('+MapLangData[MapLang]["ZoomFoto"]+')<\/div>'; Text+='<\/div>'; if (Foto["Beschreibung"] && (Foto["Beschreibung"]!="")) Text+='
'+Foto["Beschreibung"]+'<\/div>'; marker=addMarkerBigPopup(Layer,Foto["Lon"],Foto["Lat"],Foto["Name"],Text,Marker,true); setMarkerCursorPointer(marker); } function AddFoto(Nr) { AddFotoInt(FotoDB[Nr],layer_Fotos,MarkerIconFoto); } function AddWeltData(Nr,Big) { if (Big==true) { AddFotoInt(WeltDataDB[Nr],layer_WeltData,MarkerIconPointBig); } else { AddFotoInt(WeltDataDB[Nr],layer_WeltData,MarkerIconPoint); } } function AddSpecialMarker(Rec) { if (typeof(layer_SpecialMarker)=='undefined') return; Text=Rec["Name"]; var ll=new OpenLayers.LonLat(Rec["Lon"],Rec["Lat"]).transform(Projection,map.getProjectionObject()); var point = new OpenLayers.Geometry.Point(ll.lon,ll.lat); var InfoLabel = new OpenLayers.Feature.Vector(point); InfoLabel.attributes = {name: Rec["Name"]}; layer_SpecialMarker.addFeatures([InfoLabel]); layer_SpecialMarker.setVisibility(true); } function BuildLernortText(Lernort) { if (Lernort["WWW"] && (Lernort["WWW"]!="")) Text=""+Lernort["Name"]+"<\/a><\/b>"; else Text=""+Lernort["Name"]+"<\/b>"; if (Lernort["FotoKlein"] && (Lernort["FotoKlein"]!="")) { Text+='
'; if (Lernort["FotoGross"] && (Lernort["FotoGross"]!="")) Text+=''; Text+=''; if (Lernort["FotoGross"] && (Lernort["FotoGross"]!="")) Text+='<\/a>'; if (Lernort["Fotograf"] && (Lernort["Fotograf"]!="")) Text+='
'+MapLangData[MapLang]["Photo"]+': '+Lernort["Fotograf"]+'<\/div>'; Text+='<\/div>'; } Text+="
\n"; if (Lernort["Typ"] && (Lernort["Typ"]!="")) Text+="
\n"+MapLangData[MapLang]["LernortTyp"]+": "+Lernort["Typ"]+"
"; if (Lernort["Arbeitsplaetze"] && (Lernort["Arbeitsplaetze"]!="")) Text+="
\n"+Lernort["Arbeitsplaetze"]+" "+MapLangData[MapLang]["LernortArbeitsplaetze"]; if (Lernort["Raumgroesse"] && (Lernort["Raumgroesse"]!="")) Text+="
\n"+MapLangData[MapLang]["LernortRaumgroesse"]+": "+Lernort["Raumgroesse"]; if (Lernort["PCs"] && (Lernort["PCs"]!="")) Text+="
\n"+MapLangData[MapLang]["LernortPCs"]+": "+Lernort["PCs"]; if (Lernort["Tische"] && (Lernort["Tische"]!="")) Text+="
\n"+MapLangData[MapLang]["LernortTische"]+": "+Lernort["Tische"]; if (Lernort["Stuehle"] && (Lernort["Stuehle"]!="")) Text+="
\n"+MapLangData[MapLang]["LernortStuehle"]+": "+Lernort["Stuehle"]; if (Lernort["Sofa"] && (Lernort["Sofa"]!="")) Text+="
\n"+MapLangData[MapLang]["LernortSofa"]+": "+Lernort["Sofa"]; if (Lernort["Whiteboard"] && (Lernort["Whiteboard"]!="")) Text+="
\n"+MapLangData[MapLang]["LernortWhteboard"]+": "+Lernort["Whiteboard"]; if (Lernort["Tafel"] && (Lernort["Tafel"]!="")) Text+="
\n"+MapLangData[MapLang]["LernortTafel"]+": "+Lernort["Tafel"]; if (Lernort["Beamer"] && (Lernort["Beamer"]!="")) Text+="
\n"+MapLangData[MapLang]["LernortBeamer"]+": "+Lernort["Beamer"]; if (Lernort["Flipchart"] && (Lernort["Flipchart"]!="")) Text+="
\n"+MapLangData[MapLang]["LernortFlipchart"]+": "+Lernort["Flipchart"]; if (Lernort["Umfeld"] && (Lernort["Umfeld"]!="")) Text+="
\n"+MapLangData[MapLang]["LernortUmfeld"]+": "+Lernort["Umfeld"]; if (Lernort["WLAN"] && (Lernort["WLAN"]!="") && Lernort["WLAN"]=="1") Text+='
\n'+MapLangData[MapLang]["BuildingWLAN"]; Text+="
\n"; Text+=""; if (Lernort["Gebaeude"] && (Lernort["Gebaeude"]!="")) Text+="
\n"+Lernort["Gebaeude"]; if (Lernort["Strasse"] && (Lernort["Strasse"]!="")) Text+="
\n"+Lernort["Strasse"]; if (Lernort["Stadt"] && (Lernort["Stadt"]!="")) Text+="
\n"+Lernort["Stadt"]; if (Lernort["Oeffnungszeiten"] && (Lernort["Oeffnungszeiten"]!="")) Text+="
\n"+MapLangData[MapLang]["LernortOeffnungszeiten"]+": "+Lernort["Oeffnungszeiten"]; if (Lernort["Telefon"] && (Lernort["Telefon"]!="")) Text+="
\n"+MapLangData[MapLang]["Phone"]+": "+Lernort["Telefon"]; if (Lernort["Fax"] && (Lernort["Fax"]!="")) Text+="
\n"+MapLangData[MapLang]["Fax"]+": "+Lernort["Fax"]; if (Lernort["Mail"] && (Lernort["Mail"]!="")) Text+="
\n"+MapLangData[MapLang]["Mail"]+":
"+Lernort["Mail"]+"<\/a>"; if (Lernort["Schliessanlage"] && (Lernort["Schliessanlage"]!="")) Text+="
\n"+MapLangData[MapLang]["LernortSchliessanlage"]; Nav1='http://maps.google.de/maps?f=q&hl=de&q=to:+%40'+Lernort["Lat"]+',+'+Lernort["Lon"]+'&z=16'; Nav2='http://maps.google.de/maps?f=q&hl=de&q=from:+%40'+Lernort["Lat"]+',+'+Lernort["Lon"]+'&z=16'; Text+='

('+MapLangData[MapLang]["Nav"]+'
'+MapLangData[MapLang]["NavHere"]+'<\/a> '+MapLangData[MapLang]["NavOr"]+' '+MapLangData[MapLang]["NavFromHere"]+'<\/a>)<\/span>'; Text+="<\/span>"; return Text; } function AddLernort(Nr) { var Lernort=LernorteDB[Nr]; var Text=BuildLernortText(Lernort); marker=addMarkerSizePopup(layer_Lernorte,Lernort["Lon"],Lernort["Lat"],Lernort["Name"],Text,MarkerIconLernort,4); setMarkerCursorPointer(marker); LernorteMarker[Nr]=marker; } function InitMap() { OpenLayers.Lang.setCode(MapLang); /* Falls einzelnes Gebäude angezeigt werden soll */ if (InstName!="") { for (var i=0;i=0)) for (var i=0;i=0)) && (!(CampusNr>=0))) for (var i=0;i=0) { if (ChangeH1) { H=document.getElementsByTagName("h1")[1]; if (H) H.firstChild.data=H.firstChild.data+' - '+GebaeudeDB[GebaeudeNr]["Name"]; } H=document.getElementById('InstNameLabel'); if (H) H.firstChild.data=H.firstChild.data=GebaeudeDB[GebaeudeNr]["Name"]; } if (CampusNr>=0) { if (ChangeH1) { H=document.getElementsByTagName("h1")[1]; if (H) H.firstChild.data=H.firstChild.data+' - '+CampusDB[CampusNr]["Name"]; } H=document.getElementById('InstNameLabel'); if (H) H.firstChild.data=H.firstChild.data=CampusDB[CampusNr]["Name"]; } if (WeltDataNr>=0) { if (ChangeH1) { H=document.getElementsByTagName("h1")[1]; if (H) H.firstChild.data=H.firstChild.data+' - '+WeltDataDB[WeltDataNr]["Name"]; } H=document.getElementById('InstNameLabel'); if (H) H.firstChild.data=H.firstChild.data=WeltDataDB[WeltDataNr]["Name"]; } /* Karte initialisieren */ var LonLat1=new OpenLayers.LonLat(5,45).transform(Projection,new OpenLayers.Projection("EPSG:900913")); var LonLat2=new OpenLayers.LonLat(15,55).transform(Projection,new OpenLayers.Projection("EPSG:900913")); bounds=new OpenLayers.Bounds(LonLat1.lon,LonLat1.lat,LonLat2.lon,LonLat2.lat); ScanLine=new OpenLayers.Control.ScaleLine({bottomOutUnit: "", bottomInUnits: ""}); var options={ //restrictedExtent: bounds, displayProjection: Projection, minZoomLevel: 10, controls: [ new OpenLayers.Control.Navigation(), new OpenLayers.Control.KeyboardDefaults(), new OpenLayers.Control.LayerSwitcher(), new OpenLayers.Control.PanZoomBar(), ScanLine ] //maxExtent: bounds, //maxResolution: 156543, //maxScale: 5000000 }; map=new OpenLayers.Map('map',options); map.events.on({'moveend': UpdatePermaLink,'changelayer': UpdatePermaLink,'changebaselayer': UpdatePermaLink}); map.events.on({'mousemove': UpdateMousePosition}); layer_mapnik = new OpenLayers.Layer.OSM.Mapnik("Mapnik",{visibility: true, displayInLayerSwitcher: true}); map.addLayer(layer_mapnik); layer_osmarender = new OpenLayers.Layer.OSM.Osmarender("Osmarender",{visibility: false, displayInLayerSwitcher: true}); map.addLayer(layer_osmarender); layer_cyclemap = new OpenLayers.Layer.OSM.CycleMap("Cycle Map",{visibility: false, displayInLayerSwitcher: true}); map.addLayer(layer_cyclemap); /* layer_maplint = new OpenLayers.Layer.OSM.Maplint("Maplint",{visibility: false, displayInLayerSwitcher: true}); map.addLayer(layer_maplint); siehe http://wiki.openstreetmap.org/wiki/Maplint */ try { if ((BrowserDetect.browser!="Explorer") || (BrowserDetect.version>=8)) { ttips=new OpenLayers.Control.ToolTips({bgColor:"#FFFFCC",textColor :"black", opacity : 0.65}); map.addControl(ttips); } } catch(e) {ttips=0;} } function InitCampusMap() { InitMap(); StyleMap_Gebiete = new OpenLayers.StyleMap({'default':{fillColor: "#ee9900", fillOpacity: 0.2, strokeColor: "#ee9900", strokeOpacity: 1, strokeWidth: 1, strokeLinecap: "round", strokeDashstyle: "solid", label : "${name}", fontColor: "blue", fontSize: "11px", fontFamily: "Verdana, Lucida, sans-serif", fontWeight: "bold", labelAlign: "ct"}}); if (OpenLayers.Util.getBrowserName()=="msie") layer_Gebiete=""; else {layer_Gebiete = new OpenLayers.Layer.Vector(MapLangData[MapLang]["LayerArea"],{projection: Projection, visibility: false, displayInLayerSwitcher: true, styleMap: StyleMap_Gebiete}); map.addLayer(layer_Gebiete);} layer_Gebaeude = new OpenLayers.Layer.Markers(MapLangData[MapLang]["LayerFacility"], {projection: Projection, visibility: true, displayInLayerSwitcher: true}); map.addLayer(layer_Gebaeude); layer_WLAN = new OpenLayers.Layer.Markers(MapLangData[MapLang]["LayerWLAN"], {projection: Projection, visibility: false, displayInLayerSwitcher: true}); map.addLayer(layer_WLAN); layer_Fotos = new OpenLayers.Layer.Markers(MapLangData[MapLang]["LayerPhoto"], {projection: Projection, visibility: false, displayInLayerSwitcher: true}); map.addLayer(layer_Fotos); layer_Campus = new OpenLayers.Layer.Markers(MapLangData[MapLang]["LayerCampus"], {projection: Projection, visibility: false, displayInLayerSwitcher: true}); map.addLayer(layer_Campus); layer_Lernorte = new OpenLayers.Layer.Markers(MapLangData[MapLang]["LayerLernorte"], {projection: Projection, visibility: false, displayInLayerSwitcher: true}); map.addLayer(layer_Lernorte); StyleMap_SpecialMarker=new OpenLayers.StyleMap({'default':{ strokeColor: "#00FF00", strokeOpacity: 0, strokeWidth: 3, fillColor: "#FF5500", fillOpacity: 0, pointRadius: 0, pointerEvents: "visiblePainted", label : "${name}", fontColor: "blue", fontSize: "10px", fontFamily: "82% Verdana, Lucida, sans-serif", labelAlign: "ct" }}); /* layer_SpecialMarker = new OpenLayers.Layer.Vector("Simple Geometry", {projection: Projection, visibility: false, displayInLayerSwitcher: true, styleMap: StyleMap_SpecialMarker}); map.addLayer(layer_SpecialMarker); */ /* POIs hinzufügen */ if ((layer_Gebiete!="") && GebieteDB) for (var i=0;i=0) AddSpecialMarker(GebaeudeDB[GebaeudeNr]); } if (CampusDB) { for (var i=0;i=0) AddSpecialMarker(CampusDB[CampusNr]); } if (WLANDB) for (var i=0;i=0) { layer_Gebaeude.setVisibility(true); CenterGebaeude(GebaeudeNr); } else { if (CampusNr>=0) { layer_Campus.setVisibility(true); CenterCampus(CampusNr); } else { if (typeof(layer_WeltData)!='undefined') SetPositionDeutschland(); else SetPositionClausthal(); } } /* Längenskala etwas mehr an den Rand schieben */ ScanLine.div.style.left="3px"; ScanLine.div.style.bottom="3px"; /* Zoom gemäß Vorgabeeinstellung setzen */ if ((typeof(UserLon)!='undefined') && (typeof(UserLat)!='undefined') && (typeof(UserZoom)!='undefined') && (UserLon!="") && (UserLat!="") && (UserZoom!="")) SetPositionFromPermaLink(UserLon,UserLat,UserZoom); /* Layers gemäß Vorgabeeinstellung setzen */ if ((typeof(UserLayers)!='undefined') && (UserLayers!="")) SetLayersFromPermaLink(UserLayers); /* Position und Layer gemäß Parametern setzen */ if ((Lon!="") && (Lat!="")) SetPositionFromPermaLink(Lon,Lat,Zoom); if (Layers!="") SetLayersFromPermaLink(Layers); /* Und schließlich den Permalink aktualisieren */ UpdatePermaLink(); } /* Einzelnen Campusbereich heranzoomen */ function ZoomCampusArea(Nr) { var Gebiet=GebieteDB[Nr]; if (!Gebiet) return; LonLat1=new OpenLayers.LonLat(Gebiet["X1"],Gebiet["Y1"]).transform(Projection,map.getProjectionObject()); LonLat2=new OpenLayers.LonLat(Gebiet["X2"],Gebiet["Y2"]).transform(Projection,map.getProjectionObject()); Bounds=new OpenLayers.Bounds(LonLat1.lon,LonLat1.lat,LonLat2.lon,LonLat2.lat); map.zoomToExtent(Bounds); } function ZoomWorldArea(Nr) { var Area=WeltDB[Nr]; if (!Area) return; LonLat1=new OpenLayers.LonLat(Area["X1"],Area["Y1"]).transform(Projection,map.getProjectionObject()); LonLat2=new OpenLayers.LonLat(Area["X2"],Area["Y2"]).transform(Projection,map.getProjectionObject()); Bounds=new OpenLayers.Bounds(LonLat1.lon,LonLat1.lat,LonLat2.lon,LonLat2.lat); map.zoomToExtent(Bounds); } function InsertGebieteList() { for (var i=0;i0) document.write(', '); document.write(''+GebieteDB[i]["Name"]+'<\/a>'); } document.write('.'); } function InsertWeltList() { for (var i=0;i0) document.write(', '); document.write(''+WeltDB[i]["Name"]+'<\/a>'); } document.write('.'); } /* Datensatz für einzelnes Gebäude anzeigen */ function GebaeudeInfoNavData() { if (GebaeudeNr>=0) { Gebaeude=GebaeudeDB[GebaeudeNr]; Nav1='http://maps.google.de/maps?f=q&hl=de&q=to:+%40'+Gebaeude["Lat"]+',+'+Gebaeude["Lon"]+'&z=16'; Nav2='http://maps.google.de/maps?f=q&hl=de&q=from:+%40'+Gebaeude["Lat"]+',+'+Gebaeude["Lon"]+'&z=16'; return ''+MapLangData[MapLang]["NavHere"]+'<\/a> '+MapLangData[MapLang]["NavOr"]+' '+MapLangData[MapLang]["NavFromHere"]+'<\/a>'; } if (CampusNr>=0) { Campus=CampusDB[CampusNr]; Nav1='http://maps.google.de/maps?f=q&hl=de&q=to:+%40'+Campus["Lat"]+',+'+Campus["Lon"]+'&z=16'; Nav2='http://maps.google.de/maps?f=q&hl=de&q=from:+%40'+Campus["Lat"]+',+'+Campus["Lon"]+'&z=16'; return ''+MapLangData[MapLang]["NavHere"]+'<\/a> '+MapLangData[MapLang]["NavOr"]+' '+MapLangData[MapLang]["NavFromHere"]+'<\/a>'; } return ""; } function WriteGebaeudeFoto(Gebaeude) { if (!Gebaeude["FotoKlein"]) return; document.write('
'); if (Gebaeude["FotoGross"]) document.write(''); document.write(''); if (Gebaeude["FotoGross"]) document.write('<\/a>'); document.write('<\/div>'); } function WriteGebaeudeData(Gebaeude) { FirstList=true; if (Gebaeude["Nr"] && (Gebaeude["Nr"]!="")) {if (FirstList) FirstList=false; else document.write("
"); document.write('(Gebäudenummer: '+Gebaeude["Nr"]+')<\/a><\/span>');} if (Gebaeude["Strasse"] && (Gebaeude["Strasse"]!="")) {if (FirstList) FirstList=false; else document.write("
"); document.write(Gebaeude["Strasse"]);} if (Gebaeude["Ort"] && (Gebaeude["Ort"]!="")) {if (FirstList) FirstList=false; else document.write("
"); document.write(Gebaeude["Ort"]); } if (Gebaeude["Telefon"] && (Gebaeude["Telefon"]!="")) {if (FirstList) FirstList=false; else document.write("
"); document.write(MapLangData[MapLang]["Phone"]+': '+Gebaeude["Telefon"]);} if (Gebaeude["Fax"] && (Gebaeude["Fax"]!="")) {if (FirstList) FirstList=false; else document.write("
"); document.write(MapLangData[MapLang]["Fax"]+': '+Gebaeude["Fax"]);} if (Gebaeude["Mail"] && (Gebaeude["Mail"]!="")) {if (FirstList) FirstList=false; else document.write("
"); document.write(MapLangData[MapLang]["Mail"]+':
'+Gebaeude["Mail"]+'<\/a>');} if (Gebaeude["WWW"] && (Gebaeude["WWW"]!="")) {if (FirstList) FirstList=false; else document.write("
"); document.write('
'+Gebaeude["WWW"]+'<\/a>');} } function WriteGebaeudeEinrichtungen(Gebaeude) { if (!Gebaeude["Einrichtung"]) return; document.write('