/* =========================================================================== WMS HTML VIEWER JavaScript library =========================================================================== VERSION 1.1.0 DATE Marts, 2003 COMPANY GeoConsultinG, Denmark INTERNET www.geoconsulting.dk E-MAIL nk@geoconsulting.dk PHONE +45 35 349 349 AUTHOR Nikolaj Kamstrup DESCRIPTION REQUIREMENTS =========================================================================== 04.03.2003.xhbt: Bugfix if only one search result 10.03.2003.xhbt: Adding function to open different countries in windows 12.03.2003.xhbt: Adding module to show coordinates for map pin 13.03.2003.xhbt: Changing print to be able to print historic map as seen on the screen 18.03.2003.xhbt: Bugfix for historic divider on map 25.04.2003.xhbt: Bugfix to be able to choose the first element in results. // Adding onfocus event. Removing previous bugfix from 04.03.2003 30.04.2003.xhbt: adding coord search 04.06.2004.julian: adapted to work with Mozilla (tested with ver. 1.6) 07.06.2004.julian: fixed bug, whereby panning of DK_DETALJER occurred in far too large jumps - caused by accumulating pixel sizes. 09.06.2004.julian: fixed persistent coordinates (keep coordinates in hidden frame) 10.06.2004.julian: added divcoordmodule (from Det Geografiske Hjørne) for display af center coordinates 18.02.2005.julian: enabled display of central coordinate in Færø and Greenland. */ //========================================================================= //DECLARATION OF VARIABLES //========================================================================= var appLang; function setAppLang(v){ appLang = v; } function getAppLang(){ return appLang; } //21.02.2005.julian: save search results in top-level variables, so nothing is lost when reloading ASmodule.asp document.domain = "kms.dk"; // enables crossframe scripting var searchResultHtml1 = ""; // primary results, e.g. list of streets var searchResultHtml2 = ""; // secondary results, e.g. list of house numbers on selected street var searchResultHtml3 = ""; // name misleading - used to store list of municipalities (i.e. result of zeroth geokey request for cadastral search) function returnTicket() { var t = "&ticket=764971839f26f9156d63df137cab5b35"; return t; } var newLook = true; var mode = ""; // for use when dragging slider with Mozilla - julian 040514 var isMouseDown = false; var c_MOUSEDOWN = 1; var c_MOUSEMOVE = 2; var c_MOUSEUP = 3; //13.03.2003.xhbt var DIVLOC = 232 + 32; var mapList; //26.08.03.xhbt var mapList1; var mapList2; var mapList3; var mapType var mapName = Array(3); var mapNumber; var mapProjection; var mapImageFormat; var mapCenterX; var mapCenterY; var mapWidth; var mapHeight; var mapJPEGQuality; var mapURI; var mapLeft; var mapTop; var mapBorderSize; var mapBorderColor; var mapModuleBorderSize; var mapModuleLeft; var mapModuleTop; var mapModuleBGColor; var mapModuleBorderColor; var mapModuleHeaderColor; var mapModuleLayout; var navWidth; var navHeight; var navPixelSizeX; var navPixelSizeY; var navULX; var navULY; var navPath; var navLeft; var navTop; var navBorderSize; var navBorderColor; var navModuleColor; var navModuleEnabled; var navModuleLeft; var navModuleTop; var msModuleTop; var msModuleLeft; var msModuleColor; var msModuleEnabled; var msModuleHeaderColor; var msModuleHeaderText; var msModuleInterface; var msWidth; var csModuleTop; var csModuleLeft; var csModuleColor; var csModuleEnabled; var csModuleHeaderColor; var csModuleHeaderText; var csModuleInterface; var csWidth; var csID; var csArray; var asModuleColor; var asModuleEnabled; var asModuleHeaderColor; var asModuleHeaderLeft; var asModuleHeaderText; var asModuleInterface; var asModuleLeft; var asModuleTop; var asDefaultLayout; var asModuleCoordSearch; //30.04.2003.xhbt var sbModuleEnabled; var sbModuleLeft; var sbModuleTop; var sbDarkColor; var sbLightColor; var sbHeight; var sbWidth; var sb2ModuleEnabled; var sb2ModuleLeft; var sb2ModuleTop; var sb2DarkColor; var sb2LightColor; var sb2Height; var sb2Width; var hsPath; var hsBorderSize; var hsBorderColor; var lmHeight; var lmWidth; var lmX; var lmY; var lmPath; var lmrlLeft; var lmrlTop; var lmrlText; //12.03.2003.xhbt:Adding module to show coordinates for map pin var lmcdLeft; var lmcdTop; var lmcdModuleEnabled; var lmcdText1; var lmcdText2; var swmLeft; var swmTop; var swmText; var swmBorderSize; var swmBorderColor; var swmBackground; var plModuleEnabled; var plLeft; var plTop; var plText; var plDestination; var plManyMaps; //13.03.2003.xhbt:To print many maps (DKFON) var plLinks; var LASTCLICKTIME = new Number(); var DELAY = 1000; var ISIMAGE1LOADED = false; var ISIMAGE2LOADED = false; var dipPath; var dipLeft; var dipTop; var gSearchType; //30.04.2003.xhbt - 13.05.2004 julian global variable for use when displaying LMCDModule. parc. var zoomLevel; //10.07.2003.xhbt //MapText 11.09.2003.xhbt var txtsModuleEnabled; var txtsModuleLeft; var txtsModuleTop; var txtsHeight; var txtsWidth; var txtsCopyrightURL; //coordsystem //03.12.03.xhbt var coordSystemOut; var coordSystemIn; var coordWidth; var coordHeight; var coordTop; var coordLeft; var coordModuleEnabled; var coordVis; var c_COORDSHOW = 1; var c_COORDHIDE = 0; var matRegModuleWidth; var matRegModuleHeight; var matRegModuleLeft; var matRegModuleTop; var matRegModuleEnabled; var ActiveASSearchType; var loadfinished = "false"; //========================================================================= //CONSTANTS - DO NOT CHANGE //========================================================================= var c_TABLE = 0; var c_LISTBOX = 1; var c_JPEG = 2; var c_PNG = 3; var c_NOTRANSPARENCY = 0; var c_TRANSPARENCY = 1; var c_ALIAS = 0; var c_ALIAS_UK = 2; var c_PIXELSIZE = 3; var c_SCALE = 4; var c_LAYERS = 5; var c_STYLES = 6; var c_LEGEND = 7; var c_ZOOMIN = -1; var c_ZOOMOUT = 1; var c_SIMPLE = 0; var c_ADVANCED = 1; var c_ADDRESS = 0; var c_PLACENAME = 1; var c_PLACENAME_ONLY = 2; var c_COORDINATES = 3; //30.04.2003.xhbt: adding coord search var c_NO_COORD_PLACE = 4; var c_NO_COORD_ADDRESS = 5; var c_COORDINATES_WMAT = 6; var c_ADDRESS_WMAT = 7; var c_MATRIKEL = 8; var c_FIND_ET_STED = 0; var c_DK_FOER_OG_NU = 1; var c_DK_DETALJER = 2; var c_MATRIKEL = 3; var c_COORD1 = 1; var c_COORD2 = 2; //========================================================================= // Function that converts a UTM centerX to the corresponding screen x of // the hotspot (in pixel). //========================================================================= function getHSLeft(mapNumber,cx) { var hsl; // position of nav module left corner plus // distance between map centre (IRL coordinates) and // x-coordinate (IRL) of upper left corner of nav module, // converted to pixels in navn image hsl = Number(getNavLeft()) + ((cx - getNavULX())/getNavPixelSizeX()); // move HS so its center aligns with map center hsl -= Number( getHSWidth(mapNumber) / 2 ); return (parseInt(hsl)); } //========================================================================= // Function that converts a UTM centerY to the corresponding screen y of // the hotspot (in pixel). //========================================================================= function getHSTop(mapNumber,cy) { var hst; // position of nav module top (in screen pixels) minus // distance between map center (IRL coordinates) and // y-coordinate of upper left corner (IRL coordinates - navULY is something like 6424389), // converted to pixels in nav image. //hst = Number(getNavTop()) + (-(cy - getNavULY())/getNavPixelSizeY()); hst = Number(getNavTop() - ( cy - getNavULY() )/getNavPixelSizeY() ); // move top of HS, so that centre of HS aligns with centre of map hst -= Number( getHSHeight(mapNumber) / 2 ); return (parseInt(hst)); } //========================================================================= // Function that calculates the height (in pixels) of the hotspot based on // the map area. //========================================================================= function getHSHeight(mapNumber) { var ps = 0; var t; //loop through all maps and use the largest pixelsize to scale the hotspot for (var i=1; i<=getMapNumber(); i++) { t = getMapPixelSize(getMapName(i)); if (t > ps) ps = t; } var aoiy = ps * getMapHeight(mapNumber) / getNavPixelSizeY(); return (parseInt(aoiy)); } //========================================================================= // Function that calculates the width (in pixels) of the hotspot based on // the map area. //========================================================================= function getHSWidth(mapNumber) { var ps = 0; var t; //loop through all maps and use the largest pixelsize to scale the hotspot for (var i=1; i<=getMapNumber(); i++) { t = getMapPixelSize(getMapName(i)); if (t > ps) ps = t; } var aoix = ps * getMapWidth(mapNumber) / getNavPixelSizeX(); return (parseInt(aoix)); } //as function getASModuleColor() { return(asModuleColor); } function getASModuleDefaultLayout() { return(asModuleDefaultLayout); } function getASModuleEnabled() { return(asModuleEnabled); } //30.04.2003.xhbt function getASModuleCoordSearch() { return(asModuleCoordSearch); } function getASModuleHeaderColor() { return(asModuleHeaderColor); } function getASModuleHeaderLeft() { return(asModuleHeaderLeft); } function getASModuleHeaderText() { return(asModuleHeaderText); } function getASModuleInterface() { return(asModuleInterface); } function getASModuleLeft() { return(asModuleLeft); } function getASModuleTop() { return(asModuleTop); } function getASWidth() { return(asWidth); } //cs function getCSID() { return(csID); } function getCSLeft() { return(csLeft); } function getCSModuleColor() { return(csModuleColor); } function getCSModuleEnabled() { return(csModuleEnabled); } function getCSModuleHeaderColor() { return(csModuleHeaderColor); } function getCSModuleHeaderLeft() { return(csModuleHeaderLeft); } function getCSModuleHeaderText() { return(csModuleHeaderText); } function getCSModuleLeft() { return(csModuleLeft); } function getCSModuleTop() { return(csModuleTop); } function getCSModuleInterface() { return(csModuleInterface); } function getCSTop() { return(csTop); } function getCSWidth() { return(csWidth); } function getCSArray() { return csArray; } //========================================================================= // Function that returns the UTM centerX based on the position of the mouse // on the navigation image. //========================================================================= function getCenterXFromNav(CursorX, pixelsizex, ULX) { // return( getNavULX() + (getNavPixelSizeX()*(CursorX-getNavLeft()))); return( getNavULX() + getNavPixelSizeX() * ( CursorX - getNavLeft() ) ); } //========================================================================= // Function that returns the UTM centerY based on the position of the mouse // on the navigation image. //========================================================================= function getCenterYFromNav(CursorY, pixelsizey, ULY) { return(getNavULY() - (getNavPixelSizeY()*(CursorY-getNavTop()))); } //dip function getDIPLeft() { return(dipLeft); } function getDIPPath() { return(dipPath); } function getDIPTop() { return(dipTop); } //hs function getHSBorderColor() { return(hsBorderColor); } function getHSBorderSize() { return(hsBorderSize); } function getHSPath() { return(hsPath); } //lm function getLMPath() { return(lmPath); } function getLMHeight() { return(lmHeight); } function getLMRLLeft() { return(lmrlLeft); } function getLMRLText() { return(lmrlText); } function getLMRLTop() { return(lmrlTop); } function getLMWidth() { return(lmWidth); } function getLMX() { return(lmX); } function getLMY() { return(lmY); } //12.03.2003.xhbt:Adding module to show coordinates for map pin function getLMCDLeft() { return(lmcdLeft); } function getLMCDTop() { return(lmcdTop); } function getLMCDModuleEnabled() { return(lmcdModuleEnabled); } function getLMCDText1() { return(lmcdText1); } function getLMCDText2() { return(lmcdText2); } //common function getLRX(centerx, pixelsize, sizex) { //get LRX coordinates from center X coordinate var LRX = Number( Number(centerx) + (sizex / 2 * pixelsize)); return(LRX); } function getLRY(centery, pixelsize, sizey) { //get LRY coordinates from center Y coordinate var LRY = Number( Number(centery) - (sizey / 2 * pixelsize)); return(LRY); } //map function getMapBorderColor() { return(mapBorderColor); } function getMapBorderSize() { return(mapBorderSize); } function getMapCenterX() { return(mapCenterX); } function getMapCenterY() { return(mapCenterY); } function getMapHeight() { return(mapHeight); } function getMapImageFormat() { return(mapImageFormat); } function getMapJPEGQuality() { return(mapJPEGQuality); } function getMapLeft() { return(mapLeft); } function getMapList() { return(mapList); } //------------------------ //26.07.03.xhbt //------------------------ function getMapLists(number) { if(number == 1) return(mapList1); else if (number == 2) return(mapList2); else return(mapList3); } function getMapType() { return(mapType); } function getMapList2() { return(mapList2); } function getMapList3() { return(mapList3); } function getMapNames(number) { return (mapNames[number]); } //------------------------ function getMapModuleBorderSize() { return(mapModuleBorderSize); } function getMapModuleBGColor() { return(mapModuleBGColor); } function getMapModuleBorderColor() { return(mapModuleBorderColor); } function getMapModuleHeaderText() { return(mapModuleHeaderText); } function getMapModuleHeaderColor() { return(mapModuleHeaderColor); } function getMapModuleLayout() { return(mapModuleLayout); } function getMapModuleLeft() { return(mapModuleLeft); } function getMapModuleTop() { return(mapModuleTop); } function getMapWidth() { return(mapWidth); } function getMapNumber() { return(mapNumber); } function getMapName(mapNumber) { return(mapName[mapNumber]); } function getMapPixelSize(mapName) { var ps = Number(getMapInfo(c_PIXELSIZE, mapName)); //ps = ps * getUtilZoomFactor() / 100; return(ps); } function getMapProjection() { return(mapProjection); } function getMapTop() { return(mapTop); } function getMapURI() { return(mapURI); } function getMapURL(mapNumber) { //alert( "getMapURL(): document.domain is \"" + document.domain + "\"" ); var url; var mapName = getMapName(mapNumber); var ps = getMapPixelSize(mapName); var w = getMapWidth(); var h = getMapHeight(); var cx = getMapCenterX(); var cy = getMapCenterY(); //hack if(mapNumber==2 && getMapModuleLayout()==c_DK_FOER_OG_NU){ ps = getMapPixelSize( getMapName( 1 ) ); //ensure same pixelsize on both sides of slider } url = getMapURI(); url += "version=1.1.1"; url += "&service=WMS"; url += "&request=GetMap"; if( mapName.toLowerCase().indexOf( "dtk_skaermkort" ) > -1 ) url += "&servicename=topo_skaermkort&layers=dtk_skaermkort&styles="; else if( mapName.toLowerCase().indexOf( "topo_oversigt_r" ) > -1 ) url += "&servicename=topo_basis&layers=dtk_oversigt&styles="; else if( mapName.toLowerCase().indexOf( "d_200" ) > -1 ) url += "&servicename=topo_basis&layers=dtk_d200&styles="; else if( mapName.toLowerCase().indexOf( "g_2500" ) > -1 ) url += "&servicename=gtopo&layers=Gtk_g2500&styles="; else if( mapName.toLowerCase().indexOf( "g_500" ) > -1 ) url += "&servicename=gtopo&layers=Gtk_g500&styles="; else url += "&servicename=" + mapName; if( getMapInfo( c_LAYERS, mapName ) != "" ) url += "&layers=" + getMapInfo( c_LAYERS, mapName ); if( getMapInfo( c_STYLES, mapName ) != "" ) url += "&styles=" + getMapInfo( c_STYLES, mapName ); else url += "&styles=" url += "&srs=" + getMapProjection(); url += "&bbox=" + getULX(cx, ps, w); url += "," + getLRY(cy, ps, h); url += "," + getLRX(cx, ps, w); url += "," + getULY(cy, ps, h); url += "&width=" + getMapWidth(); url += "&height=" + getMapHeight(); url += "&exceptions=application/vnd.ogc.se_inimage"; url += "&illegallayers=true"; url += "&ticket=764971839f26f9156d63df137cab5b35"; if (getMapImageFormat()==c_JPEG) { url += "&format=image/jpeg"; url += "&jpegquality=" + getMapJPEGQuality(); } else url += "&format=image/png"; return(url); } //ms function getMSLeft() { return(msLeft); } function getMSModuleColor() { return(msModuleColor); } function getMSModuleEnabled() { return(msModuleEnabled); } function getMSModuleHeaderColor() { return(msModuleHeaderColor); } function getMSModuleHeaderLeft() { return(msModuleHeaderLeft); } function getMSModuleHeaderText() { return(msModuleHeaderText); } function getMSModuleLeft() { return(msModuleLeft); } function getMSModuleTop() { return(msModuleTop); } function getMSModuleInterface() { return(msModuleInterface); } function getMSTop() { return(msTop); } function getMSWidth() { return(msWidth); } //nav function getNavBorderColor() { return(navBorderColor); } function getNavBorderSize() { return(navBorderSize); } function getNavHeight() { return(navHeight); } function getNavLeft() { return(navLeft); } function getNavModuleEnabled() { return(navModuleEnabled); } function getNavModuleLeft() { return(navModuleLeft); } function getNavModuleTop() { return(navModuleTop); } function getNavPath() { return(navPath); } function getNavPixelSizeX() { return(navPixelSizeX); } function getNavPixelSizeY() { return(navPixelSizeY); } function getNavTop() { return(navTop); } function getNavULX() { return(navULX); } function getNavULY() { return(navULY); } function getNavWidth() { return(navWidth); } //pl function getPLModuleEnabled() { return(plModuleEnabled); } function getPLDestination() { return(plDestination); } function getPLLeft() { return(plLeft); } function getPLText() { return(plText); } function getPLTop() { return(plTop); } function getPLLinks() { return plLinks; } //13.03.2003.xhbt function getPLManyMaps() { return(plManyMaps); } //sb function getSBDarkColor() { return(sbDarkColor); } function getSBHeight() { return(sbHeight); } function getSBLightColor() { return(sbLightColor); } function getSBModuleEnabled() { return(sbModuleEnabled); } function getSBModuleLeft() { return(sbModuleLeft); } function getSBModuleTop() { return(sbModuleTop); } function getSBWidth() { return(sbWidth); } //sb2 function getSB2DarkColor() { return(sb2DarkColor); } function getSB2Height() { return(sb2Height); } function getSB2LightColor() { return(sb2LightColor); } function getSB2ModuleEnabled() { return(sb2ModuleEnabled); } function getSB2ModuleLeft() { return(sb2ModuleLeft); } function getSB2ModuleTop() { return(sb2ModuleTop); } function getSB2Width() { return(sb2Width); } //swm function getSWMLeft() { return(swmLeft); } function getSWMText() { return(swmText); } function getSWMTop() { return(swmTop); } function getSWMBorderSize() { return(swmBorderSize); } function getSWMBorderColor() { return(swmBorderColor); } function getSWMBackground() { return(swmBackground); } //zoomLevel function getZoomLevel() { return (zoomLevel); } //11.09.2003.xhbt: txt function getTXTSModuleEnabled() { return(txtsModuleEnabled); } function getTXTSModuleLeft() { return(txtsModuleLeft); } function getTXTSModuleTop() { return(txtsModuleTop); } function getTXTSWidth() { return(txtsWidth); } function getTXTSHeight() { return(txtsHeight); } function getTXTSCopyrightURL() { return txtsCopyrightURL; } //CoordSystem 03.12.03.xhbt: function getCoordSystemOut() { return (coordSystemOut); } function getCoordSystemIn() { return (coordSystemIn); } function getCoordWidth(v) { return (coordWidth); } function getCoordHeight(v) { return (coordHeight); } function getCoordTop(v) { return (coordTop); } function getCoordLeft(v) { return (coordLeft); } function getCoordModuleEnabled(v) { return (coordModuleEnabled); } function getCoordVis(v) { return (coordVis); } function getMatRegModuleWidth() { return matRegModuleWidth; } function getMatRegModuleHeight() { return matRegModuleHeight; } function getMatRegModuleLeft() { return matRegModuleLeft; } function getMatRegModuleTop() { return matRegModuleTop; } function getMatRegModuleEnabled() { return matRegModuleEnabled; } //common function getULX(centerx, pixelsize, sizex) { //get ULX coordinates from center X coordinate var ULX = Number( Number(centerx) - (sizex / 2 * pixelsize)); return(ULX); } function getULY(centery, pixelsize, sizey) { //get ULX coordinates from center Y coordinate var ULY = Number( Number(centery) + (sizey / 2 * pixelsize)); return(ULY); } //========================================================================= //========================================================================= //SET FUNCTIONS //========================================================================= //as function setASModuleColor(v) { asModuleColor = v; } function setASModuleDefaultLayout(v) { asModuleDefaultLayout = v; } function setASModuleEnabled(v) { asModuleEnabled = v; } //30.04.2003.xhbt function setASModuleCoordSearch(v) { asModuleCoordSearch = v; } function setASModuleHeaderColor(v) { asModuleHeaderColor = v; } function setASModuleHeaderLeft(v) { asModuleHeaderLeft = v; } function setASModuleHeaderText(v) { asModuleHeaderText = v; } function setASModuleInterface(v) { asModuleInterface = v; } function setASModuleLeft(v) { asModuleLeft = v; } function setASModuleTop(v) { asModuleTop = v; } function setASWidth(v) { asWidth = v; } //cs function setCSID(v) { csID = v; } function setCSLeft(v) { csLeft = v; } function setCSModuleColor(v) { csModuleColor = v; } function setCSModuleEnabled(v) { csModuleEnabled = v; } function setCSModuleHeaderColor(v) { csModuleHeaderColor = v; } function setCSModuleHeaderLeft(v) { csModuleHeaderLeft = v; } function setCSModuleHeaderText(v) { csModuleHeaderText = v; } function setCSModuleLeft(v) { csModuleLeft = v; } function setCSModuleTop(v) { csModuleTop = v; } function setCSModuleInterface(v) { csModuleInterface = v; } function setCSTop(v) { csTop = v; } function setCSWidth(v) { csWidth = v; } function setCSArray(v) { csArray = v; } //dip function setDIPPath(v) { dipPath = v; } function setDIPTop(v) { dipTop = v; } function setDIPLeft(v) { dipLeft = v; } //hs function setHSBorderColor(v) { hsBorderColor = v; } function setHSBorderSize(v) { hsBorderSize = v; } function setHSPath(v) { hsPath = v; } //lm function setLMPath(v) { lmPath = v; } function setLMHeight(v) { lmHeight = v; } function setLMRLLeft(v) { lmrlLeft = v; } function setLMRLText(v) { lmrlText = v; } function setLMRLTop(v) { lmrlTop = v; } function setLMWidth(v) { lmWidth = v; } function setLMX(v) { lmX = v; } function setLMY(v) { lmY = v; } //12.03.2003.xhbt:Adding module to show coordinates for map pin function setLMCDLeft(v) { lmcdLeft = v; } function setLMCDTop(v) { lmcdTop = v; } function setLMCDModuleEnabled(v) { lmcdModuleEnabled = v; } function setLMCDText1(v) { lmcdText1 = v; } function setLMCDText2(v) { lmcdText2 = v; } //map function setMapBorderColor(v) { mapBorderColor = v; } function setMapBorderSize(v) { mapBorderSize = v; } function setMapCenterX(v) { mapCenterX = Math.round( 100*Number(v) )/100; } function setMapCenterY(v) { mapCenterY = Math.round( 100*Number(v) )/100; //two decimals - centimetre precision } function setMapHeight(v) { mapHeight = v; } function setMapImageFormat(v) { mapImageFormat = v; } function setMapJPEGQuality(v) { mapJPEGQuality = v; } function setMapLeft(v) { mapLeft = v; } function setMapList(v) { mapList = v; } //------------------------ //26.07.03.xhbt //------------------------ function setMapList1(v) { mapList1 = v; } function setMapList2(v) { mapList2 = v; } function setMapList3(v) { mapList3 = v; } function setMapType(v) { mapType = v; } function setMapNames(v) { mapNames = v; } //------------------------ function setMapModuleBorderSize(v) { mapModuleBorderSize = v; } function setMapModuleBorderColor(v) { mapModuleBorderColor = v; } function setMapModuleBGColor(v) { mapModuleBGColor = v; } function setMapModuleHeaderColor(v) { mapModuleHeaderColor = v; } function setMapModuleLayout(v) { mapModuleLayout = v; } function setMapModuleLeft(v) { mapModuleLeft = v; } function setMapModuleTop(v) { mapModuleTop = v; } function setMapNumber(v) { mapNumber = v; } function setMapName(mapNumber, v) { mapName[mapNumber] = v; } function setMapProjection(v) { mapProjection = v; } function setMapTop(v) { mapTop = v; } function setMapURI(v) { mapURI = v; } function setMapWidth(v) { mapWidth = v; } //ms function setMSLeft(v) { msLeft = v; } function setMSModuleColor(v) { msModuleColor = v; } function setMSModuleEnabled(v) { msModuleEnabled = v; } function setMSModuleHeaderColor(v) { msModuleHeaderColor = v; } function setMSModuleHeaderLeft(v) { msModuleHeaderLeft = v; } function setMSModuleHeaderText(v) { msModuleHeaderText = v; } function setMSModuleLeft(v) { msModuleLeft = v; } function setMSModuleTop(v) { msModuleTop = v; } function setMSModuleInterface(v) { msModuleInterface = v; } function setMSTop(v) { msTop = v; } function setMSWidth(v) { msWidth = v; } //nav function setNavBorderColor(v) { navBorderColor = v; } function setNavBorderSize(v) { navBorderSize = v; } function setNavHeight(v) { navHeight = v; } function setNavLeft(v) { navLeft = v; } function setNavModuleColor(v) { navModuleColor = v; } function setNavModuleEnabled(v) { navModuleEnabled = v; } function setNavModuleLeft(v) { navModuleLeft = v; } function setNavModuleTop(v) { navModuleTop = v; } function setNavPath(v) { navPath = v; } function setNavPixelSizeX(v) { navPixelSizeX = v; } function setNavPixelSizeY(v) { navPixelSizeY = v; } function setNavTop(v) { navTop = v; } function setNavULX(v) { navULX = v; } function setNavULY(v) { navULY = v; } function setNavWidth(v) { navWidth = v; } //pl function setPLModuleEnabled(v) { plModuleEnabled = v; } function setPLDestination(v) { plDestination = v; } function setPLLeft(v) { plLeft = v; } function setPLText(v) { plText = v; } function setPLTop(v) { plTop = v; } function setPLLinks( v) { plLinks = v; } //13.03.2003.xhbt function setPLManyMaps(v) { plManyMaps = v; } //sb function setSBDarkColor(v) { sbDarkColor = v; } function setSBHeight(v) { sbHeight = v; } function setSBLightColor(v) { sbLightColor = v; } function setSBModuleEnabled(v) { sbModuleEnabled = v; } function setSBModuleLeft(v) { sbModuleLeft = v; } function setSBModuleTop(v) { sbModuleTop = v; } function setSBWidth(v) { sbWidth = v; } //sb2 function setSB2DarkColor(v) { sb2DarkColor = v; } function setSB2Height(v) { sb2Height = v; } function setSB2LightColor(v) { sb2LightColor = v; } function setSB2ModuleEnabled(v) { sb2ModuleEnabled = v; } function setSB2ModuleLeft(v) { sb2ModuleLeft = v; } function setSB2ModuleTop(v) { sb2ModuleTop = v; } function setSB2Width(v) { sb2Width = v; } //swm function setSWMLeft(v) { swmLeft = v; } function setSWMText(v) { swmText = v; } function setSWMTop(v) { swmTop = v; } function setSWMBorderSize(v) { swmBorderSize = v; } function setSWMBorderColor(v) { swmBorderColor = v; } function setSWMBackground(v) { swmBackground = v; } //zoomLevel function setZoomLevel(v) { zoomLevel = v; } //11.09.2003.xhbt: txt function setTXTSModuleEnabled(v) { txtsModuleEnabled = v; } function setTXTSModuleLeft(v) { txtsModuleLeft = v; } function setTXTSModuleTop(v) { txtsModuleTop = v; } function setTXTSWidth(v) { txtsWidth = v; } function setTXTSHeight(v) { txtsHeight = v; } function setTXTSCopyrightURL(v) { txtsCopyrightURL = v; } //CoordSystem 03.12.03.xhbt: function setCoordSystemOut(v) { coordSystemOut = v; } function setCoordSystemIn(v) { coordSystemIn = v; } function setCoordWidth(v) { coordWidth = v; } function setCoordHeight(v) { coordHeight = v; } function setCoordTop(v) { coordTop = v; } function setCoordLeft(v) { coordLeft = v; } function setCoordModuleEnabled(v) { coordModuleEnabled = v; } function setCoordVis(v) { coordVis = v; } function setMatRegModuleWidth(v) { matRegModuleWidth = v; } function setMatRegModuleHeight(v) { matRegModuleHeight = v; } function setMatRegModuleLeft(v) { matRegModuleLeft = v; } function setMatRegModuleTop(v) { matRegModuleTop = v; } function setMatRegModuleEnabled(v) { matRegModuleEnabled = v; } //========================================================================= // Function that loads the enabled modules according to the settings in the // customize function. //========================================================================= function load() { var url = ""; var p0 = 0; var p1 = 0; var p2 = 0; //customize application customize(); if( top.hidden && top.hidden.document.forms['hiddenform']['cx'].value != "601040" && top.hidden.document.forms['hiddenform']['cy'].value != "6190053" ) { setMapCenterX(top.hidden.document.forms['hiddenform']['cx'].value); //676000 setMapCenterY(top.hidden.document.forms['hiddenform']['cy'].value); //6124000 } else { setMapCenterX(601040); //676000 setMapCenterY(6190053); //6124000 } //load Print link module if(getPLModuleEnabled()==true) loadPLModule(); //load country selector module if(getCSModuleEnabled()==true) loadCSModule(); //find out if an attempt has been made to specify map service name var specifiedServiceName = ""; url = window.location.href; p0 = url.indexOf( "?" ); p1 = url.toLowerCase().indexOf( "servicename=", p0 + 1 ); p2 = url.indexOf( "&", p1 + 1 ); // next parameter, if any if( p0 > -1 && p1 > -1 ) { if( p2 > -1 ) // serviceName not last parameter specifiedServiceName = url.substring( p1 + "serviceName=".length, p2 ); else specifiedServiceName = url.substring( p1 + "serviceName=".length ); // no verification of servicename - error from Kortforsyningen will suffice, except in one case: if( specifiedServiceName.length > 0 ) { setMapName( getMapType(), specifiedServiceName ); // sets map in MSmodule - close your eyes for the next 7 lines var tempMapNames = new Array(); for( var i=0; i -1 && p1 > -1 ) { if( p2 > -1 ) // ActiveASSearchType not last parameter ActiveASSearchType = url.substring( p1 + "searchType=".length, p2 ); else ActiveASSearchType = url.substring( p1 + "searchType=".length ); } loadASModule( ActiveASSearchType ); loadSWMModule(); } //load dip module loadDIPModule(); //load lmrl module loadLMRLModule(); //12.03.2003.xhbt:load lmcd module if(getLMCDModuleEnabled() == true) { loadLMCDModule(); } //11.09.2003.xhbt: loading map text module if(getTXTSModuleEnabled() == true) { loadTXTSModule(); } //10.06.2004.julian: display coordinates (copy from FindInternal) if(getCoordModuleEnabled() == true) { loadCoordModule(); } if( getMatRegModuleEnabled() == true ){ loadMatRegModule(); } //load map module loadMapModule(getMapModuleLayout()); //load map(s) in map module for (var i=1; i<=getMapNumber(); i++) { loadMap(i); } } function loadJul() { //customize application customize(); if(top.hidden.document.forms['hiddenform']['cx'].value != "601040" && top.hidden.document.forms['hiddenform']['cy'].value != "6190053"){ setMapCenterX(top.hidden.document.forms['hiddenform']['cx'].value); //676000 setMapCenterY(top.hidden.document.forms['hiddenform']['cy'].value); //6124000 } //load Print link module if(getPLModuleEnabled()==true) loadPLModule(); //load country selector module if(getCSModuleEnabled()==true) loadCSModule(); //load map selector module if(getMSModuleEnabled()==true) loadMSModule(); //load navigation module and hotspot if(getNavModuleEnabled()==true) { loadNavModule(); loadHS(); } //load scale bar module if(getSBModuleEnabled()==true) loadSBModule(); //load 2nd scale bar module if(getSB2ModuleEnabled()==true) loadSB2Module(); mode = "jul"; //load search module (address default) if(getASModuleEnabled()==true) { loadASModule(getASModuleDefaultLayout()); loadSWMModule(); } //load dip module loadDIPModule(); //load lmrl module loadLMRLModule(); //12.03.2003.xhbt:load lmcd module if(getLMCDModuleEnabled() == true) { loadLMCDModule(); } //11.09.2003.xhbt: loading map text module if(getTXTSModuleEnabled() == true) { loadTXTSModule(); } //load map module loadMapModule(getMapModuleLayout()); //load map(s) in map module for (var i=1; i<=getMapNumber(); i++) { //loadMap(i); moveMaptoLocation("6130066,576;863257,487"); } geoVWithDelay("Julegade",'9999'); } function loadKms() { //customize application customize(); if(top.hidden.document.forms['hiddenform']['cx'].value != "601040" && top.hidden.document.forms['hiddenform']['cy'].value != "6190053"){ setMapCenterX(top.hidden.document.forms['hiddenform']['cx'].value); //676000 setMapCenterY(top.hidden.document.forms['hiddenform']['cy'].value); //6124000 } //load Print link module if(getPLModuleEnabled()==true) loadPLModule(); //load country selector module if(getCSModuleEnabled()==true) loadCSModule(); //load map selector module if(getMSModuleEnabled()==true) loadMSModule(); //load navigation module and hotspot if(getNavModuleEnabled()==true) { loadNavModule(); loadHS(); } //load scale bar module if(getSBModuleEnabled()==true) loadSBModule(); //load 2nd scale bar module if(getSB2ModuleEnabled()==true) loadSB2Module(); mode = "kms"; //load search module (address default) if( getASModuleEnabled()==true ) { // has search layout been specified externally, e.g. index.htm?searchType=c_ADDRESS&inputSogData=Vejnavn? var searchType = getASModuleDefaultLayout(); var url = window.location.href; var p0 = url.indexOf( "?" ); var p1 = url.indexOf( "searchType=" ); var p2 = url.indexOf( "&", p1 + 1 ); // next parameter, if any if( p0 > -1 && p1 > -1 ) { if( p2 > -1 ) // searchType not last parameter searchType = url.substring( p1 + "searchType=".length, p2 ); else searchType = url.substring( p1 + "searchType=".length ); } alert( "loading AS with searchType " + searchType ); loadASModule( searchType ); loadSWMModule(); } //load dip module loadDIPModule(); //load lmrl module loadLMRLModule(); //12.03.2003.xhbt:load lmcd module if(getLMCDModuleEnabled() == true) { loadLMCDModule(); } //11.09.2003.xhbt: loading map text module if(getTXTSModuleEnabled() == true) { loadTXTSModule(); } //load map module loadMapModule(getMapModuleLayout()); //load map(s) in map module for (var i=1; i<=getMapNumber(); i++) { //loadMap(i); moveMaptoLocation("6178892,299;722125,868"); } geoAWithDelay("5804;101",'9999'); } //========================================================================= // Display/loads the address search (AS) module //========================================================================= function loadASModule(searchType) { var imgLM = document.getElementById("imgLM"); imgLM.style.visibility = "hidden"; imgLM.style.zIndex = 13; imgLM.src = getLMPath(); if(searchType == c_COORDINATES){ gSearchType = searchType; // save searchType in global variable for use in loadLM() } else{ gSearchType = 0; } //display module var divASModule = document.getElementById("divASModule"); divASModule.style.position = "absolute"; divASModule.style.top = getASModuleTop() + "px"; divASModule.style.left = getASModuleLeft()-9 + "px"; divASModule.style.zIndex = 1; divASModule.innerHTML = asModule(searchType); } //========================================================================= // Display/loads the country selector (CS) module //========================================================================= function loadCSModule() { var divCSModule = document.getElementById("divCSModule"); divCSModule.innerHTML = csModule(); } //========================================================================= // Display/loads the country selector (CS) module //========================================================================= function loadDIPModule() { var imgDIP = document.getElementById("imgDIP"); imgDIP.src = getDIPPath(); imgDIP.style.position = "absolute"; imgDIP.style.top = getDIPTop() + "px"; imgDIP.style.left = getDIPLeft() + "px"; imgDIP.style.zIndex = 100; // was 11 julian 040517 imgDIP.style.visibility = "visible"; } //========================================================================= // Function that displays/loads the hotspot module //========================================================================= function loadHS() { //get image var imgHS = document.getElementById("imgHS"); imgHS.src = getHSPath(); //Set color of hotspot border imgHS.style.border = getHSBorderSize() + "px solid " + getHSBorderColor(); } //========================================================================= // Function that loads the location marker if location is within the // current map's area. This function is triggered when the map has just // loaded. //========================================================================= function loadLM(mapNumber) { //show marker for latest search result if it is located within the map var lmx = getLMX(); var lmy = getLMY(); if (isPointWithinMap(mapNumber, lmx, lmy)==true) { showLM(mapNumber, lmx, lmy); showLMRLModule(); //12.03.2003.xhbt: if(getLMCDModuleEnabled() == true && gSearchType == c_COORDINATES){ showLMCDModule(lmx, lmy); } } } //========================================================================= // Display/loads the LMRemoveLink module //========================================================================= function loadLMRLModule() { //load module var divLMRLModule = document.getElementById("divLMRLModule"); divLMRLModule.style.visibility = "visible"; //hidden as it will only be displayed after a search // divLMRLModule.style.visibility = "hidden"; //hidden as it will only be displayed after a search divLMRLModule.innerHTML = lmrlModule(); } //========================================================================= // 12.03.2003.xhbt:Display/loads the LMCDShowCoord module //========================================================================= function loadLMCDModule() { //load module // var obj = eval("divLMCDModule"); var divLMCDModule = document.getElementById( "divLMCDModule" ); divLMCDModule.style.visibility = "hidden"; //hidden as it will only be displayed after a search divLMCDModule.innerHTML = lmcdModule(0,0); } //========================================================================= // Function that loads pane for information from cadastral register //========================================================================= function loadMatRegModule() { var div = document.getElementById( "divMatRegModule" ); //div.style.border = "1px solid " + getSWMBackground(); div.style.position = "absolute"; div.style.left = getMatRegModuleLeft() + "px"; div.style.top = getMatRegModuleTop() + "px"; matRegModule( getMapCenterX(), getMapCenterY(), null, null ); } //========================================================================= // Function that loads a map and synchronizes the hotspot so its location // and size corresponds to the map area just loaded //========================================================================= function loadMap(mapNumber) { //show downloading image picture showDownloadingImagePicture(mapNumber); //clear all markers on map clearLM(); //load map image var mapImg = document.getElementById( "imgMap" + mapNumber ); mapImg.src = getMapURL(mapNumber); //synchronize map and HS on navigation image - only if nav is enabled if (getNavModuleEnabled()==true) syncHS(mapNumber); //synchronize scale bar to map - only if scale bar is enabled if (getSBModuleEnabled()==true) syncSB(mapNumber) //if(getCSID() == "dk"){ //don't restrict coordinate showing to DK var cx = getMapCenterX(); var cy = getMapCenterY(); if( top.hidden ) { top.hidden.document.forms['hiddenform']['cx'].value = cx; top.hidden.document.forms['hiddenform']['cy'].value = cy; } // update coordinates in coordinate display module if (getCoordModuleEnabled()==true && getCoordVis() == c_COORDSHOW){ loadCoordModule(); } if( getMatRegModuleEnabled() ) matRegModule( cx, cy, null, null ); return false; } //========================================================================= // Display/loads the map module //========================================================================= function loadMapModule(layout) { //set position of upper left corner of map image setMapTop(getMapModuleTop()+getMapModuleBorderSize()+getMapBorderSize()); setMapLeft(getMapModuleLeft()+getMapModuleBorderSize()+getMapBorderSize()); var divMapModule = document.getElementById("divMapModule"); divMapModule.innerHTML = mapModule(layout); } //========================================================================= // Display/loads the map selector (MS) module //========================================================================= function loadMSModule() { var divMSModule = document.getElementById("divMSModule"); divMSModule.innerHTML = msModule(); } //========================================================================= // Display/loads the navigation (NAV) module //========================================================================= function loadNavModule() { //set position of upper left corner of navigation image setNavTop(getNavModuleTop()); setNavLeft(getNavModuleLeft()); var divNavModule = document.getElementById("divNavModule"); divNavModule.innerHTML = navModule(); } //========================================================================= // Display/loads the print link (PL) module //========================================================================= function loadPLModule() { var divPLModule = document.getElementById("divPLModule"); divPLModule.innerHTML = plModule(); divPLModule.style.position = "absolute"; divPLModule.style.left = getPLLeft()+"px"; divPLModule.style.top = getPLTop()+"px"; } //========================================================================= // Display/loads the scale bar (SB) module //========================================================================= function loadSBModule() { var divSBModule = document.getElementById("divSBModule"); divSBModule.innerHTML = sbModule(); } //========================================================================= // Display/loads the second scale bar (SB2) module //========================================================================= function loadSB2Module() { var divSB2Module = document.getElementById("divSB2Module"); divSB2Module.innerHTML = sb2Module(); } //========================================================================= // Loads the search wait message (SWM) module //========================================================================= function loadSWMModule() { var divSWMModule = document.getElementById("divSWMModule"); divSWMModule.innerHTML = " " + getSWMText() + " "; divSWMModule.style.visibility = "hidden"; divSWMModule.style.position = "absolute"; divSWMModule.style.height = "15px"; divSWMModule.style.border = ""+getSWMBorderSize()+"px solid " + getSWMBorderColor(); divSWMModule.style.background = ""+getSWMBackground(); divSWMModule.style.left = ""+getSWMLeft()+"px"; divSWMModule.style.top = ""+getSWMTop()+"px"; divSWMModule.style.zIndex = "10"; } //11.09.2003.xhbt: //========================================================================= // Display/loads the text (TXTS) module //========================================================================= function loadTXTSModule() { //set position of upper left corner of navigation image var divTXTSModule = document.getElementById("divTXTSModule"); divTXTSModule.innerHTML = txtsModule(); } //========================================================================= // Display/loads the coordsystem (Coord) module //========================================================================= function loadCoordModule() { var divCoordModule = document.getElementById("divCoordModule"); // workaround 040630.julian // it seems that when the applikation is called with "index.htm?map=dk", // divCoordModule is somehow undefined at initial load time (but not thereafter) // Calling the application as simply "index.htm" without parameters seems to solve it. if( divCoordModule ) divCoordModule.innerHTML = coordModule(); } //30.04.2003.xhbt: Adding if conditions for coordSearch //========================================================================= // Functions that create the address search (AS) module //========================================================================= function asModule(searchType) { var html = ""; var bg = getASModuleColor(); var t = getASModuleTop(); var l = getASModuleLeft(); var ht = getASModuleHeaderText(); var tw = 226; var w = getASWidth(); var rc = 50; // has search been parameterized externally? var url = window.location.href; var searchData = ""; var p0 = url.indexOf( "?" ); var p1 = url.indexOf( "inputSogedata=", p1 + 1 ); var p2 = url.indexOf( "&", p1 + 1 ); // next parameter, if any if( p0 > -1 && p1 > -1 ) { if( p2 > -1 ) // inputSogeData not last parameter searchData = unescape( url.substring( p1 + "inputSogedata=".length, p2 ) ); else searchData = unescape( url.substring( p1 + "inputSogedata=".length ) ); } if( getAppLang()=="uk" ) { html += ""; return(html); } //========================================================================= // Functions that create the country selector (CS) module //========================================================================= function csModule() { var w = getCSWidth(); var tw = w+ 41; //62; var t = getCSModuleTop(); var l = getCSModuleLeft(); var ht = getCSModuleHeaderText(); var bg = getCSModuleColor(); var countries = getCSArray(); //create html var html = ""; html+="
"; html+=" "; html+=" "; html+=" "; html+=" "; html+=" "; html+=" "; html+=" "; html+=" "; html+=" "; html+=" "; html+="
"+ht+"
"; html += ""; html+="
"; html+="
"; return(html); } //========================================================================= // Functions that create the lmRemoveLink module //========================================================================= function lmrlModule() { var html = ""; var t = getLMRLTop(); var l = getLMRLLeft(); html += ""; html += "  "; //30.04.2003.xhbt: html += getLMRLText(); html += ""; return(html); } //========================================================================= // // 12.03.2003.xhbt:Functions that create the lmCoord module //========================================================================= function lmcdModule(utmx,utmy) { var html = ""; var t = getLMCDTop(); var l = getLMCDLeft(); html += "

