From: Steve Coast Date: Fri, 17 Nov 2006 12:23:41 +0000 (+0000) Subject: get new slippy map in rails X-Git-Tag: live~8590 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/e62fe92282de957f0be76bee2d21de50bffd8625 get new slippy map in rails --- diff --git a/app/views/site/index.rhtml b/app/views/site/index.rhtml index fb5327b81..aec6c10fe 100644 --- a/app/views/site/index.rhtml +++ b/app/views/site/index.rhtml @@ -7,45 +7,68 @@
- +<% lon = params['lon'] || '-0.1' %> +<% lat = params['lat'] || '51.5' %> +<% zoom = params['zoom'] || '11' %> + + - var jpl_wms = new OpenLayers.Layer.WMS( "NASA Global Mosaic", - "http://wms.jpl.nasa.gov/wms.cgi", - {layers: "modis,global_mosaic"}); + + OpenLayers.Util.onImageLoadError = function() { + this.src = "http://www.openstreetmap.org/javascript/img/404.png"; + } + map = new OpenLayers.Map( "map", + {maxExtent: new OpenLayers.Bounds(-20037508.34,-20037508.34,20037508.34,20037508.34), maxResolution:156543, units:'meters', projection: "EPSG:41001"} ); + layer = new OpenLayers.Layer.LikeGoogle( "OSM", "http://artem.dev.openstreetmap.org/osm_tiles/", {type:'png'} ); + map.addLayer(layer); + map.addControl(new OpenLayers.Control.LayerSwitcher()); + map.setCenter(new OpenLayers.LonLat(lon, lat), zoom); + + map.events.register("moveend", map, function() { + var lonlat = map.getCenter(); + + var lon_deg = (lonlat.lon / 20037508.34) * 180; + var lat_deg = (lonlat.lat / 20037508.34) * 180; + var PI = 3.14159265358979323846; + lat_deg = 180/PI * (2 * Math.atan(Math.exp(lat_deg * PI / 180)) - PI / 2); + var zoom = map.getZoom() + 3; + updatelinks(lon_deg,lat_deg,zoom); + }); + } + + + init(); + // --> + + + + - -<% unless @user %> -
+ <% unless @user %> +
+ - --> + --> diff --git a/config/environment.rb b/config/environment.rb index 781d332d9..686582d3e 100644 --- a/config/environment.rb +++ b/config/environment.rb @@ -5,7 +5,7 @@ # ENV['RAILS_ENV'] ||= 'production' # Specifies gem version of Rails to use when vendor/rails is not present -RAILS_GEM_VERSION = '1.1.4' +RAILS_GEM_VERSION = '1.1.6' # Bootstrap the Rails environment, frameworks, and default configuration require File.join(File.dirname(__FILE__), 'boot') diff --git a/db/migrate.sql b/db/migrate.sql index 2d55fb552..b6bc48135 100644 --- a/db/migrate.sql +++ b/db/migrate.sql @@ -8,7 +8,7 @@ alter table current_segments modify tags text not null; alter table current_segments modify id bigint(64) not null auto_increment; alter table segments modify tags text not null; -drop table meta_ways +drop table meta_ways; alter table current_ways drop index current_ways_id_visible_idx; alter table current_ways modify id bigint(64) not null auto_increment, add primary key(id); diff --git a/public/javascripts/OpenLayers.js b/public/javascripts/OpenLayers.js new file mode 100644 index 000000000..969549aa2 --- /dev/null +++ b/public/javascripts/OpenLayers.js @@ -0,0 +1,541 @@ +/* + + OpenLayers.js -- OpenLayers Map Viewer Library + + Copyright 2005-2006 MetaCarta, Inc., released under the BSD License. + Please see http://svn.openlayers.org/trunk/openlayers/license.txt + for the full text of the license. + + Includes compressed code under the following licenses: + + (For uncompressed versions of the code used please see the + OpenLayers SVN repository: ) + +*/ + +/* Prototype JavaScript framework, version 1.4.0 + * (c) 2005 Sam Stephenson + * + * Prototype is freely distributable under the terms of an MIT-style license. + * For details, see the Prototype web site: http://prototype.conio.net/ + * +/*--------------------------------------------------------------------------*/ + +/** +* +* Contains portions of Rico +* +* Copyright 2005 Sabre Airline Solutions +* +* Licensed under the Apache License, Version 2.0 (the "License"); you +* may not use this file except in compliance with the License. You +* may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +* implied. See the License for the specific language governing +* permissions and limitations under the License. +* +**/ + + +var Prototype={Version:'1.4.0',ScriptFragment:'(?:)((\n|\r|.)*?)(?:<\/script>)',emptyFunction:function(){},K:function(x){return x}} +var Class={create:function(){return function(){this.initialize.apply(this,arguments);}}} +var Abstract=new Object();Object.extend=function(destination,source){for(property in source){destination[property]=source[property];} +return destination;} +Object.inspect=function(object){try{if(object==undefined)return'undefined';if(object==null)return'null';return object.inspect?object.inspect():object.toString();}catch(e){if(e instanceof RangeError)return'...';throw e;}} +Function.prototype.bind=function(){var __method=this,args=$A(arguments),object=args.shift();return function(){return __method.apply(object,args.concat($A(arguments)));}} +Function.prototype.bindAsEventListener=function(object){var __method=this;return function(event){return __method.call(object,event||window.event);}} +Object.extend(Number.prototype,{toColorPart:function(){var digits=this.toString(16);if(this<16)return'0'+digits;return digits;},succ:function(){return this+1;},times:function(iterator){$R(0,this,true).each(iterator);return this;}});var Try={these:function(){var returnValue;for(var i=0;i]+>/gi,'');},stripScripts:function(){return this.replace(new RegExp(Prototype.ScriptFragment,'img'),'');},extractScripts:function(){var matchAll=new RegExp(Prototype.ScriptFragment,'img');var matchOne=new RegExp(Prototype.ScriptFragment,'im');return(this.match(matchAll)||[]).map(function(scriptTag){return(scriptTag.match(matchOne)||['',''])[1];});},evalScripts:function(){return this.extractScripts().map(eval);},escapeHTML:function(){var div=document.createElement('div');var text=document.createTextNode(this);div.appendChild(text);return div.innerHTML;},unescapeHTML:function(){var div=document.createElement('div');div.innerHTML=this.stripTags();return div.childNodes[0]?div.childNodes[0].nodeValue:'';},toQueryParams:function(){var pairs=this.match(/^\??(.*)$/)[1].split('&');return pairs.inject({},function(params,pairString){var pair=pairString.split('=');params[pair[0]]=pair[1];return params;});},toArray:function(){return this.split('');},camelize:function(){var oStringList=this.split('-');if(oStringList.length==1)return oStringList[0];var camelizedString=this.indexOf('-')==0?oStringList[0].charAt(0).toUpperCase()+oStringList[0].substring(1):oStringList[0];for(var i=1,len=oStringList.length;i=(result||value)) +result=value;});return result;},min:function(iterator){var result;this.each(function(value,index){value=(iterator||Prototype.K)(value,index);if(value<=(result||value)) +result=value;});return result;},partition:function(iterator){var trues=[],falses=[];this.each(function(value,index){((iterator||Prototype.K)(value,index)?trues:falses).push(value);});return[trues,falses];},pluck:function(property){var results=[];this.each(function(value,index){results.push(value[property]);});return results;},reject:function(iterator){var results=[];this.each(function(value,index){if(!iterator(value,index)) +results.push(value);});return results;},sortBy:function(iterator){return this.collect(function(value,index){return{value:value,criteria:iterator(value,index)};}).sort(function(left,right){var a=left.criteria,b=right.criteria;return ab?1:0;}).pluck('value');},toArray:function(){return this.collect(Prototype.K);},zip:function(){var iterator=Prototype.K,args=$A(arguments);if(typeof args.last()=='function') +iterator=args.pop();var collections=[this].concat(args).map($A);return this.map(function(value,index){iterator(value=collections.pluck(index));return value;});},inspect:function(){return'#';}} +Object.extend(Enumerable,{map:Enumerable.collect,find:Enumerable.detect,select:Enumerable.findAll,member:Enumerable.include,entries:Enumerable.toArray});var $A=Array.from=function(iterable){if(!iterable)return[];if(iterable.toArray){return iterable.toArray();}else{var results=[];for(var i=0;i';}} +function $H(object){var hash=Object.extend({},object||{});Object.extend(hash,Enumerable);Object.extend(hash,Hash);return hash;} +ObjectRange=Class.create();Object.extend(ObjectRange.prototype,Enumerable);Object.extend(ObjectRange.prototype,{initialize:function(start,end,exclusive){this.start=start;this.end=end;this.exclusive=exclusive;},_each:function(iterator){var value=this.start;do{iterator(value);value=value.succ();}while(this.include(value));},include:function(value){if(value=200&&this.transport.status<300);},responseIsFailure:function(){return!this.responseIsSuccess();}} +Ajax.Request=Class.create();Ajax.Request.Events=['Uninitialized','Loading','Loaded','Interactive','Complete'];Ajax.Request.prototype=Object.extend(new Ajax.Base(),{initialize:function(url,options){this.transport=Ajax.getTransport();this.setOptions(options);this.request(url);},request:function(url){var parameters=this.options.parameters||'';if(parameters.length>0)parameters+='&_=';try{this.url=url;if(this.options.method=='get'&¶meters.length>0) +this.url+=(this.url.match(/\?/)?'&':'?')+parameters;Ajax.Responders.dispatch('onCreate',this,this.transport);this.transport.open(this.options.method,this.url,this.options.asynchronous);if(this.options.asynchronous){this.transport.onreadystatechange=this.onStateChange.bind(this);setTimeout((function(){this.respondToReadyState(1)}).bind(this),10);} +this.setRequestHeaders();var body=this.options.postBody?this.options.postBody:parameters;this.transport.send(this.options.method=='post'?body:null);}catch(e){this.dispatchException(e);}},setRequestHeaders:function(){var requestHeaders=['X-Requested-With','XMLHttpRequest','X-Prototype-Version',Prototype.Version];if(this.options.method=='post'){requestHeaders.push('Content-type','application/x-www-form-urlencoded');if(this.transport.overrideMimeType) +requestHeaders.push('Connection','close');} +if(this.options.requestHeaders) +requestHeaders.push.apply(requestHeaders,this.options.requestHeaders);for(var i=0;i'+this.content+'';return $A(div.childNodes[0].childNodes[0].childNodes);}} +var Insertion=new Object();Insertion.Before=Class.create();Insertion.Before.prototype=Object.extend(new Abstract.Insertion('beforeBegin'),{initializeRange:function(){this.range.setStartBefore(this.element);},insertContent:function(fragments){fragments.each((function(fragment){this.element.parentNode.insertBefore(fragment,this.element);}).bind(this));}});Insertion.Top=Class.create();Insertion.Top.prototype=Object.extend(new Abstract.Insertion('afterBegin'),{initializeRange:function(){this.range.selectNodeContents(this.element);this.range.collapse(true);},insertContent:function(fragments){fragments.reverse(false).each((function(fragment){this.element.insertBefore(fragment,this.element.firstChild);}).bind(this));}});Insertion.Bottom=Class.create();Insertion.Bottom.prototype=Object.extend(new Abstract.Insertion('beforeEnd'),{initializeRange:function(){this.range.selectNodeContents(this.element);this.range.collapse(this.element);},insertContent:function(fragments){fragments.each((function(fragment){this.element.appendChild(fragment);}).bind(this));}});Insertion.After=Class.create();Insertion.After.prototype=Object.extend(new Abstract.Insertion('afterEnd'),{initializeRange:function(){this.range.setStartAfter(this.element);},insertContent:function(fragments){fragments.each((function(fragment){this.element.parentNode.insertBefore(fragment,this.element.nextSibling);}).bind(this));}});Element.ClassNames=Class.create();Element.ClassNames.prototype={initialize:function(element){this.element=$(element);},_each:function(iterator){this.element.className.split(/\s+/).select(function(name){return name.length>0;})._each(iterator);},set:function(className){this.element.className=className;},add:function(classNameToAdd){if(this.include(classNameToAdd))return;this.set(this.toArray().concat(classNameToAdd).join(' '));},remove:function(classNameToRemove){if(!this.include(classNameToRemove))return;this.set(this.select(function(className){return className!=classNameToRemove;}).join(' '));},toString:function(){return this.toArray().join(' ');}} +Object.extend(Element.ClassNames.prototype,Enumerable);var Field={clear:function(){for(var i=0;i=0){opt=element.options[index];value=opt.value;if(!value&&!('value'in opt)) +value=opt.text;} +return[element.name,value];},selectMany:function(element){var value=new Array();for(var i=0;i=this.offset[1]&&y=this.offset[0]&&x=this.offset[1]&&this.ycomp=this.offset[0]&&this.xcomp"+el.innerHTML+"
"},_roundTopCorners:function(el,color,bgColor){var corner=this._createCorner(bgColor);for(var i=0;i=0;i--) +corner.appendChild(this._createCornerSlice(color,bgColor,i,"bottom"));el.style.paddingBottom=0;el.appendChild(corner);},_createCorner:function(bgColor){var corner=document.createElement("div");corner.style.backgroundColor=(this._isTransparent()?"transparent":bgColor);return corner;},_createCornerSlice:function(color,bgColor,n,position){var slice=document.createElement("span");var inStyle=slice.style;inStyle.backgroundColor=color;inStyle.display="block";inStyle.height="1px";inStyle.overflow="hidden";inStyle.fontSize="1px";var borderColor=this._borderColor(color,bgColor);if(this.options.border&&n==0){inStyle.borderTopStyle="solid";inStyle.borderTopWidth="1px";inStyle.borderLeftWidth="0px";inStyle.borderRightWidth="0px";inStyle.borderBottomWidth="0px";inStyle.height="0px";inStyle.borderColor=borderColor;} +else if(borderColor){inStyle.borderColor=borderColor;inStyle.borderStyle="solid";inStyle.borderWidth="0px 1px";} +if(!this.options.compact&&(n==(this.options.numSlices-1))) +inStyle.height="2px";this._setMargin(slice,n,position);this._setBorder(slice,n,position);return slice;},_setOptions:function(options){this.options={corners:"all",color:"fromElement",bgColor:"fromParent",blend:true,border:false,compact:false} +Object.extend(this.options,options||{});this.options.numSlices=this.options.compact?2:4;if(this._isTransparent()) +this.options.blend=false;},_whichSideTop:function(){if(this._hasString(this.options.corners,"all","top")) +return"";if(this.options.corners.indexOf("tl")>=0&&this.options.corners.indexOf("tr")>=0) +return"";if(this.options.corners.indexOf("tl")>=0) +return"left";else if(this.options.corners.indexOf("tr")>=0) +return"right";return"";},_whichSideBottom:function(){if(this._hasString(this.options.corners,"all","bottom")) +return"";if(this.options.corners.indexOf("bl")>=0&&this.options.corners.indexOf("br")>=0) +return"";if(this.options.corners.indexOf("bl")>=0) +return"left";else if(this.options.corners.indexOf("br")>=0) +return"right";return"";},_borderColor:function(color,bgColor){if(color=="transparent") +return bgColor;else if(this.options.border) +return this.options.border;else if(this.options.blend) +return this._blend(bgColor,color);else +return"";},_setMargin:function(el,n,corners){var marginSize=this._marginSize(n);var whichSide=corners=="top"?this._whichSideTop():this._whichSideBottom();if(whichSide=="left"){el.style.marginLeft=marginSize+"px";el.style.marginRight="0px";} +else if(whichSide=="right"){el.style.marginRight=marginSize+"px";el.style.marginLeft="0px";} +else{el.style.marginLeft=marginSize+"px";el.style.marginRight=marginSize+"px";}},_setBorder:function(el,n,corners){var borderSize=this._borderSize(n);var whichSide=corners=="top"?this._whichSideTop():this._whichSideBottom();if(whichSide=="left"){el.style.borderLeftWidth=borderSize+"px";el.style.borderRightWidth="0px";} +else if(whichSide=="right"){el.style.borderRightWidth=borderSize+"px";el.style.borderLeftWidth="0px";} +else{el.style.borderLeftWidth=borderSize+"px";el.style.borderRightWidth=borderSize+"px";} +if(this.options.border!=false) +el.style.borderLeftWidth=borderSize+"px";el.style.borderRightWidth=borderSize+"px";},_marginSize:function(n){if(this._isTransparent()) +return 0;var marginSizes=[5,3,2,1];var blendedMarginSizes=[3,2,1,0];var compactMarginSizes=[2,1];var smBlendedMarginSizes=[1,0];if(this.options.compact&&this.options.blend) +return smBlendedMarginSizes[n];else if(this.options.compact) +return compactMarginSizes[n];else if(this.options.blend) +return blendedMarginSizes[n];else +return marginSizes[n];},_borderSize:function(n){var transparentBorderSizes=[5,3,2,1];var blendedBorderSizes=[2,1,1,1];var compactBorderSizes=[1,0];var actualBorderSizes=[0,2,0,0];if(this.options.compact&&(this.options.blend||this._isTransparent())) +return 1;else if(this.options.compact) +return compactBorderSizes[n];else if(this.options.blend) +return blendedBorderSizes[n];else if(this.options.border) +return actualBorderSizes[n];else if(this._isTransparent()) +return transparentBorderSizes[n];return 0;},_hasString:function(str){for(var i=1;i=0)return true;return false;},_blend:function(c1,c2){var cc1=Rico.Color.createFromHex(c1);cc1.blend(Rico.Color.createFromHex(c2));return cc1;},_background:function(el){try{return Rico.Color.createColorFromBackground(el).asHex();}catch(err){return"#ffffff";}},_isTransparent:function(){return this.options.color=="transparent";},_isTopRounded:function(){return this._hasString(this.options.corners,"all","top","tl","tr");},_isBottomRounded:function(){return this._hasString(this.options.corners,"all","bottom","bl","br");},_hasSingleTextChild:function(el){return el.childNodes.length==1&&el.childNodes[0].nodeType==3;}} +_OPENLAYERS_SFL_=true +OpenLayers=new Object();OpenLayers._scriptName=(typeof(_OPENLAYERS_SFL_)=="undefined"?"lib/OpenLayers.js":"OpenLayers.js");OpenLayers._getScriptLocation=function(){var scriptLocation="";var SCRIPT_NAME=OpenLayers._scriptName;var scripts=document.getElementsByTagName('script');for(var i=0;i-1)&&(index+SCRIPT_NAME.length==src.length)){scriptLocation=src.slice(0,-SCRIPT_NAME.length);break;}}} +return scriptLocation;} +if(typeof(_OPENLAYERS_SFL_)=="undefined"){(function(){var jsfiles=new Array("Prototype.js","Rico/Corner.js","Rico/Color.js","OpenLayers/BaseTypes.js","OpenLayers/Util.js","OpenLayers/Ajax.js","OpenLayers/Events.js","OpenLayers/Map.js","OpenLayers/Layer.js","OpenLayers/Icon.js","OpenLayers/Marker.js","OpenLayers/Marker/Box.js","OpenLayers/Popup.js","OpenLayers/Tile.js","OpenLayers/Feature.js","OpenLayers/Feature/WFS.js","OpenLayers/Tile/Image.js","OpenLayers/Tile/WFS.js","OpenLayers/Layer/EventPane.js","OpenLayers/Layer/FixedZoomLevels.js","OpenLayers/Layer/Google.js","OpenLayers/Layer/VirtualEarth.js","OpenLayers/Layer/Yahoo.js","OpenLayers/Layer/HTTPRequest.js","OpenLayers/Layer/Grid.js","OpenLayers/Layer/KaMap.js","OpenLayers/Layer/LikeGoogle.js","OpenLayers/Layer/MultiMap.js","OpenLayers/Layer/Markers.js","OpenLayers/Layer/Text.js","OpenLayers/Layer/WorldWind.js","OpenLayers/Layer/WMS.js","OpenLayers/Layer/WFS.js","OpenLayers/Layer/WMS/Untiled.js","OpenLayers/Layer/GeoRSS.js","OpenLayers/Layer/Boxes.js","OpenLayers/Layer/Canvas.js","OpenLayers/Popup/Anchored.js","OpenLayers/Popup/AnchoredBubble.js","OpenLayers/Control.js","OpenLayers/Control/MouseDefaults.js","OpenLayers/Control/MouseToolbar.js","OpenLayers/Control/KeyboardDefaults.js","OpenLayers/Control/PanZoom.js","OpenLayers/Control/PanZoomBar.js","OpenLayers/Control/Permalink.js","OpenLayers/Control/Scale.js","OpenLayers/Control/LayerSwitcher.js","OpenLayers/Control/LayerTabs.js");var allScriptTags="";var host=OpenLayers._getScriptLocation()+"lib/";var start=1;try{x=Prototype;} +catch(e){start=0;} +for(var i=start;i";allScriptTags+=currentScriptTag;} +document.write(allScriptTags);})();} +OpenLayers.ProxyHost="";OpenLayers.nullHandler=function(request){alert("Unhandled request return "+request.statusText);};OpenLayers.loadURL=function(uri,params,caller,onComplete,onFailure){if(OpenLayers.ProxyHost&&uri.startsWith("http")){uri=OpenLayers.ProxyHost+escape(uri);} +var success=(onComplete)?onComplete.bind(caller):OpenLayers.nullHandler;var failure=(onFailure)?onFailure.bind(caller):OpenLayers.nullHandler;new Ajax.Request(uri,{method:'get',parameters:params,onComplete:success,onFailure:failure});};OpenLayers.parseXMLString=function(text){var index=text.indexOf('<');if(index>0){text=text.substring(index);} +var ajaxResponse=Try.these(function(){var xmldom=new ActiveXObject('Microsoft.XMLDOM');xmldom.loadXML(text);return xmldom;},function(){return new DOMParser().parseFromString(text,'text/xml');},function(){var req=new XMLHttpRequest();req.open("GET","data:"+"text/xml"+";charset=utf-8,"+encodeURIComponent(text),false);if(req.overrideMimeType){req.overrideMimeType("text/xml");} +req.send(null);return req.responseXML;});return ajaxResponse;};OpenLayers.Pixel=Class.create();OpenLayers.Pixel.prototype={x:0.0,y:0.0,initialize:function(x,y){this.x=parseFloat(x);this.y=parseFloat(y);},toString:function(){return("x="+this.x+",y="+this.y);},clone:function(){return new OpenLayers.Pixel(this.x,this.y);},equals:function(px){var equals=false;if(px!=null){equals=((this.x==px.x&&this.y==px.y)||(isNaN(this.x)&&isNaN(this.y)&&isNaN(px.x)&&isNaN(px.y)));} +return equals;},add:function(x,y){return new OpenLayers.Pixel(this.x+x,this.y+y);},offset:function(px){return this.add(px.x,px.y);},CLASS_NAME:"OpenLayers.Pixel"};OpenLayers.Size=Class.create();OpenLayers.Size.prototype={w:0.0,h:0.0,initialize:function(w,h){this.w=parseFloat(w);this.h=parseFloat(h);},toString:function(){return("w="+this.w+",h="+this.h);},clone:function(){return new OpenLayers.Size(this.w,this.h);},equals:function(sz){var equals=false;if(sz!=null){equals=((this.w==sz.w&&this.h==sz.h)||(isNaN(this.w)&&isNaN(this.h)&&isNaN(sz.w)&&isNaN(sz.h)));} +return equals;},CLASS_NAME:"OpenLayers.Size"};OpenLayers.LonLat=Class.create();OpenLayers.LonLat.prototype={lon:0.0,lat:0.0,initialize:function(lon,lat){this.lon=parseFloat(lon);this.lat=parseFloat(lat);},toString:function(){return("lon="+this.lon+",lat="+this.lat);},toShortString:function(){return(this.lon+", "+this.lat);},clone:function(){return new OpenLayers.LonLat(this.lon,this.lat);},add:function(lon,lat){return new OpenLayers.LonLat(this.lon+lon,this.lat+lat);},equals:function(ll){var equals=false;if(ll!=null){equals=((this.lon==ll.lon&&this.lat==ll.lat)||(isNaN(this.lon)&&isNaN(this.lat)&&isNaN(ll.lon)&&isNaN(ll.lat)));} +return equals;},CLASS_NAME:"OpenLayers.LonLat"};OpenLayers.LonLat.fromString=function(str){var pair=str.split(",");return new OpenLayers.LonLat(parseFloat(pair[0]),parseFloat(pair[1]));};OpenLayers.Bounds=Class.create();OpenLayers.Bounds.prototype={left:0.0,bottom:0.0,right:0.0,top:0.0,initialize:function(left,bottom,right,top){this.left=parseFloat(left);this.bottom=parseFloat(bottom);this.right=parseFloat(right);this.top=parseFloat(top);},clone:function(){return new OpenLayers.Bounds(this.left,this.bottom,this.right,this.top);},equals:function(bounds){var equals=false;if(bounds!=null){equals=((this.left==bounds.left)&&(this.right==bounds.right)&&(this.top==bounds.top)&&(this.bottom==bounds.bottom));} +return equals;},toString:function(){return("left-bottom=("+this.left+","+this.bottom+")" ++" right-top=("+this.right+","+this.top+")");},toBBOX:function(){return(this.left+","+this.bottom+"," ++this.right+","+this.top);},getWidth:function(){return(this.right-this.left);},getHeight:function(){return(this.top-this.bottom);},getSize:function(){return new OpenLayers.Size(this.getWidth(),this.getHeight());},getCenterPixel:function(){return new OpenLayers.Pixel((this.left+this.right)/2,(this.bottom+this.top)/2);},getCenterLonLat:function(){return new OpenLayers.LonLat((this.left+this.right)/2,(this.bottom+this.top)/2);},add:function(x,y){return new OpenLayers.Bounds(this.left+x,this.bottom+y,this.right+x,this.top+y);},containsLonLat:function(ll,inclusive){return this.contains(ll.lon,ll.lat,inclusive);},containsPixel:function(px,inclusive){return this.contains(px.x,px.y,inclusive);},contains:function(x,y,inclusive){if(inclusive==null){inclusive=true;} +var contains=false;if(inclusive){contains=((x>=this.left)&&(x<=this.right)&&(y>=this.bottom)&&(y<=this.top));}else{contains=((x>this.left)&&(xthis.bottom)&&(y=this.left)&&(bounds.left<=this.right);inTop=(bounds.top>=this.bottom)&&(bounds.top<=this.top);inRight=(bounds.right>=this.left)&&(bounds.right<=this.right);inBottom=(bounds.bottom>=this.bottom)&&(bounds.bottom<=this.top);}else{inLeft=(bounds.left>this.left)&&(bounds.leftthis.bottom)&&(bounds.topthis.left)&&(bounds.rightthis.bottom)&&(bounds.bottom0)?this.toString():0;if(sig0)){for(var i=0;i0){this.options=Object.extend(new Object(),options);Object.extend(this,this.options);this.name=name;this.id=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_");if(this.div==null){this.div=OpenLayers.Util.createDiv();this.div.style.width="100%";this.div.style.height="100%";this.div.id=this.id;}}},destroy:function(){if(this.map!=null){this.map.removeLayer(this);} +this.map=null;this.name=null;this.div=null;this.options=null;},clone:function(obj){if(obj==null){obj=new OpenLayers.Layer(this.name,this.options);} +OpenLayers.Util.applyDefaults(obj,this);obj.map=null;return obj;},setName:function(newName){this.name=newName;if(this.map!=null) +this.map.events.triggerEvent("changelayer");},addOptions:function(newOptions){Object.extend(this.options,newOptions);Object.extend(this,this.options);},onMapResize:function(){},moveTo:function(bounds,zoomChanged,minor){},setMap:function(map){this.map=map;var properties=new Array('projection','units','scales','resolutions','maxScale','minScale','maxResolution','minResolution','minExtent','maxExtent','numZoomLevels');if(this.map.maxZoomLevel&&!this.numZoomLevels){this.numZoomLevels=this.map.maxZoomLevel+1;} +for(var i=0;i0){this.lonlat=lonlat;var newIcon=(icon)?icon:OpenLayers.Marker.defaultIcon();if(this.icon==null){this.icon=newIcon;}else{this.icon.url=newIcon.url;this.icon.size=newIcon.size;this.icon.offset=newIcon.offset;this.icon.calculateOffset=newIcon.calculateOffset;} +this.events=new OpenLayers.Events(this,this.icon.imageDiv,null);}},destroy:function(){this.map=null;if(this.icon!=null){this.icon.destroy();this.icon=null;}},draw:function(px){return this.icon.draw(px);},moveTo:function(px){if((px!=null)&&(this.icon!=null)){this.icon.moveTo(px);}},onScreen:function(){var onScreen=false;if(this.map){var screenBounds=this.map.getExtent();onScreen=screenBounds.containsLonLat(this.lonlat);} +return onScreen;},inflate:function(inflate){if(this.icon){var newSize=new OpenLayers.Size(this.icon.size.w*inflate,this.icon.size.h*inflate);this.icon.setSize(newSize);}},display:function(display){this.icon.display(display);},CLASS_NAME:"OpenLayers.Marker"};OpenLayers.Marker.defaultIcon=function(){var url=OpenLayers.Util.getImagesLocation()+"marker.png";var size=new OpenLayers.Size(21,25);var calculateOffset=function(size){return new OpenLayers.Pixel(-(size.w/2),-size.h);};return new OpenLayers.Icon(url,size,null,calculateOffset);};OpenLayers.Popup=Class.create();OpenLayers.Popup.WIDTH=200;OpenLayers.Popup.HEIGHT=200;OpenLayers.Popup.COLOR="white";OpenLayers.Popup.OPACITY=1;OpenLayers.Popup.BORDER="0px";OpenLayers.Popup.prototype={events:null,id:"",lonlat:null,div:null,size:null,contentHTML:"",backgroundColor:"",opacity:"",border:"",map:null,initialize:function(id,lonlat,size,contentHTML){if(id==null){id=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_");} +this.id=id;this.lonlat=lonlat;this.size=(size!=null)?size:new OpenLayers.Size(OpenLayers.Popup.WIDTH,OpenLayers.Popup.HEIGHT);if(contentHTML!=null){this.contentHTML=contentHTML;} +this.backgroundColor=OpenLayers.Popup.COLOR;this.opacity=OpenLayers.Popup.OPACITY;this.border=OpenLayers.Popup.BORDER;this.div=OpenLayers.Util.createDiv(this.id,null,null,null,null,null,"hidden");this.registerEvents();},destroy:function(){if(this.map!=null){this.map.removePopup(this);} +this.div=null;this.map=null;},draw:function(px){if(px==null){if((this.lonlat!=null)&&(this.map!=null)){px=this.map.getLayerPxFromLonLat(this.lonlat);}} +this.setSize();this.setBackgroundColor();this.setOpacity();this.setBorder();this.setContentHTML();this.moveTo(px);return this.div;},updatePosition:function(){if((this.lonlat)&&(this.map)){var px=this.map.getLayerPxFromLonLat(this.lonlat);this.moveTo(px);}},moveTo:function(px){if((px!=null)&&(this.div!=null)){this.div.style.left=px.x+"px";this.div.style.top=px.y+"px";}},visible:function(){return Element.visible(this.div);},toggle:function(){Element.toggle(this.div);},show:function(){Element.show(this.div);},hide:function(){Element.hide(this.div);},setSize:function(size){if(size!=undefined){this.size=size;} +if(this.div!=null){this.div.style.width=this.size.w+"px";this.div.style.height=this.size.h+"px";}},setBackgroundColor:function(color){if(color!=undefined){this.backgroundColor=color;} +if(this.div!=null){this.div.style.backgroundColor=this.backgroundColor;}},setOpacity:function(opacity){if(opacity!=undefined){this.opacity=opacity;} +if(this.div!=null){this.div.style.opacity=this.opacity;this.div.style.filter='alpha(opacity='+this.opacity*100+')';}},setBorder:function(border){if(border!=undefined){this.border=border;} +if(this.div!=null){this.div.style.border=this.border;}},setContentHTML:function(contentHTML){if(contentHTML!=null){this.contentHTML=contentHTML;} +if(this.div!=null){this.div.innerHTML=this.contentHTML;}},registerEvents:function(){this.events=new OpenLayers.Events(this,this.div,null,true);this.events.register("mousedown",this,this.onmousedown);this.events.register("mousemove",this,this.onmousemove);this.events.register("mouseup",this,this.onmouseup);this.events.register("click",this,OpenLayers.Util.safeStopPropagation);this.events.register("mouseout",this,this.onmouseout);this.events.register("dblclick",this,OpenLayers.Util.safeStopPropagation);},onmousedown:function(evt){this.mousedown=true;OpenLayers.Util.safeStopPropagation(evt);},onmousemove:function(evt){if(this.mousedown){OpenLayers.Util.safeStopPropagation(evt);}},onmouseup:function(evt){if(this.mousedown){this.mousedown=false;OpenLayers.Util.safeStopPropagation(evt);}},onmouseout:function(evt){this.mousedown=false;},CLASS_NAME:"OpenLayers.Popup"};OpenLayers.Tile=Class.create();OpenLayers.Tile.prototype={id:null,layer:null,url:null,bounds:null,size:null,position:null,drawn:false,initialize:function(layer,position,bounds,url,size){if(arguments.length>0){this.layer=layer;this.position=position;this.bounds=bounds;this.url=url;this.size=size;this.id=OpenLayers.Util.createUniqueID("Tile_");}},destroy:function(){this.layer=null;this.bounds=null;this.size=null;this.position=null;},draw:function(){this.drawn=true;},moveTo:function(bounds,position,redraw){if(redraw==null){redraw=true;} +this.clear();this.bounds=bounds.clone();this.position=position.clone();if(redraw){this.draw();}},clear:function(){this.drawn=false;},CLASS_NAME:"OpenLayers.Tile"};OpenLayers.Util=new Object();OpenLayers.Util.modifyDOMElement=function(element,id,px,sz,position,border,overflow){if(id){element.id=id;} +if(px){element.style.left=px.x+"px";element.style.top=px.y+"px";} +if(sz){element.style.width=sz.w+"px";element.style.height=sz.h+"px";} +if(position){element.style.position=position;} +if(border){element.style.border=border;} +if(overflow){element.style.overflow=overflow;}};OpenLayers.Util.createDiv=function(id,px,sz,imgURL,position,border,overflow){var dom=document.createElement('div');dom.style.padding="0";dom.style.margin="0";if(imgURL){dom.style.backgroundImage='url('+imgURL+')';} +if(!id){id=OpenLayers.Util.createUniqueID("OpenLayersDiv");} +if(!position){position="absolute";} +OpenLayers.Util.modifyDOMElement(dom,id,px,sz,position,border,overflow);return dom;};OpenLayers.Util.createImage=function(id,px,sz,imgURL,position,border,delayDisplay){image=document.createElement("img");if(delayDisplay){image.style.display="none";Event.observe(image,"load",OpenLayers.Util.onImageLoad.bindAsEventListener(image));Event.observe(image,"error",OpenLayers.Util.onImageLoadError.bindAsEventListener(image));} +image.style.alt=id;image.galleryImg="no";if(imgURL){image.src=imgURL;} +if(!id){id=OpenLayers.Util.createUniqueID("OpenLayersDiv");} +if(!position){position="relative";} +OpenLayers.Util.modifyDOMElement(image,id,px,sz,position,border);return image;};OpenLayers.Util.setOpacity=function(element,opacity){element.style.opacity=opacity;element.style.filter='alpha(opacity='+(opacity*100)+')';} +OpenLayers.Util.onImageLoad=function(){this.style.backgroundColor=null;this.style.display="";};OpenLayers.Util.onImageLoadErrorColor="pink";OpenLayers.Util.onImageLoadError=function(){this.style.backgroundColor=OpenLayers.Util.onImageLoadErrorColor;this.style.display="";};OpenLayers.Util.alphaHack=function(){var arVersion=navigator.appVersion.split("MSIE");var version=parseFloat(arVersion[1]);return((document.body.filters)&&(version>=5.5)&&(version<7));} +OpenLayers.Util.modifyAlphaImageDiv=function(div,id,px,sz,imgURL,position,border,sizing){OpenLayers.Util.modifyDOMElement(div,id,px,sz);var img=div.childNodes[0];if(imgURL){img.src=imgURL;} +OpenLayers.Util.modifyDOMElement(img,div.id+"_innerImage",null,sz,"relative",border);if(OpenLayers.Util.alphaHack()){div.style.display="inline-block";if(sizing==null){sizing="scale";} +div.style.filter="progid:DXImageTransform.Microsoft"+".AlphaImageLoader(src='"+img.src+"', "+"sizingMethod='"+sizing+"')";img.style.filter="progid:DXImageTransform.Microsoft"+".Alpha(opacity=0)";}};OpenLayers.Util.createAlphaImageDiv=function(id,px,sz,imgURL,position,border,sizing,delayDisplay){var div=OpenLayers.Util.createDiv();var img=OpenLayers.Util.createImage(null,null,null,null,null,null,false);div.appendChild(img);if(delayDisplay){img.style.display="none";Event.observe(img,"load",OpenLayers.Util.onImageLoad.bindAsEventListener(div));Event.observe(img,"error",OpenLayers.Util.onImageLoadError.bindAsEventListener(div));} +OpenLayers.Util.modifyAlphaImageDiv(div,id,px,sz,imgURL,position,border,sizing);return div;};OpenLayers.Util.upperCaseObject=function(object){var uObject=new Object();for(var key in object){uObject[key.toUpperCase()]=object[key];} +return uObject;};OpenLayers.Util.applyDefaults=function(to,from){for(var key in from){if(to[key]==null){to[key]=from[key];}}};OpenLayers.Util.getParameterString=function(params){paramsArray=new Array();for(var key in params){var value=params[key];if((value!=null)&&(typeof value!='function')){paramsArray.push(key+"="+value);}} +return paramsArray.join("&");};OpenLayers.Util.getImagesLocation=function(){return OpenLayers._getScriptLocation()+"img/";};OpenLayers.Util.getNodes=function(p,tagName){var nodes=Try.these(function(){return OpenLayers.Util._getNodes(p.documentElement.childNodes,tagName);},function(){return OpenLayers.Util._getNodes(p.childNodes,tagName);});return nodes;};OpenLayers.Util._getNodes=function(nodes,tagName){var retArray=new Array();for(var i=0;i0)) +{if(!index){index=0;} +if(result[index].childNodes.length>1){return result.childNodes[1].nodeValue;} +else if(result[index].childNodes.length==1){return result[index].firstChild.nodeValue;}}else{return"";}};OpenLayers.Util.getXmlNodeValue=function(node){var val=null;Try.these(function(){val=node.text;if(!val) +val=node.textContent;},function(){val=node.textContent;});return val;};OpenLayers.Util.mouseLeft=function(evt,div){var target=(evt.relatedTarget)?evt.relatedTarget:evt.toElement;while(target!=div&&target!=null){target=target.parentNode;} +return(target!=div);};OpenLayers.Util.rad=function(x){return x*Math.PI/180;};OpenLayers.Util.distVincenty=function(p1,p2){var a=6378137,b=6356752.3142,f=1/298.257223563;var L=OpenLayers.Util.rad(p2.lon-p1.lon);var U1=Math.atan((1-f)*Math.tan(OpenLayers.Util.rad(p1.lat)));var U2=Math.atan((1-f)*Math.tan(OpenLayers.Util.rad(p2.lat)));var sinU1=Math.sin(U1),cosU1=Math.cos(U1);var sinU2=Math.sin(U2),cosU2=Math.cos(U2);var lambda=L,lambdaP=2*Math.PI;var iterLimit=20;while(Math.abs(lambda-lambdaP)>1e-12&&--iterLimit>0){var sinLambda=Math.sin(lambda),cosLambda=Math.cos(lambda);var sinSigma=Math.sqrt((cosU2*sinLambda)*(cosU2*sinLambda)+ +(cosU1*sinU2-sinU1*cosU2*cosLambda)*(cosU1*sinU2-sinU1*cosU2*cosLambda));if(sinSigma==0)return 0;var cosSigma=sinU1*sinU2+cosU1*cosU2*cosLambda;var sigma=Math.atan2(sinSigma,cosSigma);var alpha=Math.asin(cosU1*cosU2*sinLambda/sinSigma);var cosSqAlpha=Math.cos(alpha)*Math.cos(alpha);var cos2SigmaM=cosSigma-2*sinU1*sinU2/cosSqAlpha;var C=f/16*cosSqAlpha*(4+f*(4-3*cosSqAlpha));lambdaP=lambda;lambda=L+(1-C)*f*Math.sin(alpha)*(sigma+C*sinSigma*(cos2SigmaM+C*cosSigma*(-1+2*cos2SigmaM*cos2SigmaM)));} +if(iterLimit==0)return NaN +var uSq=cosSqAlpha*(a*a-b*b)/(b*b);var A=1+uSq/16384*(4096+uSq*(-768+uSq*(320-175*uSq)));var B=uSq/1024*(256+uSq*(-128+uSq*(74-47*uSq)));var deltaSigma=B*sinSigma*(cos2SigmaM+B/4*(cosSigma*(-1+2*cos2SigmaM*cos2SigmaM)- +B/6*cos2SigmaM*(-3+4*sinSigma*sinSigma)*(-3+4*cos2SigmaM*cos2SigmaM)));var s=b*A*(sigma-deltaSigma);var d=s.toFixed(3)/1000;return d;};OpenLayers.Util.getArgs=function(){var args=new Object();var query=location.search.substring(1);var pairs=query.split("&");for(var i=0;i1.0)?(1.0/scale):scale;return normScale;};OpenLayers.Util.getResolutionFromScale=function(scale,units){if(units==null){units="degrees";} +var normScale=OpenLayers.Util.normalizeScale(scale);var resolution=1/(normScale*OpenLayers.INCHES_PER_UNIT[units]*OpenLayers.DOTS_PER_INCH);return resolution;};OpenLayers.Util.safeStopPropagation=function(evt){if(evt.stopPropagation){evt.stopPropagation();} +evt.cancelBubble=true;};Rico.Color=Class.create();Rico.Color.prototype={initialize:function(red,green,blue){this.rgb={r:red,g:green,b:blue};},setRed:function(r){this.rgb.r=r;},setGreen:function(g){this.rgb.g=g;},setBlue:function(b){this.rgb.b=b;},setHue:function(h){var hsb=this.asHSB();hsb.h=h;this.rgb=Rico.Color.HSBtoRGB(hsb.h,hsb.s,hsb.b);},setSaturation:function(s){var hsb=this.asHSB();hsb.s=s;this.rgb=Rico.Color.HSBtoRGB(hsb.h,hsb.s,hsb.b);},setBrightness:function(b){var hsb=this.asHSB();hsb.b=b;this.rgb=Rico.Color.HSBtoRGB(hsb.h,hsb.s,hsb.b);},darken:function(percent){var hsb=this.asHSB();this.rgb=Rico.Color.HSBtoRGB(hsb.h,hsb.s,Math.max(hsb.b-percent,0));},brighten:function(percent){var hsb=this.asHSB();this.rgb=Rico.Color.HSBtoRGB(hsb.h,hsb.s,Math.min(hsb.b+percent,1));},blend:function(other){this.rgb.r=Math.floor((this.rgb.r+other.rgb.r)/2);this.rgb.g=Math.floor((this.rgb.g+other.rgb.g)/2);this.rgb.b=Math.floor((this.rgb.b+other.rgb.b)/2);},isBright:function(){var hsb=this.asHSB();return this.asHSB().b>0.5;},isDark:function(){return!this.isBright();},asRGB:function(){return"rgb("+this.rgb.r+","+this.rgb.g+","+this.rgb.b+")";},asHex:function(){return"#"+this.rgb.r.toColorPart()+this.rgb.g.toColorPart()+this.rgb.b.toColorPart();},asHSB:function(){return Rico.Color.RGBtoHSB(this.rgb.r,this.rgb.g,this.rgb.b);},toString:function(){return this.asHex();}};Rico.Color.createFromHex=function(hexCode){if(hexCode.length==4){var shortHexCode=hexCode;var hexCode='#';for(var i=1;i<4;i++)hexCode+=(shortHexCode.charAt(i)+ +shortHexCode.charAt(i));} +if(hexCode.indexOf('#')==0) +hexCode=hexCode.substring(1);var red=hexCode.substring(0,2);var green=hexCode.substring(2,4);var blue=hexCode.substring(4,6);return new Rico.Color(parseInt(red,16),parseInt(green,16),parseInt(blue,16));} +Rico.Color.createColorFromBackground=function(elem){var actualColor=RicoUtil.getElementsComputedStyle($(elem),"backgroundColor","background-color");if(actualColor=="transparent"&&elem.parentNode) +return Rico.Color.createColorFromBackground(elem.parentNode);if(actualColor==null) +return new Rico.Color(255,255,255);if(actualColor.indexOf("rgb(")==0){var colors=actualColor.substring(4,actualColor.length-1);var colorArray=colors.split(",");return new Rico.Color(parseInt(colorArray[0]),parseInt(colorArray[1]),parseInt(colorArray[2]));} +else if(actualColor.indexOf("#")==0){return Rico.Color.createFromHex(actualColor);} +else +return new Rico.Color(255,255,255);} +Rico.Color.HSBtoRGB=function(hue,saturation,brightness){var red=0;var green=0;var blue=0;if(saturation==0){red=parseInt(brightness*255.0+0.5);green=red;blue=red;} +else{var h=(hue-Math.floor(hue))*6.0;var f=h-Math.floor(h);var p=brightness*(1.0-saturation);var q=brightness*(1.0-saturation*f);var t=brightness*(1.0-(saturation*(1.0-f)));switch(parseInt(h)){case 0:red=(brightness*255.0+0.5);green=(t*255.0+0.5);blue=(p*255.0+0.5);break;case 1:red=(q*255.0+0.5);green=(brightness*255.0+0.5);blue=(p*255.0+0.5);break;case 2:red=(p*255.0+0.5);green=(brightness*255.0+0.5);blue=(t*255.0+0.5);break;case 3:red=(p*255.0+0.5);green=(q*255.0+0.5);blue=(brightness*255.0+0.5);break;case 4:red=(t*255.0+0.5);green=(p*255.0+0.5);blue=(brightness*255.0+0.5);break;case 5:red=(brightness*255.0+0.5);green=(p*255.0+0.5);blue=(q*255.0+0.5);break;}} +return{r:parseInt(red),g:parseInt(green),b:parseInt(blue)};} +Rico.Color.RGBtoHSB=function(r,g,b){var hue;var saturation;var brightness;var cmax=(r>g)?r:g;if(b>cmax) +cmax=b;var cmin=(rBase Layer";baseLbl.style.marginTop="3px";baseLbl.style.marginLeft="3px";baseLbl.style.marginBottom="3px";this.layersDiv.appendChild(baseLbl);this.baseLayersDiv=document.createElement("div");this.baseLayersDiv.style.paddingLeft="10px";this.layersDiv.appendChild(this.baseLayersDiv);this.dataLbl=document.createElement("div");this.dataLbl.innerHTML="Overlays";this.dataLbl.style.marginTop="3px";this.dataLbl.style.marginLeft="3px";this.dataLbl.style.marginBottom="3px";this.layersDiv.appendChild(this.dataLbl);this.dataLayersDiv=document.createElement("div");this.dataLayersDiv.style.paddingLeft="10px";this.layersDiv.appendChild(this.dataLayersDiv);this.div.appendChild(this.layersDiv);Rico.Corner.round(this.div,{corners:"tl bl",bgColor:"transparent",color:this.activeColor,blend:false});Rico.Corner.changeOpacity(this.layersDiv,0.75);var imgLocation=OpenLayers.Util.getImagesLocation();var sz=new OpenLayers.Size(18,18);var img=imgLocation+'layer-switcher-maximize.png';this.maximizeDiv=OpenLayers.Util.createAlphaImageDiv("OpenLayers_Control_MaximizeDiv",null,sz,img,"absolute");this.maximizeDiv.style.top="5px";this.maximizeDiv.style.right="0px";this.maximizeDiv.style.left="";this.maximizeDiv.style.display="none";Event.observe(this.maximizeDiv,"click",this.maximizeControl.bindAsEventListener(this));this.div.appendChild(this.maximizeDiv);var img=imgLocation+'layer-switcher-minimize.png';var sz=new OpenLayers.Size(18,18);this.minimizeDiv=OpenLayers.Util.createAlphaImageDiv("OpenLayers_Control_MinimizeDiv",null,sz,img,"absolute");this.minimizeDiv.style.top="5px";this.minimizeDiv.style.right="0px";this.minimizeDiv.style.left="";this.minimizeDiv.style.display="none";Event.observe(this.minimizeDiv,"click",this.minimizeControl.bindAsEventListener(this));this.div.appendChild(this.minimizeDiv);},ignoreEvent:function(evt){Event.stop(evt);},mouseDown:function(evt){this.mouseDown=true;this.ignoreEvent(evt);},mouseUp:function(evt){if(this.mouseDown){this.mouseDown=false;this.ignoreEvent(evt);}},CLASS_NAME:"OpenLayers.Control.LayerSwitcher"});OpenLayers.Control.LayerTabs=Class.create();OpenLayers.Control.LayerTabs.ACTIVE_COLOR="darkblue";OpenLayers.Control.LayerTabs.NONACTIVE_COLOR="lightblue";OpenLayers.Control.LayerTabs.prototype=Object.extend(new OpenLayers.Control(),{activeColor:"",nonActiveColor:"",mode:"checkbox",initialize:function(options){this.activeColor=OpenLayers.Control.LayerTabs.ACTIVE_COLOR;this.nonActiveColor=OpenLayers.Control.LayerTabs.NONACTIVE_COLOR;this.backdrops=[];OpenLayers.Control.prototype.initialize.apply(this,arguments);},draw:function(){OpenLayers.Control.prototype.draw.apply(this);this.div.style.position="absolute";this.div.style.top="10px";this.div.style.right="0px";this.div.style.left="";this.div.style.fontFamily="sans-serif";this.div.style.color="white";this.div.style.fontWeight="bold";this.div.style.marginTop="3px";this.div.style.marginLeft="3px";this.div.style.marginBottom="3px";this.div.style.fontSize="smaller";this.div.style.width="10em";this.map.events.register("addlayer",this,this.redraw);this.map.events.register("removelayer",this,this.redraw);return this.redraw();},redraw:function(){this.div.innerHTML="";var visible=false;for(var i=0;i5||Math.abs(this.mouseDragStart.y-evt.xy.y)>5){var start=this.map.getLonLatFromViewPortPx(this.mouseDragStart);var end=this.map.getLonLatFromViewPortPx(evt.xy);var top=Math.max(start.lat,end.lat);var bottom=Math.min(start.lat,end.lat);var left=Math.min(start.lon,end.lon);var right=Math.max(start.lon,end.lon);var bounds=new OpenLayers.Bounds(left,bottom,right,top);var zoom=this.map.getZoomForExtent(bounds);this.map.setCenter(new OpenLayers.LonLat((start.lon+end.lon)/2,(start.lat+end.lat)/2),zoom);}else{var end=this.map.getLonLatFromViewPortPx(evt.xy);this.map.setCenter(new OpenLayers.LonLat((end.lon),(end.lat)),this.map.getZoom()+1);} +this.removeZoomBox();}},removeZoomBox:function(){this.map.viewPortDiv.removeChild(this.zoomBox);this.zoomBox=null;},onWheelEvent:function(e){var inMap=false;var elem=Event.element(e);while(elem!=null){if(this.map&&elem==this.map.div){inMap=true;break;} +elem=elem.parentNode;} +if(inMap){var delta=0;if(!e){e=window.event;} +if(e.wheelDelta){delta=e.wheelDelta/120;if(window.opera){delta=-delta;}}else if(e.detail){delta=-e.detail/3;} +if(delta){if(delta<0){this.defaultWheelDown();}else{this.defaultWheelUp();}} +Event.stop(e);}},CLASS_NAME:"OpenLayers.Control.MouseDefaults"});OpenLayers.Control.PanZoom=Class.create();OpenLayers.Control.PanZoom.X=4;OpenLayers.Control.PanZoom.Y=4;OpenLayers.Control.PanZoom.prototype=Object.extend(new OpenLayers.Control(),{slideFactor:50,buttons:null,position:null,initialize:function(){OpenLayers.Control.prototype.initialize.apply(this,arguments);this.position=new OpenLayers.Pixel(OpenLayers.Control.PanZoom.X,OpenLayers.Control.PanZoom.Y);},draw:function(px){OpenLayers.Control.prototype.draw.apply(this,arguments);px=this.position;this.buttons=new Array();var sz=new OpenLayers.Size(18,18);var centered=new OpenLayers.Pixel(px.x+sz.w/2,px.y);this._addButton("panup","north-mini.png",centered,sz);px.y=centered.y+sz.h;this._addButton("panleft","west-mini.png",px,sz);this._addButton("panright","east-mini.png",px.add(sz.w,0),sz);this._addButton("pandown","south-mini.png",centered.add(0,sz.h*2),sz);this._addButton("zoomin","zoom-plus-mini.png",centered.add(0,sz.h*3+5),sz);this._addButton("zoomworld","zoom-world-mini.png",centered.add(0,sz.h*4+5),sz);this._addButton("zoomout","zoom-minus-mini.png",centered.add(0,sz.h*5+5),sz);return this.div;},_addButton:function(id,img,xy,sz){var imgLocation=OpenLayers.Util.getImagesLocation()+img;var btn=OpenLayers.Util.createAlphaImageDiv("OpenLayers_Control_PanZoom_"+id,xy,sz,imgLocation,"absolute");this.div.appendChild(btn);btn.onmousedown=this.buttonDown.bindAsEventListener(btn);btn.ondblclick=this.doubleClick.bindAsEventListener(btn);btn.onclick=this.doubleClick.bindAsEventListener(btn);btn.action=id;btn.map=this.map;btn.slideFactor=this.slideFactor;this.buttons.push(btn);return btn;},doubleClick:function(evt){Event.stop(evt);return false;},buttonDown:function(evt){if(!Event.isLeftClick(evt))return;switch(this.action){case"panup":this.map.pan(0,-50);break;case"pandown":this.map.pan(0,50);break;case"panleft":this.map.pan(-50,0);break;case"panright":this.map.pan(50,0);break;case"zoomin":this.map.zoomIn();break;case"zoomout":this.map.zoomOut();break;case"zoomworld":this.map.zoomToMaxExtent();break;} +Event.stop(evt);},destroy:function(){OpenLayers.Control.prototype.destroy.apply(this,arguments);for(i=0;i=9500&&scale<=950000){scale=Math.round(scale/1000)+"K";}else if(scale>=950000){scale=Math.round(scale/1000000)+"M";}else{scale=Math.round(scale/100)*100;} +this.element.innerHTML="Scale = 1 : "+scale;},CLASS_NAME:"OpenLayers.Control.Scale"});OpenLayers.Feature=Class.create();OpenLayers.Feature.prototype={events:null,layer:null,id:null,lonlat:null,data:null,marker:null,popup:null,initialize:function(layer,lonlat,data){this.layer=layer;this.lonlat=lonlat;this.data=(data!=null)?data:new Object();this.id=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_");},destroy:function(){if((this.layer!=null)&&(this.layer.map!=null)){if(this.popup!=null){this.layer.map.removePopup(this.popup);}} +this.events=null;this.layer=null;this.id=null;this.lonlat=null;this.data=null;if(this.marker!=null){this.destroyMarker(this.marker);this.marker=null;} +if(this.popup!=null){this.destroyPopup(this.popup);this.popup=null;}},onScreen:function(){var onScreen=false;if((this.layer!=null)&&(this.layer.map!=null)){var screenBounds=this.layer.map.getExtent();onScreen=screenBounds.containsLonLat(this.lonlat);} +return onScreen;},createMarker:function(){var marker=null;if(this.lonlat!=null){this.marker=new OpenLayers.Marker(this.lonlat,this.data.icon);} +return this.marker;},destroyMarker:function(){this.marker.destroy();},createPopup:function(){if(this.lonlat!=null){var id=this.id+"_popup";var anchor=(this.marker)?this.marker.icon:null;this.popup=new OpenLayers.Popup.AnchoredBubble(id,this.lonlat,this.data.popupSize,this.data.popupContentHTML,anchor);} +return this.popup;},destroyPopup:function(){this.popup.destroy()},CLASS_NAME:"OpenLayers.Feature"};OpenLayers.Layer.Canvas=Class.create();OpenLayers.Layer.Canvas.prototype=Object.extend(new OpenLayers.Layer(),{isBaseLayer:false,isFixed:true,canvas:null,lines:new Array(),initialize:function(name,options){OpenLayers.Layer.prototype.initialize.apply(this,arguments);},destroy:function(){canvas=null;OpenLayers.Layer.prototype.destroy.apply(this,arguments);},moveTo:function(bounds,zoomChanged,minor){this.redraw();},setStrokeColor:function(color){var ctx=this.canvas.getContext("2d");ctx.strokeStyle=color;},setStrokeWidth:function(width){var ctx=this.canvas.getContext("2d");ctx.lineWidth=width;},setAlpha:function(alpha){var ctx=this.canvas.getContext("2d");ctx.globalAlpha=alpha;},clearCanvas:function(){if(this.canvas!=null){this.canvas.getContext("2d").clearRect(0,0,this.map.getSize().w,this.map.getSize().h);}},drawLine:function(start,end){var ctx=this.canvas.getContext("2d");this.addLine(start,end);this.lines.push(new Array(start,end,ctx.strokeStyle,ctx.lineWidth,ctx.globalAlpha));},addLine:function(start,end){var ctx=this.canvas.getContext("2d");var startpx=this.map.getPixelFromLonLat(start);var endpx=this.map.getPixelFromLonLat(end);ctx.beginPath();ctx.moveTo(startpx.x,startpx.y);ctx.lineTo(endpx.x,endpx.y);ctx.closePath();ctx.stroke();},redraw:function(){if(!this.canvas){this.canvas=document.createElement("CANVAS");this.canvas.setAttribute("width",this.map.getSize().w);this.canvas.setAttribute("height",this.map.getSize().h);this.div.appendChild(this.canvas);}else{this.clearCanvas();} +for(var i=0;i0){if(this.pane==null){this.pane=OpenLayers.Util.createDiv();}}},setMap:function(map){OpenLayers.Layer.prototype.setMap.apply(this,arguments);this.pane.style.zIndex=parseInt(this.div.style.zIndex)+1;this.pane.style.display=this.div.style.display;this.pane.style.width="100%";this.pane.style.height="100%";if(/MSIE/.test(navigator.userAgent)){this.pane.style.background="url("+OpenLayers.Util.getImagesLocation()+"blank.gif)";} +if(this.isFixed){this.map.viewPortDiv.appendChild(this.pane);}else{this.map.layerContainerDiv.appendChild(this.pane);}},setVisibility:function(visible,noEvent){OpenLayers.Layer.prototype.setVisibility.apply(this,arguments);this.pane.style.display=this.div.style.display;},CLASS_NAME:"OpenLayers.Layer.EventPane"});OpenLayers.Layer.HTTPRequest=Class.create();OpenLayers.Layer.HTTPRequest.prototype=Object.extend(new OpenLayers.Layer(),{url:null,params:null,initialize:function(name,url,params,options){var newArguments=arguments;if(arguments.length>0){newArguments=[name,options];} +OpenLayers.Layer.prototype.initialize.apply(this,newArguments);this.url=url;this.params=Object.extend(new Object(),params);},destroy:function(){this.url=null;this.params=null;OpenLayers.Layer.prototype.destroy.apply(this,arguments);},clone:function(obj){if(obj==null){obj=new OpenLayers.Layer.HTTPRequest(this.name,this.url,this.params,this.options);} +obj=OpenLayers.Layer.prototype.clone.apply(this,[obj]);return obj;},setUrl:function(newUrl){this.url=newUrl;},mergeNewParams:function(newParams){this.params=Object.extend(this.params,newParams);},getFullRequestString:function(newParams,altUrl){var url=(altUrl==null)?this.url:altUrl;var requestString=url;var allParams=Object.extend(new Object(),this.params);var allParams=Object.extend(allParams,newParams);var paramsString=OpenLayers.Util.getParameterString(allParams);if(paramsString!=""){var lastServerChar=this.url.charAt(this.url.length-1);if((lastServerChar=="&")||(lastServerChar=="?")){requestString+=paramsString;}else{if(this.url.indexOf('?')==-1){requestString+='?'+paramsString;}else{requestString+='&'+paramsString;}}} +return requestString;},CLASS_NAME:"OpenLayers.Layer.HTTPRequest"});OpenLayers.Layer.Markers=Class.create();OpenLayers.Layer.Markers.prototype=Object.extend(new OpenLayers.Layer(),{isBaseLayer:false,markers:null,initialize:function(name,options){OpenLayers.Layer.prototype.initialize.apply(this,arguments);this.markers=new Array();},destroy:function(){this.clearMarkers();markers=null;OpenLayers.Layer.prototype.destroy.apply(this,arguments);},moveTo:function(bounds,zoomChanged,minor){if(zoomChanged){this.redraw();}},addMarker:function(marker){this.markers.push(marker);if(this.map&&this.map.getExtent()){marker.map=this.map;this.drawMarker(marker);}},removeMarker:function(marker){this.markers.remove(marker);if((marker.icon!=null)&&(marker.icon.imageDiv!=null)&&(marker.icon.imageDiv.parentNode==this.div)){this.div.removeChild(marker.icon.imageDiv);}},clearMarkers:function(){if(this.markers!=null){while(this.markers.length>0){this.removeMarker(this.markers[0]);}}},redraw:function(){for(i=0;ithis.baseLayer.numZoomLevels-1){zoom=this.baseLayer.numZoomLevels-1;} +this.setCenter(center,zoom);} +if((noEvent==null)||(noEvent==false)){this.events.triggerEvent("changebaselayer");}}}},addControl:function(control,px){this.controls.push(control);this.addControlToMap(control,px);},addControlToMap:function(control,px){control.setMap(this);var div=control.draw(px);if(div){div.style.zIndex=this.Z_INDEX_BASE['Control']+ +this.controls.length;this.viewPortDiv.appendChild(div);}},addPopup:function(popup,exclusive){if(exclusive){for(var i=0;i=0)&&(zoomLevel0){this.bounds=bounds;this.div=OpenLayers.Util.createDiv();this.events=new OpenLayers.Events(this,this.div,null);this.setBorder(borderColor,borderWidth);}},setBorder:function(color,width){if(!color)color="red";if(!width)width=2;this.div.style.border=width+"px solid "+color;},draw:function(px,sz){OpenLayers.Util.modifyDOMElement(this.div,null,px,sz);return this.div;},onScreen:function(){var onScreen=false;if(this.map){var screenBounds=this.map.getExtent();onScreen=screenBounds.containsBounds(this.bounds,true,true);} +return onScreen;},display:function(display){this.div.style.display=(display)?"":"none";},CLASS_NAME:"OpenLayers.Marker.Box"});OpenLayers.Popup.Anchored=Class.create();OpenLayers.Popup.Anchored.prototype=Object.extend(new OpenLayers.Popup(),{relativePosition:null,anchor:null,initialize:function(id,lonlat,size,contentHTML,anchor){var newArguments=new Array(id,lonlat,size,contentHTML);OpenLayers.Popup.prototype.initialize.apply(this,newArguments);this.anchor=(anchor!=null)?anchor:{size:new OpenLayers.Size(0,0),offset:new OpenLayers.Pixel(0,0)};},draw:function(px){if(px==null){if((this.lonlat!=null)&&(this.map!=null)){px=this.map.getLayerPxFromLonLat(this.lonlat);}} +this.relativePosition=this.calculateRelativePosition(px);return OpenLayers.Popup.prototype.draw.apply(this,arguments);},calculateRelativePosition:function(px){var lonlat=this.map.getLonLatFromLayerPx(px);var extent=this.map.getExtent();var quadrant=extent.determineQuadrant(lonlat);return OpenLayers.Bounds.oppositeQuadrant(quadrant);},moveTo:function(px){var newPx=this.calculateNewPx(px);var newArguments=new Array(newPx);OpenLayers.Popup.prototype.moveTo.apply(this,newArguments);},setSize:function(size){OpenLayers.Popup.prototype.setSize.apply(this,arguments);if((this.lonlat)&&(this.map)){var px=this.map.getLayerPxFromLonLat(this.lonlat);this.moveTo(px);}},calculateNewPx:function(px){var newPx=px.offset(this.anchor.offset);var top=(this.relativePosition.charAt(0)=='t');newPx.y+=(top)?-this.size.h:this.anchor.size.h;var left=(this.relativePosition.charAt(1)=='l');newPx.x+=(left)?-this.size.w:this.anchor.size.w;return newPx;},CLASS_NAME:"OpenLayers.Popup.Anchored"});OpenLayers.Tile.Image=Class.create();OpenLayers.Tile.Image.prototype=Object.extend(new OpenLayers.Tile(),{imgDiv:null,initialize:function(layer,position,bounds,url,size){OpenLayers.Tile.prototype.initialize.apply(this,arguments);},destroy:function(){if((this.imgDiv!=null)&&(this.imgDiv.parentNode==this.layer.div)){this.layer.div.removeChild(this.imgDiv);} +this.imgDiv=null;OpenLayers.Tile.prototype.destroy.apply(this,arguments);},draw:function(){OpenLayers.Tile.prototype.draw.apply(this,arguments);if(this.imgDiv==null){this.initImgDiv();} +this.imgDiv.style.display="none";if(this.layer.alpha){OpenLayers.Util.modifyAlphaImageDiv(this.imgDiv,null,this.position,this.size,this.url);}else{this.imgDiv.src=this.url;OpenLayers.Util.modifyDOMElement(this.imgDiv,null,this.position,this.size);}},clear:function(){OpenLayers.Tile.prototype.clear.apply(this,arguments);if(this.imgDiv){this.imgDiv.style.display="none";}},moveTo:function(bounds,position,redraw){this.url=this.layer.getURL(bounds);OpenLayers.Tile.prototype.moveTo.apply(this,arguments);},initImgDiv:function(){if(this.layer.alpha){this.imgDiv=OpenLayers.Util.createAlphaImageDiv(null,this.position,this.size,null,"absolute",null,null,true);}else{this.imgDiv=OpenLayers.Util.createImage(null,this.position,this.size,null,"absolute",null,true);} +this.layer.div.appendChild(this.imgDiv);if(this.layer.opacity!=null){OpenLayers.Util.setOpacity(this.imgDiv,this.layer.opacity);}},CLASS_NAME:"OpenLayers.Tile.Image"});OpenLayers.Tile.WFS=Class.create();OpenLayers.Tile.WFS.prototype=Object.extend(new OpenLayers.Tile(),{features:null,urls:null,initialize:function(layer,position,bounds,urls,size){var newArguments=arguments;if(arguments.length>0){newArguments=[layer,position,bounds,null,size];} +OpenLayers.Tile.prototype.initialize.apply(this,newArguments);this.urls=urls;this.features=new Array();},destroy:function(){OpenLayers.Tile.prototype.destroy.apply(this,arguments);this.destroyAllFeatures();this.features=null;this.urls=null;},clear:function(){OpenLayers.Tile.prototype.clear.apply(this,arguments);this.destroyAllFeatures();},draw:function(){if(this.drawn){this.clear();} +OpenLayers.Tile.prototype.draw.apply(this,arguments);this.loadFeaturesForRegion(this.requestSuccess);},loadFeaturesForRegion:function(success,failure){if(this.urls!=null){for(var i=0;i0){var feature=this.features.shift();feature.destroy();}},CLASS_NAME:"OpenLayers.Tile.WFS"});OpenLayers.Control.MouseToolbar=Class.create();OpenLayers.Control.MouseToolbar.X=6;OpenLayers.Control.MouseToolbar.Y=300;OpenLayers.Control.MouseToolbar.prototype=Object.extend(new OpenLayers.Control(),Object.extend(new OpenLayers.Control.MouseDefaults(),{mode:null,buttons:null,direction:"vertical",buttonClicked:null,initialize:function(position,direction){OpenLayers.Control.prototype.initialize.apply(this,arguments);this.position=new OpenLayers.Pixel(OpenLayers.Control.MouseToolbar.X,OpenLayers.Control.MouseToolbar.Y);if(position){this.position=position;} +if(direction){this.direction=direction;} +this.measureDivs=[];},draw:function(){OpenLayers.Control.prototype.draw.apply(this,arguments);OpenLayers.Control.MouseDefaults.prototype.draw.apply(this,arguments);this.buttons=new Object();var sz=new OpenLayers.Size(28,28);var centered=this.position;this._addButton("zoombox","drag-rectangle-off.png","drag-rectangle-on.png",centered,sz,"Shift->Drag to zoom to area");centered=centered.add((this.direction=="vertical"?0:sz.w),(this.direction=="vertical"?sz.h:0));this._addButton("pan","panning-hand-off.png","panning-hand-on.png",centered,sz,"Drag the map to pan.");centered=centered.add((this.direction=="vertical"?0:sz.w),(this.direction=="vertical"?sz.h:0));this.switchModeTo("pan");return this.div;},_addButton:function(id,img,activeImg,xy,sz,title){var imgLocation=OpenLayers.Util.getImagesLocation()+img;var activeImgLocation=OpenLayers.Util.getImagesLocation()+activeImg;var btn=OpenLayers.Util.createAlphaImageDiv("OpenLayers_Control_MouseToolbar_"+id,xy,sz,imgLocation,"absolute");this.div.appendChild(btn);btn.imgLocation=imgLocation;btn.activeImgLocation=activeImgLocation;btn.events=new OpenLayers.Events(this,btn,null,true);btn.events.register("mousedown",this,this.buttonDown);btn.events.register("mouseup",this,this.buttonUp);btn.events.register("dblclick",this,Event.stop);btn.action=id;btn.title=title;btn.alt=title;btn.map=this.map;this.buttons[id]=btn;return btn;},buttonDown:function(evt){if(!Event.isLeftClick(evt))return;this.buttonClicked=evt.element.action;Event.stop(evt);},buttonUp:function(evt){if(!Event.isLeftClick(evt))return;if(this.buttonClicked!=null){if(this.buttonClicked==evt.element.action){this.switchModeTo(evt.element.action);} +Event.stop(evt);this.buttonClicked=null;}},defaultDblClick:function(evt){this.switchModeTo("pan");this.performedDrag=false;var newCenter=this.map.getLonLatFromViewPortPx(evt.xy);this.map.setCenter(newCenter,this.map.zoom+1);Event.stop(evt);return false;},defaultMouseDown:function(evt){if(!Event.isLeftClick(evt))return;this.mouseDragStart=evt.xy.clone();this.performedDrag=false;this.startViaKeyboard=false;if(evt.shiftKey&&this.mode!="zoombox"){this.switchModeTo("zoombox");this.startViaKeyboard=true;}else if(evt.altKey&&this.mode!="measure"){this.switchModeTo("measure");}else if(!this.mode){this.switchModeTo("pan");} +switch(this.mode){case"zoombox":this.map.div.style.cursor="crosshair";this.zoomBox=OpenLayers.Util.createDiv('zoomBox',this.mouseDragStart,null,null,"absolute","2px solid red");this.zoomBox.style.backgroundColor="white";this.zoomBox.style.filter="alpha(opacity=50)";this.zoomBox.style.opacity="0.50";this.zoomBox.style.fontSize="1px";this.zoomBox.style.zIndex=this.map.Z_INDEX_BASE["Popup"]-1;this.map.viewPortDiv.appendChild(this.zoomBox);this.performedDrag=true;break;case"measure":var distance="";if(this.measureStart){measureEnd=this.map.getLonLatFromViewPortPx(this.mouseDragStart);distance=OpenLayers.Util.distVincenty(this.measureStart,measureEnd);distance=Math.round(distance*100)/100;distance=distance+"km";this.measureStartBox=this.measureBox;} +this.measureStart=this.map.getLonLatFromViewPortPx(this.mouseDragStart);;this.measureBox=OpenLayers.Util.createDiv(null,this.mouseDragStart.add(-2-parseInt(this.map.layerContainerDiv.style.left),-2-parseInt(this.map.layerContainerDiv.style.top)),null,null,"absolute");this.measureBox.style.width="4px";this.measureBox.style.height="4px";this.measureBox.style.fontSize="1px";this.measureBox.style.backgroundColor="red";this.measureBox.style.zIndex=this.map.Z_INDEX_BASE["Popup"]-1;this.map.layerContainerDiv.appendChild(this.measureBox);if(distance){this.measureBoxDistance=OpenLayers.Util.createDiv(null,this.mouseDragStart.add(-2-parseInt(this.map.layerContainerDiv.style.left),2-parseInt(this.map.layerContainerDiv.style.top)),null,null,"absolute");this.measureBoxDistance.innerHTML=distance;this.measureBoxDistance.style.zIndex=this.map.Z_INDEX_BASE["Popup"]-1;this.map.layerContainerDiv.appendChild(this.measureBoxDistance);this.measureDivs.push(this.measureBoxDistance);} +this.measureBox.style.zIndex=this.map.Z_INDEX_BASE["Popup"]-1;this.map.layerContainerDiv.appendChild(this.measureBox);this.measureDivs.push(this.measureBox);break;default:this.map.div.style.cursor="move";break;} +document.onselectstart=function(){return false;} +Event.stop(evt);},switchModeTo:function(mode){if(mode!=this.mode){if(this.mode&&this.buttons[this.mode]){OpenLayers.Util.modifyAlphaImageDiv(this.buttons[this.mode],null,null,null,this.buttons[this.mode].imgLocation);} +if(this.mode=="measure"&&mode!="measure"){for(var i=0;i0&&(evt.clientY-offsets[1])0){var data=this.processXMLNode(xmlNode);newArguments=new Array(layer,data.lonlat,data)} +OpenLayers.Feature.prototype.initialize.apply(this,newArguments);if(arguments.length>0){this.createMarker();this.layer.addMarker(this.marker);}},destroy:function(){if(this.marker!=null){this.layer.removeMarker(this.marker);} +OpenLayers.Feature.prototype.destroy.apply(this,arguments);},processXMLNode:function(xmlNode){var point=xmlNode.getElementsByTagName("Point");var text=OpenLayers.Util.getXmlNodeValue(point[0].getElementsByTagName("coordinates")[0]);var floats=text.split(",");return{lonlat:new OpenLayers.LonLat(parseFloat(floats[0]),parseFloat(floats[1])),id:null};},CLASS_NAME:"OpenLayers.Feature.WFS"});OpenLayers.Layer.Boxes=Class.create();OpenLayers.Layer.Boxes.prototype=Object.extend(new OpenLayers.Layer.Markers(),{initialize:function(){OpenLayers.Layer.Markers.prototype.initialize.apply(this,arguments);},drawMarker:function(marker){var bounds=marker.bounds;var topleft=this.map.getLayerPxFromLonLat(new OpenLayers.LonLat(bounds.left,bounds.top));var botright=this.map.getLayerPxFromLonLat(new OpenLayers.LonLat(bounds.right,bounds.bottom));if(botright==null||topleft==null){marker.display(false);}else{var sz=new OpenLayers.Size(botright.x-topleft.x,botright.y-topleft.y);var markerDiv=marker.draw(topleft,sz);if(!marker.drawn){this.div.appendChild(markerDiv);marker.drawn=true;}}},CLASS_NAME:"OpenLayers.Layer.Boxes"});OpenLayers.Layer.GeoRSS=Class.create();OpenLayers.Layer.GeoRSS.prototype=Object.extend(new OpenLayers.Layer.Markers(),{location:null,features:null,selectedFeature:null,initialize:function(name,location){OpenLayers.Layer.Markers.prototype.initialize.apply(this,[name]);this.location=location;this.features=new Array();OpenLayers.loadURL(location,null,this,this.parseData);},destroy:function(){this.clearFeatures();this.features=null;OpenLayers.Layer.Markers.prototype.destroy.apply(this,arguments);},parseData:function(ajaxRequest){var doc=ajaxRequest.responseXML;if(!doc||ajaxRequest.fileType!="XML"){doc=OpenLayers.parseXMLString(ajaxRequest.responseText);} +this.name=doc.getElementsByTagName("title")[0].firstChild.nodeValue;var itemlist=doc.getElementsByTagName('item');for(var i=0;i0){var location=point[0].firstChild.nodeValue.split(" ");if(location.length!=2){var location=point[0].firstChild.nodeValue.split(",");}}else if(lat.length>0&&lon.length>0){var location=[parseFloat(lat[0].firstChild.nodeValue),parseFloat(lon[0].firstChild.nodeValue)];}else{continue;} +location=new OpenLayers.LonLat(parseFloat(location[1]),parseFloat(location[0]));var title="No title";try{title=OpenLayers.Util.getNodes(itemlist[i],"title")[0].firstChild.nodeValue;} +catch(e){alert(e);} +var description="No description";try{description=OpenLayers.Util.getNodes(itemlist[i],"description")[0].firstChild.nodeValue;} +catch(e){alert(e);} +try{var link=OpenLayers.Util.getNodes(itemlist[i],"link")[0].firstChild.nodeValue;}catch(e){} +data.icon=OpenLayers.Marker.defaultIcon();data.popupSize=new OpenLayers.Size(250,100);if((title!=null)&&(description!=null)){contentHTML="
";contentHTML+="
" +contentHTML+="
";contentHTML+="";if(link)contentHTML+="";contentHTML+=title;if(link)contentHTML+="";contentHTML+="";contentHTML+="
";contentHTML+="";contentHTML+=description;contentHTML+="";contentHTML+="
" +data['popupContentHTML']=contentHTML;} +var feature=new OpenLayers.Feature(this,location,data);this.features.push(feature);var marker=feature.createMarker();marker.events.register('click',feature,this.markerClick);this.addMarker(marker);}},markerClick:function(evt){sameMarkerClicked=(this==this.layer.selectedFeature);this.layer.selectedFeature=(!sameMarkerClicked)?this:null;for(var i=0;i0){var feature=this.features[0];this.features.remove(feature);feature.destroy();}}},CLASS_NAME:"OpenLayers.Layer.GeoRSS"});OpenLayers.Layer.Google=Class.create();OpenLayers.Layer.Google.prototype=Object.extend(new OpenLayers.Layer.EventPane(),Object.extend(new OpenLayers.Layer.FixedZoomLevels(),{isFixed:true,gmap:null,type:null,minZoomLevel:0,maxZoomLevel:16,initialize:function(name,options){OpenLayers.Layer.EventPane.prototype.initialize.apply(this,arguments);OpenLayers.Layer.FixedZoomLevels.prototype.initialize.apply(this,arguments);if(this.maxExtent==null){this.maxExtent=new OpenLayers.Bounds(-180,-90,180,90);} +this.addContainerPxFunction();this.numZoomLevels=this.maxZoomLevel-this.minZoomLevel+1;},destroy:function(){this.gmap=null;OpenLayers.Layer.EventPane.prototype.destroy.apply(this,arguments);},setMap:function(map){OpenLayers.Layer.EventPane.prototype.setMap.apply(this,arguments);this.loadGMap();},moveTo:function(bounds,zoomChanged,minor){if((this.gmap!=null)&&(!this.dragging)){var newOLCenter=this.map.getCenter();var newOLZoom=this.map.getZoom();if(newOLCenter!=null){var oldGCenter=this.gmap.getCenter();var oldOLCenter=this.getOLLonLatFromGLatLng(oldGCenter);var oldGZoom=this.gmap.getZoom();var oldOLZoom=this.getOLZoomFromGZoom(oldGZoom);if(!(newOLCenter.equals(oldOLCenter))||!(newOLZoom==oldOLZoom)){var newGCenter=this.getGLatLngFromOLLonLat(newOLCenter);var newGZoom=this.getGZoomFromOLZoom(newOLZoom);this.gmap.setCenter(newGCenter,newGZoom);if(this.type!=null){this.gmap.setMapType(this.type);this.type=null;}}}}},loadGMap:function(){try{this.gmap=new GMap2(this.div);this.gmap.disableDragging();this.moveTo();}catch(e){this.loadWarningMessage();}},onMapResize:function(){this.gmap.checkResize();},loadWarningMessage:function(){this.div.style.backgroundColor="darkblue";var html="";html+="The Google Layer was unable to load correctly.
";html+="
";html+="To get rid of this message, click on the Google Layer's " +html+="tab in the layer switcher in the upper-right corner.
";html+="
";html+="Most likely, this is because the Google Maps library";html+=" script was either not included, or does not contain the";html+=" correct API key for your site.
";html+="
";html+="Developers: For help getting this working correctly, ";html+="-this.tileSize.w*(this.buffer-1)){this.shiftColumn(true);}else if(tlViewPort.x<-this.tileSize.w*this.buffer){this.shiftColumn(false);}else if(tlViewPort.y>-this.tileSize.h*(this.buffer-1)){this.shiftRow(true);}else if(tlViewPort.y<-this.tileSize.h*this.buffer){this.shiftRow(false);}else{break;}}}}},getGridBounds:function(){var bottom=this.grid.length-1;var bottomLeftTile=this.grid[bottom][0];var right=this.grid[0].length-1;var topRightTile=this.grid[0][right];return new OpenLayers.Bounds(bottomLeftTile.bounds.left,bottomLeftTile.bounds.bottom,topRightTile.bounds.right,topRightTile.bounds.top);},_initTiles:function(){var viewSize=this.map.getSize();var bounds=this.map.getExtent();var extent=this.map.getMaxExtent();var resolution=this.map.getResolution();var tilelon=resolution*this.tileSize.w;var tilelat=resolution*this.tileSize.h;var offsetlon=bounds.left-extent.left;var tilecol=Math.floor(offsetlon/tilelon)-this.buffer;var tilecolremain=offsetlon/tilelon-tilecol;var tileoffsetx=-tilecolremain*this.tileSize.w;var tileoffsetlon=extent.left+tilecol*tilelon;var offsetlat=bounds.top-(extent.bottom+tilelat);var tilerow=Math.ceil(offsetlat/tilelat)+this.buffer;var tilerowremain=tilerow-offsetlat/tilelat;var tileoffsety=-tilerowremain*this.tileSize.h;var tileoffsetlat=extent.bottom+tilerow*tilelat;tileoffsetx=Math.round(tileoffsetx);tileoffsety=Math.round(tileoffsety);this.origin=new OpenLayers.Pixel(tileoffsetx,tileoffsety);var startX=tileoffsetx;var startLon=tileoffsetlon;var rowidx=0;do{var row=this.grid[rowidx++];if(!row){row=new Array();this.grid.push(row);} +tileoffsetlon=startLon;tileoffsetx=startX;var colidx=0;do{var tileBounds=new OpenLayers.Bounds(tileoffsetlon,tileoffsetlat,tileoffsetlon+tilelon,tileoffsetlat+tilelat);var x=tileoffsetx;x-=parseInt(this.map.layerContainerDiv.style.left);var y=tileoffsety;y-=parseInt(this.map.layerContainerDiv.style.top);var px=new OpenLayers.Pixel(x,y);var tile=row[colidx++];if(!tile){tile=this.addTile(tileBounds,px);row.push(tile);}else{tile.moveTo(tileBounds,px,false);} +tileoffsetlon+=tilelon;tileoffsetx+=this.tileSize.w;}while(tileoffsetlon<=bounds.right+tilelon*this.buffer) +tileoffsetlat-=tilelat;tileoffsety+=this.tileSize.h;}while(tileoffsetlat>=bounds.bottom-tilelat*this.buffer) +this.spiralTileLoad();},spiralTileLoad:function(){var tileQueue=new Array();var directions=["right","down","left","up"];var iRow=0;var iCell=-1;var direction=directions.indexOf("right");var directionsTried=0;while(directionsTried=0)&&(testCell=0)){tile=this.grid[testRow][testCell];} +if((tile!=null)&&(!tile.queued)){tileQueue.unshift(tile);tile.queued=true;directionsTried=0;iRow=testRow;iCell=testCell;}else{direction=(direction+1)%4;directionsTried++;}} +for(var i=0;iheight)?width/viewSize.w:height/viewSize.h;var mmZoom=Math.floor((Math.log(maxRes/degPerPixel))/Math.log(2));var mmZoom=Math.min(Math.max(mmZoom,this.minZoomLevel),this.maxZoomLevel);zoom=this.getOLZoomFromMMZoom(mmZoom);} +return zoom;},getOLZoomFromMMZoom:function(mmZoom){if(mmZoom)return mmZoom-1;return null;},getMMZoomFromOLZoom:function(olZoom){if(olZoom)return olZoom+1;return null;},getOLLonLatFromMMLatLong:function(mmLatLong){var olLonLat=null;if(mmLatLong!=null){olLonLat=new OpenLayers.LonLat(mmLatLong.lon,mmLatLong.lat);} +return olLonLat;},getMMLatLongFromOLLonLat:function(olLonLat){var mmLatLong=null;if(olLonLat!=null){mmLatLong=new MMLatLon(olLonLat.lat,olLonLat.lon);} +return mmLatLong;},getOLPixelFromPixel:function(pixel){var olPixel=null;if(pixel!=null){olPixel=new OpenLayers.Pixel(pixel.x,pixel.y);} +return olPixel;},getPixelFromOLPixel:function(olPixel){var pixel=null;if(olPixel!=null){pixel=new MMPoint(olPixel.x,olPixel.y);} +return pixel;},destroy:function(){this.multimap=null;OpenLayers.Layer.EventPane.prototype.destroy.apply(this,arguments);},CLASS_NAME:"OpenLayers.Layer.MultiMap"});OpenLayers.Layer.Text=Class.create();OpenLayers.Layer.Text.prototype=Object.extend(new OpenLayers.Layer.Markers(),{location:null,features:null,selectedFeature:null,initialize:function(name,options){OpenLayers.Layer.Markers.prototype.initialize.apply(this,arguments);this.features=new Array();if(this.location!=null){OpenLayers.loadURL(this.location,null,this,this.parseData);}},destroy:function(){this.clearFeatures();this.features=null;OpenLayers.Layer.Markers.prototype.destroy.apply(this,arguments);},parseData:function(ajaxRequest){var text=ajaxRequest.responseText;var lines=text.split('\n');var columns;for(var lcv=0;lcv<(lines.length-1);lcv++){var currLine=lines[lcv].replace(/^\s*/,'').replace(/\s*$/,'');if(currLine.charAt(0)!='#'){if(!columns){columns=currLine.split('\t');}else{var vals=currLine.split('\t');var location=new OpenLayers.LonLat(0,0);var title;var url;var icon,iconSize,iconOffset;var set=false;for(var valIndex=0;valIndex'+title+'

'+description+'

';} +var feature=new OpenLayers.Feature(this,location,data);this.features.push(feature);var marker=feature.createMarker();marker.events.register('click',feature,this.markerClick);this.addMarker(marker);}}}}},markerClick:function(evt){sameMarkerClicked=(this==this.layer.selectedFeature);this.layer.selectedFeature=(!sameMarkerClicked)?this:null;for(var i=0;i0){var feature=this.features[0];this.features.remove(feature);feature.destroy();}}},CLASS_NAME:"OpenLayers.Text"});OpenLayers.Layer.VirtualEarth=Class.create();OpenLayers.Layer.VirtualEarth.prototype=Object.extend(new OpenLayers.Layer.EventPane(),Object.extend(new OpenLayers.Layer.FixedZoomLevels(),{vemap:null,minZoomLevel:1,maxZoomLevel:17,initialize:function(name){OpenLayers.Layer.EventPane.prototype.initialize.apply(this,arguments);OpenLayers.Layer.FixedZoomLevels.prototype.initialize.apply(this,arguments);this.numZoomLevels=this.maxZoomLevel-this.minZoomLevel+1;},setMap:function(map){OpenLayers.Layer.EventPane.prototype.setMap.apply(this,arguments);this.loadVEMap();},moveTo:function(bounds,zoomChanged,minor){if(this.vemap!=null){var olCenter=this.map.getCenter();var veCenter=this.getVELatLongFromOLLonLat(olCenter);if(zoomChanged){var olZoom=this.map.getZoom();var veZoom=this.getVEZoomFromOLZoom(olZoom);this.vemap.SetCenterAndZoom(veCenter,veZoom);}else{this.vemap.PanToLatLong(veCenter);}}},loadVEMap:function(){var veDiv=OpenLayers.Util.createDiv(this.name);var sz=this.map.getSize();veDiv.style.width=sz.w;veDiv.style.height=sz.h;this.div.appendChild(veDiv);try{this.vemap=new VEMap(this.name);}catch(e){} +if(this.vemap==null){this.loadWarningMessage();}else{try{this.vemap.LoadMap();}catch(e){} +this.vemap.HideDashboard();}},loadWarningMessage:function(){this.div.style.backgroundColor="darkblue";var html="";html+="The VE Layer was unable to load correctly.
";html+="
";html+="To get rid of this message, click on the VE Layer's " +html+="tab in the layer switcher in the upper-right corner.
";html+="
";html+="Most likely, this is because the VE library";html+=" script was either not correctly included.
";html+="
";html+="Developers: For help getting this working correctly, ";html+="
height)?width/viewSize.w:height/viewSize.h;var veZoom=Math.floor((Math.log(maxRes/degPerPixel))/Math.log(2));var veZoom=Math.min(Math.max(veZoom,this.minZoomLevel),this.maxZoomLevel);zoom=this.getOLZoomFromVEZoom(veZoom);} +return zoom;},getOLZoomFromVEZoom:function(veZoom){var zoom=null;if(veZoom!=null){zoom=veZoom-this.minZoomLevel;} +return zoom;},getVEZoomFromOLZoom:function(olZoom){var zoom=null;if(olZoom!=null){zoom=olZoom+this.minZoomLevel;} +return zoom;},getOLLonLatFromVELatLong:function(veLatLong){var olLonLat=null;if(veLatLong!=null){olLonLat=new OpenLayers.LonLat(veLatLong.Longitude,veLatLong.Latitude);} +return olLonLat;},getVELatLongFromOLLonLat:function(olLonLat){var veLatLong=null;if(olLonLat!=null){veLatLong=new VELatLong(olLonLat.lat,olLonLat.lon);} +return veLatLong;},getOLPixelFromPixel:function(pixel){var olPixel=null;if(pixel!=null){olPixel=new OpenLayers.Pixel(pixel.x,pixel.y);} +return olPixel;},getPixelFromOLPixel:function(olPixel){var pixel=null;if(olPixel!=null){pixel=new Msn.VE.Pixel(olPixel.x,olPixel.y);} +return pixel;},CLASS_NAME:"OpenLayers.Layer.VirtualEarth"}));OpenLayers.Popup.AnchoredBubble=Class.create();OpenLayers.Popup.AnchoredBubble.CORNER_SIZE=5;OpenLayers.Popup.AnchoredBubble.prototype=Object.extend(new OpenLayers.Popup.Anchored(),{contentDiv:null,initialize:function(id,lonlat,size,contentHTML,anchor){OpenLayers.Popup.Anchored.prototype.initialize.apply(this,arguments);},draw:function(px){OpenLayers.Popup.Anchored.prototype.draw.apply(this,arguments);var contentSize=this.size.clone();contentSize.h-=(2*OpenLayers.Popup.AnchoredBubble.CORNER_SIZE);var id=this.div.id+"_contentDiv";this.contentDiv=OpenLayers.Util.createDiv(id,null,contentSize,null,"relative",null,"hidden");this.div.appendChild(this.contentDiv);this.setContentHTML();this.setRicoCorners(true);this.setBackgroundColor();this.setOpacity();return this.div;},setSize:function(size){OpenLayers.Popup.Anchored.prototype.setSize.apply(this,arguments);if(this.contentDiv!=null){var contentSize=this.size.clone();contentSize.h-=(2*OpenLayers.Popup.AnchoredBubble.CORNER_SIZE);this.contentDiv.style.height=contentSize.h+"px";this.setRicoCorners(false);}},setBackgroundColor:function(color){if(color!=undefined){this.backgroundColor=color;} +if(this.div!=null){if(this.contentDiv!=null){this.div.style.background="transparent";Rico.Corner.changeColor(this.contentDiv,this.backgroundColor);}}},setOpacity:function(opacity){if(opacity!=undefined){this.opacity=opacity;} +if(this.div!=null){if(this.contentDiv!=null){Rico.Corner.changeOpacity(this.contentDiv,this.opacity);}}},setBorder:function(border){this.border=0;},setContentHTML:function(contentHTML){if(contentHTML!=null){this.contentHTML=contentHTML;} +if(this.contentDiv!=null){this.contentDiv.innerHTML=this.contentHTML;}},setRicoCorners:function(firstTime){var corners=this.getCornersToRound(this.relativePosition);var options={corners:corners,color:this.backgroundColor,bgColor:"transparent",blend:false};if(firstTime){Rico.Corner.round(this.div,options);}else{Rico.Corner.reRound(this.contentDiv,options);this.setBackgroundColor();this.setOpacity();}},getCornersToRound:function(){var corners=['tl','tr','bl','br'];var corner=OpenLayers.Bounds.oppositeQuadrant(this.relativePosition);corners.remove(corner);return corners.join(" ");},CLASS_NAME:"OpenLayers.Popup.AnchoredBubble"});OpenLayers.Layer.KaMap=Class.create();OpenLayers.Layer.KaMap.prototype=Object.extend(new OpenLayers.Layer.Grid(),{isBaseLayer:true,units:null,resolution:OpenLayers.DOTS_PER_INCH,DEFAULT_PARAMS:{i:'jpeg',map:''},initialize:function(name,url,params,options){var newArguments=new Array();newArguments.push(name,url,params,options);OpenLayers.Layer.Grid.prototype.initialize.apply(this,newArguments);this.params=(params?params:{});if(arguments.length>0&¶ms){OpenLayers.Util.applyDefaults(this.params,this.DEFAULT_PARAMS);}},getURL:function(bounds){var mapRes=this.map.getResolution();var scale=Math.round((this.map.getScale()*10000))/10000;var cellSize=new OpenLayers.Size(mapRes*this.tileSize.w,mapRes*this.tileSize.h);var pX=Math.round(((bounds.left)/cellSize.w)*this.tileSize.w);var pY=-Math.round(((bounds.top)/cellSize.h)*this.tileSize.h);return this.getFullRequestString({t:pY,l:pX,s:scale});},addTile:function(bounds,position){var url=this.getURL(bounds);return new OpenLayers.Tile.Image(this,position,bounds,url,this.tileSize);},_initTiles:function(){var viewSize=this.map.getSize();var bounds=this.map.getExtent();var extent=this.map.getMaxExtent();var resolution=this.map.getResolution();var tilelon=resolution*this.tileSize.w;var tilelat=resolution*this.tileSize.h;var offsetlon=bounds.left;var tilecol=Math.floor(offsetlon/tilelon);var tilecolremain=offsetlon/tilelon-tilecol;var tileoffsetx=-tilecolremain*this.tileSize.w;var tileoffsetlon=tilecol*tilelon;var offsetlat=bounds.top;var tilerow=Math.ceil(offsetlat/tilelat);var tilerowremain=tilerow-offsetlat/tilelat;var tileoffsety=-(tilerowremain+1)*this.tileSize.h;var tileoffsetlat=tilerow*tilelat;tileoffsetx=Math.round(tileoffsetx);tileoffsety=Math.round(tileoffsety);this.origin=new OpenLayers.Pixel(tileoffsetx,tileoffsety);var startX=tileoffsetx;var startLon=tileoffsetlon;var rowidx=0;do{var row;row=this.grid[rowidx++];if(!row){row=new Array();this.grid.push(row);} +tileoffsetlon=startLon;tileoffsetx=startX;var colidx=0;do{var tileBounds=new OpenLayers.Bounds(tileoffsetlon,tileoffsetlat,tileoffsetlon+tilelon,tileoffsetlat+tilelat);var x=tileoffsetx;x-=parseInt(this.map.layerContainerDiv.style.left);var y=tileoffsety;y-=parseInt(this.map.layerContainerDiv.style.top);var px=new OpenLayers.Pixel(x,y);var tile;tile=row[colidx++];if(!tile){tile=this.addTile(tileBounds,px);row.push(tile);}else{tile.moveTo(tileBounds,px,false);} +tileoffsetlon+=tilelon;tileoffsetx+=this.tileSize.w;}while(tileoffsetlon<=bounds.right+tilelon*this.buffer) +tileoffsetlat-=tilelat;tileoffsety+=this.tileSize.h;}while(tileoffsetlat>=bounds.bottom-tilelat*this.buffer) +this.spiralTileLoad();},CLASS_NAME:"OpenLayers.Layer.KaMap"});OpenLayers.Layer.LikeGoogle=Class.create();OpenLayers.Layer.LikeGoogle.prototype=Object.extend(new OpenLayers.Layer.Grid,{reproject:false,isBaseLayer:true,initialize:function(name,url,options){var newArguments=new Array();newArguments.push(name,url,{},options);OpenLayers.Layer.Grid.prototype.initialize.apply(this,newArguments);},destroy:function(){OpenLayers.Layer.Grid.prototype.destroy.apply(this,arguments);},clone:function(obj){if(obj==null){obj=new OpenLayers.Layer.LikeGoogle(this.name,this.url,this.options);} +obj=OpenLayers.Layer.Grid.prototype.clone.apply(this,[obj]);return obj;},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();return this.url+z+"/"+x+"/"+y+"."+this.type;},addTile:function(bounds,position){url=this.getURL(bounds);return new OpenLayers.Tile.Image(this,position,bounds,url,this.tileSize);},CLASS_NAME:"OpenLayers.Layer.LikeGoogle"});OpenLayers.Layer.WFS=Class.create();OpenLayers.Layer.WFS.prototype=Object.extend(new OpenLayers.Layer.Grid(),Object.extend(new OpenLayers.Layer.Markers(),{isBaseLayer:false,buffer:1,featureClass:OpenLayers.Feature.WFS,tileClass:OpenLayers.Tile.WFS,DEFAULT_PARAMS:{service:"WFS",version:"1.0.0",request:"GetFeature",typename:"docpoint"},initialize:function(name,url,params,options){var newArguments=new Array();if(arguments.length>0){params=OpenLayers.Util.upperCaseObject(params);newArguments.push(name,url,params,options);} +OpenLayers.Layer.Grid.prototype.initialize.apply(this,newArguments);var newArguments=new Array();if(arguments.length>0){newArguments.push(name,options);} +OpenLayers.Layer.Markers.prototype.initialize.apply(this,newArguments);if(arguments.length>0){OpenLayers.Util.applyDefaults(this.params,OpenLayers.Util.upperCaseObject(this.DEFAULT_PARAMS));}},destroy:function(){OpenLayers.Layer.Grid.prototype.destroy.apply(this,arguments);OpenLayers.Layer.Markers.prototype.destroy.apply(this,arguments);},setMap:function(map){OpenLayers.Layer.Grid.prototype.setMap.apply(this,arguments);OpenLayers.Layer.Markers.prototype.setMap.apply(this,arguments);},moveTo:function(bounds,zoomChanged,minor){OpenLayers.Layer.Grid.prototype.moveTo.apply(this,arguments);OpenLayers.Layer.Markers.prototype.moveTo.apply(this,arguments);},clone:function(obj){if(obj==null){obj=new OpenLayers.Layer.WFS(this.name,this.url,this.params,this.options);} +obj=OpenLayers.Layer.Grid.prototype.clone.apply(this,[obj]);return obj;},addTile:function(bounds,position){var urls=new Array();urls.push(this.getFullRequestString());if(this.urls!=null){for(var i=0;i0){params=OpenLayers.Util.upperCaseObject(params);newArguments.push(name,url,params,options);} +OpenLayers.Layer.Grid.prototype.initialize.apply(this,newArguments);if(arguments.length>0){OpenLayers.Util.applyDefaults(this.params,OpenLayers.Util.upperCaseObject(this.DEFAULT_PARAMS));} +if((options==null)||!(options.isBaseLayer)){this.isBaseLayer=((this.params.TRANSPARENT!="true")&&(this.params.TRANSPARENT!=true));}},destroy:function(){OpenLayers.Layer.Grid.prototype.destroy.apply(this,arguments);},clone:function(obj){if(obj==null){obj=new OpenLayers.Layer.WMS(this.name,this.url,this.params,this.options);} +obj=OpenLayers.Layer.Grid.prototype.clone.apply(this,[obj]);return obj;},getURL:function(bounds){return this.getFullRequestString({BBOX:bounds.toBBOX(),WIDTH:this.tileSize.w,HEIGHT:this.tileSize.h});},addTile:function(bounds,position){url=this.getURL(bounds);return new OpenLayers.Tile.Image(this,position,bounds,url,this.tileSize);},mergeNewParams:function(newParams){var upperParams=OpenLayers.Util.upperCaseObject(newParams);var newArguments=[upperParams];OpenLayers.Layer.Grid.prototype.mergeNewParams.apply(this,newArguments);if(this.map!=null){this._initTiles();}},getFullRequestString:function(newParams){var projection=this.map.getProjection();this.params.SRS=(projection=="none")?null:projection;return OpenLayers.Layer.Grid.prototype.getFullRequestString.apply(this,arguments);},CLASS_NAME:"OpenLayers.Layer.WMS"});OpenLayers.Layer.WorldWind=Class.create();OpenLayers.Layer.WorldWind.prototype=Object.extend(new OpenLayers.Layer.Grid(),{DEFAULT_PARAMS:{},isBaseLayer:true,lzd:null,zoomLevels:null,initialize:function(name,url,lzd,zoomLevels,params,options){this.lzd=lzd;this.zoomLevels=zoomLevels;var newArguments=new Array();newArguments.push(name,url,params,options);OpenLayers.Layer.Grid.prototype.initialize.apply(this,newArguments);this.params=(params?params:{});if(arguments.length>0&¶ms){OpenLayers.Util.applyDefaults(this.params,this.DEFAULT_PARAMS);}},addTile:function(bounds,position){if(this.map.getResolution()<=(this.lzd/512)&&this.getZoom()<=this.zoomLevels){return new OpenLayers.Tile.Image(this,position,bounds,url,this.tileSize);}else{return new OpenLayers.Tile.Image(this,position,bounds,OpenLayers.Util.getImagesLocation()+"blank.gif",this.tileSize);}},getZoom:function(){var zoom=this.map.getZoom();var extent=this.map.getMaxExtent();zoom=zoom-Math.log(this.maxResolution/(this.lzd/512))/Math.log(2);return zoom;},getURL:function(bounds){var zoom=this.getZoom();var extent=this.map.getMaxExtent();var deg=this.lzd/Math.pow(2,this.getZoom());var x=Math.floor((bounds.left-extent.left)/deg);var y=Math.floor((bounds.bottom-extent.bottom)/deg);if(this.map.getResolution()<=(this.lzd/512)&&this.getZoom()<=this.zoomLevels){return this.getFullRequestString({L:zoom,X:x,Y:y});}else{return OpenLayers.Util.getImagesLocation()+"blank.gif";}},CLASS_NAME:"OpenLayers.Layer.WorldWind"});OpenLayers.Layer.WMS.Untiled=Class.create();OpenLayers.Layer.WMS.Untiled.prototype=Object.extend(new OpenLayers.Layer.HTTPRequest(),{DEFAULT_PARAMS:{service:"WMS",version:"1.1.1",request:"GetMap",styles:"",exceptions:"application/vnd.ogc.se_inimage",format:"image/jpeg"},imgDiv:null,initialize:function(name,url,params,options){var newArguments=new Array();if(arguments.length>0){params=OpenLayers.Util.upperCaseObject(params);newArguments.push(name,url,params,options);} +OpenLayers.Layer.HTTPRequest.prototype.initialize.apply(this,newArguments);if(arguments.length>0){OpenLayers.Util.applyDefaults(this.params,OpenLayers.Util.upperCaseObject(this.DEFAULT_PARAMS));} +if((options==null)||(options.isBaseLayer==null)){this.isBaseLayer=((this.params.TRANSPARENT!="true")&&(this.params.TRANSPARENT!=true));}},destroy:function(){this.imgDiv=null;OpenLayers.Layer.HTTPRequest.prototype.destroy.apply(this,arguments);},clone:function(obj){if(obj==null){obj=new OpenLayers.Layer.WMS.Untiled(this.name,this.url,this.params,this.options);} +obj=OpenLayers.Layer.HTTPRequest.prototype.clone.apply(this,[obj]);return obj;},setMap:function(map){OpenLayers.Layer.HTTPRequest.prototype.setMap.apply(this,arguments);this.loadImageDiv();},moveTo:function(bounds,zoomChanged,minor){if(!minor){if(bounds==null){bounds=this.map.getExtent();} +var size=this.map.getSize().clone();var url=this.getFullRequestString({BBOX:bounds.toBBOX(),WIDTH:size.w,HEIGHT:size.h});var tl=new OpenLayers.Pixel(0,0);var pos=this.map.getLayerPxFromViewPortPx(tl);Element.hide(this.imgDiv);var img=this.imgDiv;if(this.params.TRANSPARENT=='true'){OpenLayers.Util.modifyAlphaImageDiv(this.imgDiv,null,pos,size,url);img=this.imgDiv.childNodes[0];}else{OpenLayers.Util.modifyDOMElement(this.imgDiv,null,pos,size);this.imgDiv.src=url;} +Event.observe(img,"load",this.showDiv.bindAsEventListener(this));}},showDiv:function(){Element.show(this.imgDiv);},setUrl:function(newUrl){OpenLayers.Layer.HTTPRequest.prototype.setUrl.apply(this,arguments);this.moveTo();},mergeNewParams:function(newParams){var upperParams=OpenLayers.Util.upperCaseObject(newParams);var newArguments=[upperParams];OpenLayers.Layer.HTTPRequest.prototype.mergeNewParams.apply(this,newArguments);this.moveTo();},getFullRequestString:function(newParams){var projection=this.map.getProjection();this.params.SRS=(projection=="none")?null:projection;return OpenLayers.Layer.Grid.prototype.getFullRequestString.apply(this,arguments);},loadImageDiv:function(){var size=this.map.getSize().clone();var bounds=this.map.getExtent();var url="";if(bounds!=null){url=this.getFullRequestString({BBOX:bounds.toBBOX(),WIDTH:size.w,HEIGHT:size.h});} +this.div.innerHTML="";var tl=new OpenLayers.Pixel(0,0);var pos=this.map.getLayerPxFromViewPortPx(tl);if(this.params.TRANSPARENT=='true'){this.imgDiv=OpenLayers.Util.createAlphaImageDiv(null,pos,size,url,"absolute");}else{this.imgDiv=OpenLayers.Util.createImage(null,pos,size,url,"absolute");} +this.div.appendChild(this.imgDiv);},CLASS_NAME:"OpenLayers.Layer.WMS.Untiled"}); \ No newline at end of file diff --git a/public/javascripts/img/404.png b/public/javascripts/img/404.png new file mode 100644 index 000000000..b5ecdf092 Binary files /dev/null and b/public/javascripts/img/404.png differ diff --git a/public/javascripts/img/drag-rectangle-off.png b/public/javascripts/img/drag-rectangle-off.png new file mode 100644 index 000000000..fc6daf4dc Binary files /dev/null and b/public/javascripts/img/drag-rectangle-off.png differ diff --git a/public/javascripts/img/drag-rectangle-on.png b/public/javascripts/img/drag-rectangle-on.png new file mode 100644 index 000000000..7f783ce13 Binary files /dev/null and b/public/javascripts/img/drag-rectangle-on.png differ diff --git a/public/javascripts/img/east-mini.png b/public/javascripts/img/east-mini.png new file mode 100644 index 000000000..0707567a7 Binary files /dev/null and b/public/javascripts/img/east-mini.png differ diff --git a/public/javascripts/img/layer-switcher-maximize.png b/public/javascripts/img/layer-switcher-maximize.png new file mode 100644 index 000000000..8d7bb167b Binary files /dev/null and b/public/javascripts/img/layer-switcher-maximize.png differ diff --git a/public/javascripts/img/layer-switcher-minimize.png b/public/javascripts/img/layer-switcher-minimize.png new file mode 100644 index 000000000..e80bf213f Binary files /dev/null and b/public/javascripts/img/layer-switcher-minimize.png differ diff --git a/public/javascripts/img/marker.png b/public/javascripts/img/marker.png new file mode 100644 index 000000000..ccd191367 Binary files /dev/null and b/public/javascripts/img/marker.png differ diff --git a/public/javascripts/img/measuring-stick-off.png b/public/javascripts/img/measuring-stick-off.png new file mode 100644 index 000000000..70c2dffb1 Binary files /dev/null and b/public/javascripts/img/measuring-stick-off.png differ diff --git a/public/javascripts/img/measuring-stick-on.png b/public/javascripts/img/measuring-stick-on.png new file mode 100644 index 000000000..cdb8f345b Binary files /dev/null and b/public/javascripts/img/measuring-stick-on.png differ diff --git a/public/javascripts/img/north-mini.png b/public/javascripts/img/north-mini.png new file mode 100644 index 000000000..a8a0b4033 Binary files /dev/null and b/public/javascripts/img/north-mini.png differ diff --git a/public/javascripts/img/panning-hand-off.png b/public/javascripts/img/panning-hand-off.png new file mode 100644 index 000000000..4c912aca6 Binary files /dev/null and b/public/javascripts/img/panning-hand-off.png differ diff --git a/public/javascripts/img/panning-hand-on.png b/public/javascripts/img/panning-hand-on.png new file mode 100644 index 000000000..6094c64e7 Binary files /dev/null and b/public/javascripts/img/panning-hand-on.png differ diff --git a/public/javascripts/img/slider.png b/public/javascripts/img/slider.png new file mode 100644 index 000000000..23afd573b Binary files /dev/null and b/public/javascripts/img/slider.png differ diff --git a/public/javascripts/img/south-mini.png b/public/javascripts/img/south-mini.png new file mode 100644 index 000000000..6c4ac8a0f Binary files /dev/null and b/public/javascripts/img/south-mini.png differ diff --git a/public/javascripts/img/west-mini.png b/public/javascripts/img/west-mini.png new file mode 100644 index 000000000..db5f420ca Binary files /dev/null and b/public/javascripts/img/west-mini.png differ diff --git a/public/javascripts/img/zoom-minus-mini.png b/public/javascripts/img/zoom-minus-mini.png new file mode 100644 index 000000000..f9b63aba0 Binary files /dev/null and b/public/javascripts/img/zoom-minus-mini.png differ diff --git a/public/javascripts/img/zoom-plus-mini.png b/public/javascripts/img/zoom-plus-mini.png new file mode 100644 index 000000000..eecf2eb4b Binary files /dev/null and b/public/javascripts/img/zoom-plus-mini.png differ diff --git a/public/javascripts/img/zoom-world-mini.png b/public/javascripts/img/zoom-world-mini.png new file mode 100644 index 000000000..2159dde7b Binary files /dev/null and b/public/javascripts/img/zoom-world-mini.png differ diff --git a/public/javascripts/img/zoombar.png b/public/javascripts/img/zoombar.png new file mode 100644 index 000000000..959f01a93 Binary files /dev/null and b/public/javascripts/img/zoombar.png differ