/********************************************************************** * * $Id: startUp.js,v 1.8 2006/12/14 17:24:41 lbecchi Exp $ * * purpose: start up code to bootstrap initialization of kaMap within * the sample interface. Examples of using many parts of * the kaMap core api. * * purpose: This is the sample ka-Map interface. Feel free to use it * as the basis for your own applications or just to find out * how ka-Map works. * * author: Lorenzo Becchi and Andrea Cappugi (www.ominiverdi.org) * * ka-Explorer interface has been developer for Food and Agriculture * Organization of the United Nations (FAO-UN) * * ********************************************************************** * * Copyright (c) 2006 Food and Agriculture Organization of the United Nations (FAO-UN) * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. * **********************************************************************/ /****************************************************************************** * * To customize startUp: * * 1) modify toolbar Layout * act on screen.css file and modify the funcion myMapInitialized(). * If you change pan and identifyer images edit switchMode() function too. * *****************************************************************************/ var myKaMap = myKaNavigator = myKaQuery = myScalebar = null; var queryParams = null; /** * parse the query string sent to this window into a global array of key = value pairs * this function should only be called once */ function parseQueryString() { queryParams = {}; var s=window.location.search; if (s!='') { s=s.substring( 1 ); var p=s.split('&'); for (var i=0;i
Latitude: ' + roundIt(position.y,8) + '
'; } function myMouseClick(positionx, positiony) { // Made by D10 ! var geopos = document.getElementById('geoPositionClick'); if(geopos) geopos.innerHTML = 'Clicked-Longitude: ' + roundIt(positionx,8) + '
Clicked-Latitude: ' + roundIt(positiony,8) + '
'; var geoposCopy = document.getElementById('geoPositionClickCopy'); if(geoposCopy) geoposCopy.innerHTML = 'Clicked-Longitude: ' + roundIt(positionx,8) + '
Clicked-Latitude: ' + roundIt(positiony,8) + '
'; } function myLayersChanged(eventID, map) { updateLinkToView(); } function updateLinkToView() { var port = (window.location.port)? window.location.port : 80; var url = window.location.protocol+'/'+'/'+window.location.host +':'+ port +''+window.location.pathname+'?'; var extents = myKaMap.getGeoExtents(); var cx = (extents[2] + extents[0])/2; var cy = (extents[3] + extents[1])/2; var cpsURL = 'cps='+cx+','+cy+','+myKaMap.getCurrentScale(); var mapURL = 'map=' + myKaMap.currentMap; var theMap = myKaMap.getCurrentMap(); var aLayers = theMap.getLayers(); var layersURL = 'layers='; var sep = ''; for (var i=0;i