"; html += getLMCDText1() + utmx + getLMCDText2() +utmy; html += "

"; return(html); } //========================================================================= // Functions that create the map module //========================================================================= function mapModule(layout) { //required parameters var mapwidth = getMapWidth()-1; var mapheight = getMapHeight()-1; var buffer = getMapModuleBorderSize(); //size in pixel of "buffer" cells around map var mbs = getMapBorderSize(); var mbc = getMapBorderColor(); var t = getMapModuleTop(); var l = getMapModuleLeft(); if (layout==c_FIND_ET_STED || layout==c_MATRIKEL) { var tw = mapwidth+(2*mbs)-6+(2*buffer); //table width var th = mapheight+(2*mbs)-2+(2*buffer); //table height var bcw = parseInt((mapwidth+(2*mbs)-20)/4); //horisontal cell width var bch = parseInt((mapheight+(2*mbs)-20)/4); //vertical cell height //create HTML var html = ""; html +=""; html +=""; html +=" "; html +=" "; html +=" "; html +=" "; html +=" "; html +=" "; html +=" "; html +=" "; html +=" "; html +=" "; html +=" "; // html +=" "; html +=" "; html +=" "; html +=" "; html +=" "; html +=" "; html +=" "; html +=" "; html +=" "; html +=" "; html +=" "; html +=" "; html +=" "; html +=" "; html +=" "; html +=" "; html +=" "; html +=" "; html +=" "; html +=" "; html +=" "; html +=" "; html +=" "; html +=" "; html +=" "; html +=" "; html +=" "; html +=" "; html +=" "; html +="
\"panorer\"panorer\"panorer\"panorer\"panorer\"panorer\"panorer
\"panorer\"panorer
\"panorer\"panorer
\"panorer\"panorer
\"panorer\"panorer
\"panorer\"panorer
\"panorer\"panorer\"panorer\"panorer\"panorer\"panorer\"panorer
"; html +=""; } else if (layout==c_DK_FOER_OG_NU) { var tw = parseInt( mapwidth+1+(2*mbs)-6+(2*buffer), 10 ); //table width var th = parseInt( mapheight+1+(2*mbs)-2+(2*buffer), 10 ); //table height var bcw = parseInt((mapwidth-20)/4, 10); //horisontal cell width var bch = parseInt((mapheight+(2*mbs)-20)/4, 10); //vertical cell height // mozilla 040510 var div2top = t+buffer; var div2left = l + buffer; //create HTML var html = ""; // html +="
"; // html +="
"; // html +="
"; html +="
"; html +="
"; html +=""; html +=""; html +=" "; html +=" "; html +=" "; html +=" "; html +=" "; html +=" "; html +=" "; html +=" "; html +=" "; html +=" "; html +=" "; html +=" "; html+=" "; if (nom>1) { html += ""; if (j==2) html += ""; else html += ""; } html+=" "; } html+="
\"panorer\"panorer\"panorer\"panorer\"panorer\"panorer\"panorer
\"panorer"; // for some reason, IE reckons top:16px; left 16px; places divMapn inside MapModule table... // these lines have been moved up before // html +="
"; // html +="
"; html +=""; html +=" "; html +=" "; html +=" "; html +=" "; html +=" "; html +=" "; html +=" "; html +=" "; html +=" "; html +=" "; html +=" "; html +=" "; html +=" "; html +=" "; html +=" "; html +=" "; html +=" "; html +=" "; html +=" "; html +=" "; html +=" "; html +=" "; html +=" "; html +=" "; html +=" "; html +=" "; html +=" "; html +="
\"panorer
\"panorer\"panorer
\"panorer\"panorer
\"panorer\"panorer
\"panorer\"panorer
\"panorer\"panorer\"panorer\"panorer\"panorer\"panorer\"panorer
"; html +=""; var tSlider = t + buffer + 1; var lSlider = l + buffer + 1; html +=""; html +="
"; html +=""; //18.03.2003.xhbt.end: Bugfix for historic divider on map html +=" "; html +=" "; html +=" "; html +="
 
