ravegeo={internal:{},io:{},tools:{internal:{}}};
ravegeo.internal.Environment=(function(){
var _1={};
_1.isIE=(!window.opera&&navigator.userAgent.indexOf("MSIE")!=-1);
_1.isSafari=(navigator.vendor&&navigator.vendor.indexOf("Apple")!=-1);
_1.isFirefox=(navigator.userAgent.indexOf("Firefox")!=-1);
_1.isChrome=(navigator.userAgent.indexOf("Chrome")!=-1);
_1.isLinux=(navigator.userAgent.indexOf("Linux")!=-1);
_1.isWin=(navigator.userAgent.indexOf("Win")!=-1);
_1.isMac=(navigator.userAgent.indexOf("Mac")!=-1);
_1.isJavaEnabled=function(){
if(navigator.userAgent.toLowerCase().match("netscape")){
return true;
}else{
return navigator.javaEnabled();
}
};
_1.isJavaWellSupported=function(){
if(_1.isJavaEnabled()){
if(_1.isMac&&_1.isChrome){
return false;
}
return true;
}
return false;
};
return _1;
})();
ravegeo.io.Ajax=(function(){
var _2={};
var _3=0;
var _4=[];
_2.syncJsonRequest=function(_5){
var _6;
if(window.XMLHttpRequest){
_6=new XMLHttpRequest();
}else{
if(window.ActiveXObject){
_6=new ActiveXObject("Microsoft.XMLHTTP");
}else{
throw new Error("Browser not AJAX enabled.");
}
}
_6.open("GET",_5,false);
_6.send(null);
if(_6.status==200){
return eval("("+_6.responseText+")");
}else{
throw new Error("AJAX request failed: "+_6.status);
}
};
_2.asyncJsonRequest=function(_7,_8,_9){
var _a=_3++;
var _b=document.createElement("script");
_b.src=_7+"&prepend=ravegeo.io.Ajax._jsonReply("+_a+","+"&append=);";
_4[_a]={callback:_8,elem:_b};
document.body.appendChild(_b);
if(typeof (_9)!="undefined"){
setTimeout(function(){
if(_4[_a]!=null){
ravegeo.io.Ajax._jsonReply(_a,{error:{code:"REQUEST_TIMED_OUT",message:"Request timed out: "+_7}});
}
},_9);
}
};
_2._jsonReply=function(_c,_d){
var _e=_4[_c].elem;
document.body.removeChild(_e);
_4[_c].callback(_d);
_4[_c]=null;
};
return _2;
})();
ravegeo.internal.Utilities=(function(){
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;
}
}
return _16;
};
_f.leftButton=function(e){
if(!e){
e=window.event;
}
if(e.which){
return (e.which==1);
}else{
if(e.button){
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);
}
};
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(_1a){
if(typeof (_1a.complete)=="undefined"){
var _1b=new Image();
_1b.src=_1a.src;
return _1b.complete;
}
return _1a.complete;
};
if(_f.isSafari){
_f.onImageLoaded=function(_1c,_1d){
_1c.onload=function(){
_1d.apply(_1c);
};
};
}else{
_f.onImageLoaded=function(_1e,_1f){
_1e.onload=_1f;
};
}
_f.mouseX=function(e){
var _21=0;
if(e.pageX){
_21=e.pageX;
}else{
if(e.clientX){
_21=e.clientX;
if(ravegeo.internal.Environment.isIE){
if(document.documentElement&&document.documentElement.scrollLeft){
_21+=document.documentElement.scrollLeft;
}else{
if(document.body&&document.body.scrollLeft){
_21+=document.body.scrollLeft;
}
}
}
}
}
return _21;
};
_f.mouseY=function(e){
var _23=0;
if(e.pageY){
_23=e.pageY;
}else{
if(e.clientY){
_23=e.clientY;
if(ravegeo.internal.Environment.isIE){
if(document.documentElement&&document.documentElement.scrollTop){
_23+=document.documentElement.scrollTop;
}else{
if(document.body&&document.body.scrollTop){
_23+=document.body.scrollTop;
}
}
}
}
}
return _23;
};
_f.topLeftX=function(obj){
var _25=0;
if(obj.offsetParent){
do{
_25+=obj.offsetLeft;
obj=obj.offsetParent;
}while(obj);
}else{
if(obj.x){
_25+=obj.x;
}
}
return _25;
};
_f.topLeftY=function(obj){
var _27=0;
if(obj.offsetParent){
do{
_27+=obj.offsetTop;
obj=obj.offsetParent;
}while(obj);
}else{
if(obj.y){
_27+=obj.y;
}
}
return _27;
};
_f.getOpacity=function(_28){
if(_28.length==9){
return parseInt(_28.substring(1,3),16)/255;
}
return 1;
};
_f.getColor=function(_29){
if(_29.length==9){
return "#"+_29.substring(3);
}
return _29;
};
_f.fixStyle=function(_2a){
if(_2a.fillColor){
_2a.fillOpacity=_f.getOpacity(_2a.fillColor);
_2a.fillColor=_f.getColor(_2a.fillColor);
}
if(_2a.strokeColor){
_2a.strokeOpacity=_f.getOpacity(_2a.strokeColor);
_2a.strokeColor=_f.getColor(_2a.strokeColor);
}
return _2a;
};
_f.setOpacity=function(el,_2c){
if(_2c<1&&_2c>=0){
el.style.opacity=""+_2c;
el.style.filter="alpha(opacity="+Math.round(_2c*100)+")";
}
};
_f.removeChildren=function(_2d,_2e){
while(_2d.childNodes.length>1){
var _2f=_2d.childNodes[0];
if(_2f===_2e){
_2f=_2d.childNodes[1];
}
_2d.removeChild(_2f);
}
if(_2d.childNodes.length>0&&!_2e){
_2d.removeChild(_2d.childNodes[0]);
}
};
_f.stringIsEmpty=function(s){
if(s){
return s.length==0;
}
return true;
};
_f.ensureString=function(_31,_32){
if(typeof (_31)!="string"){
throw new Error("Parameter \""+_32+"\" must be a string.");
}
};
return _f;
})();
ravegeo.internal.MapCommons=(function(){
var _33={};
_33._fixParams=function(_34){
if(typeof (_34.mapContainer)=="string"){
_34.mapContainer=document.getElementById(_34.mapContainer);
}
if(!_34.url&&document&&document.getElementsByTagName){
var _35=document.getElementsByTagName("script");
var _36=/ravegeowebmap(\.debug)?\.js([\?\.]|$)/i;
for(var i=0;i<_35.length;++i){
var src=_35[i].getAttribute("src");
if(!src){
continue;
}
var m=src.match(_36);
if(m){
root=src.substring(0,m.index);
_34.url=root;
break;
}
}
}
};
_33._serializeDoubleArray=function(arr){
var s=""+arr.length+";";
for(var i=0;i<arr.length;++i){
s+=arr[i]+";";
}
return s;
};
_33._polyX_expandBounds=function(_3d,_3e,_3f,_40){
for(var i=0;i<_3d.length;++i){
if(_3d[i]<_3f.x){
_3f.x=_3d[i];
}
if(_3d[i]>_40.x){
_40.x=_3d[i];
}
if(_3e[i]<_3f.y){
_3f.y=_3e[i];
}
if(_3e[i]>_40.y){
_40.y=_3e[i];
}
}
};
MapCommons_polyX_getBounds=function(_42,_43){
var _44={x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY};
var _45={x:Number.NEGATIVE_INFINITY,y:Number.NEGATIVE_INFINITY};
for(var i=0;i<_42.length;++i){
if(_42[i]<_44.x){
_44.x=_42[i];
}
if(_42[i]>_45.x){
_45.x=_42[i];
}
if(_43[i]<_44.y){
_44.y=_43[i];
}
if(_43[i]>_45.y){
_45.y=_43[i];
}
}
return {minPoint:_44,maxPoint:_45};
};
_33._polyX_isInside=function(_47,_48,_49,_4a,_4b,_4c){
var _4d=getBounds(_47,_48);
return _4d.minPoint.x<_4b&&_4d.maxPoint.x>_49&&_4d.minPoint.y<_4c&&_4d.maxPoint.y>_4a;
};
_33._polyX_getCenter=function(_4e,_4f){
var _50=getBounds(_4e,_4f);
return {x:(_50.minPoint.x+_50.maxPoint.x)/2,y:(_50.minPoint.y+_50.maxPoint.y)/2};
};
MapCommons_polyX_geoToPixels=function(_51,_52,_53,_54){
var ret=[];
for(var i=0;i<_51.length;++i){
ret[ret.length]=Math.round((_51[i]-_52)*_53)+_54;
}
return ret;
};
_33._polyX_position=function(_57,_58,_59,_5a,_5b){
if(_57._canvasElement){
_57._layer._layerDiv.removeChild(_57._canvasElement);
}
var _5c=MapCommons_polyX_getBounds(_57._xPoints,_57._yPoints);
var _5d=Math.round((_5c.minPoint.x-_58.x)*_59.x)-_5a;
var _5e=Math.round((_5c.maxPoint.x-_58.x)*_59.x)+_5a;
var _5f=Math.round((_58.y-_5c.maxPoint.y)*_59.y)-_5a;
var _60=Math.round((_58.y-_5c.minPoint.y)*_59.y)+_5a;
var _61=MapCommons_polyX_geoToPixels(_57._xPoints,_5c.minPoint.x,_59.x,_5a);
var _62=MapCommons_polyX_geoToPixels(_57._yPoints,_5c.maxPoint.y,-_59.y,_5a);
var _63=_5e-_5d;
var _64=_60-_5f;
var _65=ravegeo.internal.Canvas.create(_63,_64);
var _66=_65.getElement();
_57._canvasElement=_66;
_66.style.position="absolute";
_66.style.zIndex="51";
_66.style.left=_5d+"px";
_66.style.top=_5f+"px";
_57._layer._layerDiv.appendChild(_66);
if(_5b){
_65.drawPolygon(_61,_62,ravegeo.internal.Utilities.fixStyle({fillColor:_57.color}));
}else{
_65.drawPolyline(_61,_62,ravegeo.internal.Utilities.fixStyle({strokeColor:_57.color,strokeWidth:_57.width}));
}
_33._addCanvasObjectEvents(_57);
};
_33._polyX_reposition=function(_67,_68,_69,_6a,_6b){
var _6c=_67._canvasElement;
var _6d=MapCommons_polyX_getBounds(_67._xPoints,_67._yPoints);
var _6e=Math.round((_6d.minPoint.x-_68.x)*_69.x)-_6a;
var _6f=Math.round((_6d.maxPoint.x-_68.x)*_69.x)+_6a;
var _70=Math.round((_68.y-_6d.maxPoint.y)*_69.y)-_6a;
var _71=Math.round((_68.y-_6d.minPoint.y)*_69.y)+_6a;
var _72=MapCommons_polyX_geoToPixels(_67._xPoints,_6d.minPoint.x,_69.x,_6a);
var _73=MapCommons_polyX_geoToPixels(_67._yPoints,_6d.maxPoint.y,-_69.y,_6a);
var _74=_6f-_6e;
var _75=_71-_70;
_6c.style.position="absolute";
_6c.style.zIndex="51";
_6c.style.left=_6e+"px";
_6c.style.top=_70+"px";
};
_33._addCanvasObjectEvents=function(_76){
var _77=_76._canvasElement;
_77._tile={owner:_76._layer};
ravegeo.TiledMap._addMapEvents(_77);
var _78=_77.firstChild;
if(_78){
_78._object=_76;
_78._tile={owner:_76._layer};
}
};
_33._polyX_move=function(_79,_7a,_7b){
movePoints(_79._xPoints,_7a);
movePoints(_79._yPoints,_7b);
_79._layer._repositionGeoObject(_79);
};
function movePoints(_7c,_7d){
for(var i=0;i<_7c.length;i++){
_7c[i]=_7c[i]+_7d;
}
}
_33.defaultInteractionDelay=700;
_33.maxInteractionDelay=10000;
_33.getHandleTimeout=15000;
_33.getTilesInfoTimeout=15000;
_33.version="2.1.1";
return _33;
})();
ravegeo.internal.ToolEventsDispatcher=(function(){
var _7f=ravegeo.internal.Utilities;
var _80=function(map){
this._tools=[];
this._map=map;
};
var _82=null;
var _83=false;
_80.prototype.addTool=function(_84){
if(_84.activate){
_84.activate(this._map);
}
this._tools[this._tools.length]=_84;
};
_80.prototype.removeTool=function(_85){
if(_85.deactivate){
_85.deactivate(this._map);
}
for(var idx in this._tools){
if(this._tools[idx]==_85){
this._tools.splice(idx,1);
break;
}
}
};
_80.prototype.mouseDown=function(_87){
var _88=this._map._getGeoPointFromEvent(_87);
var _89=this._pickObject(_87);
if(_89){
_82=_89;
this._toolsOnObjectEvent("objectMouseDown",_88,_89);
}else{
mapCurrentlyPressed=true;
this._toolsOnMapEvent("mapMouseDown",_88);
}
};
_80.prototype.mouseMoved=function(_8a){
var _8b=this._map._getGeoPointFromEvent(_8a);
if(_82){
if(_83){
this._toolsOnObjectEvent("objectDragged",_8b,_82);
}else{
this._toolsOnObjectEvent("objectDragStart",_8b,_82);
_83=true;
}
}
var _8c=this._pickObject(_8a);
if(_8c){
this._toolsOnObjectEvent("objectMouseMove",_8b,_8c);
}else{
this._toolsOnMapEvent("mapMouseMove",_8b);
}
};
_80.prototype.mouseUp=function(_8d){
var _8e=this._map._getGeoPointFromEvent(_8d);
if(_82!=null){
if(_83){
this._toolsOnObjectEvent("objectDragEnd",_8e,_82);
}
stopObjectDrag();
}
var _8f=this._pickObject(_8d);
if(_8f){
this._toolsOnObjectEvent("objectMouseUp",_8e,_8f);
}else{
this._toolsOnMapEvent("mapMouseUp",_8e);
}
};
function stopObjectDrag(){
_82=null;
_83=false;
}
_80.prototype.mouseClicked=function(_90){
var _91=this._map._getGeoPointFromEvent(_90);
var _92=this._pickObject(_90);
if(_92){
this._toolsOnObjectEvent("objectClicked",_91,_92);
}else{
this._toolsOnMapEvent("mapClicked",_91);
}
};
_80.prototype.mouseDoubleClicked=function(_93){
};
_80.prototype._pickObject=function(e){
var _95=pickByTarget(e);
if(!_95){
_95=this._pickByCoordinates(e);
}
return _95;
};
function pickByTarget(e){
var _97=_7f.getTarget(e);
var _98=_97._object;
if(!_98){
_98=_97._symbol;
}
return _98;
}
_80.prototype._pickByCoordinates=function(e){
var _9a=this._map._layers;
for(var _9b in _9a){
var _9c=_9a[_9b]._pickObject(this._map._getPixelsFromEvent(e));
if(_9c){
return _9c;
}
}
};
_80.prototype._toolsOnMapEvent=function(_9d,_9e){
_80.toolsOnMapEvent(this._map,this._tools,_9d,_9e[0],_9e[1]);
};
_80.prototype._toolsOnObjectEvent=function(_9f,_a0,_a1){
_80.toolsOnObjectEvent(this._map,this._tools,_9f,_a1._layer._id,_a1.id,_a0[0],_a0[1]);
};
_80.toolsOnMapEvent=function(map,_a3,_a4,x,y){
if(ravegeo._projector){
var p=ravegeo._projector.reverse(x,y);
x=p[0];
y=p[1];
}
for(var idx in _a3){
if(_a3[idx][_a4]){
_a3[idx][_a4](map,x,y);
}
}
};
_80.toolsOnObjectEvent=function(map,_aa,_ab,_ac,_ad,x,y){
if(ravegeo._projector){
var p=ravegeo._projector.reverse(x,y);
x=p[0];
y=p[1];
}
for(var idx in _aa){
if(_aa[idx][_ab]){
_aa[idx][_ab](map,map._layers[_ac],_ad,x,y);
}
}
};
return _80;
})();
ravegeo.internal.GeometryFunctions=(function(){
var _b2={};
_b2.closestPointOnLine=function(_b3,_b4,_b5,_b6){
if(_b3.lenght<=1){
return -1;
}
var a=Array();
var b=Array();
var _b9=Number.MAX_VALUE;
var _ba=0;
var x=0;
var y=0;
for(var i=1;i<_b3.length;i++){
a[0]=_b3[i-1];
a[1]=_b4[i-1];
b[0]=_b3[i];
b[1]=_b4[i];
if(!pointInsideExtendedSegmentBounds(_b5,_b6,a,b)){
continue;
}
var d=pointDistance2ToSegment(_b5,a,b);
if(d<_b9){
_b9=d;
}
}
return _b9;
};
function pointInsideExtendedSegmentBounds(_bf,ext,a,b){
for(var i=0;i<_bf.length;i++){
if(_bf[i]<Math.min(a[i],b[i])-ext||_bf[i]>Math.max(a[i],b[i])+ext){
return false;
}
}
return true;
}
function pointDistance2ToSegment(c,a,b){
var _c7=[];
var ab=sub(b,a);
var ac=sub(c,a);
var _ca=dot(ac,ab);
var _cb=length2(ab);
if(_ca<=0){
_c7=copy(a);
}else{
if(_ca>=_cb){
_c7=copy(b);
}else{
while(Math.abs(_ca)>36863){
_ca/=2;
if(Math.abs(_cb)>2){
_cb/=2;
}
}
_c7=add(a,div(mult(ab,_ca),_cb));
}
}
return length2(sub(c,_c7));
}
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(_d0){
var to=[];
for(var i=0;i<to.length;i++){
to[i]=_d0[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;
}
_b2.isPointInsidePolygon=function(_e6,_e7,_e8){
if(_e6.length<2){
return false;
}
var _e9=getNumberOfCrossings(_e6,_e7,_e8);
return isOdd(_e9);
};
function getNumberOfCrossings(_ea,_eb,_ec){
var _ed=_ea.length;
var _ee=[_ea[_ed-1],_eb[_ed-1]];
var _ef=0;
for(var i=0;i<_ed;++i){
var _f1=[_ea[i],_eb[i]];
var _f2=pointCrossesLine(_ec,_ee,_f1);
if(_f2){
_ef++;
}
_ee=_f1;
}
return _ef;
}
function pointCrossesLine(_f3,_f4,_f5){
var _f6=(_f5[0]-_f4[0])/(_f5[1]-_f4[1]);
var _f7=(_f4[1]<=_f3[1])&&(_f3[1]<_f5[1]);
var _f8=(_f5[1]<=_f3[1])&&(_f3[1]<_f4[1]);
var _f9=_f3[0]<_f6*(_f3[1]-_f4[1])+_f4[0];
var _fa=(_f7||_f8)&&_f9;
return _fa;
}
function isOdd(_fb){
return _fb%2!=0;
}
_b2.isPointInsideEllipse=function(_fc,_fd,_fe,_ff){
if(!pointInsideExtendedEllipseBounds(_fc,_fd,_fe,_ff)){
return false;
}
var _100=(_fc[1]-_fc[0])/2;
var _101=(_fd[1]-_fd[0])/2;
var _102=[_fc[0]+_100,_fd[0]+_101];
var _103=[_100+_ff/2,_101+_ff/2];
var _104=[_100-_ff/2,_101-_ff/2];
return (isInsideEllipse(_102,_103,_fe)&&!isInsideEllipse(_102,_104,_fe));
};
function pointInsideExtendedEllipseBounds(_105,_106,_107,_108){
return (_107[0]>(_105[0]-_108/2)&&_107[0]<(_105[1]+_108/2)&&_107[1]>(_106[0]-_108/2)&&_107[1]<(_106[1]+_108/2));
}
function isInsideEllipse(_109,_10a,_10b){
if(_10a[0]<=0||_10a[1]<=0){
return false;
}
return square(_10b[0]-_109[0])/square(_10a[0])+square(_10b[1]-_109[1])/square(_10a[1])<1;
}
function square(x){
return x*x;
}
return _b2;
})();
ravegeo.Ellipse=(function(){
var _10d=ravegeo.internal.Utilities;
var _10e=ravegeo.internal.GeometryFunctions;
var _10f=function(id,x1,y1,x2,y2,_115,_116){
_10d.ensureString(id,"id");
this.id=id;
if(x1<x2){
this._xMin=x1;
this._xMax=x2;
}else{
this._xMin=x2;
this._xMax=x1;
}
if(y1<y2){
this._yMin=y1;
this._yMax=y2;
}else{
this._yMin=y2;
this._yMax=y1;
}
this.width=(typeof (_115)!="undefined")?_115:0;
this.color=(typeof (_116)!="undefined")?_116:"#000000";
};
_10f.prototype.getBounds=function(){
var rect={xMin:this._xMin,yMin:this._yMin,xMax:this._xMax,yMax:this._yMax};
if(ravegeo._projector){
var pmin=ravegeo._projector.reverse(rect.xMin,rect.yMin);
var pmax=ravegeo._projector.reverse(rect.xMax,rect.yMax);
rect.xMin=pmin[0];
rect.yMin=pmin[1];
rect.xMax=pmax[0];
rect.yMax=pmax[1];
}
return rect;
};
_10f.prototype._project=function(){
if(ravegeo._projector){
var p=ravegeo._projector.forward(this._xMin,this._yMin);
this._xMin=p[0];
this._yMin=p[1];
p=ravegeo._projector.forward(this._xMax,this._yMax);
this._xMax=p[0];
this._yMax=p[1];
}
};
_10f.prototype._serialize=function(){
var e="e";
e+=this.id.length+";"+this.id;
e+=this._xMin+";";
e+=this._yMin+";";
e+=this._xMax+";";
e+=this._yMax+";";
e+=this.width+";";
e+=this.color.length+";"+this.color;
return e;
};
_10f.prototype._tiledMapInit=function(_11c,_11d){
this._layer=_11c;
_11c._positionGeoObject(this);
};
_10f.prototype._destroy=function(){
this._layer._layerDiv.removeChild(this._canvasElement);
};
_10f.prototype._position=function(_11e,_11f){
if(this._canvasElement){
this._layer._layerDiv.removeChild(this._canvasElement);
}
var xMin=Math.round((this._xMin-_11e.x)*_11f.x)-5;
var xMax=Math.round((this._xMax-_11e.x)*_11f.x)+5;
var yMin=Math.round((_11e.y-this._yMax)*_11f.y)-5;
var yMax=Math.round((_11e.y-this._yMin)*_11f.y)+5;
var _124=xMax-xMin;
var _125=yMax-yMin;
var _126=ravegeo.internal.Canvas.create(_124,_125);
var _127=_126.getElement();
this._canvasElement=_127;
_127.style.position="absolute";
_127.style.zIndex="51";
_127.style.left=xMin+"px";
_127.style.top=yMin+"px";
this._layer._layerDiv.appendChild(_127);
var _128=(this.width>0)?{strokeColor:this.color,strokeWidth:this.width}:{fillColor:this.color};
ravegeo.internal.Utilities.fixStyle(_128);
_126.drawOval(5,5,_124-10,_125-10,_128);
ravegeo.internal.MapCommons._addCanvasObjectEvents(this);
};
_10f.prototype._reposition=function(_129,_12a){
var xMin=Math.round((this._xMin-_129.x)*_12a.x)-5;
var xMax=Math.round((this._xMax-_129.x)*_12a.x)+5;
var yMin=Math.round((_129.y-this._yMax)*_12a.y)-5;
var yMax=Math.round((_129.y-this._yMin)*_12a.y)+5;
var _12f=xMax-xMin;
var _130=yMax-yMin;
var _131=this._canvasElement;
_131.style.position="absolute";
_131.style.zIndex="51";
_131.style.left=xMin+"px";
_131.style.top=yMin+"px";
};
_10f.prototype._isInside=function(xMin,yMin,xMax,yMax){
return this._xMin<xMax&&this._xMax>xMin&&this._yMin<yMax&&this._yMax>yMin;
};
_10f.prototype._expandBounds=function(_136,_137){
if(this._xMin<_136.x){
_136.x=this._xMin;
}
if(this._xMax>_137.x){
_137.x=this._xMax;
}
if(this._yMin<_136.y){
_136.y=this._yMin;
}
if(this._yMax>_137.y){
_137.y=this._yMax;
}
};
_10f.prototype._getCenter=function(){
return {x:(this.minX+this.maxX)/2,y:(this.minY+this.maxY)/2};
};
_10f.prototype._setHighlight=function(_138,_139){
};
_10f.prototype._removeHighlight=function(){
};
_10f.prototype._pick=function(_13a){
var _13b=this._layer._geoToPixelPointsX([this._xMin,this._xMax]);
var _13c=this._layer._geoToPixelPointsY([this._yMax,this._yMin]);
return _10e.isPointInsideEllipse(_13b,_13c,_13a,this.width);
};
_10f.prototype.move=function(_13d,_13e){
this._xMin=this._xMin+_13d;
this._xMax=this._xMax+_13d;
this._yMin=this._yMin+_13e;
this._yMax=this._yMax+_13e;
this._layer._repositionGeoObject(this);
};
return _10f;
})();
ravegeo.Symbol=(function(){
var _13f=ravegeo.internal.Utilities;
var _140=function(id,x,y,_144,_145,text){
_13f.ensureString(id,"id");
this.id=id;
this._x=x;
this._y=y;
this.symbol=_144;
this.label=(typeof (_145)!="undefined"&&_145!=null)?_145:"";
this.text=(typeof (text)!="undefined"&&text!=null)?text:"";
};
_140.prototype.getPoint=function(){
if(ravegeo._projector){
var p=ravegeo._projector.reverse(this._x,this._y);
return {x:p[0],y:p[1]};
}
return {x:this._x,y:this._y};
};
_140.prototype._project=function(){
if(ravegeo._projector){
var p=ravegeo._projector.forward(this._x,this._y);
this._x=p[0];
this._y=p[1];
}
};
_140.prototype._serialize=function(){
var s="s";
s+=this.id.length+";"+this.id;
s+=this._x+";";
s+=this._y+";";
s+=this.symbol.length+";"+this.symbol;
s+=this.label.length+";"+this.label;
s+=this.text.length+";"+this.text;
return s;
};
_140.prototype._createBallon=function(_14a){
var _14b=document.createElement("div");
_13f.setStyle(_14b,"position:absolute;top:0px;left:0px;z-index:53;border:1px solid;cursor:text;padding:3px 5px 3px 5px;white-space:pre;");
_14b.style.borderColor=_13f.getColor(_14a.borderColor);
_14b.style.backgroundColor=_13f.getColor(_14a.backgroundColor);
_14b.innerHTML+=this.text;
_14b.style.color=_13f.getColor(_14a.textColor);
_14b.style.left=(this._left+this._img.width+5)+"px";
_14b.style.top=(this._top+this._img.height+5)+"px";
return _14b;
};
function imageLoaded(){
var _14c=this._symbol;
delete _14c._notYetLoaded;
_14c._layer._positionGeoObject(_14c);
if(_14c._doHighlight){
_14c._layer.highlightGeoObject(_14c.id,_14c._doHighlight);
delete _14c._doHighlight;
}
}
_140.prototype._tiledMapInit=function(_14d,_14e){
var opts;
if(_14e){
opts={center:"Never"};
if(_14e._highlightElement){
opts.showHighlight=true;
}
if(_14e._alwaysBalloon){
opts.showText=true;
}
}
this._layer=_14d;
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:_14d};
ravegeo.TiledMap._addMapEvents(img);
var _151;
if(!_13f.stringIsEmpty(this.label)){
var _152=document.createElement("span");
this._innerLabelSpan=_152;
_152.innerHTML=this.label;
_13f.setStyle(_152,"font-family:sans-serif;font-size:small;padding:0px;white-space:pre;border:1px solid;padding:2px 3px 2px 3px;");
_152.style.borderColor=_13f.getColor(_14d._labelStyle.borderColor);
_152.style.backgroundColor=_13f.getColor(_14d._labelStyle.backgroundColor);
_152.style.color=_13f.getColor(_14d._labelStyle.textColor);
labelDiv=this._labelDiv=document.createElement("div");
_13f.setStyle(labelDiv,"position:absolute;left:-755px;z-index:49;width:1500px;text-align:center;padding:5px;margin:1px;");
labelDiv.appendChild(_152);
_152._tile={owner:_14d};
ravegeo.TiledMap._addMapEvents(_152);
labelDiv._tile={owner:_14d};
ravegeo.TiledMap._addMapEvents(labelDiv);
_151=this._symbolCenterDiv=document.createElement("div");
_13f.setStyle(_151,"position:absolute;z-index:49;width:0px;height:0px;padding:0px;margin:0px;");
_151.appendChild(labelDiv);
}
_14d._positionGeoObject(this);
_14d._layerDiv.appendChild(img);
if(_151){
_14d._layerDiv.appendChild(_151);
}
if(opts){
_14d.highlightGeoObject(this.id,opts);
}
};
_140.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);
}
};
_140.prototype._position=function(_153,_154){
var _155=this._setLeftAndTop(_153,_154);
this._img.style.left=this._left+"px";
this._img.style.top=this._top+"px";
if(this._labelDiv){
this._symbolCenterDiv.style.left=_155.x+"px";
this._symbolCenterDiv.style.top=_155.y+"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";
}
}
if(!_13f.isImageLoaded(this._img)){
this._notYetLoaded=true;
_13f.onImageLoaded(this._img,imageLoaded);
}
if(this._highlightElement){
var _156=Math.round(this._left+this._img.width/2);
var _157=Math.round(this._top+this._img.height/2);
var ow=this._highlightOuterWidth;
if(typeof (ow)!="undefined"){
this._highlightElement.style.left=Math.round(_156-ow)+"px";
this._highlightElement.style.top=(_157-ow)+"px";
}
}
};
_140.prototype._isInside=function(xMin,yMin,xMax,yMax){
return this._x>=xMin&&this._y>=yMin&&this._x<=xMax&&this._y<=yMax;
};
_140.prototype._expandBounds=function(_15d,_15e){
if(this._x<_15d.x){
_15d.x=this._x;
}
if(this._x>_15e.x){
_15e.x=this._x;
}
if(this._y<_15d.y){
_15d.y=this._y;
}
if(this._y>_15e.y){
_15e.y=this._y;
}
};
_140.prototype._getCenter=function(){
return {x:this._x,y:this._y};
};
_140.prototype._setHighlight=function(_15f,_160){
if(_15f){
this._alwaysBalloon=this._createBallon(this._layer._textStyle);
this._layer._layerDiv.appendChild(this._alwaysBalloon);
}
if(_160){
var _161=this._img.width;
var _162=this._img.height;
var _163=Math.round(this._left+_161/2);
var _164=Math.round(this._top+_162/2);
var _165=Math.max(_161,_162)/3;
var _166=(Math.sqrt(_161*_161+_162*_162)/2)+_165;
var ow=Math.round(_166+_165/2);
this._highlightOuterWidth=ow;
var _168=ravegeo.internal.Canvas.create(ow*2,ow*2);
var _169=_168.getElement();
_169.style.position="absolute";
_169.style.zIndex="51";
_169.style.left=Math.round(_163-ow)+"px";
_169.style.top=(_164-ow)+"px";
this._layer._layerDiv.appendChild(_169);
this._highlightElement=_169;
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(_166*Math.cos(i));
var y=ow-Math.floor(_166*Math.sin(i));
_168.drawCircle(x,y,_165/2,_13f.fixStyle({fillColor:this._layer._highlightColor}));
}
_169._tile={owner:this._layer};
ravegeo.TiledMap._addMapEvents(_169);
var _16f=_169.childNodes;
for(idx in _16f){
var _170=_16f[idx];
_170._tile={owner:this._layer};
}
}
this._img.style.zIndex="53";
};
_140.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;
}
};
_140.prototype._pick=function(_171){
var left=this._left+this._layer._map._mapWidth/2;
var top=this._top+this._layer._map._mapHeight/2;
return _171[0]>left&&_171[0]<(left+this._img.width)&&_171[1]>top&&_171[1]<(top+this._img.height);
};
_140.prototype._setLeftAndTop=function(_174,_175){
var cx=-Math.round((_174.x-this._x)*_175.x);
var cy=Math.round((_174.y-this._y)*_175.y);
this._left=cx-this._img.width/2;
this._top=cy-this._img.height/2;
return {x:cx,y:cy};
};
_140.prototype.move=function(_178,_179){
this._x=this._x+_178;
this._y=this._y+_179;
this._layer._positionGeoObject(this);
};
return _140;
})();
ravegeo.Polygon=(function(){
var _17a=ravegeo.internal.Utilities;
var _17b=ravegeo.internal.GeometryFunctions;
var _17c=function(id,_17e,_17f,_180){
_17a.ensureString(id,"id");
this.id=id;
this._xPoints=_17e;
this._yPoints=_17f;
this.color=(typeof (_180)!="undefined")?_180:"#000000";
};
_17c.prototype.getPoints=function(){
var xpts=this._xPoints;
var ypts=this._yPoints;
if(ravegeo._projector){
xpts=xpts.slice(0);
ypts=ypts.slice(0);
ravegeo._projector.reverseArray(xpts,ypts);
}
return {xValues:xpts,yValues:ypts};
};
_17c.prototype._project=function(){
if(ravegeo._projector){
ravegeo._projector.forwardArray(this._xPoints,this._yPoints);
}
};
_17c.prototype._serialize=function(){
var g="g";
g+=this.id.length+";"+this.id;
g+=ravegeo.internal.MapCommons._serializeDoubleArray(this._xPoints);
g+=ravegeo.internal.MapCommons._serializeDoubleArray(this._yPoints);
g+=this.color.length+";"+this.color;
return g;
};
_17c.prototype._tiledMapInit=function(_184,_185){
this._layer=_184;
_184._positionGeoObject(this);
};
_17c.prototype._destroy=function(){
this._layer._layerDiv.removeChild(this._canvasElement);
};
_17c.prototype._position=function(_186,_187){
ravegeo.internal.MapCommons._polyX_position(this,_186,_187,5,true);
};
_17c.prototype._reposition=function(_188,_189){
ravegeo.internal.MapCommons._polyX_reposition(this,_188,_189,5,true);
};
_17c.prototype._isInside=function(xMin,yMin,xMax,yMax){
ravegeo.internal.MapCommons._polyX_isInside(this._xPoints,this._yPoints,xMin,yMin,xMax,yMax);
};
_17c.prototype._expandBounds=function(_18e,_18f){
ravegeo.internal.MapCommons._polyX_expandBounds(this._xPoints,this._yPoints,_18e,_18f);
};
_17c.prototype._getCenter=function(){
return ravegeo.internal.MapCommons._polyX_getCenter(this._xPoints,this._yPoints);
};
_17c.prototype._setHighlight=function(_190,_191){
};
_17c.prototype._removeHighlight=function(){
};
_17c.prototype._pick=function(_192){
var _193=this._layer._geoToPixelPointsX(this._xPoints);
var _194=this._layer._geoToPixelPointsY(this._yPoints);
return _17b.isPointInsidePolygon(_193,_194,_192);
};
_17c.prototype.move=function(_195,_196){
ravegeo.internal.MapCommons._polyX_move(this,_195,_196);
};
return _17c;
})();
ravegeo.Polyline=(function(){
var _197=ravegeo.internal.Utilities;
var _198=ravegeo.internal.GeometryFunctions;
var _199=function(id,_19b,_19c,_19d,_19e){
_197.ensureString(id,"id");
this.id=id;
this._xPoints=_19b;
this._yPoints=_19c;
this.width=(typeof (_19d)!="undefined")?_19d:1;
this.color=(typeof (_19e)!="undefined")?_19e:"#000000";
};
_199.prototype.getPoints=function(){
var xpts=this._xPoints;
var ypts=this._yPoints;
if(ravegeo._projector){
xpts=xpts.slice(0);
ypts=ypts.slice(0);
ravegeo._projector.reverseArray(xpts,ypts);
}
return {xValues:xpts,yValues:ypts};
};
_199.prototype._project=function(){
if(ravegeo._projector){
ravegeo._projector.forwardArray(this._xPoints,this._yPoints);
}
};
_199.prototype._serialize=function(){
var l="l";
l+=this.id.length+";"+this.id;
l+=ravegeo.internal.MapCommons._serializeDoubleArray(this._xPoints);
l+=ravegeo.internal.MapCommons._serializeDoubleArray(this._yPoints);
l+=this.width+";";
l+=this.color.length+";"+this.color;
return l;
};
_199.prototype._tiledMapInit=function(_1a2,_1a3){
this._layer=_1a2;
_1a2._positionGeoObject(this);
};
_199.prototype._destroy=function(){
this._layer._layerDiv.removeChild(this._canvasElement);
};
_199.prototype._position=function(_1a4,_1a5){
ravegeo.internal.MapCommons._polyX_position(this,_1a4,_1a5,5+this.width,false);
};
_199.prototype._reposition=function(_1a6,_1a7){
ravegeo.internal.MapCommons._polyX_reposition(this,_1a6,_1a7,5+this.width,false);
};
_199.prototype._isInside=function(xMin,yMin,xMax,yMax){
ravegeo.internal.MapCommons._polyX_isInside(this._xPoints,this._yPoints,xMin,yMin,xMax,yMax);
};
_199.prototype._expandBounds=function(_1ac,_1ad){
ravegeo.internal.MapCommons._polyX_expandBounds(this._xPoints,this._yPoints,_1ac,_1ad);
};
_199.prototype._getCenter=function(){
return ravegeo.internal.MapCommons._polyX_getCenter(this._xPoints,this._yPoints);
};
_199.prototype._setHighlight=function(_1ae,_1af){
};
_199.prototype._removeHighlight=function(){
};
_199.prototype._pick=function(_1b0){
var _1b1=this._layer._geoToPixelPointsX(this._xPoints);
var _1b2=this._layer._geoToPixelPointsY(this._yPoints);
var _1b3=_198.closestPointOnLine(_1b1,_1b2,_1b0,this.width/2);
return (_1b3<this.width/2*this.width/2);
};
_199.prototype.move=function(_1b4,_1b5){
ravegeo.internal.MapCommons._polyX_move(this,_1b4,_1b5);
};
return _199;
})();
ravegeo.MercatorProjector=(function(){
var _1b6=Math.PI/180;
var _1b7=111319.49079;
var _1b8={};
_1b8.forward=function(lon,lat){
if(lat>88){
lat=88;
}
if(lat<-88){
lat=-88;
}
var _1bb=Math.sin(lat*_1b6);
var yrad=0.5*Math.log((1+_1bb)/(1-_1bb));
var y=yrad/_1b6*_1b7;
return [lon*_1b7,y];
};
_1b8.reverse=function(x,y){
var _1c0=2*Math.atan(Math.exp(y/_1b7*_1b6))-Math.PI/2;
return [x/_1b7,_1c0/_1b6];
};
_1b8.forwardArray=function(_1c1,_1c2){
for(var i in _1c1){
var p=_1b8.forward(_1c1[i],_1c2[i]);
_1c1[i]=p[0];
_1c2[i]=p[1];
}
};
_1b8.reverseArray=function(xarr,yarr){
for(var i in xarr){
var p=_1b8.reverse(xarr[i],yarr[i]);
xarr[i]=p[0];
yarr[i]=p[1];
}
};
return _1b8;
})();
ravegeo.AppletMap=(function(){
var _1c9=0;
var _1ca=ravegeo.internal.ToolEventsDispatcher;
var _1cb=function(_1cc){
ravegeo.internal.MapCommons._fixParams(_1cc);
if(ravegeo._projector){
delete ravegeo._projector;
}
if(_1cc._appletProjector){
ravegeo._projector=_1cc._appletProjector;
}
this._appletTimeoutCallback=_1cc._appletTimeoutCallback;
this._callback=_1cc.callback;
this._mapContainer=_1cc.mapContainer;
this._layers=[];
this._tools=[];
var _1cd=ravegeo.internal.MapCommons.defaultInteractionDelay;
if(typeof (_1cc.interactionDelay)!="undefined"){
_1cd=_1cc.interactionDelay;
if(_1cd>ravegeo.internal.MapCommons.maxInteractionDelay||_1cd<0){
_1cd=ravegeo.internal.MapCommons.maxInteractionDelay;
}
}
var _1ce="webmap-";
_1ce+=ravegeo.internal.MapCommons.version+".jar";
this._id="RaveGeoWebMapApplet"+_1c9++;
var html="<applet id='"+this._id+"' code='ravegeo.webmap.WebMapApplet.class' archive='"+_1cc.url+_1ce+"' mayscript='true' width='1' height='1'>";
html+="<param name='url' value='"+_1cc.url+"' />";
html+="<param name='name' value='"+_1cc.name+"' />";
if(_1cc.key){
html+="<param name='key' value='"+_1cc.key+"' />";
}
html+="<param name='callbackId' value='"+this._id+"' />";
html+="<param name='interactionDelay' value='"+_1cd+"' />";
if(_1cc.initialViewArea){
var x=_1cc.initialViewArea.x;
var y=_1cc.initialViewArea.y;
if(ravegeo._projector){
var p=ravegeo._projector.forward(x,y);
x=p[0];
y=p[1];
}
html+="<param name='initialViewArea.x' value='"+x+"' />";
html+="<param name='initialViewArea.y' value='"+y+"' />";
html+="<param name='initialViewArea.scale' value='"+_1cc.initialViewArea.scale+"' />";
}
if(_1cc.style){
var _1d3="";
for(var k in _1cc.style){
_1d3+=k+"|"+_1cc.style[k]+"|";
}
html+="<param name='style' value='"+_1d3+"' />";
}
html+="</applet>";
this._mapContainer.innerHTML+=html;
ravegeo.AppletMap.appletMaps[this._id]=this;
this._isAppletLoaded=false;
if(_1cc._maxAppletLoadTime){
var _1d5=this;
setTimeout(function(){
_1d5._appletLoadTimedOut();
},_1cc._maxAppletLoadTime);
}
this._params=_1cc;
this.addTool(ravegeo.tools.internal.DeprecatedCallbacksTool);
};
_1cb.prototype._appletLoaded=function(){
this._isAppletLoaded=true;
};
_1cb.prototype._appletLoadTimedOut=function(){
if(!this._isAppletLoaded){
if(this._appletTimeoutCallback){
this._appletTimeoutCallback();
}else{
this._errorDuringInit("AppletLoadTimeout","The applet did not load in the specified maximum time.");
}
}
};
_1cb.prototype._mapLoaded=function(){
var _1d6=this._params;
delete this._params;
this._applet=document.getElementById(this._id);
try{
this._applet.getCenterX();
}
catch(e){
if(this._appletTimeoutCallback){
this._appletTimeoutCallback();
}else{
this._errorDuringInit("LiveConnectNotAvailable","Could not connect to applet using LiveConnect.");
}
return;
}
this._applet.style.width=this._mapContainer.clientWidth+"px";
this._applet.style.height=this._mapContainer.clientHeight+"px";
try{
this._applet.getCenterX();
}
catch(e){
}
this._notifyJavaOfResizeIfNeeded(this._mapContainer.clientWidth,this._mapContainer.clientHeight);
ravegeo.internal.Utilities.removeChildren(this._mapContainer,this._applet);
if(this._callback&&this._callback.mapLoaded){
this._callback.mapLoaded(this);
}
};
_1cb.prototype._errorDuringInit=function(code,_1d8){
this._mapContainer.innerHTML="Fatal error: "+code+"<br>"+_1d8;
if(this._callback&&this._callback.errorOccurred){
this._callback.errorOccurred(code,_1d8);
}
};
_1cb.prototype._interactionEnded=function(){
if(this._callback&&this._callback.interactionEnded){
this._callback.interactionEnded(this);
}
};
_1cb.prototype._symbolClicked=function(_1d9,_1da){
if(this._callback&&this._callback.symbolClicked){
this._callback.symbolClicked(this,this._layers[_1d9],_1da);
}
};
_1cb.prototype._mapClicked=function(x,y){
_1ca.toolsOnMapEvent(this,this._tools,"mapClicked",x,y);
};
_1cb.prototype._mapDoubleClicked=function(x,y){
_1ca.toolsOnMapEvent(this,this._tools,"mapDoubleClicked",x,y);
};
_1cb.prototype._mapMouseDown=function(x,y){
_1ca.toolsOnMapEvent(this,this._tools,"mapMouseDown",x,y);
};
_1cb.prototype._mapMouseMove=function(x,y){
_1ca.toolsOnMapEvent(this,this._tools,"mapMouseMove",x,y);
};
_1cb.prototype._mapMouseUp=function(x,y){
_1ca.toolsOnMapEvent(this,this._tools,"mapMouseUp",x,y);
};
_1cb.prototype._objectDragStart=function(_1e5,_1e6,x,y){
_1ca.toolsOnObjectEvent(this,this._tools,"objectDragStart",_1e5,_1e6,x,y);
};
_1cb.prototype._objectDragEnd=function(_1e9,_1ea,x,y){
_1ca.toolsOnObjectEvent(this,this._tools,"objectDragEnd",_1e9,_1ea,x,y);
};
_1cb.prototype._objectDragged=function(_1ed,_1ee,x,y){
_1ca.toolsOnObjectEvent(this,this._tools,"objectDragged",_1ed,_1ee,x,y);
};
_1cb.prototype._objectClicked=function(_1f1,_1f2,x,y){
_1ca.toolsOnObjectEvent(this,this._tools,"objectClicked",_1f1,_1f2,x,y);
};
_1cb.prototype._objectMouseDown=function(_1f5,_1f6,x,y){
_1ca.toolsOnObjectEvent(this,this._tools,"objectMouseDown",_1f5,_1f6,x,y);
};
_1cb.prototype._objectMouseMove=function(_1f9,_1fa,x,y){
_1ca.toolsOnObjectEvent(this,this._tools,"objectMouseMove",_1f9,_1fa,x,y);
};
_1cb.prototype._objectMouseUp=function(_1fd,_1fe,x,y){
_1ca.toolsOnObjectEvent(this,this._tools,"objectMouseUp",_1fd,_1fe,x,y);
};
_1cb.prototype.getCenterX=function(){
var x=this._applet.getCenterX();
if(ravegeo._projector){
var y=this._applet.getCenterY();
var p=ravegeo._projector.reverse(x,y);
x=p[0];
}
return x;
};
_1cb.prototype.getCenterY=function(){
var y=this._applet.getCenterY();
if(ravegeo._projector){
var x=this._applet.getCenterX();
var p=ravegeo._projector.reverse(x,y);
y=p[1];
}
return y;
};
_1cb.prototype.getScale=function(){
return this._applet.getScale();
};
_1cb.prototype.getGeoBounds=function(){
var _207=eval("("+this._applet.getGeoBounds()+")");
if(ravegeo._projector){
_207[0]=ravegeo._projector.reverse(_207[0][0],_207[0][1]);
_207[1]=ravegeo._projector.reverse(_207[1][0],_207[1][1]);
}
return {xMin:_207[0][0],yMin:_207[0][1],xMax:_207[1][0],yMax:_207[1][1]};
};
_1cb.prototype.setGeoBounds=function(_208){
if(ravegeo._projector){
var minp=ravegeo._projector.forward(_208.xMin,_208.yMin);
var maxp=ravegeo._projector.forward(_208.xMax,_208.yMax);
_208={xMin:minp[0],yMin:minp[1],xMax:maxp[0],yMax:maxp[1]};
}
this._applet.setGeoBounds(_208.xMin,_208.yMin,_208.xMax,_208.yMax);
};
_1cb.prototype.getRecommendedScales=function(){
return eval("("+this._applet.getRecommendedScales()+")");
};
_1cb.prototype.setViewArea=function(x,y,_20d){
if(ravegeo._projector){
var p=ravegeo._projector.forward(x,y);
x=p[0];
y=p[1];
}
this._applet.setViewArea(x,y,_20d);
};
_1cb.prototype.newLayer=function(opts){
var _210=new ravegeo.internal.AppletLayer(this._applet,opts);
this._layers[_210._id]=_210;
return _210;
};
_1cb.prototype.removeLayer=function(_211){
this._applet.removeLayer(_211._id);
delete this._layers[_211._id];
};
_1cb.prototype.addTool=function(tool){
if(tool.activate){
tool.activate(this);
}
this._tools[this._tools.length]=tool;
};
_1cb.prototype.removeTool=function(tool){
if(tool.disable){
tool.disable(this);
}
for(var idx in this._tools){
if(this._tools[idx]==tool){
this._tools.splice(idx,1);
break;
}
}
};
_1cb.prototype.zoom=function(_215){
this._applet.zoom(_215);
};
_1cb.prototype.zoomTo=function(_216){
this._applet.zoomTo(_216);
};
_1cb.prototype.pan=function(dx,dy){
this._applet.pan(dx,dy);
};
_1cb.prototype.moveTo=function(x,y,_21b){
if(ravegeo._projector){
var p=ravegeo._projector.forward(x,y);
x=p[0];
y=p[1];
}
this._applet.moveTo(x,y,_21b);
};
_1cb.prototype.setPanningEnabled=function(_21d){
this._applet.enablePanning(_21d);
};
_1cb.prototype.moveObject=function(_21e,x,y){
this._applet.moveObject(_21e,x,y);
};
_1cb.prototype.getUpDirection=function(){
return this._applet.getUpDirection();
};
_1cb.prototype.setUpDirection=function(_221){
this._applet.setUpDirection(_221);
};
_1cb.prototype.getPitch=function(){
return this._applet.getPitch();
};
_1cb.prototype.setPitch=function(_222){
this._applet.setPitch(_222);
};
_1cb.prototype.resize=function(_223,_224){
this._applet.style.width=_223+"px";
this._applet.style.height=_224+"px";
this._mapContainer.style.width=_223+"px";
this._mapContainer.style.height=_224+"px";
this._notifyJavaOfResizeIfNeeded(_223,_224);
};
_1cb.prototype._notifyJavaOfResizeIfNeeded=function(_225,_226){
if(ravegeo.internal.Environment.isMac&&ravegeo.internal.Environment.isFirefox){
this._applet.resize(_225,this._applet.height);
this._applet.resize(this._applet.width,_226);
}
};
_1cb.initiateCreation=function(_227){
if(!ravegeo.internal.Environment.isJavaEnabled()){
throw new Error("Java does not seem to be enabled.");
}
var map=new ravegeo.AppletMap(_227);
};
_1cb.appletMaps={};
return _1cb;
})();
ravegeo.internal.AppletLayer=(function(){
var _229=function(_22a,opts){
this._applet=_22a;
if(typeof (opts)=="undefined"){
opts={};
}
opts.arrangeGeoObjects=opts.arrangeGeoObjects?true:false;
if(typeof (opts.gridWidth)=="undefined"){
opts.gridWidth=16;
}
if(typeof (opts.gridHeight)=="undefined"){
opts.gridHeight=16;
}
if(typeof (opts.labelStyle)=="undefined"){
opts.labelStyle={};
}
var _22c=opts.labelStyle;
if(!_22c.borderColor){
_22c.borderColor="";
}
if(!_22c.backgroundColor){
_22c.backgroundColor="";
}
if(!_22c.textColor){
_22c.textColor="";
}
opts.labelsAboveSymbols=opts.labelsAboveSymbols?true:false;
if(typeof (opts.textStyle)=="undefined"){
opts.textStyle={};
}
var _22d=opts.textStyle;
if(!_22d.borderColor){
_22d.borderColor="";
}
if(!_22d.backgroundColor){
_22d.backgroundColor="";
}
if(!_22d.textColor){
_22d.textColor="";
}
if(typeof (opts.highlightColor)=="undefined"){
opts.highlightColor="";
}
this._id=this._applet.newLayer(opts.arrangeGeoObjects,opts.gridWidth,opts.gridHeight,opts.labelStyle.borderColor,opts.labelStyle.backgroundColor,opts.labelStyle.textColor,opts.labelsAboveSymbols,opts.textStyle.borderColor,opts.textStyle.backgroundColor,opts.textStyle.textColor,opts.highlightColor);
};
_229.prototype.clear=function(){
this._applet.clearGeoObjects(this._id);
};
_229.prototype.addGeoObjects=function(objs){
var _22f="";
for(var idx in objs){
objs[idx]._project();
_22f+=objs[idx]._serialize();
}
this._applet.addGeoObjects(this._id,_22f);
};
_229.prototype.getGeoObjectIds=function(_231){
var js=this._applet.getGeoObjectIds(this._id,_231?true:false);
return eval("("+js+")");
};
_229.prototype.getGeoObject=function(id){
var js=this._applet.getGeoObject(this._id,id);
return eval("("+js+")");
};
_229.prototype.removeGeoObjects=function(ids){
var _236="";
for(var idx in ids){
_236+=ids[idx].length+";"+ids[idx];
}
this._applet.removeGeoObjects(this._id,_236);
};
_229.prototype.setVisible=function(_238){
if(typeof (_238)=="undefined"){
_238=true;
}
this._applet.setLayerVisible(this._id,_238);
};
_229.prototype.showGeoObjects=function(_239){
this._applet.showGeoObjects(this._id,_239);
};
_229.prototype.highlightGeoObject=function(id,_23b){
if(typeof (_23b)=="undefined"){
_23b={};
}
if(typeof (_23b.center)=="undefined"){
_23b.center="";
}
if(typeof (_23b.showText)=="undefined"){
_23b.showText=false;
}
if(typeof (_23b.showHighlight)=="undefined"){
_23b.showHighlight=false;
}
this._applet.highlightGeoObject(this._id,id,_23b.center,_23b.showText,_23b.showHighlight);
};
_229.prototype.moveGeoObject=function(id,_23d,_23e){
this._applet.moveGeoObject(this._id,id,_23d,_23e);
};
return _229;
})();
ravegeo.internal.Canvas=(function(){
var _23f="http://www.w3.org/TR/SVG11/feature#SVG";
var _240=(document.implementation&&(document.implementation.hasFeature("org.w3c.svg","1.0")||document.implementation.hasFeature(_23f,"1.1")||document.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#Shape","1.0")));
function SVGCanvas(_241,_242){
this._element=document.createElementNS(SVGCanvas.xmlns,"svg");
this._element.setAttributeNS(null,"width",_241);
this._element.setAttributeNS(null,"height",_242);
this._style={strokeColor:"#000000"};
}
SVGCanvas.xmlns="http://www.w3.org/2000/svg";
SVGCanvas.buildStyleString=function(_243){
var _244="fill:"+(_243.fillColor||"none")+";";
if(typeof (_243.fillOpacity)!="undefined"){
_244+="fill-opacity:"+_243.fillOpacity+";";
}
_244+="stroke:"+(_243.strokeColor||"none")+";";
if(typeof (_243.strokeOpacity)!="undefined"){
_244+="stroke-opacity:"+_243.strokeOpacity+";";
}
if(typeof (_243.strokeWidth)!="undefined"){
_244+="stroke-width:"+_243.strokeWidth+";";
}
return _244;
};
SVGCanvas.createPoly=function(_245,_246,type,_248){
var poly=document.createElementNS(SVGCanvas.xmlns,type);
var _24a="";
for(var i in _245){
_24a+=_245[i]+","+_246[i]+" ";
}
poly.setAttributeNS(null,"points",_24a);
poly.setAttributeNS(null,"style",SVGCanvas.buildStyleString(_248));
return poly;
};
SVGCanvas.prototype.getElement=function(){
return this._element;
};
SVGCanvas.prototype.setStyle=function(_24c){
this._style=_24c;
};
SVGCanvas.prototype.drawCircle=function(cx,cy,_24f,_250){
_250=_250||this._style;
var _251=document.createElementNS(SVGCanvas.xmlns,"circle");
_251.setAttributeNS(null,"cx",cx);
_251.setAttributeNS(null,"cy",cy);
_251.setAttributeNS(null,"r",_24f);
_251.setAttributeNS(null,"style",SVGCanvas.buildStyleString(_250));
this._element.appendChild(_251);
};
SVGCanvas.prototype.drawOval=function(x,y,_254,_255,_256){
_256=_256||this._style;
var _257=document.createElementNS(SVGCanvas.xmlns,"ellipse");
_257.setAttributeNS(null,"cx",x+_254/2);
_257.setAttributeNS(null,"cy",y+_255/2);
_257.setAttributeNS(null,"rx",_254/2);
_257.setAttributeNS(null,"ry",_255/2);
_257.setAttributeNS(null,"style",SVGCanvas.buildStyleString(_256));
this._element.appendChild(_257);
};
SVGCanvas.prototype.drawPolygon=function(_258,_259,_25a){
_25a=_25a||this._style;
this._element.appendChild(SVGCanvas.createPoly(_258,_259,"polygon",_25a));
};
SVGCanvas.prototype.drawPolyline=function(_25b,_25c,_25d){
_25d=_25d||this._style;
this._element.appendChild(SVGCanvas.createPoly(_25b,_25c,"polyline",_25d));
};
SVGCanvas.prototype.drawRect=function(x,y,_260,_261,_262){
_262=_262||this._style;
var rect=document.createElementNS(SVGCanvas.xmlns,"rect");
rect.setAttributeNS(null,"x",x);
rect.setAttributeNS(null,"y",y);
rect.setAttributeNS(null,"width",_260);
rect.setAttributeNS(null,"height",_261);
if(typeof (_262.cornerRadius)!="undefined"){
var r=(_261>_260)?_260*_262.cornerRadius:_261*_262.cornerRadius;
rect.setAttributeNS(null,"rx",r);
rect.setAttributeNS(null,"ry",r);
}
rect.setAttributeNS(null,"style",SVGCanvas.buildStyleString(_262));
this._element.appendChild(rect);
};
var _265=document.namespaces;
if(_265&&!_240){
var _266=function(_267){
return document.createElement("<ivml:"+_267+" 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){
_266=function(_268){
return document.createElement("<"+_268+" xmlns=\"urn:schemas-microsoft.com:vml\" class=\"ivml\">");
};
}
}
function VMLCanvas(_269,_26a){
var _26b=_266("group");
_26b.style.position="absolute";
_26b.style.top="0px";
_26b.style.left="0px";
_26b.style.width=_269+"px";
_26b.style.height=_26a+"px";
_26b.coordsize=_269+" "+_26a;
_26b.coordorigin="1 1";
this._element=_26b;
this._style={strokeColor:"#000000"};
}
VMLCanvas.createFillElement=function(_26c){
var fill=_266("fill");
if(typeof (_26c.fillColor)!="undefined"){
fill.color=_26c.fillColor;
if(typeof (_26c.fillOpacity)!="undefined"){
fill.opacity=_26c.fillOpacity;
}
}else{
fill.on=false;
}
return fill;
};
VMLCanvas.createStrokeElement=function(_26e){
var _26f=_266("stroke");
if(typeof (_26e.strokeColor)!="undefined"){
_26f.color=_26e.strokeColor;
if(typeof (_26e.strokeOpacity)!="undefined"){
_26f.opacity=_26e.strokeOpacity;
}
if(typeof (_26e.strokeWidth)!="undefined"){
_26f.weight=_26e.strokeWidth+"px";
}
}else{
_26f.on=false;
}
return _26f;
};
VMLCanvas.prototype.getElement=function(){
return this._element;
};
VMLCanvas.prototype.setStyle=function(_270){
this._style=_270;
};
VMLCanvas.prototype.drawCircle=function(cx,cy,_273,_274){
_274=_274||this._style;
this.drawOval(cx-_273,cy-_273,_273*2,_273*2,_274);
};
VMLCanvas.prototype.drawOval=function(x,y,_277,_278,_279){
_279=_279||this._style;
var oval=_266("oval");
oval.style.position="absolute";
oval.style.left=x;
oval.style.top=y;
oval.style.width=(_277+1);
oval.style.height=(_278+1);
oval.position="0 0";
oval.size=_277+" "+_278;
oval.appendChild(VMLCanvas.createFillElement(_279));
oval.appendChild(VMLCanvas.createStrokeElement(_279));
this._element.appendChild(oval);
};
VMLCanvas.prototype.drawPolyline=function(_27b,_27c,_27d){
_27d=_27d||this._style;
var line=_266("polyline");
line.style.position="absolute";
var _27f="";
for(var i in _27b){
_27f+=_27b[i]+" "+_27c[i]+" ";
}
line.points=_27f;
line.appendChild(VMLCanvas.createFillElement(_27d));
var _281=VMLCanvas.createStrokeElement(_27d);
_281.joinstyle="miter";
line.appendChild(_281);
this._element.appendChild(line);
};
VMLCanvas.prototype.drawPolygon=function(_282,_283,_284){
var _285=[];
var _286=[];
_285.length=_286.length=_282.length+1;
for(var i in _282){
_285[i]=_282[i];
_286[i]=_283[i];
}
_285[_282.length]=_282[0];
_286[_282.length]=_283[0];
this.drawPolyline(_285,_286,_284);
};
VMLCanvas.prototype.drawRect=function(x,y,_28a,_28b,_28c){
_28c=_28c||this._style;
var rect=_266("roundrect");
rect.style.position="absolute";
rect.style.left=x;
rect.style.top=y;
rect.style.width=(_28a+1);
rect.style.height=(_28b+1);
rect.arcsize=_28c.cornerRadius||0;
rect.appendChild(VMLCanvas.createFillElement(_28c));
var _28e=VMLCanvas.createStrokeElement(_28c);
_28e.joinstyle="miter";
rect.appendChild(_28e);
this._element.appendChild(rect);
};
function CanvasCanvas(_28f,_290){
var _291=document.createElement("canvas");
_291.setAttribute("width",_28f);
_291.setAttribute("height",_290);
this._element=_291;
this._style={strokeColor:"#000000"};
if(_291.getContext){
this._canvas=_291.getContext("2d");
}else{
throw new Error("No implementation supported.");
}
}
CanvasCanvas.createPolyPath=function(_292,_293,_294,_295){
_294.beginPath();
_294.moveTo(_292[0],_293[0]);
for(var i=1;i<_292.length;++i){
_294.lineTo(_292[i],_293[i]);
}
if(_295){
_294.closePath();
}
};
CanvasCanvas.drawPoly=function(_297,_298,_299,_29a,_29b){
if(typeof (_29a.fillColor)!="undefined"){
CanvasCanvas.createPolyPath(_297,_298,_299,_29b);
_299.fillStyle=_29a.fillColor;
_299.globalAlpha=(typeof (_29a.fillOpacity)!="undefined")?_29a.fillOpacity:1;
_299.fill();
}
if(typeof (_29a.strokeColor)!="undefined"){
CanvasCanvas.createPolyPath(_297,_298,_299,_29b);
_299.strokeStyle=_29a.strokeColor;
_299.globalAlpha=(typeof (_29a.strokeOpacity)!="undefined")?_29a.strokeOpacity:1;
_299.lineWidth=(typeof (_29a.strokeWidth)!="undefined")?_29a.strokeWidth:1;
_299.stroke();
}
};
CanvasCanvas.prototype.getElement=function(){
return this._element;
};
CanvasCanvas.prototype.setStyle=function(_29c){
this._style=_29c;
};
CanvasCanvas.prototype.drawCircle=function(cx,cy,_29f,_2a0){
_2a0=_2a0||this._style;
var _2a1=this._canvas;
_2a1.beginPath();
_2a1.arc(cx,cy,_29f,0,2*Math.PI,true);
if(typeof (_2a0.fillColor)!="undefined"){
_2a1.beginPath();
_2a1.arc(cx,cy,_29f,0,2*Math.PI,true);
_2a1.fillStyle=_2a0.fillColor;
_2a1.globalAlpha=(typeof (_2a0.fillOpacity)!="undefined")?_2a0.fillOpacity:1;
_2a1.fill();
}
if(typeof (_2a0.strokeColor)!="undefined"){
_2a1.beginPath();
_2a1.arc(cx,cy,_29f,0,2*Math.PI,true);
_2a1.strokeStyle=_2a0.strokeColor;
_2a1.globalAlpha=(typeof (_2a0.strokeOpacity)!="undefined")?_2a0.strokeOpacity:1;
_2a1.lineWidth=(typeof (_2a0.strokeWidth)!="undefined")?_2a0.strokeWidth:1;
_2a1.stroke();
}
};
CanvasCanvas.prototype.drawOval=function(x,y,_2a4,_2a5,_2a6){
var _2a7=this._canvas;
if(_2a4<0.01||_2a5<0.01){
return;
}
var cx=x+_2a4/2;
var cy=(y+_2a5/2)*_2a4/_2a5;
_2a7.save();
_2a7.scale(1,_2a5/_2a4);
this.drawCircle(cx,cy,_2a4/2,_2a6);
_2a7.restore();
};
CanvasCanvas.prototype.drawPolyline=function(_2aa,_2ab,_2ac){
_2ac=_2ac||this._style;
var _2ad=this._canvas;
CanvasCanvas.drawPoly(_2aa,_2ab,_2ad,_2ac,false);
};
CanvasCanvas.prototype.drawPolygon=function(_2ae,_2af,_2b0){
_2b0=_2b0||this._style;
var _2b1=this._canvas;
CanvasCanvas.drawPoly(_2ae,_2af,_2b1,_2b0,true);
};
CanvasCanvas.prototype.drawRect=function(x,y,_2b4,_2b5,_2b6){
_2b6=_2b6||this._style;
var _2b7=this._canvas;
if(typeof (_2b6.fillColor)!="undefined"){
_2b7.fillStyle=_2b6.fillColor;
_2b7.globalAlpha=(typeof (_2b6.fillOpacity)!="undefined")?_2b6.fillOpacity:1;
_2b7.fillRect(x,y,_2b4,_2b5);
}
if(typeof (_2b6.strokeColor)!="undefined"){
_2b7.strokeStyle=_2b6.strokeColor;
_2b7.globalAlpha=(typeof (_2b6.strokeOpacity)!="undefined")?_2b6.strokeOpacity:1;
_2b7.lineWidth=(typeof (_2b6.strokeWidth)!="undefined")?_2b6.strokeWidth:1;
_2b7.strokeRect(x,y,_2b4,_2b5);
}
};
function createCanvas(_2b8,_2b9,_2ba){
if(_2ba){
var _2bb=_2ba.toLowerCase();
if(_2bb=="svg"){
return new SVGCanvas(_2b8,_2b9);
}else{
if(_2bb=="vml"){
return new VMLCanvas(_2b8,_2b9);
}else{
if(_2bb=="canvas"){
return new CanvasCanvas(_2b8,_2b9);
}
}
}
throw new Error("No such implementation.");
}else{
if(_240){
return new SVGCanvas(_2b8,_2b9);
}else{
if(_265){
return new VMLCanvas(_2b8,_2b9);
}
}
return new CanvasCanvas(_2b8,_2b9);
}
}
return {create:createCanvas};
})();
ravegeo.internal.MapAnimator=(function(){
var _2bc=25;
var _2bd=2000;
var _2be=function(map){
this._map=map;
};
_2be.prototype._animateTo=function(_2c0,_2c1){
var pfc=this._map._getPixelsFromCenter(_2c0-this._map._geoX,_2c1-this._map._geoY);
var _2c3=Math.sqrt(pfc.x*pfc.x+pfc.y*pfc.y)*1.25;
if(this._lastTimeout){
clearTimeout(this._lastTimeout);
}
if(_2c3<_2bd&&_2c3>_2bc){
if(!this._myAnimatorFunc){
var self=this;
this._myAnimatorFunc=function(){
self._doAnimate();
};
}
this._animDestX=-pfc.x;
this._animDestY=pfc.y;
this._animDoneX=0;
this._animDoneY=0;
this._animTime=_2c3;
this._animStart=new Date().getTime();
this._myAnimatorFunc();
}else{
this._map._setGeoCenter(_2c0,_2c1);
}
};
_2be.prototype._stop=function(){
if(this._lastTimeout){
clearTimeout(this._lastTimeout);
this._lastTimeout=null;
}
};
_2be.prototype._doAnimate=function(){
var _2c5=(new Date().getTime()-this._animStart)/this._animTime;
if(_2c5>1){
this._map._interactionEnded();
delete this._lastTimeout;
}else{
var doX=Math.round(this._animDestX*_2c5-this._animDoneX);
var doY=Math.round(this._animDestY*_2c5-this._animDoneY);
this._animDoneX+=doX;
this._animDoneY+=doY;
this._map._pixMove(doX,doY);
this._lastTimeout=setTimeout(this._myAnimatorFunc,10);
}
};
return _2be;
})();
ravegeo.TiledMap=(function(){
var _2c8=ravegeo.internal.Utilities;
var _2c9=250;
var _2ca=null;
var _2cb=0;
var _2cc=0;
var _2cd=0;
var _2ce=0;
var _2cf=0;
var _2d0=false;
var _2d1=function(_2d2){
if(ravegeo._projector){
delete ravegeo._projector;
}
if(_2d2._tiledProjector){
ravegeo._projector=_2d2._tiledProjector;
}
this._url=_2d2.url;
this._name=_2d2.name;
this._key=_2d2.key;
this._tileCacherUrl=_2d2._tileServiceUrl+"GetTile?name="+_2d2._tileServiceName;
this._callback=_2d2.callback;
this._mapContainer=_2d2.mapContainer;
this._expireDate=_2d2._expireDate;
this._loadingImageUrl=this._url+"GetLoadingImage?name="+this._name;
if(typeof _2d2.interactionDelay!="undefined"){
this._interactionDelay=_2d2.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 _2d3=_2d2.tilesConfiguration;
this._originX=_2d3.originX;
this._originY=_2d3.originY;
this._nominalToMeter=_2d3.nominalToMeter;
this._tileWidthPix=_2d3.tileWidthPix;
this._tileHeightPix=_2d3.tileHeightPix;
this._zoomStepExtents=_2d3.zoomStepExtents;
var geoX=this._originX;
var geoY=this._originY;
this._zoomStep=0;
if(_2d2.initialViewArea){
var iva=_2d2.initialViewArea;
geoX=iva.x;
geoY=iva.y;
if(ravegeo._projector){
var p=ravegeo._projector.forward(iva.x,iva.y);
geoX=p[0];
geoY=p[1];
}
this._zoomStep=this._scale2ClosestZoomStep(iva.scale);
}
this._layers={};
this._nextLayerId=0;
_2c8.removeChildren(this._mapContainer);
this._outerDiv=document.createElement("div");
var _2d8=this._outerDiv;
_2c8.setStyle(_2d8,"position:absolute;top:0px;left:0px;overflow:hidden;cursor:move;");
this._tileLayer=new ravegeo.internal.TileLayer(this);
var _2d9=document.createElement("div");
_2c8.setStyle(_2d9,"width:100%;height:100%;position:relative;overflow:hidden;");
_2d9.appendChild(_2d8);
if(_2d3.copyright){
var _2da=document.createElement("div");
_2da.innerHTML=_2d3.copyright;
_2c8.setStyle(_2da,"color:black;position:absolute;left:4px;bottom:4px;z-index:1000;cursor:text;");
_2d8.appendChild(_2da);
}
this._layout(geoX,geoY);
this._mapContainer.appendChild(_2d9);
this._animator=new ravegeo.internal.MapAnimator(this);
this._toolEventsDispatcher=new ravegeo.internal.ToolEventsDispatcher(this);
this._panningEnabled=true;
this.addTool(ravegeo.tools.internal.DeprecatedCallbacksTool);
this.addTool(ravegeo.tools.internal.SymbolHoverTool);
_2d2.callback.mapLoaded(this);
};
_2d1.initiateCreation=function(_2db){
ravegeo.internal.MapCommons._fixParams(_2db);
var url=_2db.url+"GetHandle?name="+_2db.name;
if(_2db.key){
url+="&key="+_2db.key;
}
url+="&referer="+encodeURIComponent(window.location);
ravegeo.io.Ajax.asyncJsonRequest(url,function(_2dd){
initiateCreationStep2(_2db,_2dd);
},ravegeo.internal.MapCommons.getHandleTimeout);
};
function initiateCreationStep2(_2de,_2df){
if(_2df.error){
errorOccurredDuringInit(_2df.error,_2de);
return;
}
if(_2df.tileServiceUrl){
_2de._tileServiceUrl=_2df.tileServiceUrl;
}else{
_2de._tileServiceUrl=_2de.url;
}
if(_2df.tileServiceName){
_2de._tileServiceName=_2df.tileServiceName;
}else{
_2de._tileServiceName=_2de.name;
}
_2de._expireDate=new Date();
_2de._expireDate.setTime(_2de._expireDate.getTime()+_2df.timeout);
ravegeo.io.Ajax.asyncJsonRequest(_2de._tileServiceUrl+"GetTilesInfo?name="+_2de._tileServiceName,function(_2e0){
initiateCreationStep3(_2de,_2e0);
},ravegeo.internal.MapCommons.getTilesInfoTimeout);
}
function initiateCreationStep3(_2e1,_2e2){
if(_2e2.error){
errorOccurredDuringInit(_2e2.error,_2e1);
return;
}
_2e1.tilesConfiguration=_2e2;
var temp=new _2d1(_2e1);
}
function errorOccurredDuringInit(_2e4,_2e5){
errorOccurred(_2e4.code,_2e4.message,_2e5.mapContainer,_2e5.callback);
}
function errorOccurred(code,_2e7,_2e8,_2e9){
if(_2e8){
_2e8.innerHTML="Fatal error: "+code+"<br>"+_2e7;
}
if(_2e9&&_2e9.errorOccurred){
_2e9.errorOccurred(code,_2e7);
}
}
_2d1.prototype._layout=function(_2ea,_2eb){
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=_2ea;
this._geoY=_2eb;
this._tileLayer._layout(_2ea,_2eb,this._mapWidth,this._mapHeight);
for(var _2ec in this._layers){
var _2ed=this._layers[_2ec];
_2ed._layout(_2ea,_2eb,this._mapWidth,this._mapHeight);
}
};
_2d1.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(_2f0){
if(_2f0.error){
errorOccurred(_2f0.error.code,_2f0.error.message,self._mapContainer,self._callback);
return;
}
var _2f1=_2f0.timeout;
self._expireDate=new Date();
self._expireDate.setTime(self._expireDate.getTime()+_2f1);
},ravegeo.internal.MapCommons.getHandleTimeout);
}
};
_2d1.prototype._getPixelsFromCenter=function(geoX,geoY){
var _2f4=this._tileWidthPix/this._zoomStepExtents[this._zoomStep][0];
var _2f5=this._tileHeightPix/this._zoomStepExtents[this._zoomStep][1];
return {x:Math.round(geoX*_2f4),y:Math.round(geoY*_2f5)};
};
_2d1.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);
};
_2d1.prototype._setGeoCenter=function(_2f7,_2f8,_2f9){
var _2fa=false;
if(typeof (_2f9)!="undefined"){
_2fa=this._changeZoomStep(_2f9);
}
if(this._geoX!=_2f7||this._geoY!=_2f8||_2fa){
this._geoX=_2f7;
this._geoY=_2f8;
this._tileLayer._setGeoCenter(_2f7,_2f8);
for(var _2fb in this._layers){
this._layers[_2fb]._setGeoCenter(_2f7,_2f8);
}
}
};
_2d1.prototype._changeZoomStep=function(zs){
if(zs>=0&&zs<this._zoomStepExtents.length&&zs!=this._zoomStep){
this._zoomStep=zs;
return true;
}
return false;
};
_2d1.prototype._pixMove=function(x,y){
this._geoX-=x*(this._zoomStepExtents[this._zoomStep][0]/this._tileWidthPix);
this._geoY+=y*(this._zoomStepExtents[this._zoomStep][1]/this._tileHeightPix);
this._tileLayer._pixMove(x,y);
for(var _2ff in this._layers){
var _300=this._layers[_2ff];
_300._pixMove(x,y);
}
};
_2d1.prototype._zoomStep2Scale=function(zs){
return Math.round(this._zoomStepExtents[zs][1]*this._nominalToMeter/(this._tileHeightPix*0.0003));
};
_2d1.prototype._scale2ClosestZoomStep=function(_302){
var _303=this._zoomStep2Scale(0);
var _304=0;
for(var i=1;i<this._zoomStepExtents.length;++i){
var _306=this._zoomStep2Scale(i);
if(Math.abs(_306-_302)<Math.abs(_303-_302)){
_303=_306;
_304=i;
}else{
break;
}
}
return _304;
};
_2d1.prototype._getGeoWidth=function(_307){
return this._zoomStepExtents[_307][0]/this._tileWidthPix*this._mapWidth;
};
_2d1.prototype._getGeoHeight=function(_308){
return this._zoomStepExtents[_308][1]/this._tileHeightPix*this._mapHeight;
};
_2d1.prototype.getCenterX=function(){
if(ravegeo._projector){
var p=ravegeo._projector.reverse(this._geoX,this._geoY);
return p[0];
}
return this._geoX;
};
_2d1.prototype.getCenterY=function(){
if(ravegeo._projector){
var p=ravegeo._projector.reverse(this._geoX,this._geoY);
return p[1];
}
return this._geoY;
};
_2d1.prototype.getScale=function(){
return this._zoomStep2Scale(this._zoomStep);
};
_2d1.prototype.getGeoBounds=function(){
var rect=this._getGeoBounds(this._zoomStep);
if(ravegeo._projector){
var pmin=ravegeo._projector.reverse(rect.xMin,rect.yMin);
var pmax=ravegeo._projector.reverse(rect.xMax,rect.yMax);
rect.xMin=pmin[0];
rect.yMin=pmin[1];
rect.xMax=pmax[0];
rect.yMax=pmax[1];
}
return rect;
};
_2d1.prototype._getGeoBounds=function(_30e){
var _30f=this._getGeoWidth(_30e);
var _310=this._getGeoHeight(_30e);
return {xMin:this._geoX-_30f/2,yMin:this._geoY-_310/2,xMax:this._geoX+_30f/2,yMax:this._geoY+_310/2};
};
_2d1.prototype.setGeoBounds=function(_311){
if(ravegeo._projector){
var minp=ravegeo._projector.forward(_311.xMin,_311.yMin);
var maxp=ravegeo._projector.forward(_311.xMax,_311.yMax);
_311={xMin:minp[0],yMin:minp[1],xMax:maxp[0],yMax:maxp[1]};
}
var cx=(_311.xMax+_311.xMin)/2;
var cy=(_311.yMax+_311.yMin)/2;
var _316=this._getFittingZoomStep(Math.abs(_311.xMax-_311.xMin),Math.abs(_311.yMax-_311.yMin));
this._setGeoCenter(cx,cy,_316);
};
_2d1.prototype._getFittingZoomStep=function(_317,_318){
for(var i=0;i<this._zoomStepExtents.length;++i){
var _31a=this._getGeoWidth(i);
var _31b=this._getGeoHeight(i);
if(_317<=_31a&&_318<=_31b){
return i;
}
}
return this._zoomStepExtents.length-1;
};
_2d1.prototype.getRecommendedScales=function(){
var ret=[];
for(var zs in this._zoomStepExtents){
ret[zs]=this._zoomStep2Scale(zs);
}
return ret;
};
_2d1.prototype.setViewArea=function(x,y,_320){
x=parseFloat(x);
y=parseFloat(y);
if(ravegeo._projector){
var p=ravegeo._projector.forward(x,y);
x=p[0];
y=p[1];
}
var _322=this._scale2ClosestZoomStep(_320);
this._setGeoCenter(x,y,_322);
};
_2d1.prototype.zoom=function(_323){
if(_323<1){
this._setGeoCenter(this._geoX,this._geoY,this._zoomStep-1);
}else{
if(_323>1){
this._setGeoCenter(this._geoX,this._geoY,this._zoomStep+1);
}
}
};
_2d1.prototype.zoomTo=function(_324){
var _325=this._scale2ClosestZoomStep(_324);
this._setGeoCenter(this._geoX,this._geoY,_325);
};
_2d1.prototype.pan=function(dx,dy){
var _328=this._zoomStepExtents[this._zoomStep][0]/this._tileWidthPix;
var _329=this._zoomStepExtents[this._zoomStep][1]/this._tileHeightPix;
this._animator._animateTo(this._geoX+_328*this._mapWidth*dx,this._geoY+_328*this._mapHeight*dy);
};
_2d1.prototype._showBounds=function(_32a,_32b,_32c){
var _32d=this._scale2ClosestZoomStep(_32c);
if(_32a.x!=Number.POSITIVE_INFINITY){
var _32e=(_32b.x-_32a.x)*1.15;
var _32f=(_32b.y-_32a.y)*1.15;
var i;
for(i=0;i<this._zoomStepExtents.length;++i){
var _331=this._zoomStepExtents[i][0]/this._tileWidthPix*this._mapWidth;
var _332=this._zoomStepExtents[i][1]/this._tileHeightPix*this._mapHeight;
if(_331>_32e&&_332>_32f){
break;
}
}
var _333=_32a.x+(_32b.x-_32a.x)/2;
var _334=_32a.y+(_32b.y-_32a.y)/2;
if(i>_32d){
_32d=i;
}
if(_32d!=this._zoomStep){
this._setGeoCenter(_333,_334,_32d);
}else{
this._animator._animateTo(_333,_334);
}
}else{
if(_32d>this._zoomStep){
this._setGeoCenter(this._geoX,this._geoY,_32d);
}
}
};
_2d1.prototype.moveTo=function(x,y,_337){
if(this.getScale()==_337){
if(ravegeo._projector){
var p=ravegeo._projector.forward(x,y);
x=p[0];
y=p[1];
}
this._animator._animateTo(x,y);
}else{
this.setViewArea(x,y,_337);
}
};
_2d1.prototype.getUpDirection=function(){
return 0;
};
_2d1.prototype.setUpDirection=function(_339){
};
_2d1.prototype.getPitch=function(){
return 90;
};
_2d1.prototype.setPitch=function(_33a){
};
_2d1.prototype.resize=function(_33b,_33c){
this._mapContainer.style.width=_33b+"px";
this._mapContainer.style.height=_33c+"px";
this._layout(this._geoX,this._geoY);
};
_2d1.prototype.newLayer=function(opts){
var _33e=this._nextLayerId++;
var _33f=new ravegeo.internal.GeoObjectLayer(_33e,this,opts);
_33f._layout(this._geoX,this._geoY,this._mapWidth,this._mapHeight);
this._layers[_33e]=_33f;
return _33f;
};
_2d1.prototype.removeLayer=function(_340){
var _341=_340._id;
_340._destroy();
delete this._layers[_341];
};
_2d1.prototype.addTool=function(tool){
this._toolEventsDispatcher.addTool(tool);
};
_2d1.prototype.removeTool=function(tool){
this._toolEventsDispatcher.removeTool(tool);
};
_2d1.prototype.setPanningEnabled=function(_344){
this._panningEnabled=_344;
if(!_344){
endMapInteraction();
}
};
_2d1.prototype._getGeoPointFromEvent=function(e){
var dx=_2c8.mouseX(e)-_2c8.topLeftX(this._outerDiv)-this._mapWidth/2;
var dy=_2c8.mouseY(e)-_2c8.topLeftY(this._outerDiv)-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);
var _34a;
if(ravegeo._projector){
_34a=ravegeo._projector.reverse(x,y);
}else{
_34a=Array();
_34a[0]=x;
_34a[1]=y;
}
return _34a;
};
_2d1.prototype._getPixelsFromEvent=function(e){
var x=_2c8.mouseX(e)-_2c8.topLeftX(this._outerDiv);
var y=_2c8.mouseY(e)-_2c8.topLeftY(this._outerDiv);
point=Array();
point[0]=x;
point[1]=y;
return point;
};
_2d1._mouseDown=function(e){
if(_2c8.leftButton(e)){
var map=getTargetMap(e);
map._toolEventsDispatcher.mouseDown(e);
if(map._panningEnabled){
_2ca=map;
_2ca._animator._stop();
}
_2cd=_2cb=e.clientX;
_2ce=_2cc=e.clientY;
_2c8.stopEvent(e);
}
};
_2d1._mouseMoved=function(e){
var map=getTargetMap(e);
map._toolEventsDispatcher.mouseMoved(e);
var _352=_2ca;
if(_352){
var _353=e.clientX-_2cb;
var _354=e.clientY-_2cc;
if(_353>1||_353<-1||_354>1||_354<-1){
_2cb=e.clientX;
_2cc=e.clientY;
_352._pixMove(_353,_354);
}
}
};
_2d1._mouseUp=function(e){
if(!_2c8.leftButton(e)){
return;
}
var map=getTargetMap(e);
map._toolEventsDispatcher.mouseUp(e);
var _357=_2ca;
if(_357!==null){
var _358=e.clientX-_2cb;
var _359=e.clientY-_2cc;
if(_358!=0||_359!=0){
_357._pixMove(_358,_359);
}
endMapInteraction();
}
handleMouseClicks(map,e);
};
function endMapInteraction(){
var _35a=_2ca;
if(_35a&&(_2cb!=_2cd||_2cc!=_2ce)){
_35a._interactionEnded();
}
_2ca=null;
}
function handleMouseClicks(map,e){
if(_2cd==e.clientX&&_2ce==e.clientY){
_2cf++;
if(_2cf==1){
var _35d={};
for(var i in e){
_35d[i]=e[i];
}
setTimeout(function(){
mapClicked(map,_35d);
},_2c9);
}else{
mapDoubleClicked(map,e);
_2cf=0;
}
}
}
function mapClicked(map,e){
if(_2cf!=1){
return;
}
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);
_2cf=0;
}
function mapClickedCallback(_362,e){
var _364=_362._callback;
if(_364&&_364.mapClicked){
var _365=_362._getGeoPointFromEvent(e);
var x=_365[0];
var y=_365[1];
_364.mapClicked(_362,x,y);
}
}
function mapDoubleClicked(_368,e){
var map=getTargetMap(e);
map._toolEventsDispatcher.mouseDoubleClicked(e);
var _36b=map._getGeoPointFromEvent(e);
map._setGeoCenter(_36b[0],_36b[1],map._zoomStep-1);
}
_2d1._mouseWheel=function(e){
var _36d=getTargetMap(e);
var _36e=e.detail?e.detail:e.wheelDelta/-40;
var _36f=getNewZoomStep(_36d,_36e);
var _370=_36d._getGeoPointFromEvent(e);
var x=_370[0];
var y=_370[1];
var _373=_36d._zoomStepExtents[_36d._zoomStep][0]/_36d._zoomStepExtents[_36f][0];
var _374=_36d._zoomStepExtents[_36d._zoomStep][1]/_36d._zoomStepExtents[_36f][1];
var _375=(_36d._geoX-x)/_373+x;
var _376=(_36d._geoY-y)/_374+y;
_36d._setGeoCenter(_375,_376,_36f);
_2c8.stopEvent(e);
};
function getNewZoomStep(_377,_378){
if(_378<1){
return _377._zoomStep-1;
}else{
if(_378>1){
return _377._zoomStep+1;
}
}
return _377._zoomStep;
}
function getTargetMap(e){
var _37a=_2c8.getTarget(e);
return _37a._tile.owner._map;
}
_2d1._addMapEvents=function(_37b){
_2c8.addEvent(_37b,"mousedown",ravegeo.TiledMap._mouseDown,false);
_2c8.addEvent(_37b,"dragstart",ravegeo.internal.Utilities.stopEvent,false);
_2c8.addEvent(_37b,"mousemove",ravegeo.TiledMap._mouseMoved,false);
_2c8.addEvent(_37b,"mouseup",ravegeo.TiledMap._mouseUp,false);
_2d1._addMapZoomEvents(_37b);
};
_2d1._addMapZoomEvents=function(_37c){
_2c8.addEvent(_37c,"mousewheel",ravegeo.TiledMap._mouseWheel,false);
};
return _2d1;
})();
ravegeo.internal.Tile=(function(){
var Tile=function(_37e,dtx,dty){
this.owner=_37e;
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=_37e._tileWidthPix+"px";
img.style.height=_37e._tileHeightPix+"px";
img.style.left=((_37e._numberOfTiles.x/2*_37e._tileWidthPix)+this._dtx*_37e._tileWidthPix)+"px";
img.style.top=((_37e._numberOfTiles.y/2*_37e._tileHeightPix)-(this._dty+1)*_37e._tileHeightPix)+"px";
img.oncontextmenu=function(e){
return false;
};
img._tile=this;
ravegeo.TiledMap._addMapEvents(img);
};
function onImageLoad(){
var _383=this._tile;
this._tile=null;
_383.img.src=_383.newImage.src;
_383.img.onload=null;
}
Tile.prototype._updateImage=function(){
var _384=this.owner._map._tileCacherUrl;
_384+="&tx="+(this._dtx+this.owner._ctx);
_384+="&ty="+(-this._dty+this.owner._cty);
_384+="&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=_384;
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=_384;
}else{
this.img.src=_384;
}
};
Tile.prototype._position=function(){
this.img.style.left=(this._dtx*this.owner._tileWidthPix)+"px";
this.img.style.top=(this._dty*this.owner._tileHeightPix)+"px";
};
Tile.prototype._wrap=function(dtx,dty){
this._dtx+=dtx;
this._dty+=dty;
var _387=false;
var _388=this.owner._allowedTilePositions;
if(this._dtx<_388.min.x){
this._dtx+=this.owner._numberOfTiles.x;
_387=true;
}else{
if(this._dtx>_388.max.x){
this._dtx-=this.owner._numberOfTiles.x;
_387=true;
}
}
if(this._dty<_388.min.y){
this._dty+=this.owner._numberOfTiles.y;
_387=true;
}else{
if(this._dty>_388.max.y){
this._dty-=this.owner._numberOfTiles.y;
_387=true;
}
}
if(_387){
this._updateImage();
}
this._position();
};
return Tile;
})();
ravegeo.internal.TileLayer=(function(){
var _389=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);
};
_389.prototype._layout=function(_38b,_38c,_38d,_38e){
this._numberOfTiles={x:Math.ceil(_38d/this._tileWidthPix)+1,y:Math.ceil(_38e/this._tileHeightPix)+1};
var _38f=_38d/2;
var _390=_38e/2;
this._wrapLimit={min:{},max:{}};
if(this._numberOfTiles.x%2==0){
this._wrapLimit.max.x=(this._tileWidthPix*this._numberOfTiles.x)/2-_38f;
this._wrapLimit.min.x=-this._wrapLimit.max.x;
}else{
this._wrapLimit.max.x=(this._tileWidthPix*(this._numberOfTiles.x-1))/2-_38f;
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-_390;
this._wrapLimit.min.y=-this._wrapLimit.max.y;
}else{
this._wrapLimit.max.y=(this._tileHeightPix*(this._numberOfTiles.y-1))/2-_390;
this._wrapLimit.min.y=-this._wrapLimit.max.y-this._tileHeightPix;
}
this._originalLeft=Math.floor(_38d/2);
this._originalTop=Math.floor(_38e/2);
this._tiles=[];
ravegeo.internal.Utilities.removeChildren(this._myDiv);
var _391=-Math.floor(this._numberOfTiles.x/2);
var _392=-Math.floor(this._numberOfTiles.y/2);
this._allowedTilePositions={min:{x:_391,y:_392},max:{x:_391+this._numberOfTiles.x-1,y:_392+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(_38b,_38c);
};
_389.prototype._setGeoCenter=function(_396,_397){
this._positionAllTiles(_396,_397);
};
_389.prototype._positionAllTiles=function(_398,_399){
var pfc=this._map._getPixelsFromCenter(this._map._originX-_398,this._map._originY-_399);
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();
};
_389.prototype._positionDiv=function(){
this._myDiv.style.left=(this._originalLeft+this._dx)+"px";
this._myDiv.style.top=(this._originalTop+this._dy)+"px";
};
_389.prototype._pixMove=function(x,y){
this._dx+=x;
this._dy+=y;
this._wrapIfNecessary();
this._positionDiv();
};
_389.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);
}
};
_389.prototype._shouldWrap=function(){
var _3a0=this._dx>this._wrapLimit.max.x||this._dx<this._wrapLimit.min.x;
var _3a1=this._dy>this._wrapLimit.max.y||this._dy<this._wrapLimit.min.y;
return _3a0||_3a1;
};
_389.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 _389;
})();
ravegeo.internal.GeoObjectLayer=(function(){
var _3a5={borderColor:"#000000",backgroundColor:"#7f7f7f",textColor:"#ffffff"};
var _3a6={borderColor:"#7f7f7f",backgroundColor:"#ffffff",textColor:"#000000"};
var _3a7=function(id,map,opts){
this._id=id;
this._map=map;
if(typeof (opts)=="undefined"){
opts={};
}
this._textStyle=fixStyle(opts.textStyle,_3a5);
this._labelStyle=fixStyle(opts.labelStyle,_3a6);
this._labelsAboveSymbols=opts.labelsAboveSymbols;
this._highlightColor=opts.highlightColor;
if(!this._highlightColor){
this._highlightColor="#ff0000";
}
this._dragMode=opts.dragMode;
if(!this._dragMode){
this._dragMode="None";
}
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(_3ab,_3ac){
if(!_3ab){
_3ab={};
}
if(!_3ab.borderColor){
_3ab.borderColor=_3ac.borderColor;
}
if(!_3ab.backgroundColor){
_3ab.backgroundColor=_3ac.backgroundColor;
}
if(!_3ab.textColor){
_3ab.textColor=_3ac.textColor;
}
return _3ab;
}
_3a7.prototype._layout=function(_3ad,_3ae,_3af,_3b0){
this._pixMapCenter={left:Math.round(_3af/2),top:Math.round(_3b0/2)};
this._setGeoCenter(_3ad,_3ae);
};
_3a7.prototype._setGeoCenter=function(_3b1,_3b2){
this._geoCenter={x:_3b1,y:_3b2};
this._layerPixPosition={left:this._pixMapCenter.left,top:this._pixMapCenter.top};
this._positionLayerDiv();
this._positionGeoObjects();
};
_3a7.prototype._positionLayerDiv=function(){
this._layerDiv.style.left=this._layerPixPosition.left+"px";
this._layerDiv.style.top=this._layerPixPosition.top+"px";
};
_3a7.prototype._positionGeoObjects=function(){
for(var _3b3 in this._geoObjects){
var _3b4=this._geoObjects[_3b3];
_3b4._position(this._geoCenter,this._getGeoToPixels());
}
};
_3a7.prototype._positionGeoObject=function(_3b5){
_3b5._position(this._geoCenter,this._getGeoToPixels());
};
_3a7.prototype._repositionGeoObject=function(_3b6){
_3b6._reposition(this._geoCenter,this._getGeoToPixels());
};
_3a7.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]};
};
_3a7.prototype._pixMove=function(dx,dy){
this._layerPixPosition.left+=dx;
this._layerPixPosition.top+=dy;
this._positionLayerDiv();
};
_3a7.prototype._destroy=function(){
this.clear();
this._map._outerDiv.removeChild(this._layerDiv);
delete this._layerDiv;
};
_3a7.prototype.clear=function(){
for(var id in this._geoObjects){
this._geoObjects[id]._destroy();
}
this._geoObjects={};
};
_3a7.prototype.addGeoObjects=function(objs){
for(var idx in objs){
var obj=objs[idx];
obj._project();
var _3bd=this._geoObjects[obj.id];
obj._tiledMapInit(this,_3bd);
if(_3bd){
_3bd._destroy();
}
this._geoObjects[obj.id]=obj;
}
};
_3a7.prototype.getGeoObjectIds=function(_3be){
var ret=[];
var id;
if(_3be){
var _3c1=this._map.getGeoBounds();
for(id in this._geoObjects){
var _3c2=this._geoObjects[id];
if(_3c2._isInside(_3c1.xMin,_3c1.yMin,_3c1.xMax,_3c1.yMax)){
ret[ret.length]=id;
}
}
}else{
for(id in this._geoObjects){
ret[ret.length]=id;
}
}
return ret;
};
_3a7.prototype.getGeoObject=function(id){
var ret=this._geoObjects[id];
if(typeof (ret)=="undefined"){
return null;
}
return ret;
};
_3a7.prototype.removeGeoObjects=function(ids){
for(var idx in ids){
var id=ids[idx];
this._geoObjects[id]._destroy();
delete this._geoObjects[id];
}
};
_3a7.prototype.setVisible=function(_3c8){
if(typeof (_3c8)=="undefined"||_3c8){
this._layerDiv.style.visibility="visible";
}else{
this._layerDiv.style.visibility="hidden";
}
};
_3a7.prototype.showGeoObjects=function(_3c9){
var _3ca={x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY};
var _3cb={x:Number.NEGATIVE_INFINITY,y:Number.NEGATIVE_INFINITY};
for(var id in this._geoObjects){
var obj=this._geoObjects[id];
obj._expandBounds(_3ca,_3cb);
}
this._map._showBounds(_3ca,_3cb,_3c9);
};
_3a7.prototype.highlightGeoObject=function(id,_3cf){
var _3d0=this._geoObjects[id];
if(!_3cf){
_3cf={};
}
var map=this._map;
if(map._highlightedGeoObject){
map._highlightedGeoObject._removeHighlight();
delete map._highlightedGeoObject;
}
if(_3d0){
if(_3d0._notYetLoaded){
_3d0._doHighlight=_3cf;
}
if(typeof (_3cf.center)!="string"){
_3cf.center="";
}
if(!_3cf.showText){
_3cf.showText=false;
}
if(!_3cf.showHighlight){
_3cf.showHighlight=false;
}
_3d0._setHighlight(_3cf.showText,_3cf.showHighlight);
map._highlightedGeoObject=_3d0;
var _3d2=_3cf.center.toLowerCase();
var _3d3;
if(_3d2=="whennotshowing"){
var _3d4=(map._mapWidth*0.43)*(map._zoomStepExtents[map._zoomStep][0]/map._tileWidthPix);
var _3d5=(map._mapHeight*0.43)*(map._zoomStepExtents[map._zoomStep][1]/map._tileHeightPix);
var minx=map._geoX-_3d4;
var miny=map._geoY-_3d5;
var maxx=map._geoX+_3d4;
var maxy=map._geoY+_3d5;
_3d3=_3d0._getCenter();
if(_3d3.x<minx||_3d3.x>maxx||_3d3.y<miny||_3d3.y>maxy){
map._animator._animateTo(_3d3.x,_3d3.y);
}
}else{
if(_3d2!="never"){
_3d3=_3d0._getCenter();
map._animator._animateTo(_3d3.x,_3d3.y);
}
}
}
};
_3a7.prototype.moveGeoObject=function(id,_3db,_3dc){
var _3dd=this._geoObjects[id];
_3dd.move(_3db,_3dc);
};
_3a7.prototype._pickObject=function(_3de){
for(var _3df in this._geoObjects){
var _3e0=this._geoObjects[_3df];
if(_3e0._pick(_3de)){
return _3e0;
}
}
};
_3a7.prototype._geoToPixelPointsX=function(_3e1){
var _3e2=this._getGeoToPixels().x;
var _3e3=this._map.getGeoBounds();
var ret=[];
for(var i=0;i<_3e1.length;i++){
ret[i]=(_3e1[i]-_3e3.xMin)*_3e2;
}
return ret;
};
_3a7.prototype._geoToPixelPointsY=function(_3e6){
var _3e7=this._getGeoToPixels().y;
var _3e8=this._map.getGeoBounds();
var ret=[];
for(var i=0;i<_3e6.length;i++){
ret[i]=(_3e8.yMax-_3e6[i])*_3e7;
}
return ret;
};
return _3a7;
})();
ravegeo.tools.MoveObjectTool=(function(){
var _3eb={};
var _3ec=0;
var _3ed=0;
_3eb.objectMouseDown=function(map,_3ef,_3f0,x,y){
_3ec=x;
_3ed=y;
map.setPanningEnabled(false);
};
_3eb.objectDragged=function(map,_3f4,_3f5,x,y){
var _3f8=x-_3ec;
var _3f9=y-_3ed;
if(_3f8!=0||_3f9!=0){
_3ec=x;
_3ed=y;
_3f4.moveGeoObject(_3f5,_3f8,_3f9);
}
};
_3eb.objectDragEnd=function(map,_3fb,_3fc,x,y){
map.setPanningEnabled(true);
};
_3eb.objectMouseUp=function(map,_400,_401,x,y){
map.setPanningEnabled(true);
};
_3eb.deactivate=function(map){
map.setPanningEnabled(true);
};
return _3eb;
})();
ravegeo.tools.internal.SymbolHoverTool=(function(){
var _405={};
var _406=ravegeo.internal.Utilities;
var _407;
var _408;
_405.objectMouseMove=function(map,_40a,_40b,x,y){
var _40e=_40a.getGeoObject(_40b);
if(_40e==_407||_408){
return;
}else{
if(_407){
diselectCurrent();
}
}
if(_40e.symbol){
_40e._img.style.border="1px solid gray";
if(!_40e._alwaysBalloon&&!_406.stringIsEmpty(_40e.text)){
_40e._balloon=_40e._createBallon(_40e._layer._textStyle);
_40e._layer._layerDiv.appendChild(_40e._balloon);
}
_407=_40e;
}
};
_405.objectDragStart=function(map,_410,_411,x,y){
diselectCurrent();
_408=_407;
};
_405.objectDragEnd=function(map,_415,_416,x,y){
_408=null;
};
_405.mapMouseMove=function(map,x,y){
if(_407==null){
return;
}
diselectCurrent();
_407=null;
};
function diselectCurrent(){
if(_407._balloon){
_407._layer._layerDiv.removeChild(_407._balloon);
}
_407._balloon=null;
_407._img.style.border="0px none";
}
return _405;
})();
ravegeo.tools.internal.DeprecatedCallbacksTool=(function(){
var _41c={};
_41c.objectClicked=function(map,_41e,_41f,x,y){
var _422=_41e.getGeoObject(_41f);
if(_422.symbol){
var _423=map._callback;
if(_423&&_423.symbolClicked){
_423.symbolClicked(map,_41e,_41f);
}
}
};
_41c.mapClicked=function(map,x,y){
var _427=map._callback;
if(_427&&_427.mapClicked){
_427.mapClicked(map,x,y);
}
};
return _41c;
})();
ravegeo.WebMap=(function(){
var _428={};
_428.initiateCreation=function(_429){
if(ravegeo.AppletMap){
if(ravegeo.internal.Environment.isJavaWellSupported()){
_429._appletTimeoutCallback=function(){
ravegeo.TiledMap.initiateCreation(_429);
};
_429._maxAppletLoadTime=20000;
ravegeo.AppletMap.initiateCreation(_429);
}else{
ravegeo.TiledMap.initiateCreation(_429);
}
}else{
if(ravegeo.TiledMap){
ravegeo.TiledMap.initiateCreation(_429);
}else{
throw new Error("Can not show map.");
}
}
};
_428.version=ravegeo.internal.MapCommons.version;
return _428;
})();

var fixParams=function(_1){
_1.url="http://maps.labs.ericsson.net/ravegeo/webmap2/";
if(_1.callback){
_1._callback=_1.callback;
}
if(!_1.name){
_1.name="Default";
}
if(!_1.initialViewArea){
_1.initialViewArea={x:12.0203,y:57.73375,scale:25000000};
}
};
ericsson=ravegeo;
ericsson.WebMap._initiateCreation=ericsson.WebMap.initiateCreation;
ericsson.WebMap.initiateCreation=function(_2){
var _3=fixParams(_2);
this._initiateCreation(_2);
return _3;
};
ericsson.AppletMap._initiateCreation=ericsson.AppletMap.initiateCreation;
ericsson.AppletMap.initiateCreation=function(_4){
var _5=fixParams(_4);
this._initiateCreation(_4);
return _5;
};
ericsson.TiledMap._initiateCreation=ericsson.TiledMap.initiateCreation;
ericsson.TiledMap.initiateCreation=function(_6){
var _7=fixParams(_6);
this._initiateCreation(_6);
return _7;
};

