if(typeof (ravegeo)=="undefined"){
ravegeo={};
}
if(typeof (ravegeo.internal)=="undefined"){
ravegeo.internal={};
}
if(typeof (ravegeo.io)=="undefined"){
ravegeo.io={};
}
if(typeof (ravegeo.tools)=="undefined"){
ravegeo.tools={};
}
if(typeof (ravegeo.tools.internal)=="undefined"){
ravegeo.tools.internal={};
}
ravegeo.internal.Point=(function(){
var _1=function(x,y){
this.getX=function(){
return x;
};
this.getY=function(){
return y;
};
};
_1.prototype.add=function(_4){
var x=this.getX()+_4.getX();
var y=this.getY()+_4.getY();
return new _1(x,y);
};
_1.prototype.subtract=function(_7){
var x=this.getX()-_7.getX();
var y=this.getY()-_7.getY();
return new _1(x,y);
};
_1.prototype.scalarMultiply=function(k){
return new _1(this.getX()*k,this.getY()*k);
};
_1.prototype.round=function(k){
return new _1(Math.round(this.getX()),Math.round(this.getY()));
};
_1.prototype.toString=function(){
return "{x: "+this.getX()+", y: "+this.getY()+"}";
};
_1.prototype.equals=function(_c){
return this.getX()==_c.getX()&&this.getY()==_c.getY();
};
_1.ZERO=new _1(0,0);
return _1;
})();
ravegeo.internal.Environment=(function(){
var _d={};
_d.isIE=(!window.opera&&navigator.userAgent.indexOf("MSIE")!=-1);
_d.isSafari=(navigator.vendor&&navigator.vendor.indexOf("Apple")!=-1);
_d.isFirefox=(navigator.userAgent.indexOf("Firefox")!=-1);
_d.isChrome=(navigator.userAgent.indexOf("Chrome")!=-1);
_d.isLinux=(navigator.userAgent.indexOf("Linux")!=-1);
_d.isWin=(navigator.userAgent.indexOf("Win")!=-1);
_d.isMac=(navigator.userAgent.indexOf("Mac")!=-1);
_d.isJavaEnabled=function(){
if(navigator.userAgent.toLowerCase().match("netscape")){
return true;
}else{
return navigator.javaEnabled();
}
};
_d.isJavaWellSupported=function(){
if(_d.isJavaEnabled()){
if(_d.isMac&&_d.isChrome){
return false;
}
return true;
}
return false;
};
return _d;
})();
ravegeo.internal.Utilities=(function(){
var _e=ravegeo.internal.Point;
var _f={};
_f.addEvent=function(obj,_11,fn,_13){
if(obj.addEventListener){
if(_11=="mousewheel"){
obj.addEventListener("DOMMouseScroll",fn,_13);
}
obj.addEventListener(_11,fn,_13);
}else{
if(obj.attachEvent){
obj.attachEvent("on"+_11,fn);
}else{
obj["on"+_11]=fn;
}
}
};
_f.stopEvent=function(e){
if(e&&e.stopPropagation&&e.preventDefault){
e.stopPropagation();
e.preventDefault();
}else{
if(window.event){
window.event.cancelBubble=true;
window.event.returnValue=false;
}
}
};
_f.getTarget=function(e){
var _16;
if(!e){
e=window.event;
}
if(e.target){
_16=e.target;
}else{
if(e.srcElement){
_16=e.srcElement;
}
}
if(_16.nodeType==3||_16.nodeType==4){
_16=_16.parentNode;
}
return _16;
};
_f.leftButton=function(e){
if(!e){
e=window.event;
}
if(typeof (e.which)!="undefined"){
return e.which==0||e.which==1;
}else{
if(typeof (e.button)!="undefined"){
return e.button==0||e.button==1;
}
}
};
_f.setStyle=function(_18,_19){
if(typeof (_18.style.cssText)!="undefined"){
_18.style.cssText=_19;
}else{
_18.setAttribute("style",_19);
}
};
_f.setClassName=function(_1a,_1b){
_1a.className=_1b;
};
ravegeo.internal.Environment.isIE=(!window.opera&&navigator.userAgent.indexOf("MSIE")!=-1);
ravegeo.internal.Environment.isSafari=(navigator.vendor&&navigator.vendor.indexOf("Apple")!=-1);
_f.isImageLoaded=function(_1c){
if(typeof (_1c.complete)=="undefined"){
var _1d=new Image();
_1d.src=_1c.src;
return _1d.complete;
}
return _1c.complete;
};
if(_f.isSafari){
_f.onImageLoaded=function(_1e,_1f){
_1e.onload=function(){
_1f.apply(_1e);
};
};
}else{
_f.onImageLoaded=function(_20,_21){
_20.onload=_21;
};
}
_f.getMouseCoordsOnFixed=function(e){
if(e.changedTouches){
var _23=e.changedTouches[0];
return new _e(_23.clientX,_23.clientY);
}else{
return new _e(e.clientX,e.clientY);
}
};
_f.getMouseCoords=function(e,_25){
if(e.pageX){
return new _e(e.pageX,e.pageY);
}else{
if(e.changedTouches){
var _26=e.changedTouches[0];
return new _e(_26.clientX,_26.clientY);
}else{
if(e.clientX){
var _27=e.clientX;
var _28=e.clientY;
if(ravegeo.internal.Environment.isIE){
if(document.documentElement&&document.documentElement.scrollLeft){
_27+=document.documentElement.scrollLeft;
}else{
if(document.body&&document.body.scrollLeft){
_27+=document.body.scrollLeft;
}
}
if(document.documentElement&&document.documentElement.scrollTop){
_28+=document.documentElement.scrollTop;
}else{
if(document.body&&document.body.scrollTop){
_28+=document.body.scrollTop;
}
}
}
return new _e(_27,_28);
}else{
return _e.ZERO;
}
}
}
};
_f.topLeft=function(obj){
var _2a=0;
var _2b=0;
if(obj.offsetParent){
do{
_2a+=obj.offsetTop;
_2b+=obj.offsetLeft;
obj=obj.offsetParent;
}while(obj);
}else{
if(obj.y){
_2b+=obj.x;
_2a+=obj.y;
}
}
return new _e(_2b,_2a);
};
_f.getOpacity=function(_2c){
if(_2c.length==9){
return parseInt(_2c.substring(1,3),16)/255;
}
return 1;
};
_f.getColor=function(_2d){
if(_2d.length==9){
return "#"+_2d.substring(3);
}
return _2d;
};
_f.fixStyle=function(_2e){
if(_2e.fillColor){
_2e.fillOpacity=_f.getOpacity(_2e.fillColor);
_2e.fillColor=_f.getColor(_2e.fillColor);
}
if(_2e.strokeColor){
_2e.strokeOpacity=_f.getOpacity(_2e.strokeColor);
_2e.strokeColor=_f.getColor(_2e.strokeColor);
}
return _2e;
};
_f.setOpacity=function(el,_30){
if(_30<1&&_30>=0){
el.style.opacity=""+_30;
el.style.filter="alpha(opacity="+Math.round(_30*100)+")";
}
};
_f.removeChildren=function(_31,_32){
while(_31.childNodes.length>1){
var _33=_31.childNodes[0];
if(_33===_32){
_33=_31.childNodes[1];
}
_31.removeChild(_33);
}
if(_31.childNodes.length>0&&!_32){
_31.removeChild(_31.childNodes[0]);
}
};
_f.stringIsEmpty=function(s){
if(s){
return s.length==0;
}
return true;
};
_f.ensureString=function(_35,_36){
if(typeof (_35)!="string"){
throw new Error("Parameter \""+_36+"\" must be a string.");
}
};
_f.getFloat=function(_37,_38){
if(!_f.isValue(_37)){
_37=_38;
}
if(typeof (_37)!="number"){
_37=parseFloat(_37);
}
if(isNaN(_37)){
throw Error("Not a number!");
}
return _37;
};
_f.getInteger=function(_39,_3a){
if(!_f.isValue(_39)){
_39=_3a;
}
if(typeof (_39)=="number"){
_39=Math.round(_39);
}else{
_39=parseInt(_39);
}
if(isNaN(_39)){
throw Error("Not a number!");
}
return _39;
};
_f.getFloatArray=function(_3b){
for(var idx in _3b){
_3b[idx]=_f.getFloat(_3b[idx]);
}
return _3b.slice();
};
_f.getFloatValuesObject=function(obj){
var _3e={};
for(var idx in obj){
_3e[idx]=_f.getFloat(obj[idx]);
}
return _3e;
};
_f.getFloatPoint=function(_40){
return {x:_f.getFloat(_40.x),y:_f.getFloat(_40.y)};
};
_f.getIntegerPoint=function(_41){
return {x:_f.getInteger(_41.x),y:_f.getInteger(_41.y)};
};
_f.objectToArray=function(_42){
var _43=[];
for(var idx in _42){
_43[_43.length]=_42[idx];
}
return _43;
};
_f.getBoolean=function(_45,_46){
if(!_f.isValue(_45)){
_45=_46;
}
if(typeof (_45)=="string"){
_45=_45=="true"?true:false;
}
if(typeof (_45)!="boolean"){
throw Error("Boolean value expected!");
}
return _45;
};
_f.getValueOrUndefined=function(_47,_48){
if(!_f.isValue(_47)||_47==""){
return undefined;
}else{
return _48(_47);
}
};
_f.setMissingObjectFields=function(_49,_4a,_4b,_4c,_4d){
var _4e=_f.isValue(_49);
for(var i=0;i<_4b.length;i++){
if(!_f.isValue(_4a[_4c[i]])){
_4a[_4c[i]]=(_4e&&_f.isValue(_49[_4b[i]]))?_49[_4b[i]]:_4d[i];
}
}
};
_f.isValue=function(_50){
return (typeof (_50)!="undefined"&&_50!=null);
};
return _f;
})();
ravegeo.internal.Canvas=(function(){
var _51="http://www.w3.org/TR/SVG11/feature#SVG";
var _52=(document.implementation&&(document.implementation.hasFeature("org.w3c.svg","1.0")||document.implementation.hasFeature(_51,"1.1")||document.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#Shape","1.0")));
function SVGCanvas(_53,_54){
this._element=document.createElementNS(SVGCanvas.xmlns,"svg");
this._element.setAttributeNS(null,"width",_53);
this._element.setAttributeNS(null,"height",_54);
this._style={strokeColor:"#000000"};
}
SVGCanvas.xmlns="http://www.w3.org/2000/svg";
SVGCanvas.buildStyleString=function(_55){
var _56="fill:"+(_55.fillColor||"none")+"; stroke-linecap: round; stroke-linejoin: round;";
if(typeof (_55.fillOpacity)!="undefined"){
_56+="fill-opacity:"+_55.fillOpacity+";";
}
_56+="stroke:"+(_55.strokeColor||"none")+";";
if(typeof (_55.strokeOpacity)!="undefined"){
_56+="stroke-opacity:"+_55.strokeOpacity+";";
}
if(typeof (_55.strokeWidth)!="undefined"){
_56+="stroke-width:"+_55.strokeWidth+";";
}
return _56;
};
SVGCanvas.createPoly=function(_57,_58,_59,_5a){
var _5b=document.createElementNS(SVGCanvas.xmlns,_59);
var _5c="";
for(var i in _57){
_5c+=_57[i]+","+_58[i]+" ";
}
_5b.setAttributeNS(null,"points",_5c);
_5b.setAttributeNS(null,"style",SVGCanvas.buildStyleString(_5a));
return _5b;
};
SVGCanvas.prototype.getElement=function(){
return this._element;
};
SVGCanvas.prototype.setStyle=function(_5e){
this._style=_5e;
};
SVGCanvas.prototype.drawCircle=function(cx,cy,_61,_62){
_62=_62||this._style;
var _63=document.createElementNS(SVGCanvas.xmlns,"circle");
_63.setAttributeNS(null,"cx",cx);
_63.setAttributeNS(null,"cy",cy);
_63.setAttributeNS(null,"r",_61);
_63.setAttributeNS(null,"style",SVGCanvas.buildStyleString(_62));
this._element.appendChild(_63);
};
SVGCanvas.prototype.drawOval=function(x,y,_66,_67,_68){
_68=_68||this._style;
var _69=document.createElementNS(SVGCanvas.xmlns,"ellipse");
_69.setAttributeNS(null,"cx",x+_66/2);
_69.setAttributeNS(null,"cy",y+_67/2);
_69.setAttributeNS(null,"rx",_66/2);
_69.setAttributeNS(null,"ry",_67/2);
_69.setAttributeNS(null,"style",SVGCanvas.buildStyleString(_68));
this._element.appendChild(_69);
};
SVGCanvas.prototype.drawPolygon=function(_6a,_6b,_6c){
_6c=_6c||this._style;
this._element.appendChild(SVGCanvas.createPoly(_6a,_6b,"polygon",_6c));
};
SVGCanvas.prototype.drawPolyline=function(_6d,_6e,_6f){
_6f=_6f||this._style;
this._element.appendChild(SVGCanvas.createPoly(_6d,_6e,"polyline",_6f));
};
SVGCanvas.prototype.drawRect=function(x,y,_72,_73,_74){
_74=_74||this._style;
var _75=document.createElementNS(SVGCanvas.xmlns,"rect");
_75.setAttributeNS(null,"x",x);
_75.setAttributeNS(null,"y",y);
_75.setAttributeNS(null,"width",_72);
_75.setAttributeNS(null,"height",_73);
if(typeof (_74.cornerRadius)!="undefined"){
var r=(_73>_72)?_72*_74.cornerRadius:_73*_74.cornerRadius;
_75.setAttributeNS(null,"rx",r);
_75.setAttributeNS(null,"ry",r);
}
_75.setAttributeNS(null,"style",SVGCanvas.buildStyleString(_74));
this._element.appendChild(_75);
};
var _77=document.namespaces;
if(_77&&!_52){
var _78=function(_79){
return document.createElement("<ivml:"+_79+" class=\"ivml\">");
};
document.createStyleSheet().addRule(".ivml","behavior:url(#default#VML)");
try{
if(!document.namespaces.ivml){
document.namespaces.add("ivml","urn:schemas-microsoft-com:vml");
}
}
catch(e){
_78=function(_7a){
return document.createElement("<"+_7a+" xmlns=\"urn:schemas-microsoft.com:vml\" class=\"ivml\">");
};
}
}
function VMLCanvas(_7b,_7c){
var _7d=_78("group");
_7d.style.position="absolute";
_7d.style.top="0px";
_7d.style.left="0px";
_7d.style.width=_7b+"px";
_7d.style.height=_7c+"px";
_7d.coordsize=_7b+" "+_7c;
_7d.coordorigin="1 1";
this._element=_7d;
this._style={strokeColor:"#000000"};
}
VMLCanvas.createFillElement=function(_7e){
var _7f=_78("fill");
if(typeof (_7e.fillColor)!="undefined"){
_7f.color=_7e.fillColor;
if(typeof (_7e.fillOpacity)!="undefined"){
_7f.opacity=_7e.fillOpacity;
}
}else{
_7f.on=false;
}
return _7f;
};
VMLCanvas.createStrokeElement=function(_80){
var _81=_78("stroke");
if(typeof (_80.strokeColor)!="undefined"){
_81.color=_80.strokeColor;
if(typeof (_80.strokeOpacity)!="undefined"){
_81.opacity=_80.strokeOpacity;
}
if(typeof (_80.strokeWidth)!="undefined"){
_81.weight=_80.strokeWidth+"px";
}
}else{
_81.on=false;
}
return _81;
};
VMLCanvas.prototype.getElement=function(){
return this._element;
};
VMLCanvas.prototype.setStyle=function(_82){
this._style=_82;
};
VMLCanvas.prototype.drawCircle=function(cx,cy,_85,_86){
_86=_86||this._style;
this.drawOval(cx-_85,cy-_85,_85*2,_85*2,_86);
};
VMLCanvas.prototype.drawOval=function(x,y,_89,_8a,_8b){
_8b=_8b||this._style;
var _8c=_78("oval");
_8c.style.position="absolute";
_8c.style.left=x;
_8c.style.top=y;
_8c.style.width=(_89+1);
_8c.style.height=(_8a+1);
_8c.position="0 0";
_8c.size=_89+" "+_8a;
_8c.appendChild(VMLCanvas.createFillElement(_8b));
_8c.appendChild(VMLCanvas.createStrokeElement(_8b));
this._element.appendChild(_8c);
};
VMLCanvas.prototype.drawPolyline=function(_8d,_8e,_8f){
_8f=_8f||this._style;
var _90=_78("polyline");
_90.style.position="absolute";
var _91="";
for(var i in _8d){
_91+=_8d[i]+" "+_8e[i]+" ";
}
_90.points=_91;
_90.appendChild(VMLCanvas.createFillElement(_8f));
var _93=VMLCanvas.createStrokeElement(_8f);
_93.joinstyle="miter";
_90.appendChild(_93);
this._element.appendChild(_90);
};
VMLCanvas.prototype.drawPolygon=function(_94,_95,_96){
var _97=[];
var _98=[];
_97.length=_98.length=_94.length+1;
for(var i in _94){
_97[i]=_94[i];
_98[i]=_95[i];
}
_97[_94.length]=_94[0];
_98[_94.length]=_95[0];
this.drawPolyline(_97,_98,_96);
};
VMLCanvas.prototype.drawRect=function(x,y,_9c,_9d,_9e){
_9e=_9e||this._style;
var _9f=_78("roundrect");
_9f.style.position="absolute";
_9f.style.left=x;
_9f.style.top=y;
_9f.style.width=(_9c+1);
_9f.style.height=(_9d+1);
_9f.arcsize=_9e.cornerRadius||0;
_9f.appendChild(VMLCanvas.createFillElement(_9e));
var _a0=VMLCanvas.createStrokeElement(_9e);
_a0.joinstyle="miter";
_9f.appendChild(_a0);
this._element.appendChild(_9f);
};
function CanvasCanvas(_a1,_a2){
var _a3=document.createElement("canvas");
_a3.setAttribute("width",_a1);
_a3.setAttribute("height",_a2);
this._element=_a3;
this._style={strokeColor:"#000000"};
if(_a3.getContext){
this._canvas=_a3.getContext("2d");
}else{
throw new Error("No implementation supported.");
}
}
CanvasCanvas.createPolyPath=function(_a4,_a5,_a6,_a7){
_a6.beginPath();
_a6.moveTo(_a4[0],_a5[0]);
for(var i=1;i<_a4.length;++i){
_a6.lineTo(_a4[i],_a5[i]);
}
if(_a7){
_a6.closePath();
}
};
CanvasCanvas.drawPoly=function(_a9,_aa,_ab,_ac,_ad){
_ab.lineJoin="round";
_ab.lineCap="round";
if(typeof (_ac.fillColor)!="undefined"){
CanvasCanvas.createPolyPath(_a9,_aa,_ab,_ad);
_ab.fillStyle=_ac.fillColor;
_ab.globalAlpha=(typeof (_ac.fillOpacity)!="undefined")?_ac.fillOpacity:1;
_ab.fill();
}
if(typeof (_ac.strokeColor)!="undefined"){
CanvasCanvas.createPolyPath(_a9,_aa,_ab,_ad);
_ab.strokeStyle=_ac.strokeColor;
_ab.globalAlpha=(typeof (_ac.strokeOpacity)!="undefined")?_ac.strokeOpacity:1;
_ab.lineWidth=(typeof (_ac.strokeWidth)!="undefined")?_ac.strokeWidth:1;
_ab.stroke();
}
};
CanvasCanvas.prototype.getElement=function(){
return this._element;
};
CanvasCanvas.prototype.setStyle=function(_ae){
this._style=_ae;
};
CanvasCanvas.prototype.drawCircle=function(cx,cy,_b1,_b2){
_b2=_b2||this._style;
var _b3=this._canvas;
_b3.beginPath();
_b3.arc(cx,cy,_b1,0,2*Math.PI,true);
if(typeof (_b2.fillColor)!="undefined"){
_b3.beginPath();
_b3.arc(cx,cy,_b1,0,2*Math.PI,true);
_b3.fillStyle=_b2.fillColor;
_b3.globalAlpha=(typeof (_b2.fillOpacity)!="undefined")?_b2.fillOpacity:1;
_b3.fill();
}
if(typeof (_b2.strokeColor)!="undefined"){
_b3.beginPath();
_b3.arc(cx,cy,_b1,0,2*Math.PI,true);
_b3.strokeStyle=_b2.strokeColor;
_b3.globalAlpha=(typeof (_b2.strokeOpacity)!="undefined")?_b2.strokeOpacity:1;
_b3.lineWidth=(typeof (_b2.strokeWidth)!="undefined")?_b2.strokeWidth:1;
_b3.stroke();
}
};
CanvasCanvas.prototype.drawOval=function(x,y,_b6,_b7,_b8){
var _b9=this._canvas;
if(_b6<0.01||_b7<0.01){
return;
}
var cx=x+_b6/2;
var cy=(y+_b7/2)*_b6/_b7;
_b9.save();
_b9.scale(1,_b7/_b6);
this.drawCircle(cx,cy,_b6/2,_b8);
_b9.restore();
};
CanvasCanvas.prototype.drawPolyline=function(_bc,_bd,_be){
_be=_be||this._style;
var _bf=this._canvas;
CanvasCanvas.drawPoly(_bc,_bd,_bf,_be,false);
};
CanvasCanvas.prototype.drawPolygon=function(_c0,_c1,_c2){
_c2=_c2||this._style;
var _c3=this._canvas;
CanvasCanvas.drawPoly(_c0,_c1,_c3,_c2,true);
};
CanvasCanvas.prototype.drawRect=function(x,y,_c6,_c7,_c8){
_c8=_c8||this._style;
var _c9=this._canvas;
if(typeof (_c8.fillColor)!="undefined"){
_c9.fillStyle=_c8.fillColor;
_c9.globalAlpha=(typeof (_c8.fillOpacity)!="undefined")?_c8.fillOpacity:1;
_c9.fillRect(x,y,_c6,_c7);
}
if(typeof (_c8.strokeColor)!="undefined"){
_c9.strokeStyle=_c8.strokeColor;
_c9.globalAlpha=(typeof (_c8.strokeOpacity)!="undefined")?_c8.strokeOpacity:1;
_c9.lineWidth=(typeof (_c8.strokeWidth)!="undefined")?_c8.strokeWidth:1;
_c9.strokeRect(x,y,_c6,_c7);
}
};
function createCanvas(_ca,_cb,_cc){
if(_cc){
var _cd=_cc.toLowerCase();
if(_cd=="svg"){
return new SVGCanvas(_ca,_cb);
}else{
if(_cd=="vml"){
return new VMLCanvas(_ca,_cb);
}else{
if(_cd=="canvas"){
return new CanvasCanvas(_ca,_cb);
}
}
}
throw new Error("No such implementation.");
}else{
if(_52){
return new SVGCanvas(_ca,_cb);
}else{
if(_77){
return new VMLCanvas(_ca,_cb);
}
}
return new CanvasCanvas(_ca,_cb);
}
}
return {create:createCanvas};
})();
ravegeo.LayerOptions=(function(){
var _ce=ravegeo.internal.Utilities;
var _cf=function(_d0){
if(typeof (_d0)=="undefined"){
_d0={};
}
this.gridWidth=_ce.getInteger(_d0.gridWidth,25);
this.gridHeight=_ce.getInteger(_d0.gridHeight,25);
this.labelStyle=(typeof (_d0.labelStyle)=="undefined")?{}:_d0.labelStyle;
var _d1=this.labelStyle;
if(!_d1.borderColor){
_d1.borderColor="";
}
if(!_d1.backgroundColor){
_d1.backgroundColor="";
}
if(!_d1.textColor){
_d1.textColor="";
}
this.labelsAboveSymbols=_ce.getBoolean(_d0.labelsAboveSymbols,false);
this.hoverBorder=_ce.getBoolean(_d0.hoverBorder,true);
this.textStyle=(typeof (_d0.textStyle)=="undefined")?{}:_d0.textStyle;
var _d2=this.textStyle;
if(!_d2.borderColor){
_d2.borderColor="";
}
if(!_d2.backgroundColor){
_d2.backgroundColor="";
}
if(!_d2.textColor){
_d2.textColor="";
}
this.highlightColor=(typeof (_d0.highlightColor)=="undefined")?"":_d0.highlightColor;
this.leadLinesVisible=_ce.getBoolean(_d0.leadLinesVisible,false);
this.moveFromCenter=_ce.getBoolean(_d0.moveFromCenter,this.leadLinesVisible);
this.miniSymbol=(typeof (_d0.miniSymbol)=="undefined")?"":_d0.miniSymbol;
this.arrangeMinScale=_ce.getInteger(_d0.arrangeMinScale,-1);
this.arrangeMaxScale=_ce.getInteger(_d0.arrangeMaxScale,-1);
this.labelMinScale=_ce.getInteger(_d0.labelMinScale,-1);
this.labelMaxScale=_ce.getInteger(_d0.labelMaxScale,-1);
this.miniSymbolMinScale=_ce.getInteger(_d0.miniSymbolMinScale,-1);
this.arrangeGeoObjects=_ce.getBoolean(_d0.arrangeGeoObjects,false);
if(this.arrangeMinScale>0||this.arrangeMaxScale>0){
this.arrangeGeoObjects=true;
}
};
_cf.prototype._serialize=function(){
var s="";
s=writeBoolean(s,this.arrangeGeoObjects);
s+=this.arrangeMinScale+";";
s+=this.arrangeMaxScale+";";
s+=this.gridWidth+";";
s+=this.gridHeight+";";
s=writeBoolean(s,this.leadLinesVisible);
s=writeBoolean(s,this.moveFromCenter);
s+=this.labelMinScale+";";
s+=this.labelMaxScale+";";
s+=this.miniSymbolMinScale+";";
s+=this.miniSymbol.length+";"+this.miniSymbol;
s+=this.labelStyle.borderColor.length+";"+this.labelStyle.borderColor;
s+=this.labelStyle.backgroundColor.length+";"+this.labelStyle.backgroundColor;
s+=this.labelStyle.textColor.length+";"+this.labelStyle.textColor;
s=writeBoolean(s,this.labelsAboveSymbols);
s=writeBoolean(s,this.hoverBorder);
s+=this.textStyle.borderColor.length+";"+this.textStyle.borderColor;
s+=this.textStyle.backgroundColor.length+";"+this.textStyle.backgroundColor;
s+=this.textStyle.textColor.length+";"+this.textStyle.textColor;
s+=this.highlightColor.length+";"+this.highlightColor;
return s;
};
function writeBoolean(s,_d5){
var _d6=_d5?1:0;
s+=_d6+";";
return s;
}
return _cf;
})();
ravegeo.internal.Tile=(function(){
var _d7=function(_d8,dtx,dty){
this.owner=_d8;
this._dtx=dtx;
this._dty=dty;
this.img=document.createElement("img");
var img=this.img;
img.style.position="absolute";
img.style.MozUserSelect="none";
img.style.width=_d8._tileWidthPix+"px";
img.style.height=_d8._tileHeightPix+"px";
img.style.left=((_d8._numberOfTiles.x/2*_d8._tileWidthPix)+this._dtx*_d8._tileWidthPix)+"px";
img.style.top=((_d8._numberOfTiles.y/2*_d8._tileHeightPix)-(this._dty+1)*_d8._tileHeightPix)+"px";
img.oncontextmenu=function(e){
return false;
};
img._tile=this;
ravegeo.TiledMap._addMapEvents(img);
};
function onImageLoad(){
var _dd=this._tile;
this._tile=null;
_dd.img.src=_dd.newImage.src;
_dd.img.onload=null;
}
_d7.prototype._updateImage=function(){
var _de=this.owner._map._tileCacherUrl;
_de+="&tx="+(this._dtx+this.owner._ctx);
_de+="&ty="+(-this._dty+this.owner._cty);
_de+="&zoomStep="+this.owner._map._zoomStep;
if(this.newImage){
this.newImage.onload=null;
this.newImage.src=null;
this.newImage._tile=null;
}
if(this.newImage){
this.newImage.onload=null;
}
this.newImage=new Image(5,5);
this.newImage.src=_de;
if(!ravegeo.internal.Utilities.isImageLoaded(this.newImage)){
this.newImage._tile=this;
this.img.src=this.owner._map._loadingImageUrl;
ravegeo.internal.Utilities.onImageLoaded(this.newImage,onImageLoad);
this.newImage.src=_de;
}else{
this.img.src=_de;
}
};
_d7.prototype._position=function(){
this.img.style.left=(this._dtx*this.owner._tileWidthPix)+"px";
this.img.style.top=(this._dty*this.owner._tileHeightPix)+"px";
};
_d7.prototype._wrap=function(dtx,dty){
this._dtx+=dtx;
this._dty+=dty;
var _e1=false;
var _e2=this.owner._allowedTilePositions;
if(this._dtx<_e2.min.x){
this._dtx+=this.owner._numberOfTiles.x;
_e1=true;
}else{
if(this._dtx>_e2.max.x){
this._dtx-=this.owner._numberOfTiles.x;
_e1=true;
}
}
if(this._dty<_e2.min.y){
this._dty+=this.owner._numberOfTiles.y;
_e1=true;
}else{
if(this._dty>_e2.max.y){
this._dty-=this.owner._numberOfTiles.y;
_e1=true;
}
}
if(_e1){
this._updateImage();
}
this._position();
};
return _d7;
})();
ravegeo.ControlPosition=(function(){
var _e3={TOP_LEFT:0,TOP_RIGHT:1,BOTTOM_LEFT:2,BOTTOM_RIGHT:3};
return _e3;
})();
ravegeo.internal.GeometryFunctions=(function(){
var _e4=180/Math.PI;
var _e5=1/_e4;
var _e6={};
_e6.closestPointOnLine=function(_e7,_e8,_e9,_ea){
if(_e7.length<=1){
return -1;
}
var a=Array();
var b=Array();
var _ed=Number.MAX_VALUE;
var _ee=0;
var x=0;
var y=0;
for(var i=1;i<_e7.length;i++){
a[0]=_e7[i-1];
a[1]=_e8[i-1];
b[0]=_e7[i];
b[1]=_e8[i];
if(!pointInsideExtendedSegmentBounds(_e9,_ea,a,b)){
continue;
}
var d=pointDistance2ToSegment(_e9,a,b);
if(d<_ed){
_ed=d;
}
}
return _ed;
};
function pointInsideExtendedSegmentBounds(_f3,ext,a,b){
for(var i=0;i<_f3.length;i++){
if(_f3[i]<Math.min(a[i],b[i])-ext||_f3[i]>Math.max(a[i],b[i])+ext){
return false;
}
}
return true;
}
function pointDistance2ToSegment(c,a,b){
var _fb=[];
var ab=sub(b,a);
var ac=sub(c,a);
var _fe=dot(ac,ab);
var _ff=length2(ab);
if(_fe<=0){
_fb=copy(a);
}else{
if(_fe>=_ff){
_fb=copy(b);
}else{
while(Math.abs(_fe)>36863){
_fe/=2;
if(Math.abs(_ff)>2){
_ff/=2;
}
}
_fb=add(a,div(mult(ab,_fe),_ff));
}
}
return length2(sub(c,_fb));
}
function sub(a,b){
var ret=Array();
for(var i=0;i<a.length;i++){
ret[i]=a[i]-b[i];
}
return ret;
}
function copy(from){
var to=[];
for(var i=0;i<to.length;i++){
to[i]=from[i];
}
return to;
}
function add(a,b){
var ret=Array();
for(var i=0;i<a.length;i++){
ret[i]=a[i]+b[i];
}
return ret;
}
function mult(a,b){
var ret=Array();
for(var i=0;i<a.length;i++){
ret[i]=a[i]*b;
}
return ret;
}
function div(a,b){
var ret=Array();
for(var i=0;i<a.length;i++){
ret[i]=a[i]/b;
}
return ret;
}
function length2(v){
var l=0;
for(var i=0;i<v.length;i++){
l+=v[i]*v[i];
}
return l;
}
function dot(a,b){
var p=0;
for(var i=0;i<a.length;i++){
p+=a[i]*b[i];
}
return p;
}
_e6.isPointInsidePolygon=function(_11a,_11b,_11c){
if(_11a.length<2){
return false;
}
var _11d=getNumberOfCrossings(_11a,_11b,_11c);
return isOdd(_11d);
};
function getNumberOfCrossings(_11e,_11f,_120){
var _121=_11e.length;
var _122=[_11e[_121-1],_11f[_121-1]];
var _123=0;
for(var i=0;i<_121;++i){
var _125=[_11e[i],_11f[i]];
var _126=pointCrossesLine(_120,_122,_125);
if(_126){
_123++;
}
_122=_125;
}
return _123;
}
function pointCrossesLine(_127,_128,_129){
var _12a=(_129[0]-_128[0])/(_129[1]-_128[1]);
var _12b=(_128[1]<=_127[1])&&(_127[1]<_129[1]);
var _12c=(_129[1]<=_127[1])&&(_127[1]<_128[1]);
var _12d=_127[0]<_12a*(_127[1]-_128[1])+_128[0];
var _12e=(_12b||_12c)&&_12d;
return _12e;
}
function isOdd(_12f){
return _12f%2!=0;
}
_e6.isPointInsideEllipse=function(_130,_131,_132,_133){
if(!pointInsideExtendedEllipseBounds(_130,_131,_132,_133)){
return false;
}
var _134=(_130[1]-_130[0])/2;
var _135=(_131[1]-_131[0])/2;
var _136=[_130[0]+_134,_131[0]+_135];
var _137=[_134+_133/2,_135+_133/2];
var _138=[_134-_133/2,_135-_133/2];
return (isInsideEllipse(_136,_137,_132)&&!isInsideEllipse(_136,_138,_132));
};
function pointInsideExtendedEllipseBounds(_139,_13a,_13b,_13c){
return (_13b[0]>(_139[0]-_13c/2)&&_13b[0]<(_139[1]+_13c/2)&&_13b[1]>(_13a[0]-_13c/2)&&_13b[1]<(_13a[1]+_13c/2));
}
function isInsideEllipse(_13d,_13e,_13f){
if(_13e[0]<=0||_13e[1]<=0){
return false;
}
return square(_13f[0]-_13d[0])/square(_13e[0])+square(_13f[1]-_13d[1])/square(_13e[1])<1;
}
function square(x){
return x*x;
}
_e6.toRadians=function(_141){
return _141*_e5;
};
_e6.toDegrees=function(_142){
return _142*_e4;
};
return _e6;
})();
ravegeo.internal.MapCommons=(function(){
var _143={};
_143._fixParams=function(_144){
if(typeof (_144.mapContainer)=="string"){
_144.mapContainer=document.getElementById(_144.mapContainer);
}
if(!_144.url&&document&&document.getElementsByTagName){
var _145=document.getElementsByTagName("script");
var _146=/ravegeowebmap(\.debug)?\.js([\?\.]|$)/i;
for(var i=0;i<_145.length;++i){
var src=_145[i].getAttribute("src");
if(!src){
continue;
}
var m=src.match(_146);
if(m){
_144.url=src.substring(0,m.index);
break;
}
}
}
};
_143._serializeDoubleArray=function(arr){
var s=""+arr.length+";";
for(var i=0;i<arr.length;++i){
s+=arr[i]+";";
}
return s;
};
_143._polyX_expandBounds=function(_14d,_14e,_14f,_150){
for(var i=0;i<_14d.length;++i){
if(_14d[i]<_14f.x){
_14f.x=_14d[i];
}
if(_14d[i]>_150.x){
_150.x=_14d[i];
}
if(_14e[i]<_14f.y){
_14f.y=_14e[i];
}
if(_14e[i]>_150.y){
_150.y=_14e[i];
}
}
};
MapCommons_polyX_getBounds=function(_152,_153){
var _154={x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY};
var _155={x:Number.NEGATIVE_INFINITY,y:Number.NEGATIVE_INFINITY};
for(var i=0;i<_152.length;++i){
if(_152[i]<_154.x){
_154.x=_152[i];
}
if(_152[i]>_155.x){
_155.x=_152[i];
}
if(_153[i]<_154.y){
_154.y=_153[i];
}
if(_153[i]>_155.y){
_155.y=_153[i];
}
}
return {minPoint:_154,maxPoint:_155};
};
_143._polyX_isInside=function(_157,_158,xMin,yMin,xMax,yMax){
var _15d=getBounds(_157,_158);
return _15d.minPoint.x<xMax&&_15d.maxPoint.x>xMin&&_15d.minPoint.y<yMax&&_15d.maxPoint.y>yMin;
};
_143._polyX_getCenter=function(_15e,_15f){
var _160=getBounds(_15e,_15f);
return {x:(_160.minPoint.x+_160.maxPoint.x)/2,y:(_160.minPoint.y+_160.maxPoint.y)/2};
};
MapCommons_polyX_geoToPixels=function(_161,_162,_163,_164){
var ret=[];
for(var i=0;i<_161.length;++i){
ret[ret.length]=Math.round((_161[i]-_162)*_163)+_164;
}
return ret;
};
_143._polyX_position=function(_167,_168,_169,_16a,_16b){
if(_167._canvasElement){
_167._layer._layerDiv.removeChild(_167._canvasElement);
}
var _16c=MapCommons_polyX_getBounds(_167._xPoints,_167._yPoints);
var xMin=Math.round((_16c.minPoint.x-_168.x)*_169.x)-_16a;
var xMax=Math.round((_16c.maxPoint.x-_168.x)*_169.x)+_16a;
var yMin=Math.round((_168.y-_16c.maxPoint.y)*_169.y)-_16a;
var yMax=Math.round((_168.y-_16c.minPoint.y)*_169.y)+_16a;
var _171=MapCommons_polyX_geoToPixels(_167._xPoints,_16c.minPoint.x,_169.x,_16a);
var _172=MapCommons_polyX_geoToPixels(_167._yPoints,_16c.maxPoint.y,-_169.y,_16a);
var _173=xMax-xMin;
var _174=yMax-yMin;
var _175=ravegeo.internal.Canvas.create(_173,_174);
var _176=_175.getElement();
_167._canvasElement=_176;
_176.style.position="absolute";
_176.style.zIndex="51";
_176.style.left=xMin+"px";
_176.style.top=yMin+"px";
_167._layer._layerDiv.appendChild(_176);
if(_16b){
_175.drawPolygon(_171,_172,ravegeo.internal.Utilities.fixStyle({fillColor:_167.color}));
}else{
_175.drawPolyline(_171,_172,ravegeo.internal.Utilities.fixStyle({strokeColor:_167.color,strokeWidth:_167.width}));
}
_143._addCanvasObjectEvents(_167);
};
_143._polyX_reposition=function(_177,_178,_179,_17a,_17b){
var _17c=_177._canvasElement;
var _17d=MapCommons_polyX_getBounds(_177._xPoints,_177._yPoints);
var xMin=Math.round((_17d.minPoint.x-_178.x)*_179.x)-_17a;
var xMax=Math.round((_17d.maxPoint.x-_178.x)*_179.x)+_17a;
var yMin=Math.round((_178.y-_17d.maxPoint.y)*_179.y)-_17a;
var yMax=Math.round((_178.y-_17d.minPoint.y)*_179.y)+_17a;
var _182=MapCommons_polyX_geoToPixels(_177._xPoints,_17d.minPoint.x,_179.x,_17a);
var _183=MapCommons_polyX_geoToPixels(_177._yPoints,_17d.maxPoint.y,-_179.y,_17a);
var _184=xMax-xMin;
var _185=yMax-yMin;
_17c.style.position="absolute";
_17c.style.zIndex="51";
_17c.style.left=xMin+"px";
_17c.style.top=yMin+"px";
};
_143._addCanvasObjectEvents=function(_186){
var _187=_186._canvasElement;
_187._tile={owner:_186._layer};
ravegeo.TiledMap._addMapEvents(_187);
var _188=_187.firstChild;
if(_188){
_188._object=_186;
_188._tile={owner:_186._layer};
}
};
_143._polyX_move=function(_189,_18a,_18b,_18c){
var _18d=_189.getPoints();
movePoints(_18d.xValues,_18a);
movePoints(_18d.yValues,_18b);
_189._xPoints=_18d.xValues;
_189._yPoints=_18d.yValues;
_189._project(_18c);
_189._layer._repositionGeoObject(_189);
};
function movePoints(_18e,_18f){
for(var i=0;i<_18e.length;i++){
_18e[i]=_18e[i]+_18f;
}
}
_143.defaultInteractionDelay=700;
_143.maxInteractionDelay=10000;
_143.getHandleTimeout=15000;
_143.getTilesInfoTimeout=15000;
_143.version="2.3.11.22183";
return _143;
})();
ravegeo.tools.internal.DeprecatedCallbacksTool=(function(){
var _191={};
_191.mouseClicked=function(map,x,y,_195,_196){
if(_196){
objectClicked(map,_195,_196);
}else{
mapClicked(map,x,y);
}
};
function objectClicked(map,_198,_199){
var _19a=_198.getGeoObject(_199);
if(_19a&&_19a.symbol){
var _19b=map._callback;
if(_19b&&_19b.symbolClicked){
_19b.symbolClicked(map,_198,_199);
}
}
}
function mapClicked(map,x,y){
var _19f=map._callback;
if(_19f&&_19f.mapClicked){
_19f.mapClicked(map,x,y);
}
}
return _191;
})();
ravegeo.internal.PlateCarreProjector=(function(){
var _1a0={};
_1a0.forward=function(x,y){
return [x,y];
};
_1a0.reverse=function(x,y){
return [x,y];
};
_1a0.forwardArray=function(_1a5,_1a6){
};
_1a0.reverseArray=function(xarr,yarr){
};
return _1a0;
})();
ravegeo.internal.ToolEventsDispatcher=(function(){
var _1a9=ravegeo.internal.Utilities;
var _1aa=function(map){
this._tools=[];
this._map=map;
};
_1aa.prototype.addTool=function(tool){
if(tool.activate){
tool.activate(this._map);
}
this._tools[this._tools.length]=tool;
};
_1aa.prototype.removeTool=function(tool){
if(tool.deactivate){
tool.deactivate(this._map);
}
for(var idx in this._tools){
if(this._tools[idx]==tool){
this._tools.splice(idx,1);
break;
}
}
};
_1aa.prototype.mouseDown=function(_1af){
this._notifyTools("mousePressed",_1af);
};
_1aa.prototype.mouseMoved=function(_1b0){
this._notifyTools("mouseMoved",_1b0);
};
_1aa.prototype.mouseUp=function(_1b1){
this._notifyTools("mouseReleased",_1b1);
};
_1aa.prototype.mouseClicked=function(_1b2){
this._notifyTools("mouseClicked",_1b2);
};
_1aa.prototype.mouseDoubleClicked=function(_1b3){
this._notifyTools("mouseDoubleClicked",_1b3);
};
_1aa.prototype._notifyTools=function(_1b4,_1b5){
var _1b6=this._getProjectedPointFromEvent(_1b5);
var _1b7=this._pickObject(_1b5);
var _1b8=null;
var _1b9=null;
if(_1b7){
_1b9=_1b7.id;
_1b8=this._map._layers[_1b7._layer._id];
}
for(var idx in this._tools){
if(this._tools[idx][_1b4]){
this._tools[idx][_1b4](this._map,_1b6[0],_1b6[1],_1b8,_1b9);
}
}
};
_1aa.prototype._getProjectedPointFromEvent=function(_1bb){
var _1bc=this._map._getGeoPointFromEvent(_1bb);
return this._map._projector.reverse(_1bc.getX(),_1bc.getY());
};
_1aa.prototype._pickObject=function(e){
var _1be=pickByTarget(e);
if(!_1be){
_1be=this._pickByCoordinates(e);
}
return _1be;
};
function pickByTarget(e){
var _1c0=_1a9.getTarget(e);
var _1c1=_1c0._object;
if(!_1c1){
_1c1=_1c0._symbol;
}
return _1c1;
}
_1aa.prototype._pickByCoordinates=function(e){
var _1c3=this._map._layers;
for(var _1c4 in _1c3){
var _1c5=this._map._getPixelsFromEvent(e);
var _1c6=_1c3[_1c4]._pickObject([_1c5.getX(),_1c5.getY()]);
if(_1c6){
return _1c6;
}
}
};
return _1aa;
})();
ravegeo.internal.AppletLayer=(function(){
var _1c7=ravegeo.internal.Utilities;
var _1c8=function(_1c9,opts,_1cb){
this._applet=_1c9;
this._projector=_1cb;
opts=new ravegeo.LayerOptions(opts);
this._id=this._applet.newLayer(opts._serialize());
};
_1c8.prototype.clear=function(){
this._applet.clearGeoObjects(this._id);
};
_1c8.prototype.addGeoObjects=function(objs,opts){
if(typeof (opts)=="undefined"){
opts={};
}
if(typeof (opts.clear)=="undefined"){
opts.clear=false;
}
var _1ce="";
for(var idx in objs){
objs[idx]._project(this._projector);
_1ce+=objs[idx]._serialize();
}
this._applet.addGeoObjects(this._id,_1ce,opts.clear);
};
_1c8.prototype.getGeoObjectIds=function(_1d0){
var js=this._applet.getGeoObjectIds(this._id,_1d0?true:false);
return eval("("+js+")");
};
_1c8.prototype.getGeoObject=function(id){
var js=this._applet.getGeoObject(this._id,id);
return eval("("+js+")");
};
_1c8.prototype.removeGeoObjects=function(ids){
var _1d5="";
for(var idx in ids){
_1d5+=ids[idx].length+";"+ids[idx];
}
this._applet.removeGeoObjects(this._id,_1d5);
};
_1c8.prototype.setVisible=function(_1d7){
if(typeof (_1d7)=="undefined"){
_1d7=true;
}
this._applet.setLayerVisible(this._id,_1d7);
};
_1c8.prototype.showGeoObjects=function(_1d8){
_1d8=_1c7.getInteger(_1d8);
this._applet.showGeoObjects(this._id,_1d8);
};
_1c8.prototype.highlightGeoObject=function(id,_1da){
if(typeof (_1da)=="undefined"){
_1da={};
}
if(typeof (_1da.center)=="undefined"){
_1da.center="";
}
if(typeof (_1da.showText)=="undefined"){
_1da.showText=false;
}
if(typeof (_1da.showHighlight)=="undefined"){
_1da.showHighlight=false;
}
this._applet.highlightGeoObject(this._id,id,_1da.center,_1da.showText,_1da.showHighlight);
};
_1c8.prototype.moveGeoObject=function(id,_1dc,_1dd){
_1dc=_1c7.getFloat(_1dc,0);
_1dd=_1c7.getFloat(_1dd,0);
this._applet.moveGeoObject(this._id,id,_1dc,_1dd);
};
_1c8.prototype.pickGeoObjectIds=function(x,y){
x=_1c7.getFloat(x);
y=_1c7.getFloat(y);
var js=this._applet.pickGeoObjectIds(this._id,x,y);
return eval("("+js+")");
};
_1c8.prototype.setArrangeGeoObjects=function(_1e1){
this._applet.setArrangeGeoObjects(this._id,_1e1);
};
return _1c8;
})();
ravegeo.tools.internal.SymbolHoverTool=(function(){
var _1e2={};
var _1e3=ravegeo.internal.Utilities;
var _1e4;
var _1e5;
_1e2.mousePressed=function(map,x,y,_1e9,_1ea){
if(_1e9){
var _1eb=_1e9.getGeoObject(_1ea);
if(_1eb.symbol){
_1e5=_1eb;
}
}
};
_1e2.mouseReleased=function(map,x,y,_1ef,_1f0){
_1e5=null;
if(_1ef){
var _1f1=_1ef.getGeoObject(_1f0);
reselectSymbol(_1f1);
}
};
_1e2.mouseMoved=function(map,x,y,_1f5,_1f6){
if(!_1f5){
diselectCurrent();
return;
}
var _1f7=_1f5.getGeoObject(_1f6);
if(_1f7==_1e5){
diselectCurrent();
return;
}
reselectSymbol(_1f7);
};
function reselectSymbol(_1f8){
if(_1f8!=_1e4){
if(_1e4){
diselectCurrent();
}
if(_1f8.symbol){
if(_1f8._layer._hoverBorder){
_1f8._img.style.border="1px solid gray";
}
if(!_1f8._alwaysBalloon&&!_1e3.stringIsEmpty(_1f8.text)){
_1f8._balloon=_1f8._createBallon(_1f8._layer._textStyle);
_1f8._layer._layerDiv.appendChild(_1f8._balloon);
}
_1e4=_1f8;
}
}
}
function diselectCurrent(){
if(!_1e4){
return;
}
var _1f9=_1e4._balloon;
_1e4._balloon=null;
_1e4._img.style.border="0px none";
if(_1f9){
try{
_1e4._layer._layerDiv.removeChild(_1f9);
}
catch(e){
}
}
_1e4=null;
}
return _1e2;
})();
ravegeo.internal.MercatorProjector=(function(){
var _1fa=Math.PI/180;
var _1fb=111319.49079;
var _1fc={};
_1fc.forward=function(lon,lat){
if(lat>88){
lat=88;
}
if(lat<-88){
lat=-88;
}
var _1ff=Math.sin(lat*_1fa);
var yrad=0.5*Math.log((1+_1ff)/(1-_1ff));
var y=yrad/_1fa*_1fb;
return [lon*_1fb,y];
};
_1fc.reverse=function(x,y){
var _204=2*Math.atan(Math.exp(y/_1fb*_1fa))-Math.PI/2;
return [x/_1fb,_204/_1fa];
};
_1fc.forwardArray=function(_205,_206){
for(var i in _205){
var p=_1fc.forward(_205[i],_206[i]);
_205[i]=p[0];
_206[i]=p[1];
}
};
_1fc.reverseArray=function(xarr,yarr){
for(var i in xarr){
var p=_1fc.reverse(xarr[i],yarr[i]);
xarr[i]=p[0];
yarr[i]=p[1];
}
};
return _1fc;
})();
ravegeo.io.Ajax=(function(){
var Ajax={};
var _20e=0;
var _20f=[];
Ajax.syncJsonRequest=function(url){
var req;
if(window.XMLHttpRequest){
req=new XMLHttpRequest();
}else{
if(window.ActiveXObject){
req=new ActiveXObject("Microsoft.XMLHTTP");
}else{
throw new Error("Browser not AJAX enabled.");
}
}
req.open("GET",url,false);
req.send(null);
if(req.status==200){
return eval("("+req.responseText+")");
}else{
throw new Error("AJAX request failed: "+req.status);
}
};
Ajax.asyncJsonRequest=function(url,_213,_214){
var _215=_20e++;
var elem=document.createElement("script");
elem.src=url+"&prepend=ravegeo.io.Ajax._jsonReply("+_215+","+"&append=);";
_20f[_215]={callback:_213,elem:elem};
document.body.appendChild(elem);
if(typeof (_214)!="undefined"){
setTimeout(function(){
if(_20f[_215]!=null){
ravegeo.io.Ajax._jsonReply(_215,{error:{code:"REQUEST_TIMED_OUT",message:"Request timed out: "+url}});
}
},_214);
}
};
Ajax._jsonReply=function(_217,_218){
var elem=_20f[_217].elem;
document.body.removeChild(elem);
_20f[_217].callback(_218);
_20f[_217]=null;
};
return Ajax;
})();
ravegeo.internal.MapAnimator=(function(){
var _21a=25;
var _21b=2000;
var _21c=function(map){
this._map=map;
};
_21c.prototype._animateTo=function(_21e,_21f){
var pfc=this._map._getPixelsFromCenter(_21e-this._map._geoX,_21f-this._map._geoY);
var _221=Math.sqrt(pfc.x*pfc.x+pfc.y*pfc.y)*1.25;
if(this._lastTimeout){
clearTimeout(this._lastTimeout);
}
if(_221<_21b&&_221>_21a){
if(!this._myAnimatorFunc){
var self=this;
this._myAnimatorFunc=function(){
self._doAnimate();
};
}
this._animDest=new ravegeo.internal.Point(-pfc.x,pfc.y);
this._animDone=ravegeo.internal.Point.ZERO;
this._animTime=_221;
this._animStart=new Date().getTime();
this._myAnimatorFunc();
}else{
this._map._setGeoCenter(_21e,_21f);
}
};
_21c.prototype._stop=function(){
if(this._lastTimeout){
clearTimeout(this._lastTimeout);
this._lastTimeout=null;
}
};
_21c.prototype._doAnimate=function(){
var _223=(new Date().getTime()-this._animStart)/this._animTime;
if(_223>1){
this._map._interactionEnded();
delete this._lastTimeout;
}else{
var move=this._animDest.scalarMultiply(_223).subtract(this._animDone).round();
this._animDone=this._animDone.add(move);
this._map._pixMove(move);
this._lastTimeout=setTimeout(this._myAnimatorFunc,10);
}
};
return _21c;
})();
ravegeo.internal.GeoObjectLayer=(function(){
var _225=ravegeo.internal.Utilities;
var _226={borderColor:"#000000",backgroundColor:"#7f7f7f",textColor:"#ffffff"};
var _227={borderColor:"#7f7f7f",backgroundColor:"#ffffff",textColor:"#000000"};
var _228=function(id,map,opts){
this._id=id;
this._map=map;
if(typeof (opts)=="undefined"){
opts={};
}
opts=new ravegeo.LayerOptions(opts);
this._textStyle=fixStyle(opts.textStyle,_226);
this._labelStyle=fixStyle(opts.labelStyle,_227);
this._labelsAboveSymbols=opts.labelsAboveSymbols;
this._hoverBorder=_225.getBoolean(opts.hoverBorder,true);
this._highlightColor=opts.highlightColor;
if(!this._highlightColor){
this._highlightColor="#ff0000";
}
this._labelMinScale=opts.labelMinScale==-1?0:opts.labelMinScale;
this._labelMaxScale=opts.labelMaxScale==-1?Number.MAX_VALUE:opts.labelMaxScale;
this._miniSymbolMinScale=opts.miniSymbolMinScale==-1?Number.MAX_VALUE:opts.miniSymbolMinScale;
this._miniSymbol=opts.miniSymbol;
this._geoObjects={};
this._layerDiv=document.createElement("div");
ravegeo.internal.Utilities.setStyle(this._layerDiv,"position:absolute;z-index:"+(50+id)+";overflow:visible;width:0px;height:0px;");
map._outerDiv.appendChild(this._layerDiv);
};
function fixStyle(_22c,_22d){
if(!_22c){
_22c={};
}
if(!_22c.borderColor){
_22c.borderColor=_22d.borderColor;
}
if(!_22c.backgroundColor){
_22c.backgroundColor=_22d.backgroundColor;
}
if(!_22c.textColor){
_22c.textColor=_22d.textColor;
}
return _22c;
}
_228.prototype._layout=function(_22e,_22f,_230,_231){
this._pixMapCenter={left:Math.round(_230/2),top:Math.round(_231/2)};
this._setGeoCenter(_22e,_22f);
};
_228.prototype._setGeoCenter=function(_232,_233){
this._geoCenter={x:_232,y:_233};
this._layerPixPosition={left:this._pixMapCenter.left,top:this._pixMapCenter.top};
this._positionLayerDiv();
this._positionGeoObjects();
};
_228.prototype._positionLayerDiv=function(){
this._layerDiv.style.left=this._layerPixPosition.left+"px";
this._layerDiv.style.top=this._layerPixPosition.top+"px";
};
_228.prototype._positionGeoObjects=function(){
for(var _234 in this._geoObjects){
var _235=this._geoObjects[_234];
_235._position(this._geoCenter,this._getGeoToPixels());
}
};
_228.prototype._positionGeoObject=function(_236){
_236._position(this._geoCenter,this._getGeoToPixels());
};
_228.prototype._repositionGeoObject=function(_237){
_237._reposition(this._geoCenter,this._getGeoToPixels());
};
_228.prototype._getGeoToPixels=function(){
return {x:this._map._tileWidthPix/this._map._zoomStepExtents[this._map._zoomStep][0],y:this._map._tileHeightPix/this._map._zoomStepExtents[this._map._zoomStep][1]};
};
_228.prototype._pixMove=function(dx,dy){
this._layerPixPosition.left+=dx;
this._layerPixPosition.top+=dy;
this._positionLayerDiv();
};
_228.prototype._destroy=function(){
this.clear();
this._map._outerDiv.removeChild(this._layerDiv);
delete this._layerDiv;
};
_228.prototype.clear=function(){
for(var id in this._geoObjects){
this._geoObjects[id]._destroy();
}
this._geoObjects={};
};
_228.prototype.addGeoObjects=function(objs,opts){
if(opts&&opts.clear){
this.clear();
}
for(var idx in objs){
var obj=objs[idx];
var _23f=this._geoObjects[obj.id];
obj._setMissingFields(_23f);
obj._project(this._map._projector);
obj._tiledMapInit(this,_23f);
if(_23f){
_23f._destroy();
}
this._geoObjects[obj.id]=obj;
}
};
_228.prototype.getGeoObjectIds=function(_240){
var ret=[];
var id;
if(_240){
var _243=this._map.getGeoBounds();
for(id in this._geoObjects){
var _244=this._geoObjects[id];
if(_244._isInside(_243.xMin,_243.yMin,_243.xMax,_243.yMax)){
ret[ret.length]=id;
}
}
}else{
for(id in this._geoObjects){
ret[ret.length]=id;
}
}
return ret;
};
_228.prototype.getGeoObject=function(id){
var ret=this._geoObjects[id];
if(typeof (ret)=="undefined"){
return null;
}
return ret;
};
_228.prototype.removeGeoObjects=function(ids){
for(var idx in ids){
var id=ids[idx];
if(this._geoObjects[id]){
this._geoObjects[id]._destroy();
delete this._geoObjects[id];
}
}
};
_228.prototype.setVisible=function(_24a){
if(typeof (_24a)=="undefined"||_24a){
this._layerDiv.style.visibility="visible";
}else{
this._layerDiv.style.visibility="hidden";
}
};
_228.prototype.showGeoObjects=function(_24b){
_24b=_225.getInteger(_24b);
var _24c={x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY};
var _24d={x:Number.NEGATIVE_INFINITY,y:Number.NEGATIVE_INFINITY};
for(var id in this._geoObjects){
var obj=this._geoObjects[id];
obj._expandBounds(_24c,_24d);
}
this._map._showBounds(_24c,_24d,_24b);
};
_228.prototype.highlightGeoObject=function(id,_251){
var _252=this._geoObjects[id];
if(!_251){
_251={};
}
var map=this._map;
if(map._highlightedGeoObject){
map._highlightedGeoObject._removeHighlight();
delete map._highlightedGeoObject;
}
if(_252){
if(_252._notYetLoaded){
_252._doHighlight=_251;
}
if(typeof (_251.center)!="string"){
_251.center="";
}
if(!_251.showText){
_251.showText=false;
}
if(!_251.showHighlight){
_251.showHighlight=false;
}
_252._setHighlight(_251.showText,_251.showHighlight);
map._highlightedGeoObject=_252;
var _254=_251.center.toLowerCase();
var _255;
if(_254=="whennotshowing"){
var _256=(map._mapWidth*0.43)*(map._zoomStepExtents[map._zoomStep][0]/map._tileWidthPix);
var _257=(map._mapHeight*0.43)*(map._zoomStepExtents[map._zoomStep][1]/map._tileHeightPix);
var minx=map._geoX-_256;
var miny=map._geoY-_257;
var maxx=map._geoX+_256;
var maxy=map._geoY+_257;
_255=_252._getCenter();
if(_255.x<minx||_255.x>maxx||_255.y<miny||_255.y>maxy){
map._animator._animateTo(_255.x,_255.y);
}
}else{
if(_254!="never"){
_255=_252._getCenter();
map._animator._animateTo(_255.x,_255.y);
}
}
}
};
_228.prototype.moveGeoObject=function(id,_25d,_25e){
_25d=_225.getFloat(_25d,0);
_25e=_225.getFloat(_25e,0);
var _25f=this._geoObjects[id];
if(_25f){
_25f._move(_25d,_25e,this._map._projector);
}
};
_228.prototype.pickGeoObjectIds=function(geoX,geoY){
geoX=_225.getFloat(geoX);
geoY=_225.getFloat(geoY);
var _262=this._map._projector.forward(geoX,geoY);
var _263=this._geoToPixelPoint(_262);
var _264=[];
for(var _265 in this._geoObjects){
var _266=this._geoObjects[_265];
if(_266._pick(_263)){
_264[_264.length]=_266.id;
}
}
return _264;
};
_228.prototype._pickObject=function(_267){
for(var _268 in this._geoObjects){
var _269=this._geoObjects[_268];
if(_269._pick(_267)){
return _269;
}
}
};
_228.prototype._geoToPixelPointsX=function(_26a){
var _26b=this._getGeoToPixels().x;
var _26c=this._map._getGeoBounds(this._map._zoomStep);
var ret=[];
for(var i=0;i<_26a.length;i++){
ret[i]=(_26a[i]-_26c.xMin)*_26b;
}
return ret;
};
_228.prototype._geoToPixelPointsY=function(_26f){
var _270=this._getGeoToPixels().y;
var _271=this._map._getGeoBounds(this._map._zoomStep);
var ret=[];
for(var i=0;i<_26f.length;i++){
ret[i]=(_271.yMax-_26f[i])*_270;
}
return ret;
};
_228.prototype._geoToPixelPoint=function(_274){
var _275=this._getGeoToPixels();
var _276=this._map._getGeoBounds(this._map._zoomStep);
var x=(_274[0]-_276.xMin)*_275.x;
var y=(_276.yMax-_274[1])*_275.y;
var ret=[x,y];
return ret;
};
_228.prototype.setArrangeGeoObjects=new function(_27a){
};
return _228;
})();
ravegeo.internal.TileLayer=(function(){
var _27b=function(map){
this._map=map;
this._tileWidthPix=map._tileWidthPix;
this._tileHeightPix=map._tileHeightPix;
this._myDiv=document.createElement("div");
ravegeo.internal.Utilities.setStyle(this._myDiv,"position:absolute;overflow:visible;width:10px;height:10px;");
map._outerDiv.appendChild(this._myDiv);
};
_27b.prototype._layout=function(_27d,_27e,_27f,_280){
this._numberOfTiles={x:Math.ceil(_27f/this._tileWidthPix)+1,y:Math.ceil(_280/this._tileHeightPix)+1};
var _281=_27f/2;
var _282=_280/2;
this._wrapLimit={min:{},max:{}};
if(this._numberOfTiles.x%2==0){
this._wrapLimit.max.x=(this._tileWidthPix*this._numberOfTiles.x)/2-_281;
this._wrapLimit.min.x=-this._wrapLimit.max.x;
}else{
this._wrapLimit.max.x=(this._tileWidthPix*(this._numberOfTiles.x-1))/2-_281;
this._wrapLimit.min.x=-this._wrapLimit.max.x-this._tileWidthPix;
}
if(this._numberOfTiles.y%2==0){
this._wrapLimit.max.y=(this._tileHeightPix*this._numberOfTiles.y)/2-_282;
this._wrapLimit.min.y=-this._wrapLimit.max.y;
}else{
this._wrapLimit.max.y=(this._tileHeightPix*(this._numberOfTiles.y-1))/2-_282;
this._wrapLimit.min.y=-this._wrapLimit.max.y-this._tileHeightPix;
}
this._originalLeft=Math.floor(_27f/2);
this._originalTop=Math.floor(_280/2);
this._tiles=[];
ravegeo.internal.Utilities.removeChildren(this._myDiv);
var _283=-Math.floor(this._numberOfTiles.x/2);
var _284=-Math.floor(this._numberOfTiles.y/2);
this._allowedTilePositions={min:{x:_283,y:_284},max:{x:_283+this._numberOfTiles.x-1,y:_284+this._numberOfTiles.y-1}};
for(var i=this._allowedTilePositions.min.x;i<=this._allowedTilePositions.max.x;++i){
for(var j=this._allowedTilePositions.min.y;j<=this._allowedTilePositions.max.y;++j){
var tile=new ravegeo.internal.Tile(this,i,j);
this._tiles[this._tiles.length]=tile;
this._myDiv.appendChild(tile.img);
}
}
this._positionAllTiles(_27d,_27e);
};
_27b.prototype._setGeoCenter=function(_288,_289){
this._positionAllTiles(_288,_289);
};
_27b.prototype._positionAllTiles=function(_28a,_28b){
var pfc=this._map._getPixelsFromCenter(this._map._originX-_28a,this._map._originY-_28b);
this._dx=pfc.x%this._tileWidthPix;
this._dy=-pfc.y%this._tileHeightPix;
if(pfc.x<0){
this._ctx=-Math.ceil(pfc.x/this._tileWidthPix);
}else{
this._ctx=-Math.floor(pfc.x/this._tileWidthPix);
}
if(pfc.y<0){
this._cty=-Math.ceil(pfc.y/this._tileHeightPix)-1;
}else{
this._cty=-Math.floor(pfc.y/this._tileHeightPix)-1;
}
for(var i=0;i<this._tiles.length;++i){
this._tiles[i]._updateImage();
this._tiles[i]._position();
}
this._wrapIfNecessary();
this._positionDiv();
this._map._interactionEnded();
};
_27b.prototype._positionDiv=function(){
this._myDiv.style.left=(this._originalLeft+this._dx)+"px";
this._myDiv.style.top=(this._originalTop+this._dy)+"px";
};
_27b.prototype._pixMove=function(x,y){
this._dx+=x;
this._dy+=y;
this._wrapIfNecessary();
this._positionDiv();
};
_27b.prototype._wrapIfNecessary=function(){
if(this._shouldWrap()){
var dtx=0;
if(this._dx<this._wrapLimit.min.x){
dtx=Math.min(Math.ceil(this._dx/this._tileWidthPix),-1);
}else{
if(this._dx>this._wrapLimit.max.x){
dtx=Math.max(Math.ceil(this._dx/this._tileWidthPix),1);
}
}
var dty=0;
if(this._dy<this._wrapLimit.min.y){
dty=Math.min(Math.ceil(this._dy/this._tileHeightPix),-1);
}else{
if(this._dy>this._wrapLimit.max.y){
dty=Math.max(Math.ceil(this._dy/this._tileHeightPix),1);
}
}
this._wrap(dtx,dty);
}
};
_27b.prototype._shouldWrap=function(){
var _292=this._dx>this._wrapLimit.max.x||this._dx<this._wrapLimit.min.x;
var _293=this._dy>this._wrapLimit.max.y||this._dy<this._wrapLimit.min.y;
return _292||_293;
};
_27b.prototype._wrap=function(dtx,dty){
this._ctx-=dtx;
this._cty+=dty;
this._dx-=this._tileWidthPix*dtx;
this._dy-=this._tileHeightPix*dty;
for(var i=0;i<this._tiles.length;++i){
this._tiles[i]._wrap(dtx,dty);
}
};
return _27b;
})();
ravegeo.internal.ControlCommons=(function(){
var _297=ravegeo.internal.Utilities;
var _298=ravegeo.ControlPosition;
var _299={};
var _29a=10;
var _29b=10;
_299.initControl=function(_29c,_29d,_29e){
_29c.position=_297.getInteger(_29d,_29e);
validateControlPosition(_29c.position);
};
function validateControlPosition(_29f){
for(var idx in _298){
if(_298[idx]==_29f){
return;
}
}
throw Error("Unsupported control position!");
}
_299.serialize=function(_2a1){
var s=_2a1._getType();
s+=_2a1.position+";";
return s;
};
_299.addToTiledMap=function(map,_2a4){
if(!map._controls){
initMapControls(map);
}
var div=_2a4._getDivElement();
_2a4._div=div;
setDivPosition(_2a4);
map._outerDiv.appendChild(div);
_2a4._map=map;
_2a4._update();
saveControl(map,_2a4);
};
function setDivPosition(_2a6){
_2a6._div.style.position="absolute";
switch(_2a6.position){
case _298.TOP_LEFT:
_2a6._div.style.top=_29b+"px";
_2a6._div.style.left=_29a+"px";
break;
case _298.TOP_RIGHT:
_2a6._div.style.top=_29b+"px";
_2a6._div.style.right=_29a+"px";
break;
case _298.BOTTOM_LEFT:
_2a6._div.style.bottom=_29b+"px";
_2a6._div.style.left=_29a+"px";
break;
case _298.BOTTOM_RIGHT:
_2a6._div.style.bottom=_29b+"px";
_2a6._div.style.right=_29a+"px";
}
}
function saveControl(map,_2a8){
var type=_2a8._getType();
if(map._controls[type]){
_299.removeFromTiledMap(map,map._controls[type]);
}
map._controls[type]=_2a8;
}
function initMapControls(map){
map._controls={};
if(!map._callback){
map._callback={};
}
var _2ab=map._callback.interactionEnded;
map._callback.interactionEnded=function(){
for(var idx in map._controls){
map._controls[idx]._update();
}
if(_2ab){
_2ab(map);
}
};
}
_299.removeFromTiledMap=function(map,_2ae){
delete map._controls[_2ae._getType()];
map._outerDiv.removeChild(_2ae._div);
};
return _299;
})();
ravegeo.Symbol=(function(){
var _2af=ravegeo.internal.Utilities;
var _2b0=function(id,_2b2){
if(arguments.length>2){
this._initWithDefaults(arguments[0],arguments[1],arguments[2],arguments[3],arguments[4],arguments[5],arguments[6],arguments[7]);
}else{
this._initNoDefaults(id,_2b2);
}
};
_2b0.prototype._initWithDefaults=function(id,x,y,_2b6,_2b7,text,_2b9,_2ba){
_2af.ensureString(id,"id");
this.id=id;
this._x=_2af.getFloat(x);
this._y=_2af.getFloat(y);
this.symbol=_2b6;
this.label=_2af.isValue(_2b7)?_2b7:"";
this.text=_2af.isValue(text)?text:"";
this._providedAnchorX=_2af.getValueOrUndefined(_2b9,_2af.getInteger);
this._providedAnchorY=_2af.getValueOrUndefined(_2ba,_2af.getInteger);
};
_2b0.prototype._initNoDefaults=function(id,_2bc){
_2af.ensureString(id,"id");
this.id=id;
this._x=_2af.getValueOrUndefined(_2bc.x,_2af.getFloat);
this._y=_2af.getValueOrUndefined(_2bc.y,_2af.getFloat);
this.symbol=_2bc.symbol;
this.label=_2bc.label;
this.text=_2bc.text;
this._providedAnchorX=_2af.getValueOrUndefined(_2bc.anchorX,_2af.getInteger);
this._providedAnchorY=_2af.getValueOrUndefined(_2bc.anchorY,_2af.getInteger);
};
_2b0.prototype._setMissingFields=function(_2bd){
if(_2af.isValue(_2bd)&&_2af.isValue(this.symbol)){
_2bd._providedAnchorX=null;
_2bd._providedAnchorY=null;
}
_2af.setMissingObjectFields(_2bd,this,["_xUnprojected","_yUnprojected","symbol","label","text","_providedAnchorX","_providedAnchorY"],["_x","_y","symbol","label","text","_providedAnchorX","_providedAnchorY"],[null,null,null,"","",null,null]);
if(this._x==null||this._y==null){
throw new Error("New object's required properties are missing! Required properties: x, y.");
}
};
_2b0.prototype.getPoint=function(){
if(this._projector){
var _2be=this._projector.reverse(this._x,this._y);
return {x:_2be[0],y:_2be[1]};
}
return {x:this._x,y:this._y};
};
_2b0.prototype._project=function(_2bf){
if(!_2af.isValue(this._x)||!_2af.isValue(this._y)){
return;
}
this._xUnprojected=this._x;
this._yUnprojected=this._y;
this._projector=_2bf;
var _2c0=this._projector.forward(this._x,this._y);
this._x=_2c0[0];
this._y=_2c0[1];
};
_2b0.prototype._serialize=function(){
var s="s";
s+=this.id.length+";"+this.id;
s+=_2af.isValue(this._x)?this._x+";":";";
s+=_2af.isValue(this._y)?this._y+";":";";
s+=_2af.isValue(this.symbol)?this.symbol.length+";"+this.symbol:";";
s+=_2af.isValue(this.label)?this.label.length+";"+this.label:";";
s+=_2af.isValue(this.text)?this.text.length+";"+this.text:";";
s+=_2af.isValue(this._providedAnchorX)?_2af.getInteger(this._providedAnchorX)+";":";";
s+=_2af.isValue(this._providedAnchorY)?_2af.getInteger(this._providedAnchorY)+";":";";
return s;
};
_2b0.prototype._createBallon=function(_2c2){
var _2c3=document.createElement("div");
_2af.setStyle(_2c3,"position:absolute;top:0px;left:0px;z-index:53;border:1px solid;cursor:text;padding:3px 5px 3px 5px;white-space:pre;");
_2c3.style.borderColor=_2af.getColor(_2c2.borderColor);
_2c3.style.backgroundColor=_2af.getColor(_2c2.backgroundColor);
_2c3.innerHTML+=this.text;
_2c3.style.color=_2af.getColor(_2c2.textColor);
_2c3.style.left=(this._left+this._img.width+2)+"px";
_2c3.style.top=(this._top+this._img.height+2)+"px";
_2af.setClassName(_2c3,"raveGeoWebMapText");
return _2c3;
};
function imageLoaded(){
var _2c4=this._symbol;
delete _2c4._notYetLoaded;
_2c4._layer._positionGeoObject(_2c4);
if(_2c4._doHighlight){
_2c4._layer.highlightGeoObject(_2c4.id,_2c4._doHighlight);
delete _2c4._doHighlight;
}
}
_2b0.prototype._tiledMapInit=function(_2c5,_2c6){
var opts;
if(_2c6){
opts={center:"Never"};
if(_2c6._highlightElement){
opts.showHighlight=true;
}
if(_2c6._alwaysBalloon){
opts.showText=true;
}
}
this._layer=_2c5;
var img=document.createElement("img");
this._img=img;
img.src=this.symbol;
img.style.position="absolute";
img.style.zIndex="50";
try{
img.style.cursor="pointer";
}
catch(e){
img.style.cursor="hand";
}
img._symbol=this;
img._tile={owner:_2c5};
ravegeo.TiledMap._addMapEvents(img);
var _2c9;
if(!_2af.stringIsEmpty(this.label)){
var _2ca=document.createElement("span");
this._innerLabelSpan=_2ca;
_2ca.innerHTML=this.label;
_2af.setStyle(_2ca,"font-family:sans-serif;font-size:small;padding:0px;white-space:pre;border:1px solid;padding:2px 3px 2px 3px;");
_2af.setClassName(_2ca,"raveGeoWebMapLabel");
_2ca.style.borderColor=_2af.getColor(_2c5._labelStyle.borderColor);
_2ca.style.backgroundColor=_2af.getColor(_2c5._labelStyle.backgroundColor);
_2ca.style.color=_2af.getColor(_2c5._labelStyle.textColor);
labelDiv=this._labelDiv=document.createElement("div");
_2af.setStyle(labelDiv,"position:absolute;left:-755px;z-index:49;width:1500px;text-align:center;padding:5px;margin:1px;");
labelDiv.appendChild(_2ca);
_2ca._tile={owner:_2c5};
ravegeo.TiledMap._addMapEvents(_2ca);
labelDiv._tile={owner:_2c5};
ravegeo.TiledMap._addMapEvents(labelDiv);
_2c9=this._symbolCenterDiv=document.createElement("div");
_2af.setStyle(_2c9,"position:absolute;z-index:49;width:0px;height:0px;padding:0px;margin:0px;");
_2c9.appendChild(labelDiv);
}
_2c5._positionGeoObject(this);
_2c5._layerDiv.appendChild(img);
if(_2c9){
_2c5._layerDiv.appendChild(_2c9);
}
if(opts){
_2c5.highlightGeoObject(this.id,opts);
}
};
_2b0.prototype._destroy=function(){
if(this==this._layer._map._highlightedGeoObject){
this._removeHighlight();
delete this._layer._map._highlightedGeoObject;
}
this._layer._layerDiv.removeChild(this._img);
if(this._balloon){
this._layer._layerDiv.removeChild(this._balloon);
}
if(this._symbolCenterDiv){
this._labelDiv._tile=null;
this._innerLabelSpan._tile=null;
this._layer._layerDiv.removeChild(this._symbolCenterDiv);
}
};
_2b0.prototype._position=function(_2cb,_2cc){
var _2cd=this._getCurrentImage();
this._setLeftAndTop(_2cb,_2cc);
this._img.style.left=this._left+"px";
this._img.style.top=this._top+"px";
if(this._labelDiv){
var _2ce=this._inScaleRange(this._layer._labelMinScale,this._layer._labelMaxScale);
this._labelDiv.style.display=_2ce?"block":"none";
if(_2ce){
this._symbolCenterDiv.style.left=this._left+this._img.width/2+"px";
this._symbolCenterDiv.style.top=this._top+this._img.height/2+"px";
if(this._layer._labelsAboveSymbols){
this._labelDiv.style.bottom=(this._img.height/2-3)+"px";
}else{
this._labelDiv.style.top=(this._img.height/2-1)+"px";
}
}
}
this._moveText();
if(!_2af.isImageLoaded(_2cd)){
this._notYetLoaded=true;
_2af.onImageLoaded(_2cd,imageLoaded);
}
if(this._highlightElement){
var _2cf=Math.round(this._left+this._img.width/2);
var _2d0=Math.round(this._top+this._img.height/2);
var ow=this._highlightOuterWidth;
if(typeof (ow)!="undefined"){
this._highlightElement.style.left=Math.round(_2cf-ow)+"px";
this._highlightElement.style.top=(_2d0-ow)+"px";
}
}
};
_2b0.prototype._moveText=function(){
if(this._balloon){
this._balloon.style.left=(this._left+this._img.width+2)+"px";
this._balloon.style.top=(this._top+this._img.height+2)+"px";
}
if(this._alwaysBalloon){
this._alwaysBalloon.style.left=(this._left+this._img.width+2)+"px";
this._alwaysBalloon.style.top=(this._top+this._img.height+2)+"px";
}
};
_2b0.prototype._inScaleRange=function(_2d2,_2d3){
var _2d4=this._layer._map.getScale();
return !(_2d2&&_2d4<_2d2||_2d3&&_2d4>_2d3);
};
_2b0.prototype._getCurrentImage=function(){
this._showMiniSymbol=this._layer._miniSymbol!=""&&this._inScaleRange(this._layer._miniSymbolMinScale);
var _2d5=new Image();
_2d5.src=this._showMiniSymbol?this._layer._miniSymbol:this.symbol;
_2d5._symbol=this._img._symbol;
this._img.src=_2d5.src;
this._img.width=_2d5.width;
this._img.height=_2d5.height;
return _2d5;
};
_2b0.prototype._setLeftAndTop=function(_2d6,_2d7){
var cx=-Math.round((_2d6.x-this._x)*_2d7.x);
var cy=Math.round((_2d6.y-this._y)*_2d7.y);
this.anchorX=!_2af.isValue(this._providedAnchorX)||this._showMiniSymbol?this._img.width/2:this._providedAnchorX;
this.anchorY=!_2af.isValue(this._providedAnchorY)||this._showMiniSymbol?this._img.height/2:this._providedAnchorY;
this._left=cx-this.anchorX;
this._top=cy-this.anchorY;
};
_2b0.prototype._isInside=function(xMin,yMin,xMax,yMax){
return this._x>=xMin&&this._y>=yMin&&this._x<=xMax&&this._y<=yMax;
};
_2b0.prototype._expandBounds=function(_2de,_2df){
if(this._x<_2de.x){
_2de.x=this._x;
}
if(this._x>_2df.x){
_2df.x=this._x;
}
if(this._y<_2de.y){
_2de.y=this._y;
}
if(this._y>_2df.y){
_2df.y=this._y;
}
};
_2b0.prototype._getCenter=function(){
return {x:this._x,y:this._y};
};
_2b0.prototype._setHighlight=function(_2e0,_2e1){
if(_2e0){
this._alwaysBalloon=this._createBallon(this._layer._textStyle);
this._layer._layerDiv.appendChild(this._alwaysBalloon);
}
if(_2e1){
var _2e2=this._img.width;
var _2e3=this._img.height;
var _2e4=Math.round(this._left+_2e2/2);
var _2e5=Math.round(this._top+_2e3/2);
var _2e6=Math.max(_2e2,_2e3)/3;
var _2e7=(Math.sqrt(_2e2*_2e2+_2e3*_2e3)/2)+_2e6;
var ow=Math.round(_2e7+_2e6/2);
this._highlightOuterWidth=ow;
var _2e9=ravegeo.internal.Canvas.create(ow*2,ow*2);
var _2ea=_2e9.getElement();
_2ea.style.position="absolute";
_2ea.style.zIndex="51";
_2ea.style.left=Math.round(_2e4-ow)+"px";
_2ea.style.top=(_2e5-ow)+"px";
this._layer._layerDiv.appendChild(_2ea);
this._highlightElement=_2ea;
var end=Math.PI*2+0.1;
var inc=Math.PI/6;
for(var i=0;i<=end;i+=inc){
var x=ow-Math.floor(_2e7*Math.cos(i));
var y=ow-Math.floor(_2e7*Math.sin(i));
_2e9.drawCircle(x,y,_2e6/2,_2af.fixStyle({fillColor:this._layer._highlightColor}));
}
_2ea._tile={owner:this._layer};
ravegeo.TiledMap._addMapEvents(_2ea);
var _2f0=_2ea.childNodes;
for(var idx in _2f0){
var _2f2=_2f0[idx];
_2f2._tile={owner:this._layer};
}
}
this._img.style.zIndex="53";
};
_2b0.prototype._removeHighlight=function(){
this._img.style.zIndex="50";
if(this._alwaysBalloon){
this._layer._layerDiv.removeChild(this._alwaysBalloon);
delete this._alwaysBalloon;
}
if(this._highlightElement){
this._layer._layerDiv.removeChild(this._highlightElement);
delete this._highlightOuterWidth;
delete this._highlightElement;
}
};
_2b0.prototype._pick=function(_2f3){
var _2f4={x:this._layer._map._geoX,y:this._layer._map._geoY};
var _2f5=this._layer._getGeoToPixels();
var cx=-Math.round((_2f4.x-this._x)*_2f5.x);
var cy=Math.round((_2f4.y-this._y)*_2f5.y);
var left=cx-this.anchorX+this._layer._map._mapWidth/2;
var top=cy-this.anchorY+this._layer._map._mapHeight/2;
return _2f3[0]>left&&_2f3[0]<(left+this._img.width+5)&&_2f3[1]>top&&_2f3[1]<(top+this._img.height+5);
};
_2b0.prototype._move=function(_2fa,_2fb,_2fc){
var _2fd=this.getPoint();
this._x=_2fd.x+_2fa;
this._y=_2fd.y+_2fb;
this._project(_2fc);
this._layer._positionGeoObject(this);
};
return _2b0;
})();
ravegeo.Ellipse=(function(){
var _2fe=ravegeo.internal.Utilities;
var _2ff=ravegeo.internal.GeometryFunctions;
var _300=function(id,_302){
if(arguments.length>2){
this._initWithDefaults(arguments[0],arguments[1],arguments[2],arguments[3],arguments[4],arguments[5],arguments[6]);
}else{
this._initNoDefaults(id,_302);
}
};
_300.prototype._initWithDefaults=function(id,x1,y1,x2,y2,_308,_309){
_2fe.ensureString(id,"id");
this.id=id;
this._x1=_2fe.getFloat(x1);
this._x2=_2fe.getFloat(x2);
this._y1=_2fe.getFloat(y1);
this._y2=_2fe.getFloat(y2);
this._setMinMaxPoints();
this.width=_2fe.getInteger(_308,0);
this.color=(typeof (_309)!="undefined")?_309:"#000000";
};
_300.prototype._initNoDefaults=function(id,_30b){
_2fe.ensureString(id,"id");
this.id=id;
this._x1=_2fe.getValueOrUndefined(_30b.x1,_2fe.getFloat);
this._x2=_2fe.getValueOrUndefined(_30b.x2,_2fe.getFloat);
this._y1=_2fe.getValueOrUndefined(_30b.y1,_2fe.getFloat);
this._y2=_2fe.getValueOrUndefined(_30b.y2,_2fe.getFloat);
this.width=_2fe.getValueOrUndefined(_30b.width,_2fe.getInteger);
this.color=_30b.color;
};
_300.prototype._setMissingFields=function(_30c){
_2fe.setMissingObjectFields(_30c,this,["_x1Unprojected","_x2Unprojected","_y1Unprojected","_y2Unprojected","color","width"],["_x1","_x2","_y1","_y2","color","width"],[null,null,null,null,"#000000",0]);
if(this._x1==null||this._x2==null||this._y1==null||this._y2==null){
throw new Error("New object's required properties are missing! Required properties: x1, x2, y1, y2.");
}
this._setMinMaxPoints();
};
_300.prototype._setMinMaxPoints=function(){
if(this._x1<this._x2){
this._xMin=this._x1;
this._xMax=this._x2;
}else{
this._xMin=this._x2;
this._xMax=this._x1;
}
if(this._y1<this._y2){
this._yMin=this._y1;
this._yMax=this._y2;
}else{
this._yMin=this._y2;
this._yMax=this._y1;
}
};
_300.prototype.getBounds=function(){
var rect={xMin:this._xMin,yMin:this._yMin,xMax:this._xMax,yMax:this._yMax};
if(this._projector){
var pmin=this._projector.reverse(rect.xMin,rect.yMin);
var pmax=this._projector.reverse(rect.xMax,rect.yMax);
rect.xMin=pmin[0];
rect.yMin=pmin[1];
rect.xMax=pmax[0];
rect.yMax=pmax[1];
}
return rect;
};
_300.prototype._project=function(_310){
if(!_2fe.isValue(this._x1)||!_2fe.isValue(this._y1)||!_2fe.isValue(this._x2)||!_2fe.isValue(this._y2)){
return;
}
this._x1Unprojected=this._x1;
this._y1Unprojected=this._y1;
this._x2Unprojected=this._x2;
this._y2Unprojected=this._y2;
this._projector=_310;
var _311=_310.forward(this._x1,this._y1);
this._x1=_311[0];
this._y1=_311[1];
var _311=_310.forward(this._x2,this._y2);
this._x2=_311[0];
this._y2=_311[1];
var _311=_310.forward(this._xMin,this._yMin);
this._xMin=_311[0];
this._yMin=_311[1];
_311=_310.forward(this._xMax,this._yMax);
this._xMax=_311[0];
this._yMax=_311[1];
};
_300.prototype._serialize=function(){
var e="e";
e+=this.id.length+";"+this.id;
e+=_2fe.isValue(this._x1)?this._x1+";":";";
e+=_2fe.isValue(this._y1)?this._y1+";":";";
e+=_2fe.isValue(this._x2)?this._x2+";":";";
e+=_2fe.isValue(this._y2)?this._y2+";":";";
e+=_2fe.isValue(this.width)?this.width+";":";";
e+=_2fe.isValue(this.color)?this.color.length+";"+this.color:";";
return e;
};
_300.prototype._tiledMapInit=function(_313,_314){
this._layer=_313;
_313._positionGeoObject(this);
};
_300.prototype._destroy=function(){
this._layer._layerDiv.removeChild(this._canvasElement);
};
_300.prototype._position=function(_315,_316){
if(this._canvasElement){
this._layer._layerDiv.removeChild(this._canvasElement);
}
var xMin=Math.round((this._xMin-_315.x)*_316.x)-5;
var xMax=Math.round((this._xMax-_315.x)*_316.x)+5;
var yMin=Math.round((_315.y-this._yMax)*_316.y)-5;
var yMax=Math.round((_315.y-this._yMin)*_316.y)+5;
var _31b=xMax-xMin;
var _31c=yMax-yMin;
var _31d=ravegeo.internal.Canvas.create(_31b,_31c);
var _31e=_31d.getElement();
this._canvasElement=_31e;
_31e.style.position="absolute";
_31e.style.zIndex="51";
_31e.style.left=xMin+"px";
_31e.style.top=yMin+"px";
this._layer._layerDiv.appendChild(_31e);
var _31f=(this.width>0)?{strokeColor:this.color,strokeWidth:this.width}:{fillColor:this.color};
ravegeo.internal.Utilities.fixStyle(_31f);
_31d.drawOval(5,5,_31b-10,_31c-10,_31f);
ravegeo.internal.MapCommons._addCanvasObjectEvents(this);
};
_300.prototype._reposition=function(_320,_321){
var xMin=Math.round((this._xMin-_320.x)*_321.x)-5;
var xMax=Math.round((this._xMax-_320.x)*_321.x)+5;
var yMin=Math.round((_320.y-this._yMax)*_321.y)-5;
var yMax=Math.round((_320.y-this._yMin)*_321.y)+5;
var _326=xMax-xMin;
var _327=yMax-yMin;
var _328=this._canvasElement;
_328.style.position="absolute";
_328.style.zIndex="51";
_328.style.left=xMin+"px";
_328.style.top=yMin+"px";
};
_300.prototype._isInside=function(xMin,yMin,xMax,yMax){
return this._xMin<xMax&&this._xMax>xMin&&this._yMin<yMax&&this._yMax>yMin;
};
_300.prototype._expandBounds=function(_32d,_32e){
if(this._xMin<_32d.x){
_32d.x=this._xMin;
}
if(this._xMax>_32e.x){
_32e.x=this._xMax;
}
if(this._yMin<_32d.y){
_32d.y=this._yMin;
}
if(this._yMax>_32e.y){
_32e.y=this._yMax;
}
};
_300.prototype._getCenter=function(){
return {x:(this.minX+this.maxX)/2,y:(this.minY+this.maxY)/2};
};
_300.prototype._setHighlight=function(_32f,_330){
};
_300.prototype._removeHighlight=function(){
};
_300.prototype._pick=function(_331){
var _332=this._layer._geoToPixelPointsX([this._xMin,this._xMax]);
var _333=this._layer._geoToPixelPointsY([this._yMax,this._yMin]);
return _2ff.isPointInsideEllipse(_332,_333,_331,this.width);
};
_300.prototype._move=function(_334,_335,_336){
var _337=this.getBounds();
this._xMin=_337.xMin+_334;
this._xMax=_337.xMax+_334;
this._yMin=_337.yMin+_335;
this._yMax=_337.yMax+_335;
this._project(_336);
this._layer._repositionGeoObject(this);
};
return _300;
})();
ravegeo.AppletMap=(function(){
var _338=0;
var _339=ravegeo.internal.Utilities;
var _33a=ravegeo.internal.ToolEventsDispatcher;
var _33b=function(_33c){
ravegeo.internal.MapCommons._fixParams(_33c);
this._projector=ravegeo.internal.PlateCarreProjector;
this._appletTimeoutCallback=_33c._appletTimeoutCallback;
this._callback=_33c.callback;
this._mapContainer=_33c.mapContainer;
this._layers=[];
this._tools=[];
var _33d=ravegeo.internal.MapCommons.defaultInteractionDelay;
if(typeof (_33c.interactionDelay)!="undefined"){
_33d=_339.getInteger(_33c.interactionDelay);
if(_33d>ravegeo.internal.MapCommons.maxInteractionDelay||_33d<0){
_33d=ravegeo.internal.MapCommons.maxInteractionDelay;
}
}
var _33e="webmap-";
_33e+=ravegeo.internal.MapCommons.version+".jar";
this._id="RaveGeoWebMapApplet"+_338++;
var _33f=_33c.url+_33e;
var html="<applet id='"+this._id+"' code='ravegeo.webmap.WebMapApplet.class' archive='"+_33f+"' mayscript='true' width='1' height='1'>";
html+="<param name='cache_archive' value='"+_33f+"' />";
html+="<param name='url' value='"+_33c.url+"' />";
html+="<param name='name' value='"+_33c.name+"' />";
if(_33c.key){
html+="<param name='key' value='"+_33c.key+"' />";
}
html+="<param name='callbackId' value='"+this._id+"' />";
html+="<param name='interactionDelay' value='"+_33d+"' />";
if(_33c.initialViewArea){
var x=_339.getFloat(_33c.initialViewArea.x);
var y=_339.getFloat(_33c.initialViewArea.y);
var _343=this._projector.forward(x,y);
html+="<param name='initialViewArea.x' value='"+_343[0]+"' />";
html+="<param name='initialViewArea.y' value='"+_343[1]+"' />";
html+="<param name='initialViewArea.scale' value='"+_33c.initialViewArea.scale+"' />";
}
if(_33c.style){
var _344="";
for(var k in _33c.style){
_344+=k+"|"+_33c.style[k]+"|";
}
html+="<param name='style' value='"+_344+"' />";
}
html+="<param name='userAgent' value='"+navigator.userAgent+"' />";
html+="</applet>";
this._mapContainer.innerHTML+=html;
ravegeo.AppletMap.appletMaps[this._id]=this;
this._isAppletLoaded=false;
if(_33c._maxAppletLoadTime){
var _346=this;
setTimeout(function(){
_346._appletLoadTimedOut();
},_33c._maxAppletLoadTime);
}
this._params=_33c;
this.addTool(ravegeo.tools.internal.DeprecatedCallbacksTool);
this._sizeCallbacks=[];
};
_33b.prototype._appletLoaded=function(){
this._isAppletLoaded=true;
};
_33b.prototype._appletLoadTimedOut=function(){
if(!this._isAppletLoaded){
this._abortInit("AppletLoadTimeout","The applet did not load in the specified maximum time.");
}
};
_33b.prototype._abortInit=function(code,_348){
if(this._appletTimeoutCallback){
this._appletTimeoutCallback();
}else{
this._errorDuringInit(code,_348);
}
};
_33b.prototype._mapLoaded=function(){
var _349=this._params;
delete this._params;
this._applet=document.getElementById(this._id);
try{
this._applet.emptyMethod();
}
catch(e){
if(this._appletTimeoutCallback){
this._appletTimeoutCallback();
}else{
this._errorDuringInit("LiveConnectNotAvailable","Could not connect to applet using LiveConnect.");
}
return;
}
var _34a=this._mapContainer.clientWidth;
var _34b=this._mapContainer.clientHeight;
if(this._callback&&this._callback.mapLoaded){
var map=this;
this._addSizeCallback(function(){
map._callback.mapLoaded(map);
},_34a,_34b);
}
this._applet.style.width=_34a+"px";
this._applet.style.height=_34b+"px";
try{
this._applet.emptyMethod();
}
catch(e){
}
this._notifyJavaOfResizeIfNeeded(_34a,_34b);
ravegeo.internal.Utilities.removeChildren(this._mapContainer,this._applet);
};
_33b.prototype._mapSizeSet=function(_34d,_34e){
for(var i=0;i<this._sizeCallbacks.length;i++){
var _350=this._sizeCallbacks[i];
if(_350.width==_34d&&_350.height==_34e){
_350.callback();
this._sizeCallbacks.splice(i,1);
}
}
};
_33b.prototype._errorDuringInit=function(code,_352){
this._mapContainer.innerHTML="Fatal error: "+code+"<br>"+_352;
if(this._callback&&this._callback.errorOccurred){
this._callback.errorOccurred(code,_352);
}
};
_33b.prototype._interactionEnded=function(){
if(this._callback&&this._callback.interactionEnded){
this._callback.interactionEnded(this);
}
};
_33b.prototype._mouseClicked=function(x,y,_355,_356){
this._notifyTools("mouseClicked",x,y,_355,_356);
};
_33b.prototype._mouseDoubleClicked=function(x,y,_359,_35a){
this._notifyTools("mouseDoubleClicked",x,y,_359,_35a);
};
_33b.prototype._mousePressed=function(x,y,_35d,_35e){
this._notifyTools("mousePressed",x,y,_35d,_35e);
};
_33b.prototype._mouseMoved=function(x,y,_361,_362){
this._notifyTools("mouseMoved",x,y,_361,_362);
};
_33b.prototype._mouseReleased=function(x,y,_365,_366){
this._notifyTools("mouseReleased",x,y,_365,_366);
};
_33b.prototype._linkPressed=function(url){
window.location=url;
};
_33b.prototype._notifyTools=function(_368,x,y,_36b,_36c){
var _36d=null;
if(_36b!=null){
_36d=this._layers[_36b];
}
for(var idx in this._tools){
if(this._tools[idx][_368]){
this._tools[idx][_368](this,x,y,_36d,_36c);
}
}
};
_33b.prototype.getCenterX=function(){
var x=this._applet.getCenterX();
var y=this._applet.getCenterY();
var _371=this._projector.reverse(x,y);
return _371[0];
};
_33b.prototype.getCenterY=function(){
var y=this._applet.getCenterY();
var x=this._applet.getCenterX();
var _374=this._projector.reverse(x,y);
return _374[1];
};
_33b.prototype.getScale=function(){
return this._applet.getScale();
};
_33b.prototype.getGeoBounds=function(){
var _375=eval("("+this._applet.getGeoBounds()+")");
_375[0]=this._projector.reverse(_375[0][0],_375[0][1]);
_375[1]=this._projector.reverse(_375[1][0],_375[1][1]);
return {xMin:_375[0][0],yMin:_375[0][1],xMax:_375[1][0],yMax:_375[1][1]};
};
_33b.prototype.setGeoBounds=function(_376){
_376=_339.getFloatValuesObject(_376);
var minp=this._projector.forward(_376.xMin,_376.yMin);
var maxp=this._projector.forward(_376.xMax,_376.yMax);
_376={xMin:minp[0],yMin:minp[1],xMax:maxp[0],yMax:maxp[1]};
this._applet.setGeoBounds(_376.xMin,_376.yMin,_376.xMax,_376.yMax);
};
_33b.prototype.getWidth=function(){
return this._mapContainer.clientWidth;
};
_33b.prototype.getHeight=function(){
return this._mapContainer.clientHeight;
};
_33b.prototype.getRecommendedScales=function(){
return eval("("+this._applet.getRecommendedScales()+")");
};
_33b.prototype.geoToDisplay=function(_379){
_379=_339.getFloatPoint(_379);
_379=this._applet.geoToDisplay(_379.x,_379.y);
return eval("("+_379+")");
};
_33b.prototype.displayToGeo=function(_37a){
_37a=_339.getIntegerPoint(_37a);
_37a=this._applet.displayToGeo(_37a.x,_37a.y);
return eval("("+_37a+")");
};
_33b.prototype.setViewArea=function(x,y,_37d){
x=_339.getFloat(x);
y=_339.getFloat(y);
_37d=_339.getInteger(_37d);
var _37e=this._projector.forward(x,y);
this._applet.setViewArea(_37e[0],_37e[1],_37d);
};
_33b.prototype.newLayer=function(opts){
var _380=new ravegeo.internal.AppletLayer(this._applet,opts,this._projector);
this._layers[_380._id]=_380;
return _380;
};
_33b.prototype.removeLayer=function(_381){
this._applet.removeLayer(_381._id);
delete this._layers[_381._id];
};
_33b.prototype.addTool=function(tool){
if(tool.activate){
tool.activate(this);
}
this._tools[this._tools.length]=tool;
};
_33b.prototype.removeTool=function(tool){
if(tool.deactivate){
tool.deactivate(this);
}
for(var idx in this._tools){
if(this._tools[idx]==tool){
this._tools.splice(idx,1);
break;
}
}
};
_33b.prototype.addControl=function(_385){
var str=_385._serialize();
this._applet.addControl(str);
};
_33b.prototype.removeControl=function(_387){
this._applet.removeControl(_387._getType());
};
_33b.prototype.zoom=function(_388){
_388=_339.getFloat(_388);
this._applet.zoom(_388);
};
_33b.prototype.zoomTo=function(_389){
_389=_339.getInteger(_389);
this._applet.zoomTo(_389);
};
_33b.prototype.pan=function(dx,dy){
dx=_339.getFloat(dx);
dy=_339.getFloat(dy);
this._applet.pan(dx,dy);
};
_33b.prototype.moveTo=function(x,y,_38e){
x=_339.getFloat(x);
y=_339.getFloat(y);
_38e=_339.getInteger(_38e);
var _38f=this._projector.forward(x,y);
this._applet.moveTo(_38f[0],_38f[1],_38e);
};
_33b.prototype.setPanningEnabled=function(_390){
this._applet.setPanningEnabled(_390);
};
_33b.prototype.setDoubleClickZoomingEnabled=function(_391){
this._applet.setDoubleClickZoomingEnabled(_391);
};
_33b.prototype.getUpDirection=function(){
return this._applet.getUpDirection();
};
_33b.prototype.setUpDirection=function(_392){
_392=_339.getInteger(_392);
this._applet.setUpDirection(_392);
};
_33b.prototype.getPitch=function(){
return this._applet.getPitch();
};
_33b.prototype.setPitch=function(_393){
_393=_339.getFloat(_393);
this._applet.setPitch(_393);
};
_33b.prototype.resize=function(_394,_395,_396){
_394=_339.getInteger(_394);
_395=_339.getInteger(_395);
this._applet.style.width=_394+"px";
this._applet.style.height=_395+"px";
this._mapContainer.style.width=_394+"px";
this._mapContainer.style.height=_395+"px";
this._notifyJavaOfResizeIfNeeded(_394,_395);
if(_396){
this._addSizeCallback(_396,_394,_395);
}
};
_33b.prototype._addSizeCallback=function(_397,_398,_399){
this._sizeCallbacks[this._sizeCallbacks.length]={width:_398,height:_399,callback:_397};
};
_33b.prototype.getLayers=function(){
return _339.objectToArray(this._layers);
};
_33b.prototype._notifyJavaOfResizeIfNeeded=function(_39a,_39b){
if(ravegeo.internal.Environment.isMac&&ravegeo.internal.Environment.isFirefox){
this._applet.resize(_39a,this._applet.height);
this._applet.resize(this._applet.width,_39b);
}
};
_33b.initiateCreation=function(_39c){
if(!ravegeo.internal.Environment.isJavaEnabled()){
throw new Error("Java does not seem to be enabled.");
}
if(!ravegeo.internal.Environment.isJavaWellSupported()){
throw new Error("Applet map is not supported for this browser.");
}
var map=new ravegeo.AppletMap(_39c);
};
_33b.prototype.implementation=function(){
return "ravegeo.AppletMap";
};
_33b.appletMaps={};
return _33b;
})();
ravegeo.TiledMap=(function(){
var _39e=ravegeo.internal.Point;
var _39f=ravegeo.internal.Utilities;
var _3a0=250;
var _3a1=null;
var _3a2=_39e.ZERO;
var _3a3=_39e.ZERO;
var _3a4=0;
var _3a5=false;
var _3a6=function(_3a7){
this._url=_3a7.url;
this._name=_3a7.name;
this._key=_3a7.key;
this._tileCacherUrl=_3a7._tileServiceUrl+"GetTile?name="+_3a7._tileServiceName;
this._callback=_3a7.callback;
this._mapContainer=_3a7.mapContainer;
this._expireDate=_3a7._expireDate;
this._loadingImageUrl=this._url+"GetLoadingImage?name="+this._name;
if(typeof _3a7.interactionDelay!="undefined"){
this._interactionDelay=_39f.getInteger(_3a7.interactionDelay);
if(this._interactionDelay>ravegeo.internal.MapCommons.maxInteractionDelay||this._interactionDelay<0){
this._interactionDelay=ravegeo.internal.MapCommons.maxInteractionDelay;
}
}else{
this._interactionDelay=ravegeo.internal.MapCommons.defaultInteractionDelay;
}
var _3a8=_3a7.tilesConfiguration;
this._originX=_3a8.originX;
this._originY=_3a8.originY;
this._nominalToMeter=_3a8.nominalToMeter;
this._tileWidthPix=_3a8.tileWidthPix;
this._tileHeightPix=_3a8.tileHeightPix;
this._zoomStepExtents=_3a8.zoomStepExtents;
if(_3a8.projection=="mercator"){
this._projector=ravegeo.internal.MercatorProjector;
}else{
this._projector=ravegeo.internal.PlateCarreProjector;
}
var geoX=this._originX;
var geoY=this._originY;
this._zoomStep=0;
if(_3a7.initialViewArea){
var iva=_3a7.initialViewArea;
geoX=_39f.getFloat(iva.x);
geoY=_39f.getFloat(iva.y);
var _3ac=this._projector.forward(iva.x,iva.y);
geoX=_3ac[0];
geoY=_3ac[1];
this._zoomStep=this._scale2ClosestZoomStep(iva.scale);
}
this._layers={};
this._nextLayerId=0;
_39f.removeChildren(this._mapContainer);
this._outerDiv=document.createElement("div");
var _3ad=this._outerDiv;
_39f.setStyle(_3ad,"position:absolute;top:0px;left:0px;overflow:hidden;cursor:move;");
this._tileLayer=new ravegeo.internal.TileLayer(this);
var _3ae=document.createElement("div");
_39f.setStyle(_3ae,"width:100%;height:100%;position:relative;overflow:hidden;");
_3ae.appendChild(_3ad);
var _3af=_3a8.copyright;
if(typeof (_3a7._copyright)!="undefined"){
_3af=_3a7._copyright;
}
if(_3af){
var _3b0=document.createElement("div");
_3b0.innerHTML=_3af;
_39f.setStyle(_3b0,"color:black;position:absolute;left:4px;bottom:4px;z-index:1000;cursor:text;");
_3ad.appendChild(_3b0);
}
this._layout(geoX,geoY);
this._mapContainer.appendChild(_3ae);
this._animator=new ravegeo.internal.MapAnimator(this);
this._toolEventsDispatcher=new ravegeo.internal.ToolEventsDispatcher(this);
this._panningEnabled=true;
this._dblClickZoomingEnabled=true;
this.addTool(ravegeo.tools.internal.DeprecatedCallbacksTool);
this.addTool(ravegeo.tools.internal.SymbolHoverTool);
_3a7.callback.mapLoaded(this);
_39f.addEvent(document,"mouseup",endMapInteraction,false);
};
_3a6.initiateCreation=function(_3b1){
ravegeo.internal.MapCommons._fixParams(_3b1);
var url=_3b1.url+"GetHandle?name="+_3b1.name;
if(_3b1.key){
url+="&key="+_3b1.key;
}
url+="&referer="+encodeURIComponent(window.location);
ravegeo.io.Ajax.asyncJsonRequest(url,function(_3b3){
initiateCreationStep2(_3b1,_3b3);
},ravegeo.internal.MapCommons.getHandleTimeout);
};
function initiateCreationStep2(_3b4,_3b5){
if(_3b5.error){
errorOccurredDuringInit(_3b5.error,_3b4);
return;
}
_3b4._copyright=_3b5.copyright;
if(_3b5.tileServiceUrl){
_3b4._tileServiceUrl=_3b5.tileServiceUrl;
}else{
_3b4._tileServiceUrl=_3b4.url;
}
if(_3b5.tileServiceName){
_3b4._tileServiceName=_3b5.tileServiceName;
}else{
_3b4._tileServiceName=_3b4.name;
}
_3b4._expireDate=new Date();
_3b4._expireDate.setTime(_3b4._expireDate.getTime()+_3b5.timeout);
ravegeo.io.Ajax.asyncJsonRequest(_3b4._tileServiceUrl+"GetTilesInfo?name="+_3b4._tileServiceName,function(_3b6){
initiateCreationStep3(_3b4,_3b6);
},ravegeo.internal.MapCommons.getTilesInfoTimeout);
}
function initiateCreationStep3(_3b7,_3b8){
if(_3b8.error){
errorOccurredDuringInit(_3b8.error,_3b7);
return;
}
_3b7.tilesConfiguration=_3b8;
var temp=new _3a6(_3b7);
}
function errorOccurredDuringInit(_3ba,_3bb){
errorOccurred(_3ba.code,_3ba.message,_3bb.mapContainer,_3bb.callback);
}
function errorOccurred(code,_3bd,_3be,_3bf){
if(_3be){
_3be.innerHTML="Fatal error: "+code+"<br>"+_3bd;
}
if(_3bf&&_3bf.errorOccurred){
_3bf.errorOccurred(code,_3bd);
}
}
_3a6.prototype._layout=function(_3c0,_3c1){
this._mapWidth=this._mapContainer.clientWidth;
this._mapHeight=this._mapContainer.clientHeight;
this._outerDiv.style.width=this._mapWidth+"px";
this._outerDiv.style.height=this._mapHeight+"px";
this._geoX=_3c0;
this._geoY=_3c1;
this._tileLayer._layout(_3c0,_3c1,this._mapWidth,this._mapHeight);
for(var _3c2 in this._layers){
var _3c3=this._layers[_3c2];
_3c3._layout(_3c0,_3c1,this._mapWidth,this._mapHeight);
}
};
_3a6.prototype._updateExpireDate=function(){
if(this._expireDate<new Date()){
var self=this;
var url=this._url+"GetHandle?name="+this._name;
if(this._key){
url+="&key="+this._key;
}
ravegeo.io.Ajax.asyncJsonRequest(url,function(_3c6){
if(_3c6.error){
errorOccurred(_3c6.error.code,_3c6.error.message,self._mapContainer,self._callback);
return;
}
var _3c7=_3c6.timeout;
self._expireDate=new Date();
self._expireDate.setTime(self._expireDate.getTime()+_3c7);
},ravegeo.internal.MapCommons.getHandleTimeout);
}
};
_3a6.prototype._getPixelsFromCenter=function(geoX,geoY){
var _3ca=this._tileWidthPix/this._zoomStepExtents[this._zoomStep][0];
var _3cb=this._tileHeightPix/this._zoomStepExtents[this._zoomStep][1];
return {x:Math.round(geoX*_3ca),y:Math.round(geoY*_3cb)};
};
_3a6.prototype._interactionEnded=function(){
if(this._cbTimeout){
clearTimeout(this._cbTimeout);
}
var self=this;
this._cbTimeout=setTimeout(function(){
self._updateExpireDate();
if(self._callback&&self._callback.interactionEnded){
self._callback.interactionEnded(self);
}
self._cbTimeout=null;
},this._interactionDelay);
};
_3a6.prototype._setGeoCenter=function(_3cd,_3ce,_3cf){
var _3d0=false;
if(typeof (_3cf)!="undefined"){
_3d0=this._changeZoomStep(_3cf);
}
if(this._geoX!=_3cd||this._geoY!=_3ce||_3d0){
this._geoX=_3cd;
this._geoY=_3ce;
this._tileLayer._setGeoCenter(_3cd,_3ce);
for(var _3d1 in this._layers){
this._layers[_3d1]._setGeoCenter(_3cd,_3ce);
}
}
};
_3a6.prototype._changeZoomStep=function(zs){
if(zs>=0&&zs<this._zoomStepExtents.length&&zs!=this._zoomStep){
this._zoomStep=zs;
return true;
}
return false;
};
_3a6.prototype._pixMove=function(_3d3){
this._geoX-=_3d3.getX()*(this._zoomStepExtents[this._zoomStep][0]/this._tileWidthPix);
this._geoY+=_3d3.getY()*(this._zoomStepExtents[this._zoomStep][1]/this._tileHeightPix);
this._tileLayer._pixMove(_3d3.getX(),_3d3.getY());
for(var _3d4 in this._layers){
var _3d5=this._layers[_3d4];
_3d5._pixMove(_3d3.getX(),_3d3.getY());
}
};
_3a6.prototype._zoomStep2Scale=function(zs){
return Math.round(this._zoomStepExtents[zs][1]*this._nominalToMeter/(this._tileHeightPix*0.0003));
};
_3a6.prototype._scale2ClosestZoomStep=function(_3d7){
var _3d8=this._zoomStep2Scale(0);
var _3d9=0;
for(var i=1;i<this._zoomStepExtents.length;++i){
var _3db=this._zoomStep2Scale(i);
if(Math.abs(_3db-_3d7)<Math.abs(_3d8-_3d7)){
_3d8=_3db;
_3d9=i;
}else{
break;
}
}
return _3d9;
};
_3a6.prototype._getGeoWidth=function(_3dc){
return this._zoomStepExtents[_3dc][0]/this._tileWidthPix*this._mapWidth;
};
_3a6.prototype._getGeoHeight=function(_3dd){
return this._zoomStepExtents[_3dd][1]/this._tileHeightPix*this._mapHeight;
};
_3a6.prototype.getCenterX=function(){
var _3de=this._projector.reverse(this._geoX,this._geoY);
return _3de[0];
};
_3a6.prototype.getCenterY=function(){
var _3df=this._projector.reverse(this._geoX,this._geoY);
return _3df[1];
};
_3a6.prototype.getScale=function(){
return this._zoomStep2Scale(this._zoomStep);
};
_3a6.prototype.geoToDisplay=function(_3e0){
_3e0=_39f.getFloatPoint(_3e0);
var _3e1=this._projector.forward(_3e0.x,_3e0.y);
_3e0={x:_3e1[0],y:_3e1[1]};
var _3e2=this._getGeoBounds(this._zoomStep);
var _3e3={width:_3e2.xMax-_3e2.xMin,height:_3e2.yMax-_3e2.yMin};
var _3e4={x:this.getWidth()/_3e3.width,y:this.getHeight()/_3e3.height};
var _3e5=_3e0.x-_3e2.xMin;
var _3e6=_3e2.yMax-_3e0.y;
return {x:_3e5*_3e4.x,y:_3e6*_3e4.y};
};
_3a6.prototype.displayToGeo=function(_3e7){
_3e7=_39f.getIntegerPoint(_3e7);
var _3e8=this._getGeoBounds(this._zoomStep);
var _3e9={width:_3e8.xMax-_3e8.xMin,height:_3e8.yMax-_3e8.yMin};
var _3ea={x:_3e8.xMin+_3e7.x*_3e9.width/this.getWidth(),y:_3e8.yMin+(this.getHeight()-_3e7.y)*_3e9.height/this.getHeight()};
var _3eb=this._projector.reverse(_3ea.x,_3ea.y);
return {x:_3eb[0],y:_3eb[1]};
};
_3a6.prototype.getGeoBounds=function(){
var rect=this._getGeoBounds(this._zoomStep);
var pmin=this._projector.reverse(rect.xMin,rect.yMin);
var pmax=this._projector.reverse(rect.xMax,rect.yMax);
rect.xMin=pmin[0];
rect.yMin=pmin[1];
rect.xMax=pmax[0];
rect.yMax=pmax[1];
return rect;
};
_3a6.prototype._getGeoBounds=function(_3ef){
var _3f0=this._getGeoWidth(_3ef);
var _3f1=this._getGeoHeight(_3ef);
return {xMin:this._geoX-_3f0/2,yMin:this._geoY-_3f1/2,xMax:this._geoX+_3f0/2,yMax:this._geoY+_3f1/2};
};
_3a6.prototype.setGeoBounds=function(_3f2){
_3f2=_39f.getFloatValuesObject(_3f2);
var minp=this._projector.forward(_3f2.xMin,_3f2.yMin);
var maxp=this._projector.forward(_3f2.xMax,_3f2.yMax);
_3f2={xMin:minp[0],yMin:minp[1],xMax:maxp[0],yMax:maxp[1]};
var cx=(_3f2.xMax+_3f2.xMin)/2;
var cy=(_3f2.yMax+_3f2.yMin)/2;
var _3f7=this._getFittingZoomStep(Math.abs(_3f2.xMax-_3f2.xMin),Math.abs(_3f2.yMax-_3f2.yMin));
this._setGeoCenter(cx,cy,_3f7);
};
_3a6.prototype.getWidth=function(){
return this._mapContainer.clientWidth;
};
_3a6.prototype.getHeight=function(){
return this._mapContainer.clientHeight;
};
_3a6.prototype._getFittingZoomStep=function(_3f8,_3f9){
for(var i=0;i<this._zoomStepExtents.length;++i){
var _3fb=this._getGeoWidth(i);
var _3fc=this._getGeoHeight(i);
if(_3f8<=_3fb&&_3f9<=_3fc){
return i;
}
}
return this._zoomStepExtents.length-1;
};
_3a6.prototype.getRecommendedScales=function(){
var ret=[];
for(var zs in this._zoomStepExtents){
ret[zs]=this._zoomStep2Scale(zs);
}
return ret;
};
_3a6.prototype.setViewArea=function(x,y,_401){
x=_39f.getFloat(x);
y=_39f.getFloat(y);
_401=_39f.getInteger(_401);
var _402=this._projector.forward(x,y);
var _403=this._scale2ClosestZoomStep(_401);
this._setGeoCenter(_402[0],_402[1],_403);
};
_3a6.prototype.zoom=function(_404){
_404=_39f.getFloat(_404);
if(_404<1){
this._setGeoCenter(this._geoX,this._geoY,this._zoomStep-1);
}else{
if(_404>1){
this._setGeoCenter(this._geoX,this._geoY,this._zoomStep+1);
}
}
};
_3a6.prototype.zoomTo=function(_405){
_405=_39f.getInteger(_405);
var _406=this._scale2ClosestZoomStep(_405);
this._setGeoCenter(this._geoX,this._geoY,_406);
};
_3a6.prototype.pan=function(dx,dy){
dx=_39f.getFloat(dx);
dy=_39f.getFloat(dy);
var _409=this._zoomStepExtents[this._zoomStep][0]/this._tileWidthPix;
var _40a=this._zoomStepExtents[this._zoomStep][1]/this._tileHeightPix;
this._animator._animateTo(this._geoX+_409*this._mapWidth*dx,this._geoY+_409*this._mapHeight*dy);
};
_3a6.prototype._showBounds=function(_40b,_40c,_40d){
var _40e=this._scale2ClosestZoomStep(_40d);
if(_40b.x!=Number.POSITIVE_INFINITY){
var _40f=(_40c.x-_40b.x)*1.15;
var _410=(_40c.y-_40b.y)*1.15;
var i;
for(i=0;i<this._zoomStepExtents.length;++i){
var _412=this._zoomStepExtents[i][0]/this._tileWidthPix*this._mapWidth;
var _413=this._zoomStepExtents[i][1]/this._tileHeightPix*this._mapHeight;
if(_412>_40f&&_413>_410){
break;
}
}
var _414=_40b.x+(_40c.x-_40b.x)/2;
var _415=_40b.y+(_40c.y-_40b.y)/2;
if(i>_40e){
_40e=i;
}
if(_40e!=this._zoomStep){
this._setGeoCenter(_414,_415,_40e);
}else{
this._animator._animateTo(_414,_415);
}
}else{
if(_40e>this._zoomStep){
this._setGeoCenter(this._geoX,this._geoY,_40e);
}
}
};
_3a6.prototype.moveTo=function(x,y,_418){
x=_39f.getFloat(x);
y=_39f.getFloat(y);
_418=_39f.getInteger(_418);
if(this.getScale()==_418){
var _419=this._projector.forward(x,y);
this._animator._animateTo(_419[0],_419[1]);
}else{
this.setViewArea(x,y,_418);
}
};
_3a6.prototype.getUpDirection=function(){
return 0;
};
_3a6.prototype.setUpDirection=function(_41a){
};
_3a6.prototype.getPitch=function(){
return 90;
};
_3a6.prototype.setPitch=function(_41b){
};
_3a6.prototype.resize=function(_41c,_41d,_41e){
_41c=_39f.getInteger(_41c);
_41d=_39f.getInteger(_41d);
this._mapContainer.style.width=_41c+"px";
this._mapContainer.style.height=_41d+"px";
this._layout(this._geoX,this._geoY);
if(_41e){
_41e();
}
};
_3a6.prototype.newLayer=function(opts){
var _420=this._nextLayerId++;
var _421=new ravegeo.internal.GeoObjectLayer(_420,this,opts);
_421._layout(this._geoX,this._geoY,this._mapWidth,this._mapHeight);
this._layers[_420]=_421;
return _421;
};
_3a6.prototype.removeLayer=function(_422){
var _423=_422._id;
_422._destroy();
delete this._layers[_423];
};
_3a6.prototype.addTool=function(tool){
this._toolEventsDispatcher.addTool(tool);
};
_3a6.prototype.removeTool=function(tool){
this._toolEventsDispatcher.removeTool(tool);
};
_3a6.prototype.addControl=function(_426){
_426._addToTiledMap(this);
};
_3a6.prototype.removeControl=function(_427){
_427._removeFromTiledMap(this);
};
_3a6.prototype.setPanningEnabled=function(_428){
this._panningEnabled=_428;
var _429=_428?"move":"default";
this._outerDiv.style.cursor=_429;
if(!_428){
endMapInteraction();
}
};
_3a6.prototype.setDoubleClickZoomingEnabled=function(_42a){
this._dblClickZoomingEnabled=_42a;
if(!_42a){
endMapInteraction();
}
};
_3a6.prototype.getLayers=function(){
return _39f.objectToArray(this._layers);
};
_3a6.prototype._getGeoPointFromEvent=function(e){
var _42c=this._getPixelsFromEvent(e);
var dx=_42c.getX()-this._mapWidth/2;
var dy=_42c.getY()-this._mapHeight/2;
var x=this._geoX+dx*(this._zoomStepExtents[this._zoomStep][0]/this._tileWidthPix);
var y=this._geoY-dy*(this._zoomStepExtents[this._zoomStep][1]/this._tileHeightPix);
return new _39e(x,y);
};
_3a6.prototype._getMouseCoords=function(e){
if(this._mapContainer.style.position=="fixed"){
return _39f.getMouseCoordsOnFixed(e);
}else{
return _39f.getMouseCoords(e);
}
};
_3a6.prototype._getPixelsFromEvent=function(e){
var _433=this._getMouseCoords(e);
return _433.subtract(_39f.topLeft(this._outerDiv));
};
_3a6._mouseDown=function(e){
if(!_39f.leftButton(e)){
return;
}
var map=getTargetMap(e);
map._toolEventsDispatcher.mouseDown(e);
if(map._panningEnabled){
_3a1=map;
_3a1._animator._stop();
}
_3a3=_3a2=_39f.getMouseCoords(e);
_39f.stopEvent(e);
};
_3a6._mouseMoved=function(e){
var map=getTargetMap(e);
map._toolEventsDispatcher.mouseMoved(e);
var _438=_3a1;
if(_438){
var _439=_39f.getMouseCoords(e);
var diff=_439.subtract(_3a2);
if(diff.getX()>1||diff.getX()<-1||diff.getY()>1||diff.getY()<-1){
_3a2=_439;
_438._pixMove(diff);
}
}
};
_3a6._mouseUp=function(e){
if(!_39f.leftButton(e)){
return;
}
var map=getTargetMap(e);
map._toolEventsDispatcher.mouseUp(e);
var _43d=_3a1;
if(_43d!==null){
var _43e=_39f.getMouseCoords(e);
var diff=_43e.subtract(_3a2);
if(!diff.equals(_39e.ZERO)){
_43d._pixMove(diff);
}
endMapInteraction();
}
handleMouseClicks(map,e);
};
function endMapInteraction(){
var _440=_3a1;
if(_440&&!_3a2.equals(_3a3)){
_440._interactionEnded();
}
_3a1=null;
}
function handleMouseClicks(map,e){
var _443=_39f.getMouseCoords(e);
if(_3a3.equals(_443)){
_3a4++;
if(_3a4==1){
mapClicked(map,e);
setTimeout(function(){
_3a4=0;
},_3a0);
}else{
mapDoubleClicked(map,e);
}
}
}
function mapClicked(map,e){
var targ;
if(!e){
e=window.event;
}
if(e.target){
targ=e.target;
}else{
if(e.srcElement){
targ=e.srcElement;
}
}
var map=getTargetMap(e);
map._toolEventsDispatcher.mouseClicked(e);
}
function mapDoubleClicked(_447,e){
var map=getTargetMap(e);
map._toolEventsDispatcher.mouseDoubleClicked(e);
if(map._dblClickZoomingEnabled){
var _44a=map._getGeoPointFromEvent(e);
map._setGeoCenter(_44a.getX(),_44a.getY(),map._zoomStep-1);
}
}
_3a6._mouseWheel=function(e){
var _44c=getTargetMap(e);
var _44d=e.detail?e.detail:e.wheelDelta/-40;
var _44e=getNewZoomStep(_44c,_44d);
var _44f=_44c._getGeoPointFromEvent(e);
var _450=_44c._zoomStepExtents[_44c._zoomStep][0]/_44c._zoomStepExtents[_44e][0];
var _451=_44c._zoomStepExtents[_44c._zoomStep][1]/_44c._zoomStepExtents[_44e][1];
var _452=(_44c._geoX-_44f.getX())/_450+_44f.getX();
var _453=(_44c._geoY-_44f.getY())/_451+_44f.getY();
_44c._setGeoCenter(_452,_453,_44e);
_39f.stopEvent(e);
};
function getNewZoomStep(_454,_455){
if(_455<1){
if(_454._zoomStep>0){
return _454._zoomStep-1;
}
}else{
if(_455>1){
if(_454._zoomStepExtents.length>_454._zoomStep+1){
return _454._zoomStep+1;
}
}
}
return _454._zoomStep;
}
function getTargetMap(e){
var _457=_39f.getTarget(e);
if(_457._tile){
return _457._tile.owner._map;
}
}
_3a6._addMapEvents=function(_458){
_39f.addEvent(_458,"mousedown",ravegeo.TiledMap._mouseDown,false);
_39f.addEvent(_458,"dragstart",ravegeo.internal.Utilities.stopEvent,false);
_39f.addEvent(_458,"mousemove",ravegeo.TiledMap._mouseMoved,false);
_39f.addEvent(_458,"mouseup",ravegeo.TiledMap._mouseUp,false);
_39f.addEvent(_458,"touchstart",ravegeo.TiledMap._mouseDown,false);
_39f.addEvent(_458,"touchend",ravegeo.TiledMap._mouseUp,false);
_39f.addEvent(_458,"touchmove",ravegeo.TiledMap._mouseMoved,false);
_3a6._addMapZoomEvents(_458);
};
_3a6._addMapZoomEvents=function(_459){
_39f.addEvent(_459,"mousewheel",ravegeo.TiledMap._mouseWheel,false);
};
_3a6.prototype.implementation=function(){
return "ravegeo.TiledMap";
};
return _3a6;
})();
ravegeo.ScaleBar=(function(){
var _45a=ravegeo.internal.ControlCommons;
var _45b=ravegeo.ControlPosition.BOTTOM_RIGHT;
var _45c=100000000;
var _45d=0.0003;
var _45e=150;
var _45f=function(_460){
_45a.initControl(this,_460,_45b);
};
_45f.prototype._serialize=function(){
return _45a.serialize(this);
};
_45f.prototype._getType=function(){
return "s";
};
_45f.prototype._addToTiledMap=function(map){
_45a.addToTiledMap(map,this);
};
_45f.prototype._removeFromTiledMap=function(map){
_45a.removeFromTiledMap(map,this);
};
_45f.prototype._getDivElement=function(){
var div=document.createElement("div");
div.style.color="#000000";
div.style.textAlign="center";
div.style.padding="0px";
div.style.fontSize="8pt";
div.style.fontWeight="bold";
div.style.zIndex="10000000";
div.style.fontFamily="Arial";
this._meterDiv=document.createElement("div");
this._meterDiv.style.borderStyle="none solid solid solid";
this._meterDiv.style.borderWidth="2px 2px 2px 2px";
this._feetDiv=document.createElement("div");
this._feetDiv.style.borderStyle="none solid none solid";
this._feetDiv.style.borderWidth="2px 2px 2px 2px";
div.appendChild(this._meterDiv);
div.appendChild(this._feetDiv);
return div;
};
_45f.prototype._update=function(){
var _464=this._updateMeterScale();
var _465=this._updateFeetScale();
this._updateBorders(_464,_465);
};
_45f.prototype._updateMeterScale=function(){
var _466=this._map.getScale()*_45d;
var _467=_45e*_466;
var _468=findSuitableGeoLengthOfScaleBar(_467);
var _469=Math.round(_45e*(_468/_467));
this._meterDiv.style.width=_469+"px";
var _46a=(_468<1000)?_468+" m":(_468/1000)+" km";
this._meterDiv.innerHTML=_46a;
return _469;
};
_45f.prototype._updateFeetScale=function(){
var _46b=this._map.getScale()*_45d*3.28;
var _46c=_45e*_46b;
var _46d=findSuitableFeetGeoLengthOfScaleBar(_46c);
var _46e=Math.round(_45e*(_46d/_46c));
this._feetDiv.style.width=_46e+"px";
var _46f=(_46d<5280)?_46d+" ft":(_46d/5280)+" mi";
this._feetDiv.innerHTML=_46f;
return _46e;
};
_45f.prototype._updateBorders=function(_470,_471){
if(_470>_471){
this._meterDiv.style.borderStyle="none solid solid solid";
this._feetDiv.style.borderStyle="none solid none solid";
}else{
this._meterDiv.style.borderStyle="none solid none solid";
this._feetDiv.style.borderStyle="solid solid none solid";
}
};
function findSuitableGeoLengthOfScaleBar(_472){
if(_472<10){
return 10;
}
var _473=_45c;
while(true){
if(_472>=_473){
break;
}
_473/=10;
}
if(_472>=5*_473){
return 5*_473;
}
if(_472>=2*_473){
return 2*_473;
}
return _473;
}
function findSuitableFeetGeoLengthOfScaleBar(_474){
if(_474<5280){
return findSuitableGeoLengthOfScaleBar(_474);
}else{
_474=_474/5280;
var _475=_45c/1000;
while(true){
if(_474>=_475){
break;
}
_475/=10;
}
if(_474>=5*_475){
return 5*_475*5280;
}
if(_474>=2*_475){
return 2*_475*5280;
}
return _475*5280;
}
}
return _45f;
})();
ravegeo.Polyline=(function(){
var _476=ravegeo.internal.Utilities;
var _477=ravegeo.internal.GeometryFunctions;
var _478=function(id,_47a){
if(arguments.length>2){
this._initWithDefaults(arguments[0],arguments[1],arguments[2],arguments[3],arguments[4]);
}else{
this._initNoDefaults(id,_47a);
}
};
_478.prototype._initWithDefaults=function(id,_47c,_47d,_47e,_47f){
_476.ensureString(id,"id");
this.id=id;
this._xPoints=_476.getFloatArray(_47c);
this._yPoints=_476.getFloatArray(_47d);
this.width=_476.getInteger(_47e,1);
this.color=(typeof (_47f)!="undefined")?_47f:"#000000";
};
_478.prototype._initNoDefaults=function(id,_481){
_476.ensureString(id,"id");
this.id=id;
this._xPoints=_476.getValueOrUndefined(_481.xPoints,_476.getFloatArray);
this._yPoints=_476.getValueOrUndefined(_481.yPoints,_476.getFloatArray);
this.width=_476.getValueOrUndefined(_481.width,_476.getInteger);
this.color=_481.color;
};
_478.prototype._setMissingFields=function(_482){
_476.setMissingObjectFields(_482,this,["_xPointsUnprojected","_yPointsUnprojected","color","width"],["_xPoints","_yPoints","color","width"],[null,null,"#000000",1]);
if(this._yPoints==null||this._xPoints==null){
throw new Error("New object's required properties are missing! Required properties: xPoints, yPoints.");
}
};
_478.prototype.getPoints=function(){
var xpts=this._xPoints;
var ypts=this._yPoints;
if(this._projector){
xpts=xpts.slice(0);
ypts=ypts.slice(0);
this._projector.reverseArray(xpts,ypts);
}
return {xValues:xpts,yValues:ypts};
};
_478.prototype._project=function(_485){
if(!_476.isValue(this._xPoints)||!_476.isValue(this._yPoints)){
return;
}
this._xPointsUnprojected=this._xPoints.slice();
this._yPointsUnprojected=this._yPoints.slice();
this._projector=_485;
_485.forwardArray(this._xPoints,this._yPoints);
};
_478.prototype._serialize=function(){
var l="l";
l+=this.id.length+";"+this.id;
l+=_476.isValue(this._xPoints)?ravegeo.internal.MapCommons._serializeDoubleArray(this._xPoints):";";
l+=_476.isValue(this._yPoints)?ravegeo.internal.MapCommons._serializeDoubleArray(this._yPoints):";";
l+=_476.isValue(this.width)?this.width+";":";";
l+=_476.isValue(this.color)?this.color.length+";"+this.color:";";
return l;
};
_478.prototype._tiledMapInit=function(_487,_488){
this._layer=_487;
_487._positionGeoObject(this);
};
_478.prototype._destroy=function(){
this._layer._layerDiv.removeChild(this._canvasElement);
};
_478.prototype._position=function(_489,_48a){
ravegeo.internal.MapCommons._polyX_position(this,_489,_48a,5+this.width,false);
};
_478.prototype._reposition=function(_48b,_48c){
ravegeo.internal.MapCommons._polyX_reposition(this,_48b,_48c,5+this.width,false);
};
_478.prototype._isInside=function(xMin,yMin,xMax,yMax){
ravegeo.internal.MapCommons._polyX_isInside(this._xPoints,this._yPoints,xMin,yMin,xMax,yMax);
};
_478.prototype._expandBounds=function(_491,_492){
ravegeo.internal.MapCommons._polyX_expandBounds(this._xPoints,this._yPoints,_491,_492);
};
_478.prototype._getCenter=function(){
return ravegeo.internal.MapCommons._polyX_getCenter(this._xPoints,this._yPoints);
};
_478.prototype._setHighlight=function(_493,_494){
};
_478.prototype._removeHighlight=function(){
};
_478.prototype._pick=function(_495){
var _496=this._layer._geoToPixelPointsX(this._xPoints);
var _497=this._layer._geoToPixelPointsY(this._yPoints);
var _498=_477.closestPointOnLine(_496,_497,_495,this.width/2);
return (parseFloat(_498)<parseFloat(this.width/2*this.width/2));
};
_478.prototype._move=function(_499,_49a,_49b){
ravegeo.internal.MapCommons._polyX_move(this,_499,_49a,_49b);
};
return _478;
})();
ravegeo.Polygon=(function(){
var _49c=ravegeo.internal.Utilities;
var _49d=ravegeo.internal.GeometryFunctions;
var _49e=function(id,_4a0){
if(arguments.length>2){
this._initWithDefaults(arguments[0],arguments[1],arguments[2],arguments[3]);
}else{
this._initNoDefaults(id,_4a0);
}
};
_49e.prototype._initWithDefaults=function(id,_4a2,_4a3,_4a4){
_49c.ensureString(id,"id");
this.id=id;
this._xPoints=_49c.getFloatArray(_4a2);
this._yPoints=_49c.getFloatArray(_4a3);
this.color=(typeof (_4a4)!="undefined")?_4a4:"#000000";
};
_49e.prototype._initNoDefaults=function(id,_4a6){
_49c.ensureString(id,"id");
this.id=id;
this._xPoints=_49c.getValueOrUndefined(_4a6.xPoints,_49c.getFloatArray);
this._yPoints=_49c.getValueOrUndefined(_4a6.yPoints,_49c.getFloatArray);
this.color=_4a6.color;
};
_49e.prototype._setMissingFields=function(_4a7){
_49c.setMissingObjectFields(_4a7,this,["_xPointsUnprojected","_yPointsUnprojected","color"],["_xPoints","_yPoints","color"],[null,null,"#000000"]);
if(this._xPoints==null||this._yPoints==null){
throw new Error("New object's required properties are missing! Required properties: xPoints, yPoints.");
}
};
_49e.prototype.getPoints=function(){
var xpts=this._xPoints;
var ypts=this._yPoints;
if(this._projector){
xpts=xpts.slice(0);
ypts=ypts.slice(0);
this._projector.reverseArray(xpts,ypts);
}
return {xValues:xpts,yValues:ypts};
};
_49e.prototype._project=function(_4aa){
if(!_49c.isValue(this._xPoints)||!_49c.isValue(this._yPoints)){
return;
}
this._xPointsUnprojected=this._xPoints.slice();
this._yPointsUnprojected=this._yPoints.slice();
this._projector=_4aa;
_4aa.forwardArray(this._xPoints,this._yPoints);
};
_49e.prototype._serialize=function(){
var g="g";
g+=this.id.length+";"+this.id;
g+=_49c.isValue(this._xPoints)?ravegeo.internal.MapCommons._serializeDoubleArray(this._xPoints):";";
g+=_49c.isValue(this._yPoints)?ravegeo.internal.MapCommons._serializeDoubleArray(this._yPoints):";";
g+=_49c.isValue(this.color)?this.color.length+";"+this.color:";";
return g;
};
_49e.prototype._tiledMapInit=function(_4ac,_4ad){
this._layer=_4ac;
_4ac._positionGeoObject(this);
};
_49e.prototype._destroy=function(){
this._layer._layerDiv.removeChild(this._canvasElement);
};
_49e.prototype._position=function(_4ae,_4af){
ravegeo.internal.MapCommons._polyX_position(this,_4ae,_4af,5,true);
};
_49e.prototype._reposition=function(_4b0,_4b1){
ravegeo.internal.MapCommons._polyX_reposition(this,_4b0,_4b1,5,true);
};
_49e.prototype._isInside=function(xMin,yMin,xMax,yMax){
ravegeo.internal.MapCommons._polyX_isInside(this._xPoints,this._yPoints,xMin,yMin,xMax,yMax);
};
_49e.prototype._expandBounds=function(_4b6,_4b7){
ravegeo.internal.MapCommons._polyX_expandBounds(this._xPoints,this._yPoints,_4b6,_4b7);
};
_49e.prototype._getCenter=function(){
return ravegeo.internal.MapCommons._polyX_getCenter(this._xPoints,this._yPoints);
};
_49e.prototype._setHighlight=function(_4b8,_4b9){
};
_49e.prototype._removeHighlight=function(){
};
_49e.prototype._pick=function(_4ba){
var _4bb=this._layer._geoToPixelPointsX(this._xPoints);
var _4bc=this._layer._geoToPixelPointsY(this._yPoints);
return _49d.isPointInsidePolygon(_4bb,_4bc,_4ba);
};
_49e.prototype._move=function(_4bd,_4be,_4bf){
ravegeo.internal.MapCommons._polyX_move(this,_4bd,_4be,_4bf);
};
return _49e;
})();
ravegeo.WebMap=(function(){
var _4c0={};
_4c0.initiateCreation=function(_4c1){
if(ravegeo.AppletMap){
if(ravegeo.internal.Environment.isJavaWellSupported()){
_4c1._appletTimeoutCallback=function(){
ravegeo.TiledMap.initiateCreation(_4c1);
};
_4c1._maxAppletLoadTime=20000;
ravegeo.AppletMap.initiateCreation(_4c1);
}else{
ravegeo.TiledMap.initiateCreation(_4c1);
}
}else{
if(ravegeo.TiledMap){
ravegeo.TiledMap.initiateCreation(_4c1);
}else{
throw new Error("Can not show map.");
}
}
};
_4c0.version=ravegeo.internal.MapCommons.version;
return _4c0;
})();