"; html +="
"; html +=""; html +=""; html +="
"; html +=""; html +=" "; html +=" "; html +=" "; html +="
"; html +="
"; html +=""; //18.03.2003.xhbt.begin: Bugfix for historic divider on map // html +="
"; html +="
"; html +=""; //18.03.2003.xhbt.end: Bugfix for historic divider on map html +=" "; html +=" "; html +=" "; html +="
 
"; html +="
"; html +=""; var tRing = t+mapheight+buffer+20; var lRing = Math.round( l+buffer+2+(mapwidth/2)-6 ); html +="
"; } else { var tw = mapwidth+(2*mbs)-6+(4*buffer)-6; //table width var th = mapheight+(2*mbs)-2+(2*buffer); //table height var bcw = parseInt(mapwidth/2); //horisontal cell width var bch = parseInt((mapheight+(2*mbs)-20)/4); //vertical cell height // mozilla 040510 var div2top = t+buffer; var div2left = l + buffer; //create HTML var html = ""; html +=""; html +=""; html +=" "; html +=" "; html +=" "; html +=" "; html +=" "; html +=" "; html +=" "; html +=" "; html +=" "; html +=" "; html +=" "; // html +=" "; html +=" "; html +=" "; html +=" "; html +=" "; html +=" "; html +=" "; html +=" "; html +=" "; html +=" "; html +=" "; html +=" "; html +=" "; html +=" "; html +=" "; html +=" "; html +=" "; html +=" "; html +=" "; html +=" "; html +=" "; html +=" "; html +=" "; html +=" "; html +=" "; html +=" "; html +=" "; html +=" "; html +="
\"panorer\"panorer\"panorer\"panorer\"panorer\"panorer\"panorer
\"panorer"; // this line made Mozilla go bad: // (1) table width/height of 100% was interpreted relative to the whole window // (2) style="position:absolute" without top or left values .... pfui! (But this is not the complete story, since single cells subsequently set their z-index -1) // html +=" "; // this made IE go bad // html +="
"; // html +=" "; // rowspan and colspan added - julian 040510 // html +=" "; html +=" "; html +=" "; // html +=" "; html +=" "; // html +=" "; // html +="
"; html +="
\"panorer
\"panorer\"panorer
\"panorer\"panorer
\"panorer\"panorer
\"panorer\"panorer
\"panorer\"panorer\"panorer\"panorer\"panorer\"panorer\"panorer
"; html +=""; } return(html); // return html; } //========================================================================= // Functions that create the map selector (MS) module //========================================================================= function msModule() { var nom = getMapNumber(); var mn = getMapName(mapNumber); var w = getMSWidth(); var tw = w+1; //+ 41; //62; var t = getMSModuleTop(); var l = getMSModuleLeft(); var ht = getMSModuleHeaderText(); var bg = getMSModuleColor(); var maptype = getMapType(); //create html var html=""; html+="
"; html+=""; html+=" "; html+=" "; html+=" "; html+=" "; html+=" "; html+=" "; if(newLook == true){ if(getCSID() == "dk"){ var mapLists; if(getMapModuleLayout() != c_DK_DETALJER){ if( getMapModuleLayout() != c_DK_FOER_OG_NU ) { html +=" "; html +=" "; html +=" "; } // !c_DK_FOER_OG_NU mapLists = getMapLists(maptype); //setMapName(); if( getMapModuleLayout() == c_DK_FOER_OG_NU ) { //selector for historical map (map #2) html+=" "; html+=" "; html +=" "; } else { // not c_DK_FOER_OG_NU //create a mapselector for each available map for (var j=1; j<=nom ; j++) { html+=" "; html+=" "; html +=" "; } } } else{ mapLists = getMapList(); for (var j=1; j<=nom ; j++) { html+=" "; html+=" "; html+=" "; } } html+="
"+ht+"
"; html += ""; html +="
"; html += ""; html += ""; html += ""; html +="
"; html += ""; html += ""; html += ""; html +="
"; html += ""; html += ""; html += ""; html+="
"; html+="
"; } else{ //if other countries //create a mapselector for each available map for (var j=1; j<=nom ; j++) { html+="
"; html += ""; html+="HøjreVenstre
"; } //end other countries } else{ //if new look is false setMapList(Array("DTK_Skaermkort_4","DTK_Skaermkort_10","print_DTK_Kort25_klassisk_254","D_100","D_200","D_3200","none","M_20","M20_lav","D_25")); //create a mapselector for each available map for (var j=1; j<=nom ; j++) { html+=" "; html+=" "; html += ""; html+=""; if (nom>1) { html += ""; if (j==2) html += "Højre"; else html += "Venstre"; } html+=" "; } html+=""; } return(html); } //========================================================================= // Functions that create the navigation (NAV) module //========================================================================= function navModule() { var html = ""; var nw = getNavWidth(); var nh = getNavHeight(); var np = getNavPath(); var t = getNavTop(); var l = getNavLeft(); var bc = getNavBorderColor(); var bs = getNavBorderSize(); //create html // html +=""; // html += ""; html +=""; html += ""; return(html); } function triggerGeoS() { geoS(document.formPNS.stednavn.value); return(false); } //========================================================================= // Functions that create the Print Link module //========================================================================= function plModule() { var arrLinks = new Array(); //array med parmetre til link-modulet - eet element per link (print, signaturforklaring, etc.) var cIDX_FNAME = 0; //navn på onclick-handler for dette link var cIDX_IMGROOT = 1; //navn på grafik-elementer: images/.gif og images/_over.gif var cIDX_TITLE = 2; //titel på link. Bruges flere steder var arrLinksInterface = getPLLinks(); //getPLLinks returnerer array med navn på grafik-element og titel - brugeren skal ikke vide noget om event-handlers var mapNumber; if( getMapModuleLayout()==c_DK_FOER_OG_NU ) mapNumber = 2; if( getMapModuleLayout()==c_DK_DETALJER ) mapNumber = 1; for( var i=0; i"; html += "" + getPLText() + ""; html += ""; for( var i=0; i"; html += "\"""; html += ""; html += " "; } html += ""; html += ""; arrLinks = null; return(html); } //========================================================================= // Functions that create the scale bar (SB) module //========================================================================= function sbModule() { var lw = 1; //line width var w = parseInt((getSBWidth()-(3*lw))/2); var h = getSBHeight(); var l = getSBModuleLeft(); var t = getSBModuleTop(); var html=""; html+=""; html+=" " html+=" "; html+=" "; html+=" "; html+=" "; html+=" "; html+=" "; html+="
"; //if( getMapModuleLayout()==c_DK_FOER_OG_NU ) { //writes markers above scale bar // html+="
0m
"; // html+="
"; // html+="
"; //} else { //writes markers below scale bar html+="
0m
"; html+="
"; html+="
"; //} return(html); } //========================================================================= // Functions that create a second scale bar (SB2) module //========================================================================= function sb2Module() { var lw = 1; //line width var w = parseInt((getSB2Width()-(3*lw))/2); var h = getSB2Height(); var l = getSB2ModuleLeft(); var t = getSB2ModuleTop(); var html=""; html+=""; html+=" " html+=" "; html+=" "; html+=" "; html+=" "; html+=" "; html+=" "; html+="
"; html+="
0m
"; html+="
"; html+="
"; return(html); } //11.09.2003.xhbt: text module //========================================================================= // Functions that create the text (TXTS) module //========================================================================= function txtsModule() { var html = ""; var w = getTXTSWidth(); var h = getTXTSHeight(); var t = getTXTSModuleTop(); var l = getTXTSModuleLeft(); var bc = getNavBorderColor(); var bs = getNavBorderSize(); var cpurl = getTXTSCopyrightURL(); html+=""; html+=" " html+=" "; html+=" "; html+="
"; //html+=" "; html+=" "; html+="
"; //create html return html; } //========================================================================= // Functions that create the coordsystem module //========================================================================= function coordModule() { var html = ""; var h = getCoordHeight(); var t = getCoordTop(); var l = getCoordLeft(); var cx = getMapCenterX(); var cy = getMapCenterY(); html += "

"; //html += "
"; html += "

"; return(html); } function changeCoordVis(cc){ setCoordVis(cc); loadCoordModule(); } //========================================================================= // Function that changes the currently loaded map to another. //========================================================================= function changeCountry(country) { setCSID(country); if (country=="dk") { //use full place name search loadASModule("c_PLACENAME"); //setMapList(Array("D_3200","D_300","D_100")); setMapList(Array("1","2")); setMapName(1,"DTK_Skaermkort_10"); setMapProjection("EPSG:25832"); //32632 setCoordSystemIn("utm32_euref89"); //for coordModule setCoordSystemOut("utm32_euref89"); setMapCenterX(601040); //676000 setMapCenterY(6190053); //6124000 setNavWidth(172); setNavHeight(133); setNavPixelSizeX(2740); //2014 setNavPixelSizeY(2907); //2014 setNavULX(432190); //429190 setNavULY(6424389); //6408389 setNavPath("images/sat_dk_70.gif"); setNavModuleLeft(560); setNavModuleTop(88); setPLDestination("findetsted_udskrift.htm"); setSWMTop(393); //324 } else { //use place name search only loadASModule("c_PLACENAME_ONLY"); if (country=="gr") { setMapList(Array("G_2500","G_500")); setMapName(1,"G_2500"); setMapProjection("EPSG:32624"); //projection supported by WMS //setCoordSystemIn("utm24_wgs84"); //for coordModule setCoordSystemIn("utm24_gr96"); //for coordModule setCoordSystemOut("utm24_gr96"); setMapCenterX(-69578); setMapCenterY(7710779); setNavWidth(164); setNavHeight(134); setNavPixelSizeX(21329); setNavPixelSizeY(21419); setNavULX(-1310000); setNavULY(9370000); setNavPath("images/sat_gr_70.gif"); setNavModuleLeft(546); setNavModuleTop(88); setPLDestination("findetsted_udskrift.htm"); setSWMTop(373); } else { setMapList(Array("ftopo")); setMapName(1,"ftopo"); setMapProjection("EPSG:32629"); //23029 setCoordSystemIn("utm29_euref89"); //for coordModule setCoordSystemOut("utm29_euref89"); setMapCenterX(617389); setMapCenterY(6877914); setNavWidth(164); setNavHeight(134); setNavPixelSizeX(908); setNavPixelSizeY(911); setNavULX(534257); setNavULY(6925400); setNavPath("images/sat_faro_70.gif"); setNavModuleLeft(546); setNavModuleTop(88); setPLDestination("findetsted_udskrift.htm"); setSWMTop(373); } } //load map selector module if(getMSModuleEnabled()==true) loadMSModule(); //load navigation module and hotspot if(getNavModuleEnabled()==true) { loadNavModule(); loadHS(1); } if( getASModuleCoordSearch() ) loadCoordModule(); //load lmrl module loadLMRLModule(); // 12.03.2003.xhbt:load lmcd module loadLMCDModule(); // 02.09.2003.xhbt:load PLModule if( getPLModuleEnabled() ) loadPLModule(); //11.09.2003.xhbt: load seach text loadSWMModule(); //load map module loadMapModule(getMapModuleLayout()); //load map(s) in map module for (var i=1; i<=getMapNumber(); i++) { loadMap(i); } } //========================================================================= // Function that changes the currently loaded map to another. //========================================================================= function changeMap(mapNumber, mapName) { if(mapName == "none"){ } else{ setMapName(mapNumber, mapName); loadMap(mapNumber); } } //========================================================================= // Function that clears any location marks on the map. //========================================================================= function clearLM() { var imgLM = document.getElementById( "imgLM" ); var divLMRLModule = document.getElementById( "divLMRLModule" ); var divLMCDModule = document.getElementById( "divLMCDModule" ); // alert("clearLM (3254): imgLM, divLMRL are about to be hidden"); imgLM.style.visibility = "hidden"; divLMRLModule.style.visibility = "hidden"; // 12.03.2003.xhbt: if(getLMCDModuleEnabled() == true){ divLMCDModule.style.visibility = "hidden"; } } //========================================================================= // Function that converts the X part of a UTM coordinate to the correspon- // ding screen x. //========================================================================= function utmXtoScreenX(mapNumber, x) { var ps = getMapPixelSize(getMapName(mapNumber)); var cx = getMapCenterX(); var w = getMapWidth(); var scrulx = getMapLeft(); var utmulx = getULX(cx, ps, w); return(parseInt((x-utmulx)/ps)+scrulx); } //========================================================================= // Function that converts the Y part of a UTM coordinate to the correspon- // ding screen y. //========================================================================= function utmYtoScreenY(mapNumber, y) { var ps = getMapPixelSize(getMapName(mapNumber)); var cy = getMapCenterY(); var h = getMapHeight(); var scruly = getMapTop(); var utmuly = getULY(cy, ps, h); return(parseInt((utmuly-y)/ps)+scruly); } //========================================================================= // Function that shows the location marker on the map //========================================================================= function showLM(mapNumber,utmx, utmy) { //convert UTM point to screen point var l = utmXtoScreenX(mapNumber,utmx)-12; var t = utmYtoScreenY(mapNumber,utmy)-36; var imgLM = document.getElementById( "imgLM" ); imgLM.style.position = "absolute"; imgLM.style.zIndex = "13"; imgLM.style.left = ""+l+"px"; imgLM.style.top = ""+t+"px"; imgLM.style.visibility = "visible"; } //========================================================================= // Function that show the hyperlink to remove the location marker from map //========================================================================= function showLMRLModule() { var divLMRLModule = document.getElementById( "divLMRLModule" ); divLMRLModule.style.visibility = "visible"; } //========================================================================= // 12.03.2003.xhbt: Function that show the coords for the location marker from map //========================================================================= function showLMCDModule(utmx,utmy) { // var obj = eval("divLMCDModule"); var divLMCDModule = document.getElementById( "divLMCDModule" ); divLMCDModule.innerHTML = lmcdModule(utmx,utmy); divLMCDModule.style.visibility = "visible"; } //========================================================================= // Function that returns true if the UTM point (x,y) is within the current // map area. Otherwise false is returned. //========================================================================= function isPointWithinMap(mapNumber,x,y) { var w=getMapWidth(); var h=getMapHeight(); var ps=getMapPixelSize(getMapName(mapNumber)); var cx=getMapCenterX(); var cy=getMapCenterY(); var dx = getLMWidth()/2*ps; var dy = getLMHeight()/2*ps; var minx=getULX(cx, ps, w) + dx; var miny=getLRY(cy, ps, h); var maxx=getLRX(cx, ps, w) - dx; var maxy=getULY(cy, ps, h) - dy; if(x>=minx && x<=maxx && y>=miny && y<=maxy) return(true); else return(false); } //========================================================================= // Function that moves the map a half map's width/height to one of eight // directions //========================================================================= function moveMap(mapNumber, direction) { var ps = Number(getMapPixelSize(getMapName(mapNumber))); if (getMapModuleLayout()==c_DK_DETALJER) // we choose the smallest pixel size, corresponding to the map with finest scale { var ps1 = getMapPixelSize( getMapName(1) ); var ps2 = getMapPixelSize( getMapName(2) ); ps = ps1 < ps2 ? ps1 : ps2; } var w = Number(getMapWidth()); var h = Number(getMapHeight()); var cx = Number(getMapCenterX()); var cy = Number(getMapCenterY()); if (direction=='N') { cy += (h / 2 * ps); } if (direction=='S') { cy -= (h / 2 * ps); } if (direction=='W') { cx -= (w / 2 * ps); } if (direction=='E') { cx += (w / 2 * ps); } if (direction=='NE') { cy += (h / 2 * ps); cx += (w / 2 * ps); } if (direction=='NW') { cy += (h / 2 * ps); cx -= (w / 2 * ps); } if (direction=='SW') { cy -= (h / 2 * ps); cx -= (w / 2 * ps); } if (direction=='SE') { cy -= (h / 2 * ps); cx += (w / 2 * ps); } //update variables setMapCenterX(cx); setMapCenterY(cy); //reload map if( (getMapModuleLayout()==c_DK_FOER_OG_NU) || (getMapModuleLayout()==c_DK_DETALJER) ) { for (var i=1; i<=getMapNumber(); i++) loadMap(i); } else loadMap(mapNumber); } //========================================================================= // Function that occurs when mouse buttion is clicked over map or nav. // Action depends on where the cursor was placed (map or nav). //========================================================================= function mouseClicked(e) { if( !e ) e=window.event; //IE // var cursorX = getMouseX(); // var cursorY = getMouseY(); var x = e.clientX; var y = e.clientY; var mapClicked = false; var navClicked = false; var navLeft = getNavModuleLeft() + getNavBorderSize(); var navRight = navLeft + getNavWidth(); var navTop = getNavModuleTop() - getNavBorderSize(); var navBottom = navTop + getNavHeight(); var map1Left = getMapModuleLeft() + getMapModuleBorderSize() + getMapBorderSize(); var map1Right = map1Left + getMapWidth(); var map1Top = getMapModuleTop() + getMapModuleBorderSize() + getMapBorderSize(); var map1Bottom = map1Top + getMapHeight(); if( getMapModuleLayout()==c_DK_DETALJER) { var map2Left = map1Right + getMapModuleBorderSize() + 2*getMapBorderSize(); var map2Right = map2Left + getMapWidth(); var map2Top = map1Top; var map2Bottom = map1Bottom; } var ml = getMapLeft(); var mt = getMapTop(); var ps; var cx = getMapCenterX(); var cy = getMapCenterY(); // did click occur within navModule (incl. HS) if( navLeft <= x && x <= navRight && navTop <= y && y <= navBottom ) { navClicked = true; cx = Number(getCenterXFromNav(x, getNavPixelSizeX(), getNavULX())); cy = Number(getCenterYFromNav(y, getNavPixelSizeY(), getNavULY())); var ps1 = Number(getMapPixelSize(getMapName(1))); if( getMapModuleLayout()==c_DK_DETALJER ) { var ps2 = Number(getMapPixelSize(getMapName(2))); ps = ps1DELAY*0.9) { if (result != "") { if (result != "0;0") //due to 0;0 coordinates in address database { //split result var coordinates = new Array(2); coordinates = result.split(";"); //convert to float var newCenterX = parseFloat(coordinates[1]); var newCenterY = parseFloat(coordinates[0]); //set center coordinate setMapCenterX(newCenterX); setMapCenterY(newCenterY); //set PNS marker coordinate setLMX(newCenterX); setLMY(newCenterY); if( getMatRegModuleEnabled() ) matRegModule( newCenterX, newCenterY, null, null ); //load map(s) in map module for (var i=1; i<=getMapNumber(); i++) { loadMap(i); } } else alert("Der var ikke muligt at stedbestemme adressen."); } } } //========================================================================= // //========================================================================= function moveMaptoLocationWithDelay(result) { LASTCLICKTIME = timeSince70(); window.setTimeout("moveMaptoLocation('"+result+"')", DELAY); } //========================================================================= // Function that replaces "text" by "by" in string "string". //========================================================================= function replace(string,text,by) { // Replaces text with by in string var strLength = string.length, txtLength = text.length; if ((strLength == 0) || (txtLength == 0)) return string; var i = string.indexOf(text); if ((!i) && (text != string.substring(0,txtLength))) return string; if (i == -1) return string; var newstr = string.substring(0,i) + by; if (i+txtLength < strLength) newstr += replace(string.substring(i+txtLength,strLength),text,by); return newstr; } //========================================================================= // Function that rounds number to X decimals. //========================================================================= function round(number, X) { //rounds number to X decimal places, defaults to 2 X = (!X ? 2 : X); return Math.round(number*Math.pow(10,X))/Math.pow(10,X); } //========================================================================= // Function that synchronize the position and size of the hot spot to the // map. //========================================================================= function syncHS(mapNumber) { var l = getHSLeft(mapNumber,getMapCenterX()); var t = getHSTop(mapNumber,getMapCenterY()); var w = getHSWidth(mapNumber); var h = getHSHeight(mapNumber); var nl = getNavLeft(); var nt = getNavTop(); var nw = getNavWidth(); var nh = getNavHeight(); var bs = getHSBorderSize(); var bc = getHSBorderColor() var bl = "" + bs + "px solid " + bc; var br = "" + bs + "px solid " + bc; var bt = "" + bs + "px solid " + bc; var bb = "" + bs + "px solid " + bc; //left if(l(nl+nw)) // if hs-right is outside nav { w-=(l+w)-(nl+nw); // subtract from hs-width the distance from nav-right to hs-right br="0px solid " + bc; } //top if(t(nt+nh)) // if hs-bottom is outside ("greater than" = "below") nav { h-=(t+h)-(nt+nh); // subtract from hs-height the distance between nav-bottom and hs-bottom bb="0px solid " + bc; } //positions the hot spot. var imgHSStyle = document.getElementById( "imgHS" ).style; imgHSStyle.zIndex = 10; imgHSStyle.position = "absolute"; imgHSStyle.left = "" + l + "px"; imgHSStyle.top = "" + t + "px"; //sets hot spot border. imgHSStyle.borderLeft = bl; imgHSStyle.borderRight = br; imgHSStyle.borderTop = bt; imgHSStyle.borderBottom = bb; //resizes the hot spot so it's size correspond to the map. imgHSStyle.width = w + "px"; imgHSStyle.height = h + "px"; } //========================================================================= // Function that synchronize the scale bar so it's scale corresponds to the // map. //========================================================================= function syncSB(mapNumber) { //get pixel size var ps = getMapPixelSize(getMapName(mapNumber)); //get scale bar width if (mapNumber>1 && getMapModuleLayout==c_DK_DETALJER) var w = getSB2Width(); else var w = getSBWidth(); var start = 0; var mid = parseInt(0.5 * ps * w); var end = parseInt(ps * w); //check if thousand separator (km) is necessary if (ps*w<1000) { start+="m"; mid+="m"; end+="m"; } else { start+="km"; mid=round(mid/1000,2); mid+="km"; end=round(end/1000,2); end+="km"; } //change scale bar if (mapNumber>1 && getMapModuleLayout()==c_DK_DETALJER) { var divSB2StartLabel = document.getElementById("divSB2StartLabel"); divSB2StartLabel.innerHTML = start; var divSB2EndLabel = document.getElementById("divSB2EndLabel"); divSB2EndLabel.innerHTML = end; var divSB2MidLabel = document.getElementById("divSB2MidLabel"); divSB2MidLabel.innerHTML = mid; } else { var divSBStartLabel = document.getElementById("divSBStartLabel"); divSBStartLabel.innerHTML = start; var divSBEndLabel = document.getElementById("divSBEndLabel"); divSBEndLabel.innerHTML = end; var divSBMidLabel = document.getElementById("divSBMidLabel"); divSBMidLabel.innerHTML = mid; } } //========================================================================= function getDecimal(n) { var m = getInteger(n); return(n-m); } //========================================================================= function getInteger(n) { if (n<0) return(Math.ceil(n)); else return(Math.floor(n)); } //========================================================================= function showSearchWaitMessage() { var divSWMModule = document.getElementById( "divSWMModule" ); divSWMModule.style.visibility = "visible"; } //========================================================================= function hideSearchWaitMessage() { var divSWMModule = document.getElementById( "divSWMModule" ); divSWMModule.style.visibility = "hidden"; } //========================================================================= function showDownloadingImagePicture(mapNumber) { // This is tricky. // It appears that the onload event for the map image is not executed by Opera when the src attribute of the img is // changed. Thus, hideDownloadingImagePicture() is called when the application is first loaded - but not when the // user navigates! 040628.julian // This solution is chosen, since Opera by itself displays a dowloading bar while an image is being downloaded. if( navigator.userAgent.indexOf( "Opera" ) < 0 ) { if (mapNumber==1) ISIMAGE1LOADED = false; else ISIMAGE2LOADED = false; var imgDIP = document.getElementById( "imgDIP" ); imgDIP.style.visibility = "visible"; } } //========================================================================= function hideDownloadingImagePicture(imgIndex, numberOfImages) { var imgDIP = document.getElementById( "imgDIP" ); //alert("hide DIP"+imgIndex); if (numberOfImages==1) ISIMAGE2LOADED = true; if (imgIndex==1) ISIMAGE1LOADED = true; else ISIMAGE2LOADED = true; if (ISIMAGE1LOADED != true || ISIMAGE2LOADED != true) imgDIP.style.visibility = "visible"; else imgDIP.style.visibility = "hidden"; } //========================================================================= function showPrintPreview(pdffile) { var url; url = getPLDestination()+"?"+getMapURLParameters(pdffile); window.open(url,"Udskriv","toolbar=no,scrollbars=yes,location=no,status=yes,menubar=no,width=789,height=500,screenX=0,screenY=0,top=0,left=0,resizable=yes"); } //========================================================================= function stripEnd(string, character) { var endpos; for (var i=0; i -1 ) url += "&mapName=topo_skaermkort&layers=dtk_skaermkort&styles="; else if( mapName=="topo_oversigt_r" ) url += "&mapName=topo_basis&layers=dtk_oversigt&styles="; else if( mapName=="D_200" ) url += "&mapName=topo_basis&layers=dtk_d200&styles="; else if( mapName=="G_2500" ) url += "&mapName=gtopo&layers=Gtk_g2500&styles="; else if( mapName=="G_500" ) url += "&mapName=gtopo&layers=Gtk_g500&styles="; else { url += "&mapName=" + mapName; if( getMapInfo( c_LAYERS, mapName ) != "" ) url += "&layers=" + getMapInfo( c_LAYERS, mapName ) + "&styles=" + getMapInfo( c_STYLES, mapName ); } url += "&scale=" + getMapInfo(c_SCALE, mapName); url += "&coord=" + "xxx"; if( (getMapModuleLayout() != c_FIND_ET_STED ) && (getMapModuleLayout() != c_MATRIKEL ) ){ mapName = getMapName(2); ps = getMapPixelSize(mapName); url += "&name2="+getMapInfo(c_ALIAS, mapName); if( mapName.toLowerCase().indexOf( "dtk_skaermkort" ) > -1 ) url += "&mapName2=topo_skaermkort&layers2=dtk_skaermkort&styles2="; else if( mapName=="topo_oversigt_r" ) url += "&mapName2=topo_basis&layers2=dtk_oversigt&styles2="; else if( mapName=="D_200" ) url += "&mapName2=topo_basis&layers2=dtk_d200&styles2="; else if( mapName=="G_2500" ) url += "&mapName2=gtopo&layers2=Gtk_g2500&styles2="; else if( mapName=="G_500" ) url += "&mapName2=gtopo&layers2=Gtk_g500&styles2="; else { url += "&mapName2=" + mapName; if( getMapInfo( c_LAYERS, mapName ) != "" ) url += "&layers2=" + getMapInfo( c_LAYERS, mapName ) + "&styles2=" + getMapInfo( c_STYLES, mapName ); } url += "&scale2=" + getMapInfo(c_SCALE, mapName); url += "&ps2=" + ps; } } else{ //else use old print var w = getMapWidth(); var h = getMapHeight(); var mn, ps; for (var i=1; i<=getMapNumber(); i++) { mn = getMapName(i); ps = getMapPixelSize(mn); //url += getMapURI(); url += "version=1.1.1"; url += "&service=WMS"; url += "&request=GetMap"; url += "&servicename=" + mn; url += "&srs=" + getMapProjection(); url += "&bbox=" + getULX(cx, ps, w); url += "," + getLRY(cy, ps, h); url += "," + getLRX(cx, ps, w); url += "," + getULY(cy, ps, h); url += "&width=" + w; url += "&height=" + h; url += "&exceptions=application/vnd.ogc.se_inimage"; url += "&ticket=764971839f26f9156d63df137cab5b35"; if (getMapImageFormat()==c_JPEG) { url += "&format=image/jpeg"; url += "&jpegquality=" + getMapJPEGQuality(); } else url += "&format=image/png"; url += "&nowcomesanothermap?"; } //13.03.2003.xhbt if(getPLManyMaps() == true){ url += "&divloc=" + DIVLOC; } } return(url); } //========================================================================= // Event handler for mouse events relating to the slider in Danmark Før & Nu //========================================================================= function divide(e,action) { if( action == c_MOUSEDOWN ) { isMouseDown = true; } else if ( action == c_MOUSEUP ) { isMouseDown = false; } if(!e) e=window.event; // IE var divMap1 = document.getElementById( "divMap1" ); var divRing = document.getElementById( "divRing" ); var divSlider = document.getElementById( "divSlider" ); var divTableOnTopOfRing = document.getElementById( "divTableOnTopOfRing" ); if ( isMouseDown ) { DIVLOC = e.clientX; var w = DIVLOC-getMapModuleLeft()-getMapModuleBorderSize(); var l = DIVLOC-6; divMap1.style.width = w + "px"; divRing.style.left = l + "px"; //18.03.03.xhbt: change from 6 to 22 divSlider.style.cursor = "e-resize"; divTableOnTopOfRing.style.cursor = "e-resize"; } else { divSlider.style.cursor = "default"; divTableOnTopOfRing.style.cursor = "default"; } } //-------------------------------------------------------------------------- //10.03.03.xhbt.begin: Adding function to open different countries in windows //-------------------------------------------------------------------------- //========================================================================= // Function that loads the enabled modules according to the country. //========================================================================= function loadCountry(maps) { if(maps == "dk"){ load(); } else{ load(); changeCountry(maps); loadCSModuleCountry(maps); } } //========================================================================= // Display/loads the country selector (CS) module according to country //========================================================================= function loadCSModuleCountry(maps) { var divCSModule = document.getElementById("divCSModule"); divCSModule.innerHTML = csModuleCountry(maps); } //============================================================================= // Functions that create the country selector (CS) module according to country //============================================================================== function csModuleCountry(maps) { var w = getCSWidth(); var tw = w+62; var t = getCSModuleTop(); var l = getCSModuleLeft(); var ht = getCSModuleHeaderText(); var bg = getCSModuleColor(); //create html var html=""; html+="
"; html+=""; html+=" "; html+=" "; html+=" "; html+=" "; html+=" "; html+=" "; html+=" "; html+=" "; html+=" "; html+="
"+ht+"
"; html += ""; html+="
"; html+="
"; return(html); } //------------------------------------------------------------------------- //10.03.03.xhbt.end: Adding function to open different countries in windows //------------------------------------------------------------------------- //========================================================================= function openInfoWindow(mapName) { //open window og send med variable var url = "info.htm?" + getMetaPath(mapName); window.open(url,"Info","toolbar=no,location=no,directories=no,menubar=no,scrollbars=no,resizable=no,status=no,width=450,height=450"); } //========================================================================= // Function that makes metadataurl //========================================================================= function getMetaPath(mapName) { var url=""; var ps = getMapPixelSize(mapName); url += "name="+getMapInfo(c_MAPINFOIDX_ALIAS, mapName); url += "&srs=" + getMapProjection(); url += "&ps=" + ps; url += "&scale=" + getMapInfo(c_SCALE, mapName); url += "&service=" + mapName; return url; } //========================================================================= // Function that changes the currently loaded map to another. //========================================================================= function changeType(typeNo) { var html = ""; var nom = getMapNumber(); var mn = getMapName(mapNumber); var w = getMSWidth(); var tw = w+62; var t = getMSModuleTop(); var l = getMSModuleLeft(); var ht = getMSModuleHeaderText(); var bg = getMSModuleColor(); //setMapType(typeNo); var mapLists = getMapLists(typeNo); typeNo = typeNo -1; //create a mapselector for each available map for (var j=1; j<=nom ; j++) { html += ""; } //Update listbox content var tdMapResult = document.getElementById( "tdMapResult" ); tdMapResult.innerHTML = html; changeMap(1,getMapNames(typeNo)); } //-------------------------------------------------------- // (Re-)write contents of MatReg module // Called by loadMatRegModule at startup, and also everytime the map moves //-------------------------------------------------------- function matRegModule( cx, cy, matrikel, ejerlav ) { var html = "