/*
* Copyright 2005- by IONIC Software S.A.,
* 18 Av Wallonie, 4460 Grace-Hollogne, Belgium.
* All rights reserved.
*
* This software is the confidential and proprietary information
* of IONIC Software S.A.("Confidential Information").
* You shall not disclose such Confidential Information and shall use
* it only in accordance with the terms of the license agreement
* you entered into with IONIC Software.
*
*
* IMPORTANT
*
* This file is internal to RedSpider Enterprise Tilapia toolkit. It is subject to
* changes and CANNOT BE DIRECTLY ACCESSED BY APPLICATIONS. Only
* the objects contained in the IONIC.api package may be used.
*/
/*
* Some IE-specific stuff. Especially for knowing what format to
* choose for images: GIF or PNG?
*/
var IE = false; /*@cc_on IE=true; @*/
var IE7 = false;
/*@cc_on
/*@if (@_jscript_version >= 5.7)
IE7=true;
@else @*/
/*@end
@*/
/*
* We will try and discover the pixel size (in meters) of the
* screen. That helps get a correct scale.
*/
var PixelSize = 0.00028;
// Add an onload handler
YAHOO.util.Event.on (
window,
"load",
function () {
var d = document.createElement ("div");
d.style.width = d.style.height = "1in";
d.style.backgroundColor = "#e0e0e0";
document.body.appendChild (d);
try {
var nfo = ElementPosition.get (d);
var dpi = nfo.width;
PixelSize = (1 / ((100 / 2.54) * dpi));
//
} catch (e) {
//
} finally {
document.body.removeChild (d);
}
});
/*
* Copyright 2005- by IONIC Software S.A.,
* 18 Av Wallonie, 4460 Grace-Hollogne, Belgium.
* All rights reserved.
*
* This software is the confidential and proprietary information
* of IONIC Software S.A.("Confidential Information").
* You shall not disclose such Confidential Information and shall use
* it only in accordance with the terms of the license agreement
* you entered into with IONIC Software.
*
*
* IMPORTANT
*
* This file is internal to RedSpider Enterprise Tilapia toolkit. It is subject to
* changes and CANNOT BE DIRECTLY ACCESSED BY APPLICATIONS. Only
* the objects contained in the IONIC.api package may be used.
*/
/**
* Name spaces definition file.
*/
/**
* This declares the 'root' name space of the whole Tilapia tookit, 'IONIC'.
* It provides a namespace creation helper method.
*/
if (typeof IONIC === "undefined") {
/**
* @class IONIC
* @static
*/
var IONIC = {};
/**
* Define 'namespaces' in the IONIC namespace
*
*
* Those namespaces can be composed; i.e., "util.misc". Is
* such cases, that will result in two namespaces being
* created
*
* - the "util" namespace in the "IONIC" parent
* - the "misc" namespace in the "util" parent
*
*
*/
IONIC.defns = function () {
var i, n, j, n2;
var curns, parts, curpart, node;
for (i = 0, n = arguments.length; i < n; i ++) {
curns = arguments [i];
parts = curns.split ('.');
node = IONIC;
for (j = 0, n2 = parts.length; j < n2; j ++) {
curpart = parts [j];
// Ignore an "IONIC" prefix
if (curpart === "IONIC") {
continue;
}
if (typeof (node [curpart]) === "undefined") {
node [curpart] = {};
}
node = node [curpart];
}
}
};
}
/****************************************************************************
* *
* ONLY the API contained in the IONIC.api package is user-accessible. The *
* other packages are internal to Tilapia. *
* *
****************************************************************************/
/*
* IONIC.api.maps: The 'map' object and other objects directly related to it
* (key maps, layers, map service discovery,...).
*/
IONIC.defns ("api.maps");
/*
* IONIC.api.maps.keymap: All that's needed in order to attach keymaps
* (i.e., child maps) to 'main' maps.
*/
IONIC.defns ("api.maps.keymap");
/*
* IONIC.api.ui: Objects related to the user interface: HTML-related helper,
* toolbars, layer list viewer,...
*/
IONIC.defns ("api.ui");
IONIC.defns ("api.ui.featuretableactions");
/*
* IONIC.api.ui.navigation: A navigation tool bar.
*/
IONIC.defns ("api.ui.navigation");
/*
* IONIC.api.geom: Geometry-related objects such as box, point, polygons,...
*/
IONIC.defns ("api.geom");
/*
* IONIC.api.features: Feature and feature editing related objects (feature
* definitions, feature edition panels,...).
*/
IONIC.defns ("api.feature");
/*
* IONIC.api.misc: Miscellaneous
*/
IONIC.defns ("api.misc");
/****************************************************************************
* *
* The following defines name spaces outside the IONIC.api package. It is *
* internal to Tilapia and should not be accessed directly by the user. *
* *
****************************************************************************/
/*
* Private packages hold the same kind of objects as their public counterparts.
*/
IONIC.defns ("misc");
IONIC.defns ("maps");
IONIC.defns ("ui");
IONIC.defns ("ui.security");
IONIC.defns ("geom");
IONIC.defns ("geom.edit");
IONIC.defns ("feature");
IONIC.defns ("feature.edit");
IONIC.defns ("portray");
IONIC.defns ("security");
/**
* Create a new XMLHttpRequest object.
*
* Inspired from
* here
*
* @return a new XMLHttpRequest object.
*/
IONIC.misc.createXMLHttpRequest = function () {
var xmlhttp;
/*@cc_on
@if (@_jscript_version >= 5)
try {
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
} catch (E) {
xmlhttp = false;
}
} @else
xmlhttp = false;
@end @*/
if (! xmlhttp && typeof XMLHttpRequest !== 'undefined') {
try {
xmlhttp = new XMLHttpRequest();
} catch (e) {
xmlhttp = false;
}
}
return xmlhttp;
};
IONIC.misc.isDigit=function(ch){if((ch>='0')&&(ch<='9')){return true;}else{return false;}};IONIC.misc.isAlpha=function(ch){if(((ch>='a')&&(ch<='z'))||((ch>='A')&&(ch<='Z'))){return true;}else{return false;}};IONIC.misc.isAlnum=function(ch){if(IONIC.misc.isAlpha(ch)||IONIC.misc.isDigit(ch)){return true;}else{return false;}};IONIC.misc.isNumber=function(o){return(typeof(o)==="number");};IONIC.misc.trimString=function(str){return str.replace(/^\s+/g,'').replace(/\s+$/g,'');};IONIC.misc.getPreferredImageMimeType=function(){return"image/gif";};IONIC.misc.getLocationSearchParameter=function(location,paramName,caseSensitive){var values=[];var ss=location.search;var kvps,i,n,knv;if(ss.length>0){ss=ss.substring(1);kvps=ss.split('&');for(i=0,n=kvps.length;i0){return vals[0];}};IONIC.misc.getWebappBaseUrl=function(){return"/ioniciasclient";};IONIC.misc.setElementOpacity=function(el,opacity){if(IE){try{el.filters.alpha.opacity=opacity*100;}catch(e){el.style.filter+="alpha(opacity="+(opacity*100)+")";}}else{el.style.opacity=opacity;}};IONIC.misc.mouseOnElement=function(e,element){var info=ElementPosition.get(element);e=e||event;var evt=JSToolbox.Event;var mx=evt.getMouseX(e);var my=evt.getMouseY(e);if(mx<(info.left)||mx>=(info.left+info.width)||my<(info.top)||my>=(info.top+info.height)){return false;}else{return true;}};IONIC.misc.swapElements=function(elt1,elt2){var parent1,parent2,sib1,sib2;if(elt1.swapNode){elt1.swapNode(elt2);}else{parent1=elt1.parentNode;parent2=elt2.parentNode;sib1=elt1.nextSibling;sib2=elt2.nextSibling;if(sib2!=elt1){parent2.insertBefore(elt1,sib2);}
if(sib1!=elt2){parent1.insertBefore(elt2,sib1);}}};IONIC.misc.makeGensymmer=function(initcnt){var count=(typeof initcnt==="number"?initcnt:0);return function(prefix){var str="g_"+(count++)+(prefix?prefix:"");return str;};};var gensym=IONIC.misc.makeGensymmer();IONIC.misc.findItem=function(item,array,test,key){var i,n,res;var eq=function(val0,val1){return val0===val1;};if(!test){test=eq;}
for(i=0,n=array.length;i0){c_start=doc.cookie.indexOf(name+"=");if(c_start!=-1){c_start=c_start+name.length+1;c_end=doc.cookie.indexOf(";",c_start);if(c_end==-1){c_end=doc.cookie.length;}
return unescape(doc.cookie.substring(c_start,c_end));}}}
IONIC.misc.subset=function(pred,arr){var out=[];if(arr){IONIC.misc.forEach(function(item){if(pred(item)===true){out.push(item);}},arr);}
return out;};IONIC.misc.removeUndefined=function(input){var out=[];var i,n,cur;for(i=0,n=input.length;i');}else{obj._transitFrame=document.createElement('IFRAME');obj._transitFrame.id=obj._transitFrame.name=frameId;}
s=obj._transitFrame.style;s.display="none";s.width=s.height="1px";document.body.appendChild(obj._transitFrame);}
return obj._transitFrame;};IONIC.misc.destroyTransitFrame=function(obj){if(obj._transitFrame){document.body.removeChild(obj._transitFrame);}};IONIC.misc.ajaxifyForm=function(dh,form,actionName,keep,callback,errorCallback){var frameReferencerObject={};var trampolineName=gensym("trampoline");var self=this;top[trampolineName]=function(object){if(!object.error){if(callback){callback(object);}}else{if(errorCallback){errorCallback(object);}else{alert('Error: '+object.errorMessage+'. '+object.stackTrace);}}
if(keep===false){top[trampolineName]=null;setTimeout(function(){IONIC.misc.destroyTransitFrame(frameReferencerObject);},30000);}};var transitFrame=IONIC.misc.getTransitFrame(frameReferencerObject);form.target=transitFrame.name;if(actionName){form.action=IONIC.misc.getWebappBaseUrl()+actionName;}
form.enctype=form.encoding="multipart/form-data";form.method="POST";var wrappedHtml=form["wrappedInHtml"];if(!wrappedHtml){wrappedHtml=dh.elt("input");wrappedHtml.type="hidden";wrappedHtml.name="wrappedInHtml";wrappedHtml.value="true";dh.append(form,wrappedHtml);}
var codeToExecute="function (object) {\n"+" top ['"+trampolineName+"'] (object);\n"+"}";var jsCallbackCode=form["jsCallbackCode"];if(!jsCallbackCode){jsCallbackCode=dh.elt("input");jsCallbackCode.type="hidden";jsCallbackCode.name="jsCallbackCode";dh.append(form,jsCallbackCode);}
jsCallbackCode.value=codeToExecute;var jsCallbackErrorCode=form["jsCallbackErrorCode"];if(!jsCallbackErrorCode){jsCallbackErrorCode=dh.elt("input");jsCallbackErrorCode.type="hidden";jsCallbackErrorCode.name="jsCallbackErrorCode";dh.append(form,jsCallbackErrorCode);}
jsCallbackErrorCode.value=codeToExecute;};IONIC.misc._tryTrace=function(){var callers=[];var cler=arguments.callee.caller;if(cler){do{callers.push(cler.name||"[anonymous]");cler=cler.caller;}while(cler);}
return callers;};IONIC.misc.appendStyleRule=function(ruleSet){var ruleSetPattern,match,selector,declarations;if(document.styleSheets){if(document.styleSheets.length===0){IONIC.misc.appendStyleElement();}
if(document.styleSheets.length>0){if(document.styleSheets[0].insertRule){document.styleSheets[document.styleSheets.length-1].insertRule(ruleSet,document.styleSheets[document.styleSheets.length-1].cssRules.length);}else if(document.styleSheets[0].addRule){ruleSetPattern=/(.*)({([^}]*)})/;match=ruleSetPattern.exec(ruleSet);if(match){selector=match[1];declarations=match[3];document.styleSheets[document.styleSheets.length-1].addRule(selector,declarations);}}}}};IONIC.misc.appendStyleElement=function(){var styleElement,headElement;if(document.createElement){styleElement=document.createElement('style');if(styleElement){styleElement.type='text/css';headElement=document.getElementsByTagName('head')[0];headElement.appendChild(styleElement);}}};
IONIC.misc.ErrorMessage=function(){throw"This object is not a constructor; it should not be instantiated.";};IONIC.misc.ErrorMessage.alert=function(errorMessage){var msg="An error has occured:\n\n"+errorMessage.message;alert(msg);};
IONIC.misc.CustomEvent=function(type,oScope,silent,signature){YAHOO.util.CustomEvent.call(this,type,oScope,silent,signature);};IONIC.misc.extendType(IONIC.misc.CustomEvent,YAHOO.util.CustomEvent);IONIC.misc.CustomEvent.prototype.fire=function(){var e,rv=YAHOO.util.CustomEvent.prototype.fire.apply(this,arguments);if(this.lastError){e=this.lastError;this.lastError=null;throw e;}else{return rv;}};
YAHOO.widget.LogWriter.prototype.debug=function(message){this.log(message,"info");};YAHOO.widget.LogWriter.prototype.warn=function(message){this.log(message,"warn");};YAHOO.widget.LogWriter.prototype.error=function(message){this.log(message,"error");};IONIC.misc.createDedicatedLogger=function(id){return new YAHOO.widget.LogWriter(id);};IONIC.misc.getDefaultLogger=(function(){var dl;return function(){if(!dl){dl=IONIC.misc.createDedicatedLogger("global");}
return dl;};})();
IONIC.misc.PropertyType={};IONIC.misc.PropertyType._STR_TO_INT={};IONIC.misc.PropertyType._INT_TO_STR={};IONIC.misc.PropertyType.getInt=function(strType){return IONIC.misc.PropertyType._STR_TO_INT(strType);};IONIC.misc.PropertyType.getString=function(intType){return IONIC.misc.PropertyType._INT_TO_STR(intType);};IONIC.misc.PropertyType.register=function(type,intVal){intVal=intVal||IONIC.misc.PropertyType._INT_TO_STR.length;IONIC.misc.PropertyType._INT_TO_STR[intVal]=type;IONIC.misc.PropertyType._STR_TO_INT[type]=intVal};IONIC.misc.PropertyType.BYTE="byte";IONIC.misc.PropertyType.register(IONIC.misc.PropertyType.BYTE);IONIC.misc.PropertyType.FLOAT="float";IONIC.misc.PropertyType.register(IONIC.misc.PropertyType.FLOAT);IONIC.misc.PropertyType.DOUBLE="double";IONIC.misc.PropertyType.register(IONIC.misc.PropertyType.DOUBLE);IONIC.misc.PropertyType.INTEGER="integer";IONIC.misc.PropertyType.register(IONIC.misc.PropertyType.INTEGER);IONIC.misc.PropertyType.LONG="long";IONIC.misc.PropertyType.register(IONIC.misc.PropertyType.LONG);IONIC.misc.PropertyType.SHORT="short";IONIC.misc.PropertyType.register(IONIC.misc.PropertyType.SHORT);IONIC.misc.PropertyType.DOUBLE="double";IONIC.misc.PropertyType.register(IONIC.misc.PropertyType.DOUBLE);IONIC.misc.PropertyType.DATE="date";IONIC.misc.PropertyType.register(IONIC.misc.PropertyType.DATE);IONIC.misc.PropertyType.STRING="string";IONIC.misc.PropertyType.register(IONIC.misc.PropertyType.STRING);
IONIC.misc.BaseStack=function(){this.initBaseStack();};IONIC.misc.BaseStack.newInstance=function(){return new IONIC.misc.BaseStack();};IONIC.misc.BaseStack.prototype.initBaseStack=function(){this.lifo=[];IONIC.misc.createCustomEvents(["onContentsChanged"],this);};IONIC.misc.BaseStack.prototype.push=function(item){this.lifo.splice(0,0,item);this.onContentsChanged.fire(this.lifo.length);};IONIC.misc.BaseStack.prototype.pop=function(){var r;if(this.lifo.length){r=this.lifo.splice(0,1);this.onContentsChanged.fire(this.lifo.length);return r[0];}else{throw"Stack is empty";}};IONIC.misc.BaseStack.prototype.top=function(){return this.lifo[0];};
IONIC.misc.CompositeClassName=function(element,parts){this.parts=parts?parts:{};this.element=element;if(element.className){this.parts["$inherited"+gensym()]=element.className;}
this.syncWithElement();element._compClassName=this;IONIC.misc.CompositeClassName.registerInstance(this);};IONIC.misc.CompositeClassName.instances=[];IONIC.misc.CompositeClassName.registerInstance=function(inst){IONIC.misc.CompositeClassName.instances.push(inst);};(function(){YAHOO.util.Event.on(window,"unload",function(){IONIC.misc.forEach(function(inst){inst.destroy();},IONIC.misc.CompositeClassName.instances);IONIC.misc.CompositeClassName.instances=[];});})();IONIC.misc.CompositeClassName.newInstance=function(element,parts){return new IONIC.misc.CompositeClassName(element,parts);};IONIC.misc.CompositeClassName.forElement=function(element,nocreate){if(!element._compClassName&&!nocreate){element._compClassName=new IONIC.misc.CompositeClassName(element);}
return element._compClassName;};IONIC.misc.CompositeClassName.prototype.destroy=function(){var element=this.element;if(this.element){this.element=null;element._compClassName=null;}};IONIC.misc.CompositeClassName.prototype.setPart=function(key,value){if(!key){key=gensym("CCNkey_");}
this.parts[key]=value;this.syncWithElement();};IONIC.misc.CompositeClassName.prototype.getPart=function(key){return this.parts[key];};IONIC.misc.CompositeClassName.prototype.syncWithElement=function(){var arr=[];for(var i in this.parts){if(this.parts.hasOwnProperty(i)){arr[arr.length]=this.parts[i];}}
this.element.className=arr.join(" ");};
Date.prototype.setISO8601=function(string){var regexp="([0-9]{4})(-([0-9]{2})(-([0-9]{2})"+"(T([0-9]{2}):([0-9]{2})(:([0-9]{2})(\.([0-9]+))?)?"+"(Z|(([-+])([0-9]{2}):([0-9]{2})))?)?)?)?";var d=string.match(new RegExp(regexp));var offset=0;var date=new Date(d[1],0,1);if(d[3]){date.setMonth(d[3]-1);}
if(d[5]){date.setDate(d[5]);}
if(d[7]){date.setHours(d[7]);}
if(d[8]){date.setMinutes(d[8]);}
if(d[10]){date.setSeconds(d[10]);}
if(d[12]){date.setMilliseconds(Number("0."+d[12])*1000);}
if(d[14]){offset=(Number(d[16])*60)+Number(d[17]);offset*=((d[15]=='-')?1:-1);}
offset-=date.getTimezoneOffset();time=(Number(date)+(offset*60*1000));this.setTime(Number(time));}
Date.prototype.toISO8601String=function(format,offset){if(!format){var format=6;}
if(!offset){var offset='Z';var date=this;}else{var d=offset.match(/([-+])([0-9]{2}):([0-9]{2})/);var offsetnum=(Number(d[2])*60)+Number(d[3]);offsetnum*=((d[1]=='-')?-1:1);var date=new Date(Number(Number(this)+(offsetnum*60000)));}
var zeropad=function(num){return((num<10)?'0':'')+num;}
var str="";str+=date.getUTCFullYear();if(format>1){str+="-"+zeropad(date.getUTCMonth()+1);}
if(format>2){str+="-"+zeropad(date.getUTCDate());}
if(format>3){str+="T"+zeropad(date.getUTCHours())+":"+zeropad(date.getUTCMinutes());}
if(format>5){var secs=Number(date.getUTCSeconds()+"."+
((date.getUTCMilliseconds()<100)?'0':'')+
zeropad(date.getUTCMilliseconds()));str+=":"+zeropad(secs);}else if(format>4){str+=":"+zeropad(date.getUTCSeconds());}
if(format>3){str+=offset;}
return str;}
IONIC.misc.RequestTool=function(){this._ehs={};this._ehs[IONIC.misc.RequestTool.DEFAULT_ERROR_HANDLER]=IONIC.misc.RequestTool.DEFAULT_ERROR_HANDLER_FUN;this.setErrorHandler(IONIC.misc.RequestTool.IONIC_ERROR_HTTP_CODE,IONIC.misc.RequestTool.DEFAULT_IONIC_ERROR_HANDLER_FUN);};IONIC.misc.RequestTool.newInstance=function(){return new IONIC.misc.RequestTool();};IONIC.misc.RequestTool.JSON_MIME_TYPE="application/json";IONIC.misc.RequestTool.IONIC_ERROR_HTTP_CODE=407;IONIC.misc.RequestTool.DEFAULT_ERROR_HANDLER_FUN=function(status,respText){var conf=confirm("There was an error while performing the operation. Do you want to see the details?");var funname,purl;if(conf){funname=gensym("errorTextRetriever");window[funname]=function(){return respText;};purl=IONIC.misc.getWebappBaseUrl()+"/BaseErrorHandler.jsp?messageGetter="+
escape(funname);window.open(purl,"windowFor_"+funname,'scrollbars=1,resizable=1,menubar=0');}};IONIC.misc.RequestTool.DEFAULT_IONIC_ERROR_HANDLER_FUN=function(status,respText,request,callback,quiet){var service,errorMsg=eval("("+respText+")");var alertMsg="An error has occured.";if(errorMsg.type.indexOf("authentication")===0){alertMsg+="\nAccess to a secure service has not been granted.";if(errorMsg.type==="authenticationError"){service=IONIC.security.SecureServices.getSecureService(errorMsg.serviceType,errorMsg.serviceUrl);if(service){service.removeUserPassword();IONIC.security.SecureServices.setSecureService(service);}else{IONIC.security.SecureServices.setSecureService(new IONIC.security.SecureService(errorMsg.serviceType,errorMsg.serviceUrl));}}}
if(!quiet){if(errorMsg.message&&errorMsg.message.length>0){alertMsg+="\nThe complete error message is:\n"+errorMsg.message;}
alert(alertMsg);}};IONIC.misc.RequestTool.DEFAULT_ERROR_HANDLER="%def";IONIC.misc.RequestTool.prototype.withUrl=function(url,httpMethod,callback,bodyText){this._withUrl(url,httpMethod,callback,bodyText);};IONIC.misc.RequestTool.prototype._withUrl=function(url,httpMethod,callback,bodyText){httpMethod=httpMethod.toUpperCase();var req=IONIC.misc.createXMLHttpRequest();var self=this;req.onreadystatechange=function(){var success,obj,vname,contentType;if(req.readyState==4){success=false;obj=null;if(req.status==200){success=true;contentType=req.getResponseHeader("Content-Type");if(contentType&&contentType.indexOf(IONIC.misc.RequestTool.JSON_MIME_TYPE)>=0){obj=eval(req.responseText);}}
if(self.requestHTMLNotifier){self.requestHTMLNotifier.style.display="none";}
if(self.requestListener){self.requestListener("stop",url,success);}
if(success){IONIC.misc.RequestTool._doSuccess(self,callback,obj,req);}else{IONIC.misc.RequestTool._doError(self,callback,req);}
setTimeout(function(){req.onreadystatechange=function(){};req=null;self=null;},100);}};var isGet=httpMethod==="GET";if(isGet){url+=(url.indexOf("?")>=0?"&":"?")+"time="+new Date().getTime();}
req.open(httpMethod,url,true);if(!isGet){req.setRequestHeader("Content-Type","application/json");}
if(this.requestHTMLNotifier){this.requestHTMLNotifier.style.display="";}
if(this.requestListener){this.requestListener("start",url);}
req.send(bodyText?bodyText:"");};IONIC.misc.RequestTool._doSuccess=function(rt,callback,obj,req){if(callback){callback(true,obj,req.responseText,req);}};IONIC.misc.RequestTool._doError=function(rt,callback,req){var hndlr=rt.getErrorHandler(req.status)||rt.getDefaultErrorHandler();if(hndlr){hndlr(req.status,req.responseText,req,callback);}};IONIC.misc.RequestTool.prototype.getErrorHandler=function(code){return this._ehs["$"+code]||this._ehs[IONIC.misc.RequestTool.DEFAULT_ERROR_HANDLER];};IONIC.misc.RequestTool.prototype.hasErrorHandler=function(code){return!!this._ehs["$"+code];};IONIC.misc.RequestTool.prototype.setErrorHandler=function(code,handler){this._ehs["$"+code]=handler;};IONIC.misc.RequestTool.prototype.getDefaultErrorHandler=function(){return this._ehs[IONIC.misc.RequestTool.DEFAULT_ERROR_HANDLER];};IONIC.misc.RequestTool.prototype.setDefaultErrorHandler=function(handler){this._ehs[IONIC.misc.RequestTool.DEFAULT_ERROR_HANDLER]=handler;};IONIC.misc.RequestTool.prototype.setRequestHTMLNotifier=function(htmlElement){this.requestHTMLNotifier=htmlElement;};IONIC.misc.RequestTool.prototype.setRequestListener=function(listener){this.requestListener=listener;};IONIC.misc.RequestTool.prototype._wrapIterationCallbacks=function(beginCb,iterationCb,endCb,treeChildrenKey,sortKey,nodeTreatment,firstLevelKey){var maybeTreat=function(desc){return nodeTreatment?nodeTreatment(desc):desc;};return function(success,parsedObject,responseText,thisReq){var sortWithKey,descNode,arr,i,n,obj;if(beginCb){beginCb(success,parsedObject,responseText,thisReq);}
if(iterationCb){if(sortKey){if(typeof sortKey==="string"){sortWithKey=function(arr){return arr.sort(function(o0,o1){if(o0[sortKey]===o1[sortKey]){return 0;}else if(o0[sortKey]=this._items.length){this._ptr=this._items.length-1;}
this._fireStateChanged();}};IONIC.misc.HistoryChain.prototype._fireStateChanged=function(){var p=this._ptr;var l=this._items.length;this.onStateChanged.fire(p,l,(p0));};IONIC.misc.HistoryChain.prototype.addItem=function(forwardOp,backOp){if(this._ptr>0){this._items=this._items.slice(this._ptr);}
var i={fwd:forwardOp,back:backOp};this._items.splice(0,0,i);this._ptr=1;var mi=this.getMaxItems();if(this._items.length>mi){this._items=this._items.slice(0,mi);}
this.forward(true);this._fireStateChanged();return i;};IONIC.misc.HistoryChain.prototype._setPtr=function(p,noEvent){if(p!=this._ptr){this._ptr=p;if(!noEvent){this._fireStateChanged();}}};IONIC.misc.HistoryChain.prototype.forward=function(noEvent){var r;var tuple;var curPtr=this._ptr;switch(curPtr){case-1:tuple=this._items[0];curPtr=0;break;case 0:r=false;break;default:tuple=this._items[--curPtr];r=true;}
if(tuple){tuple.fwd();}
this._setPtr(curPtr,noEvent);return r;};IONIC.misc.HistoryChain.prototype.back=function(noEvent){var r;var tuple;var curPtr=this._ptr;var maxPtr=this._items.length;switch(curPtr){case-1:throw"Trying to 'back' on geometry editing history, but there has been no action so far.";case maxPtr:r=false;break;default:tuple=this._items[curPtr++];r=true;}
if(tuple){tuple.back();}
this._setPtr(curPtr,noEvent);return r;};
IONIC.misc.QName=function(name,nsUri){this.name=name;this.namespace=nsUri;};IONIC.misc.QName.prototype.getName=function(){return this.name;};IONIC.misc.QName.prototype.getNamespace=function(){return this.namespace;};IONIC.misc.QName.prototype.equals=function(other){return IONIC.misc.QName.equal(this,other);};IONIC.misc.QName.equal=function(qn0,qn1){return qn0.name===qn1.name&&qn0.namespace===qn1.namespace;};IONIC.misc.QName.prototype.toString=function(){return"{"+this.namespace+"}"+this.name;};
IONIC.misc.ObjReference=function(obj,onEstablished,onBrk,onB4Brk){this.setObject(obj);this.setHandlers(onEstablished,onBrk,onB4Brk);this.activated=false;};IONIC.misc.ObjReference.prototype.setHandlers=function(onEstablished,onBrk,onB4Brk){this._oe=onEstablished;this._ob=onBrk;this._obb=onB4Brk;};IONIC.misc.ObjReference.prototype.setObject=function(o){this._o=o;};IONIC.misc.ObjReference.prototype.getObject=function(){return this._o;};IONIC.misc.ObjReference.prototype.activate=function(){this.ensureInactive();if(this.isObjectAvailable()){this.onEstablished(this.getObject());}};IONIC.misc.ObjReference.prototype.ensureInactive=function(){if(this.activated){throw"Illegal state: ObjReference is already activated";}};IONIC.misc.ObjReference.prototype.isObjectAvailable=function(){return!!this._o;};IONIC.misc.ObjReference.prototype.onEstablished=function(o){var h=this._getOnEstablishedHandler();if(h){h(o);}};IONIC.misc.ObjReference.prototype.onBroken=function(o){var h=this._getOnBrokenHandler();if(h){h(o);}};IONIC.misc.ObjReference.prototype.onB4Broken=function(o){var h=this._getOnB4BrokenHandler();if(h){h(o);}};IONIC.misc.ObjReference.prototype._getOnEstablishedHandler=function(){return this._oe;};IONIC.misc.ObjReference.prototype._getOnBrokenHandler=function(){return this._ob;};IONIC.misc.ObjReference.prototype._getOnB4BrokenHandler=function(){return this._obb;};
IONIC.misc.TilapiaPoolSoftReference=function(objName,objType,onEstablished,onBrk,onB4Brk){this.setHandlers(onEstablished,onBrk,onB4Brk);this._on=objName;this._ot=objType;var thisRef=this;IONIC.api.misc.TilapiaPool.onAdded.subscribe(function(etype,args){var name=args[0];var type=args[1];if(objName===name&&objType===type){thisRef.onEstablished(args[2]);}});IONIC.api.misc.TilapiaPool.onRemoved.subscribe(function(etype,args){var name=args[0];var type=args[1];var obj=args[2];if(objName===name&&objType===type){thisRef.onB4Broken(obj);thisRef.onBroken(obj);}});};IONIC.misc.extendType(IONIC.misc.TilapiaPoolSoftReference,IONIC.misc.ObjReference);IONIC.misc.TilapiaPoolSoftReference.prototype.getObjectName=function(){return this._on;};IONIC.misc.TilapiaPoolSoftReference.prototype.getObjectType=function(){return this._ot;};IONIC.misc.TilapiaPoolSoftReference.prototype.setObject=function(o){throw"Illegal state: IONIC.misc.TilapiaPoolSoftReference#setObject () was called";};IONIC.misc.TilapiaPoolSoftReference.prototype.getObject=function(){return IONIC.api.misc.TilapiaPool.getObject(this.getObjectName(),this.getObjectType());};IONIC.misc.TilapiaPoolSoftReference.prototype.isObjectAvailable=function(){return!!this.getObject();};
IONIC.misc.AbstractResultsHandler=function(){};IONIC.misc.AbstractResultsHandler.prototype.onB4RequestSubmitted=function(){};IONIC.misc.AbstractResultsHandler.prototype.onBegin=function(success,obj){IONIC.misc.unimp("IONIC.misc.AbstractResultsHandler","onBegin");};IONIC.misc.AbstractResultsHandler.prototype.onIterate=function(item){IONIC.misc.unimp("IONIC.misc.AbstractResultsHandler","onIterate");};IONIC.misc.AbstractResultsHandler.prototype.onEnd=function(){IONIC.misc.unimp("IONIC.misc.AbstractResultsHandler","onEnd");};
IONIC.ui.AbstractLoadingSign=function(win){win=win||window;this.progress=0;this.setComponent(this.createComponent(new IONIC.api.ui.DomHelper(win.document)));this.getComponent().style.display="none";this.isLoading=false;};IONIC.ui.AbstractLoadingSign.prototype.getComponent=function(){return this.component;};IONIC.ui.AbstractLoadingSign.prototype.setComponent=function(comp){this.component=comp;};IONIC.ui.AbstractLoadingSign.prototype.createComponent=function(dh){IONIC.misc.unimp("IONIC.ui.AbstractLoadingSign","createComponent");};IONIC.ui.AbstractLoadingSign.prototype.onLoadStart=function(){this.getComponent().style.display="";};IONIC.ui.AbstractLoadingSign.prototype.onLoadEnd=function(){this.getComponent().style.display="none";};IONIC.ui.AbstractLoadingSign.prototype.onProgress=function(progress){};IONIC.ui.AbstractLoadingSign.prototype.getProgress=function(){return this.progress;};IONIC.ui.AbstractLoadingSign.prototype.setProgress=function(progress){progress=Math.min(1.0,Math.max(0.0,progress));this.progress=progress;if(!this.isLoading){this.onLoadStart();}
this.onProgress(progress);if(progress===1.0){this.onLoadEnd();this.isLoading=false;}
this.refreshComponent();};IONIC.ui.AbstractLoadingSign.prototype.refreshComponent=function(){};
IONIC.ui.AbstractEditor=function(component){if(!component){throw"Missing component for editor";}
this._cpnt=component;};IONIC.ui.AbstractEditor.prototype.getComponent=function(){return this._cpnt;};IONIC.ui.AbstractEditor.prototype.getValue=function(){IONIC.misc.unimp("IONIC.ui.AbstractEditor","getValue");};
IONIC.ui.AbstractMultiValuedEditor=function(component){IONIC.ui.AbstractEditor.call(this,component);};IONIC.misc.extendType(IONIC.ui.AbstractMultiValuedEditor,IONIC.ui.AbstractEditor);IONIC.ui.AbstractMultiValuedEditor.prototype.getValue=function(){var values=this.getValues();return values;};IONIC.ui.AbstractMultiValuedEditor.prototype.getValues=function(){IONIC.misc.unimp("IONIC.ui.AbstractMultiValuedEditor","getValues");};
IONIC.ui.AbstractComposedEditor=function(component){IONIC.ui.AbstractMultiValuedEditor.call(this,component);var args=[],i,n;if(arguments.length>1){for(i=0,n=arguments.length;i(this.hasNoPrompt()?-1:0)){o=c.options[c.options.selectedIndex];val=(o&&o.value&&o.value!=="")?o.value:undefined;}
return val;};IONIC.ui.SelectEditor.prototype.setNoPrompt=function(flag){this._noPrompt=!!flag;};IONIC.ui.SelectEditor.prototype.hasNoPrompt=function(){return this._noPrompt;};
IONIC.ui.NavigableMapEditor=function(holder,dh){IONIC.ui.AbstractSpatialEditor.call(this,holder);this._dh=dh;this.initComponent();};IONIC.misc.extendType(IONIC.ui.NavigableMapEditor,IONIC.ui.AbstractSpatialEditor);IONIC.ui.NavigableMapEditor.prototype.getValue=function(){if(this.isMapVisible()){var map=this.getMap();return this.boxToPolygon(map.getSrsBox());}};IONIC.ui.NavigableMapEditor.prototype.getMap=function(){return this._map;};IONIC.ui.NavigableMapEditor.prototype.getDomHelper=function(){return this._dh;};IONIC.ui.NavigableMapEditor.prototype.initComponent=function(){var holder=this.getComponent();var dh=this.getDomHelper();var thisRef=this;var toggler=dh.elt("img");toggler.onclick=function(){thisRef.toggleMapVisibility();};var block=dh.elt("div");this._map=new IONIC.api.maps.Map(block);var block2=dh.elt("div");var navbar=new IONIC.api.ui.NavigationBar(block2,this._map);var nba=IONIC.api.ui.NavigationBar;navbar.addItems(nba.ZOOMIN|nba.ZOOMOUT|nba.PAN|nba.HISTORY);dh.append(holder,toggler,block,block2);holder.toggler=toggler;holder.mapHolder=block;holder.navbarHolder=block2;this.setMapVisibility(false);};IONIC.ui.NavigableMapEditor.prototype.toggleMapVisibility=function(){this.setMapVisibility(!this.isMapVisible());};IONIC.ui.NavigableMapEditor.prototype.setMapVisibility=function(visibility){var holder=this.getComponent();var toggler=holder.toggler;var mapHolder=holder.mapHolder;var navbarHolder=holder.navbarHolder;if(visibility){toggler.src=IONIC.misc.getWebappBaseUrl()+"/images/editor/navigablemap/toggle_toinvisible.gif";toggler.alt="tilapia.editor.navigablemap.toggle.toinvisibile.alt";toggler.title="tilapia.editor.navigablemap.toggle.toinvisibile.title";mapHolder.style.display="";navbarHolder.style.display="";}else{toggler.src=IONIC.misc.getWebappBaseUrl()+"/images/editor/navigablemap/toggle_tovisible.gif";toggler.alt="tilapia.editor.navigablemap.toggle.tovisibile.alt";toggler.title="tilapia.editor.navigablemap.toggle.tovisibile.title";mapHolder.style.display="none";navbarHolder.style.display="none";}};IONIC.ui.NavigableMapEditor.prototype.isMapVisible=function(){return this.getComponent().mapHolder.style.display!=="none";};
IONIC.ui.TimestampIntervalEditor=function(component){IONIC.ui.AbstractComposedEditor.call(this,component);};IONIC.misc.extendType(IONIC.ui.TimestampIntervalEditor,IONIC.ui.AbstractComposedEditor);IONIC.ui.TimestampIntervalEditor.prototype.getValues=function(){var c=this.getComponent();var startDate=c.startBoundComponent.dateValue;var endDate=c.endBoundComponent.dateValue;return[startDate||null,endDate||null];};IONIC.ui.TimestampIntervalEditor.buildComponent=function(dh){var startBoundComponent=dh.elt("input");startBoundComponent.type="text";startBoundComponent.value="";startBoundComponent.dateValue=undefined;startBoundComponent.readOnly=true;var endBoundComponent=dh.elt("input");endBoundComponent.type="text";endBoundComponent.value="";endBoundComponent.dateValue=undefined;endBoundComponent.readOnly=true;var startCalendarHolder=dh.elt("div.timestampCalendar");var endCalendarHolder=dh.elt("div.timestampCalendar");startCalendarHolder.id=gensym("cphdr");endCalendarHolder.id=gensym("cphdr");startCalendarHolder.style.position=endCalendarHolder.style.position="absolute";startCalendarHolder.style.visibility=endCalendarHolder.style.visibility="hidden";startCalendarHolder.style.backgroundColor=endCalendarHolder.style.backgroundColor="white";dh.append(dh.getDocument().body,startCalendarHolder);dh.append(dh.getDocument().body,endCalendarHolder);var startCalendarHook=dh.elt("img");var endCalendarHook=dh.elt("img");startCalendarHook.id=gensym("chk");endCalendarHook.id=gensym("chk");startCalendarHook.src=endCalendarHook.src=IONIC.misc.getWebappBaseUrl()+"/images/editor/timestamp/calendar.gif";startCalendarHook.alt=endCalendarHook.alt="calendar";startCalendarHook.title=endCalendarHook.title="Open calendar";var startClear=dh.elt("img");var endClear=dh.elt("img");startClear.src=endClear.src=IONIC.misc.getWebappBaseUrl()+"/images/editor/timestamp/clear.gif";startClear.alt=endClear.alt="clear";startClear.title=endClear.title="Clear current date";var startCal=new CalendarPopup(startCalendarHolder.id);startCal.showNavigationDropdowns();var endCal=new CalendarPopup(endCalendarHolder.id);endCal.showNavigationDropdowns();var win=window;var startCBName=gensym("startCalCb");var endCBName=gensym("endCalCb");win[startCBName]=function(y,m,d){var date=new Date(Date.UTC(y,m-1,d,0,0,0));startBoundComponent.value=date.toUTCString();startBoundComponent.dateValue=date;};win[endCBName]=function(y,m,d){var date=new Date(Date.UTC(y,m-1,d,23,59,59));endBoundComponent.value=date.toUTCString();endBoundComponent.dateValue=date;};startCal.setReturnFunction(startCBName);endCal.setReturnFunction(endCBName);startCalendarHook.onclick=function(){startCal.showCalendar(startCalendarHook.id);return false;};endCalendarHook.onclick=function(){endCal.showCalendar(endCalendarHook.id);return false;};startClear.onclick=function(){startBoundComponent.value="";startBoundComponent.dateValue=undefined;};endClear.onclick=function(){endBoundComponent.value="";endBoundComponent.dateValue=undefined;};var cpnt=dh.elt("div.ui_timestampIntervalEditor",dh.elt("table",dh.elt("tbody",dh.elt("tr",dh.elt("td",startBoundComponent),dh.elt("td",startCalendarHook),dh.elt("td",startClear)),dh.elt("tr",dh.elt("td",endBoundComponent),dh.elt("td",endCalendarHook),dh.elt("td",endClear)))));cpnt.startBoundComponent=startBoundComponent;cpnt.endBoundComponent=endBoundComponent;cpnt.startCalendar=startCal;cpnt.endCalendar=endCal;return cpnt;};
IONIC.ui.TBItem=function(factory,name){this.nme=name;this.ena=true;this.sts={};this.fac=factory;}
IONIC.ui.TBItem.DISABLED_STYLE="%%dis";IONIC.ui.TBItem.INITIAL_STYLE="%%ini";IONIC.ui.TBItem.prototype.getName=function(){return this.nme;};IONIC.ui.TBItem.prototype.getItemFactory=function(){return this.fac;};IONIC.ui.TBItem.prototype.setItemFactory=function(f){this.fac=f;};IONIC.ui.TBItem.prototype.getItemGroup=function(){return this.grp;};IONIC.ui.TBItem.prototype.setItemGroup=function(g){this.grp=g;};IONIC.ui.TBItem.prototype.getComponent=function(){if(!this.cpnt)
this.cpnt=this.createComponent();return this.cpnt;};IONIC.ui.TBItem.prototype.createComponent=function(){throw"Don't know how to create component";};IONIC.ui.TBItem.prototype.select=function(){};IONIC.ui.TBItem.prototype.onselect=function(){};IONIC.ui.TBItem.prototype.ondeselect=function(){};IONIC.ui.TBItem.prototype.onactivate=function(){};IONIC.ui.TBItem.prototype.registerStyle=function(name,data){};IONIC.ui.TBItem.prototype.selectStyle=function(name){}
IONIC.ui.TBItem.prototype.setEnabled=function(flag){this.ena=flag;};IONIC.ui.TBItem.prototype.isEnabled=function(flag){return this.ena;};IONIC.ui.TBItem.prototype.setVisibility=function(flag){this.getComponent().style.display=(flag?"":"none");};IONIC.ui.TBItem.prototype.destroy=function(){this.onDestroy();};IONIC.ui.TBItem.prototype.onDestroy=function(){};
IONIC.ui.TBImgItem=function(factory,name,fileName,title,alt){IONIC.ui.TBItem.call(this,factory,name);this.registerStyle(IONIC.ui.TBItem.INITIAL_STYLE,{fileName:fileName,title:title,alt:alt});this.selectStyle(IONIC.ui.TBItem.INITIAL_STYLE);};IONIC.misc.extendType(IONIC.ui.TBImgItem,IONIC.ui.TBItem);IONIC.ui.TBImgItem.prototype.select=function(e){var g=this.getItemGroup();if(g){g.setSelected(this,e);}else{this.onactivate(e);}};IONIC.ui.TBImgItem.prototype.createComponent=function(){var thisRef=this;var f=this.getItemFactory();var d=f.getDocument();var img=d.createElement("img");img.title=this.imgTitle;img.alt=this.imgAlt;img.src=IONIC.misc.getWebappBaseUrl()+"/"+f.getImagePath()+"/"+this.imgFileName;img.onclick=function(e){if(thisRef.isEnabled()){thisRef.select(e);}};img.ccn=new IONIC.misc.CompositeClassName(img);img.ccn.setPart("sel","deselected");return img;};IONIC.ui.TBImgItem.prototype.getImageFileName=function(){return this.imgFileName;};IONIC.ui.TBImgItem.prototype.setImageFileName=function(fn){this.imgFileName=fn;var f=this.getItemFactory();this.getComponent().src=IONIC.misc.getWebappBaseUrl()+"/"+f.getImagePath()+"/"+this.imgFileName;};IONIC.ui.TBImgItem.prototype.setImageTitle=function(t){this.imgTitle=t;this.getComponent().title=t;};IONIC.ui.TBImgItem.prototype.setImageAlt=function(alt){this.imgAlt=alt;this.getComponent().alt=alt;};IONIC.ui.TBImgItem.prototype.registerStyle=function(name,data){this.sts[name]=data;};IONIC.ui.TBImgItem.prototype.selectStyle=function(name){var s=this.sts[name];if(s){this.setImageFileName(s.fileName);this.setImageTitle(s.title);this.setImageAlt(s.alt);}else{}};IONIC.ui.TBImgItem.prototype.setEnabled=function(flag){var bef=this.isEnabled();IONIC.ui.TBItem.prototype.setEnabled.call(this,flag);if(bef!=flag){this.selectStyle(flag?IONIC.ui.TBItem.INITIAL_STYLE:IONIC.ui.TBItem.DISABLED_STYLE);}};IONIC.ui.TBImgItem.prototype.destroy=function(){IONIC.ui.TBItem.prototype.destroy.call(this);this.getComponent().onclick=undefined;};
IONIC.ui.TBInputItem=function(factory,name,text,initialValue){IONIC.ui.TBItem.call(this,factory,name);this.labelText=text;this.initVal=initialValue;};IONIC.misc.extendType(IONIC.ui.TBInputItem,IONIC.ui.TBItem);IONIC.ui.TBInputItem.prototype.createComponent=function(){var f=this.getItemFactory();var d=f.getDocument();var c=d.createElement("div");var l=d.createTextNode(this.labelText);var i=d.createElement("input");i.className='inputItem';i.type="text";if(typeof this.initVal!=="undefined"){i.value=this.initVal;}
c.appendChild(l);c.appendChild(i);c.input=i;return c;};IONIC.ui.TBInputItem.prototype.getValue=function(){var v=this.getComponent().input.value;return(this.unformatter?this.unformatter(v):v);};IONIC.ui.TBInputItem.prototype.setValue=function(v){var c=this.getComponent();c.input.value=(this.formatter?this.formatter(v):v);};IONIC.ui.TBInputItem.prototype.setFormatter=function(f){this.formatter=f;};IONIC.ui.TBInputItem.prototype.setUnformatter=function(f){this.unformatter=f;};IONIC.ui.TBInputItem.prototype.setEditable=function(flag){flag=!!flag;var c=this.getComponent();c.editable=flag;if(flag){var thisRef=this;c.onkeydown=function(e){thisRef.checkKey(e);return true;};c.input.readOnly=false;}else{c.input.readOnly=true;c.onkeydown=null;}};IONIC.ui.TBInputItem.prototype.checkKey=function(e){e=e||event;var code;if(e.keyCode)code=e.keyCode;else if(e.which)code=e.which;var character=String.fromCharCode(code);if(code==8||code==46||(code>=96&&code<=105)||IONIC.misc.isDigit(character)){this.userModified();}else if(code==13){this.synchronizeInput();}};IONIC.ui.TBInputItem.prototype.userModified=function(){this.setNeedsSync(true);this.showApplyDialog();};IONIC.ui.TBInputItem.prototype.setNeedsSync=function(flag){this.nsc=flag;};IONIC.ui.TBInputItem.prototype.getNeedsSync=function(){return this.nsc;};IONIC.ui.TBInputItem.prototype.setSize=function(s){return this.getComponent().input.size=s;};IONIC.ui.TBInputItem.prototype.synchronizeInput=function(){};IONIC.ui.TBInputItem.prototype.showApplyDialog=function(){};IONIC.ui.TBInputItem.prototype.destroy=function(){IONIC.ui.TBItem.prototype.destroy.call(this);this.getComponent().onkeydown=undefined;};
IONIC.ui.TBLabelItem=function(factory,name,text){IONIC.ui.TBItem.call(this,factory,name);this.labelText=text||"";}
IONIC.misc.extendType(IONIC.ui.TBLabelItem,IONIC.ui.TBItem);IONIC.ui.TBLabelItem.prototype.createComponent=function(){var f=this.getItemFactory();var d=f.getDocument();var c=d.createElement("span");c.innerHTML=this.labelText;return c;}
IONIC.ui.TBLabelItem.prototype.setValue=function(text){this.getComponent().innerHTML=text||"";}
IONIC.ui.TBSelectItem=function(factory,name,text){IONIC.ui.TBItem.call(this,factory,name);this.labelText=text;};IONIC.misc.extendType(IONIC.ui.TBSelectItem,IONIC.ui.TBItem);IONIC.ui.TBSelectItem.prototype.createComponent=function(){var self=this;var f=this.getItemFactory();var d=f.getDocument();var component=d.createElement("div");var l=d.createTextNode(this.labelText);var select=d.createElement("select");select.className='selectItem';component.appendChild(l);component.appendChild(select);component.select=select;select.onchange=function(){self.onchange();};return component;};IONIC.ui.TBSelectItem.prototype.getValue=function(){var select=this.getComponent().select;var value=select.options[select.options.selectedIndex].value
return value;};IONIC.ui.TBSelectItem.prototype.setValue=function(value){var select=this.getComponent().select;var i,n,idxToSelect;for(i=0,n=select.options.length;i=96&&code<=105)||IONIC.misc.isDigit(character)){this.userModifiedInput();}else if(code==13){this.userAcceptedInput();}};IONIC.ui.navigation.AbstractNavInfoInputField.prototype.userModifiedInput=function(){};IONIC.ui.navigation.AbstractNavInfoInputField.prototype.userAcceptedInput=function(){};IONIC.ui.navigation.AbstractNavInfoInputField.prototype.getInputSize=function(){return this._inputSz||12;};IONIC.ui.navigation.AbstractNavInfoInputField.prototype.setInputSize=function(size){this._inputSz=size;this.getComponentInput().size=size;};IONIC.ui.navigation.AbstractNavInfoInputField.prototype.getComponentInput=function(){var c=this.getComponent();return c.getElementsByTagName("input")[0];};IONIC.ui.navigation.AbstractNavInfoInputField.prototype.setValue=function(v){var i=this.getComponentInput();i.value=""+v;};IONIC.ui.navigation.AbstractNavInfoInputField.prototype.getValue=function(){return this.getComponentInput().value;};IONIC.ui.navigation.AbstractNavInfoInputField.prototype.setEnabled=function(flag){var i=this.getComponentInput();i.readOnly=!flag;};IONIC.ui.navigation.AbstractNavInfoInputField.prototype.getLabelText=function(){return"";};
IONIC.defns("ui.navigation");IONIC.ui.navigation.AbstractBoxModifyingNavInfoInputField=function(navInfo){IONIC.ui.navigation.AbstractNavInfoInputField.call(this,navInfo);};IONIC.misc.extendType(IONIC.ui.navigation.AbstractBoxModifyingNavInfoInputField,IONIC.ui.navigation.AbstractNavInfoInputField);IONIC.ui.navigation.AbstractBoxModifyingNavInfoInputField.prototype.userAcceptedInput=function(){var map,box;var val=+(this.getValue());if(!isNaN(val)&&typeof val==="number"){map=this.getMap();if(map){box=map.getBox();box=this.modifyBox(box,val);if(box){map.setBox(box);}}}};IONIC.ui.navigation.AbstractBoxModifyingNavInfoInputField.prototype.modifyBox=function(box,arg){return box;};
IONIC.defns("ui.navigation");IONIC.ui.navigation.AbstractCoordField=function(navInfo){IONIC.ui.navigation.AbstractBoxModifyingNavInfoInputField.call(this,navInfo);this.setInputSize(7);};IONIC.misc.extendType(IONIC.ui.navigation.AbstractCoordField,IONIC.ui.navigation.AbstractBoxModifyingNavInfoInputField);IONIC.ui.navigation.AbstractCoordField.prototype.onMapAvailable=function(map,handler){if(typeof this._handler==="number"){throw"Illegal state: The map was already available";}
var map=this.getMap();this._handlerId=map.addHandler("onmousemove",handler);};IONIC.ui.navigation.AbstractCoordField.prototype.onB4MapUnavailable=function(map){if(typeof this._handlerId==="number"){map.removeHandler("onmousemove",this._handlerId);this._handlerId=undefined;}};IONIC.ui.navigation.AbstractCoordField.prototype.setCoordValue=function(v){this.setValue(this.format(+v));};IONIC.ui.navigation.AbstractCoordField.prototype.format=function(inp){return Math.round(inp*1e3)/1e3;};
IONIC.ui.AbstractObjectRenderer=function(){};IONIC.ui.AbstractObjectRenderer.prototype.render=function(parentResultsHandler,object){IONIC.misc.unimp("IONIC.ui.AbstractObjectRenderer","render");};
var Dom=YAHOO.util.Dom;var Event=YAHOO.util.Event;var DDM=YAHOO.util.DragDropMgr;IONIC.ui.LayerListDDEntry=function(id,sGroup,config){IONIC.ui.LayerListDDEntry.superclass.constructor.call(this,id,sGroup,config);this.logger=this.logger||YAHOO;var el=this.getDragEl();Dom.setStyle(el,"opacity",0.67);this.goingUp=false;this.lastY=0;};YAHOO.extend(IONIC.ui.LayerListDDEntry,YAHOO.util.DDProxy,{startDrag:function(x,y){this.logger.log(this.id+" startDrag");var dragEl=this.getDragEl();var clickEl=this.getEl();Dom.setStyle(clickEl,"visibility","hidden");dragEl.innerHTML=clickEl.innerHTML;Dom.setStyle(dragEl,"color",Dom.getStyle(clickEl,"color"));Dom.setStyle(dragEl,"backgroundColor",Dom.getStyle(clickEl,"backgroundColor"));Dom.setStyle(dragEl,"border","2px solid gray");},endDrag:function(e){var srcEl=this.getEl();var proxy=this.getDragEl();Dom.setStyle(proxy,"visibility","");var a=new YAHOO.util.Motion(proxy,{points:{to:Dom.getXY(srcEl)}},0.2,YAHOO.util.Easing.easeOut)
var proxyid=proxy.id;var thisid=this.id;a.onComplete.subscribe(function(){Dom.setStyle(proxyid,"visibility","hidden");Dom.setStyle(thisid,"visibility","");});a.animate();this.config.owner.applyLayersOrder();},onDragDrop:function(e,id){if(DDM.interactionInfo.drop.length===1){var pt=DDM.interactionInfo.point;var region=DDM.interactionInfo.sourceRegion;if(!region.intersect(pt)){var destEl=Dom.get(id);var destDD=DDM.getDDById(id);destEl.appendChild(this.getEl());destDD.isEmpty=false;DDM.refreshCache();}}},onDrag:function(e){var y=Event.getPageY(e);if(ythis.lastY){this.goingUp=false;}
this.lastY=y;},onDragOver:function(e,id){if(isArray(id)){for(var inx=0;inx0&&this._ssld.styles[0]);if(!style){callback(null);return;}
callback(style.iconUrl);};IONIC.maps.LayerLegend.prototype.render=function(){this._dh.clr(this._elt);if(this._isVisible===false||this.getSetting("display")==="none"){return;}
var self=this;var elt=this._dh.elt("div.LayerLegend");var titleTxt=this._dh.txt(this.getSetting("title")||this._ssld.getParentLayerDescriptor().getTitle()||this._ssld.getName());var img=this._dh.elt("img.LayerLegendImg");switch(this.getSetting("titlePosition")){case"none":this._dh.append(elt,img);break;case"right":var title=this._dh.elt("span.Title",titleTxt);this._dh.append(elt,img,title);break;case"left":var title=this._dh.elt("span.Title",titleTxt);this._dh.append(elt,title,img);break;default:var title=this._dh.elt("div.Title",titleTxt);this._dh.append(elt,title,img);break;}
function nextUrl(callback,noMoreProducersCallback){var producer;while((producer=producers.shift())){if(typeof producer==="string"){callback(producer);return;}else{producer.call(self,callback);return;}}
noMoreProducersCallback();}
var producers=this.getSetting("legendProducers").concat([IONIC.api.maps.MapLegend.NOLEGENDURL]);this._dh.append(this._elt,elt);img.onerror=function(event){function setImgUrl(url){if(url){img.src=url;}else{img.onerror(event);}}
nextUrl(setImgUrl,function(){img.onerror=null;});};nextUrl(function(url){img.src=url;});img.onload=function(){img.onload=img.onerror=null;};};IONIC.maps.LayerLegend.prototype.refresh=IONIC.maps.LayerLegend.prototype.render;IONIC.maps.LayerLegend.prototype.destroy=function(){this._ssld.getParentLayerDescriptor().onVisibilityChanged.unsubscribe(this._onVisibilityChangedCallback);this._dh.rmv(this._elt);};
IONIC.maps.ContextSerializationTool=function(window){IONIC.misc.errorInstantiate("IONIC.maps.ContextSerializationTool");};IONIC.maps.ContextSerializationTool.serialize=function(map,saveCredentials){var topObj=IONIC.api.maps.Map.toTransportFormat(map);var str=JSON.stringify(topObj);var transitFrame=IONIC.misc.getTransitFrame(IONIC.maps.ContextSerializationTool);var form=document.createElement("form");form.style.display="none";form.method="post";form.name=gensym("context_serialization_form_");form.target=transitFrame.name;form.enctype="multipart/form-data";form.action=IONIC.misc.getWebappBaseUrl()+"/buildContext.do"+
(saveCredentials?"?saveCredentials="+escape(saveCredentials):"");var jsonText=document.createElement("input");jsonText.type="hidden";jsonText.name="jsonText";jsonText.value=str;form.appendChild(jsonText);document.body.appendChild(form);form.submit();};IONIC.maps.ContextSerializationTool.serializeToString=function(map,callback){var rt=new IONIC.misc.RequestTool();var url=IONIC.misc.getWebappBaseUrl()+"/buildContext.do?outputType=string";rt.withUrl(url,"POST",function(success,obj,responseText){callback(responseText);},JSON.stringify(IONIC.api.maps.Map.toTransportFormat(map)));};IONIC.maps.ContextSerializationTool.withDeserialized=function(form,callback,win,map){win=win||window;var dh=new IONIC.api.ui.DomHelper(win.document);var self=this;IONIC.misc.ajaxifyForm(dh,form,"/extractContext.do",true,function(viewDescriptor){self._loadOrCreateMap(map,win,viewDescriptor,callback);});var extractionMethod=form.extractionMethod;if(!extractionMethod){extractionMethod=dh.elt("input");extractionMethod.type="hidden";extractionMethod.name="extractionMethod";extractionMethod.value="contextfile";dh.append(form,extractionMethod);}
form.submit();};IONIC.maps.ContextSerializationTool.withDeserializedFromString=function(xmlBlob,callback,win,map){var rt=new IONIC.misc.RequestTool();var thisRef=this;var url=IONIC.misc.getWebappBaseUrl()+"/extractContext.do"+"?extractionMethod=handler"+"&handlerClassName=com.ionicsoft.paic.actions.context.HttpServletRequestBodyContextStreamSource";rt.withUrl(url,"POST",function(success,mapDescriptor,response){if(callback){thisRef._loadOrCreateMap(map,win,mapDescriptor,callback);}},xmlBlob);};IONIC.maps.ContextSerializationTool._loadOrCreateMap=function(map,win,descriptor,callback){if(!descriptor){throw"Woops! The object that was returned by the server does not appear to be a view descriptor..";}
var view;var proceed=function(){if(callback){callback(view);}};if(map){view=map;view.loadMapFromDescriptor(descriptor,proceed);}else{view=IONIC.api.maps.Map.fromTransportFormat(descriptor,win,null,proceed);}};
IONIC.defns("maps");IONIC.maps.BoxNegociatorsQueue=function(){this.negociators=[];};IONIC.maps.BoxNegociatorsQueue.prototype.insertAt=function(negociator,position){var list=this.getNegociators();if(position>list.length){throw"Illegal state: Cannot insert box negociator at out-of-bounds position "+position;}
list.splice(position,0,negociator);};IONIC.maps.BoxNegociatorsQueue.prototype.forEachNegociator=function(fun){IONIC.misc.forEach(fun,this.getNegociators());};IONIC.maps.BoxNegociatorsQueue.prototype.getNegociators=function(){return this.negociators;};IONIC.maps.BoxNegociatorsQueue.prototype.remove=function(negociator){var list=this.getNegociators();var data=IONIC.misc.findItem(negociator,list);if(data){list.splice(data[1],1);}};IONIC.maps.BoxNegociatorsQueue.prototype.withNegociatedBox=function(input,prevBox,map,proceed){var self=this;var negociators=this.getNegociators().slice();var iteratr=function(currentBox){var curNeg=negociators.shift();if(curNeg){curNeg.withNegociatedBox(currentBox,prevBox,map,iteratr);}else{proceed(currentBox);}};iteratr(input);};
IONIC.maps.AbstractBoxNegociator=function(){};IONIC.maps.AbstractBoxNegociator.prototype.toString=function(){return"IONIC.maps.AbstractBoxNegociator";};IONIC.maps.AbstractBoxNegociator.prototype.withNegociatedBox=function(input,prevBox,view,proceed){proceed(input);};IONIC.maps.AbstractBoxNegociator.prototype.findPreferredPositionInQueue=function(queue){return queue.getNegociators().length;};
IONIC.maps.SimpleBoxNegociator=function(){IONIC.maps.AbstractBoxNegociator.call(this);this.setAspect(1.0);};IONIC.misc.extendType(IONIC.maps.SimpleBoxNegociator,IONIC.maps.AbstractBoxNegociator);IONIC.maps.SimpleBoxNegociator.prototype.setAspect=function(aspect){this.aspect=aspect;};IONIC.maps.SimpleBoxNegociator.prototype.getAspect=function(){return this.aspect;};IONIC.maps.SimpleBoxNegociator.prototype.toString=function(){return"IONIC.maps.SimpleBoxNegociator";};IONIC.maps.SimpleBoxNegociator.prototype.withNegociatedBox=function(input,prevBox,map,proceed){var conb=this.getConstrainedBox();var offx=0,offy=0;if(conb){if(conb.epsgId!=input.epsgId){}else{if(input.minxconb.maxx){offx=conb.maxx-input.maxx;}
if(input.maxy>conb.maxy){offy=conb.maxy-input.maxy;}
if(offx||offy){input.shift(offx,offy);}
if(input.minx0.0001){if(dxBox>dyBox){output=new IONIC.api.geom.Box(input.minx,center.y-((dxBox/2)*ratioPxl),input.maxx,center.y+((dxBox/2)*ratioPxl),input.epsgId);}else{output=new IONIC.api.geom.Box(center.x-((dyBox/2)/ratioPxl),input.miny,center.x+((dyBox/2)/ratioPxl),input.maxy,input.epsgId);}}else{output=input;}
proceed(output);};IONIC.maps.SimpleBoxNegociator.prototype.getConstrainedBox=function(){return this._constrBox;};IONIC.maps.SimpleBoxNegociator.prototype.setConstrainedBox=function(box){this._constrBox=box;};
IONIC.maps.GridBoxNegociator=function(grids){IONIC.maps.AbstractBoxNegociator.call(this);this._gs=grids;};IONIC.misc.extendType(IONIC.maps.GridBoxNegociator,IONIC.maps.AbstractBoxNegociator);IONIC.maps.GridBoxNegociator.prototype.getGridsDescriptions=function(){return this._gs;};IONIC.maps.GridBoxNegociator.prototype.forEachGridDescription=function(fun){IONIC.misc.forEach(fun,this.getGridsDescriptions());};IONIC.maps.GridBoxNegociator.GridDesc=function(dxpp,dypp,informativeScale){this.dxpp=dxpp;this.dypp=dypp;this.informativeScale=informativeScale;};IONIC.maps.GridBoxNegociator.GridDesc.prototype.getAspect=function(){return this.dypp/this.dxpp;};IONIC.maps.GridBoxNegociator.prototype.withNegociatedBox=function(input,prevBox,view,proceed){var i,n,rsx,rsy,_x,_y,center,newBox;var width=view.getWidth();var height=view.getHeight();var grids=this.getGridsDescriptions();var dx=input.diffX();var dy=input.diffY();var rrx=dx/width;var rry=dy/height;var curGrid,curGridRatioDist;var curGridScale,curGridRatioX,curGridRatioY;var careForX=rrx>=rry;var foundGrid,foundGridRatioDist;for(i=0,n=grids.length;i0?" type=\"text/vbscript\"":"")+" src=\"",(path+"/"+file),"\"",">","","script",">\n");}
var inclStr=includes.join("");document.write(inclStr);})();
IONIC.maps.AbstractLayerDescriptor=function(){this.uuid=gensym("uuid");this.opacity=1.0;this.visibilityBits={};this.whenInitializedQueue=[];this.webappBaseURL=IONIC.misc.getWebappBaseUrl();IONIC.misc.createCustomEvents(this.getCustomEventsNames(),this);this.setUserVisibility(true);};IONIC.maps.AbstractLayerDescriptor.customEventsNames=["onLoading","onLoadingDone","onLoadingError","onVisibilityChanged","onOpacityChanged","onAttributeChanged"];IONIC.maps.AbstractLayerDescriptor.prototype.getView=function(){return this.map;};IONIC.maps.AbstractLayerDescriptor.prototype.getMap=function(){return this.getView();};IONIC.maps.AbstractLayerDescriptor.prototype.getCustomEventsNames=function(){return IONIC.maps.AbstractLayerDescriptor.customEventsNames.slice();};IONIC.maps.AbstractLayerDescriptor.prototype.isBasemap=function(){return false;};IONIC.maps.AbstractLayerDescriptor.prototype.getBoundingBox=function(){};IONIC.maps.AbstractLayerDescriptor.prototype.setView=function(v){this.setMap();};IONIC.maps.AbstractLayerDescriptor.prototype.attachToMap=function(map){var htmlLayer=this.produceHTMLLayer();if(htmlLayer){this.setHTMLLayer(htmlLayer);map.getHTMLView().appendChild(htmlLayer);}};IONIC.maps.AbstractLayerDescriptor.prototype.detachFromMap=function(map){var htmlLayer=this.getHTMLLayer();var htmlView=map.getHTMLView();if(htmlLayer&&htmlLayer.parentNode===htmlView){htmlView.removeChild(htmlLayer);}};IONIC.maps.AbstractLayerDescriptor.prototype.destroy=function(domHelper){if(this.getMap()){throw"Illegal state: IONIC.maps.AbstractLayerDescriptor.prototype.destroy() was called but the layer still refers the map";}
var htmlLayer=this.getHTMLLayer();if(htmlLayer){domHelper.purge(htmlLayer);this.setHTMLLayer(null);}};IONIC.maps.AbstractLayerDescriptor.prototype.setMap=function(map){this.map=map;};IONIC.maps.AbstractLayerDescriptor.prototype.refresh=function(mapRequest){if(mapRequest){mapRequest.layerLoaded(this);}};IONIC.maps.AbstractLayerDescriptor.prototype.setIntermediateBox=function(box,mapBox,zoomPoint){};IONIC.maps.AbstractLayerDescriptor.prototype.onMapDragStart=function(){};IONIC.maps.AbstractLayerDescriptor.prototype.onMapDragEnd=function(){};IONIC.maps.AbstractLayerDescriptor.prototype.mapFullyRefreshed=function(){};IONIC.maps.AbstractLayerDescriptor.prototype.mapResized=function(width,height){};IONIC.maps.AbstractLayerDescriptor.prototype.mapScaleComputed=function(scale){};IONIC.maps.AbstractLayerDescriptor.prototype.toString=function(){return"Layer ("+this.uuid+")";};IONIC.maps.AbstractLayerDescriptor.prototype.isNativelySupportedSrs=function(epsgId){return true;};IONIC.maps.AbstractLayerDescriptor.prototype.getHTMLLayer=function(){return this.htmlLayer;};IONIC.maps.AbstractLayerDescriptor.prototype.produceHTMLLayer=function(){};IONIC.maps.AbstractLayerDescriptor.prototype.setHTMLLayer=function(layer){this.htmlLayer=layer;};IONIC.maps.AbstractLayerDescriptor.prototype.shift=function(shiftx,shifty){var view=this.getView();var htmlLayer=this.getHTMLLayer();if(htmlLayer){htmlLayer.style.left=shiftx+'px';htmlLayer.style.top=shifty+'px';}};IONIC.maps.AbstractLayerDescriptor.prototype.endDrag=function(){};IONIC.maps.AbstractLayerDescriptor.prototype.getScaleRangeVisibility=function(){return this.getScaleVisibility();};IONIC.maps.AbstractLayerDescriptor.prototype.getScaleVisibility=function(){if(!this.getView()){return true;}
return this.isVisibleAtScale(this.getView().getComputedScale());};IONIC.maps.AbstractLayerDescriptor.prototype.isVisibleAtScale=function(scale){return true;};IONIC.maps.AbstractLayerDescriptor.prototype.getVisibility=function(){var id,bits=this.visibilityBits,vis=true;for(id in bits){if(bits.hasOwnProperty(id)){vis=vis&&bits[id];}}
return vis&&this.getScaleVisibility();};IONIC.maps.AbstractLayerDescriptor.USER_VISIBILITY_BIT="user";IONIC.maps.AbstractLayerDescriptor.prototype.toggleUserVisibility=function(){this.setUserVisibility(!this.getUserVisibility());};IONIC.maps.AbstractLayerDescriptor.prototype.setUserVisibility=function(flag){this.setVisibilityBit(IONIC.maps.AbstractLayerDescriptor.USER_VISIBILITY_BIT,flag);var map=this.getMap();var curSrsBox,htmlLayer;if(map){htmlLayer=this.getHTMLLayer();if(htmlLayer){this.setHTMLLayerVisibility(this.getVisibility());}}};IONIC.maps.AbstractLayerDescriptor.prototype.getUserVisibility=function(){return this.getVisibilityBit(IONIC.maps.AbstractLayerDescriptor.USER_VISIBILITY_BIT);};IONIC.maps.AbstractLayerDescriptor.prototype.setVisibilityBit=function(bit,value){this.visibilityBits[bit]=!!value;this.fireVisibilityChanged();};IONIC.maps.AbstractLayerDescriptor.prototype.getVisibilityBit=function(bit){return this.visibilityBits[bit];};IONIC.maps.AbstractLayerDescriptor.prototype.fireVisibilityChanged=function(){this.onVisibilityChanged.fire(this.getVisibility(),this.getUserVisibility(),this.getScaleVisibility());};IONIC.maps.AbstractLayerDescriptor.prototype.setHTMLLayerVisibility=function(flag){var l=this.getHTMLLayer();var cur;var wanted;if(l){cur=l.style.visibility;wanted=(flag===true)?"visible":"hidden";if(cur!==wanted){l.style.visibility=wanted;}}};IONIC.maps.AbstractLayerDescriptor.prototype.setOpacity=function(factor){factor=Math.max(0.0,Math.min(factor,1.0));var view,htmlLayer;if(this.opacity!=factor){this.opacity=factor;this.setHTMLLayerOpacity(factor);this.onOpacityChanged.fire(factor);}};IONIC.maps.AbstractLayerDescriptor.prototype.getOpacity=function(){return this.opacity;};IONIC.maps.AbstractLayerDescriptor.prototype.setHTMLLayerOpacity=function(factor){var l=this.getHTMLLayer();if(l){IONIC.misc.setElementOpacity(l,factor);}};IONIC.maps.AbstractLayerDescriptor.prototype.setBoxNegociator=function(boxNegociator){this.boxNegociator=boxNegociator;};IONIC.maps.AbstractLayerDescriptor.prototype.getBoxNegociator=function(){return this.boxNegociator;};IONIC.maps.AbstractLayerDescriptor.prototype.isLayerInitializing=function(){return!!this.initializing;};IONIC.maps.AbstractLayerDescriptor.prototype.setLayerInitializing=function(state){var self;var prevState=this.initializing;this.initializing=state;if(typeof prevState==="boolean"){if(prevState===true){if(state===false){self=this;IONIC.misc.forEach(function(callback){callback(self);},this.getInitializedCallbacksQueue());this.setInitializedCallbacksQueue([]);}}else{if(state===true){throw"Illegal state: A layer that was done initializing cannot start initialization again";}}}};IONIC.maps.AbstractLayerDescriptor.prototype.withInitializedLayer=function(fun){if(this.isLayerInitializing()){this.getInitializedCallbacksQueue().push(fun);}else{fun(this);}};IONIC.maps.AbstractLayerDescriptor.prototype.getInitializedCallbacksQueue=function(){return this.whenInitializedQueue;};IONIC.maps.AbstractLayerDescriptor.prototype.setInitializedCallbacksQueue=function(queue){this.whenInitializedQueue=queue;};
IONIC.maps.AbstractMapLayerDescriptor=function(){IONIC.maps.AbstractLayerDescriptor.call(this);this.title="";this.userSelected=false;this.ssLayers=[];};IONIC.misc.extendType(IONIC.maps.AbstractMapLayerDescriptor,IONIC.maps.AbstractLayerDescriptor);IONIC.maps.AbstractMapLayerDescriptor.prototype.setTitle=function(title){this.title=title;};IONIC.maps.AbstractMapLayerDescriptor.prototype.getTitle=function(){return this.title;};IONIC.maps.AbstractMapLayerDescriptor.prototype.isBasemap=function(){return true;};IONIC.maps.AbstractMapLayerDescriptor.prototype.getServiceType=function(){var ss0=this.getServerSideLayers()[0];if(ss0){return ss0.getServiceType();}};IONIC.maps.AbstractMapLayerDescriptor.prototype.isUserVisibilityChangeAllowed=function(){return false;};IONIC.maps.AbstractMapLayerDescriptor.prototype.hasMetadata=function(){return false;};IONIC.maps.AbstractMapLayerDescriptor.prototype.isUserSelectable=function(){return true;};IONIC.maps.AbstractMapLayerDescriptor.prototype.isUserSelected=function(){return this.userSelected;};IONIC.maps.AbstractMapLayerDescriptor.prototype.setUserSelected=function(flag){this.userSelected=flag;};IONIC.maps.AbstractMapLayerDescriptor.prototype.toggleUserSelected=function(){this.setUserSelected(!this.isUserSelected());};IONIC.maps.AbstractMapLayerDescriptor.prototype.positionChanged=function(){};IONIC.maps.AbstractMapLayerDescriptor.prototype.supportsReprojecting=function(){IONIC.misc.unimp("IONIC.maps.AbstractMapLayerDescriptor","supportsReprojecting");};IONIC.maps.AbstractMapLayerDescriptor.prototype.isRemovable=function(){return true;};IONIC.maps.AbstractMapLayerDescriptor.prototype.mapScaleComputed=function(scale){this.setHTMLLayerVisibility(this.getVisibility());};IONIC.maps.AbstractMapLayerDescriptor.prototype.mapResized=function(width,height){var l=this.getHTMLLayer(),s;if(l){l.width=width;l.height=height;s=l.style;if(s){s.width=width+"px";s.height=height+"px";}}};IONIC.maps.AbstractMapLayerDescriptor.prototype.featureSetChanged=function(url,name,namespace,ids){};IONIC.maps.AbstractMapLayerDescriptor.prototype.supportsPreviewing=function(){return false;};IONIC.maps.AbstractMapLayerDescriptor.prototype.forEachServerSideLayer=function(callback){for(var i=0,n=this.getServerSideLayers().length;i0){finalEnv=cs[0].getEnvelope();}
for(i=1,n=cs.length;i0){e=true;break;}}
if(e){throw"Cannot get child for insertion with pointer #"+ptr;}else{c=this.createChild(this.epsgId);this.pushChild(c);}}
return c;};IONIC.geom.CCG.prototype.createChild=function(epsgId){throw this+" does not override createChild(). It should.";};IONIC.geom.CCG.prototype.insertPointAt=function(ptr,pt){var c;if(ptr.length>1){c=this._getChild4Insert(ptr);c.insertPointAt(ptr.slice(1),pt);}else{throw"Should never have come here!";}};IONIC.geom.CCG.prototype.getPointAt=function(ptr){var cn=ptr[0];var c=this._directChild4Ptr(ptr,true,"getPointAt");return c.getPointAt(ptr.slice(1));};IONIC.geom.CCG.prototype.deletePointAt=function(ptr,autodel){var cn=ptr[0];var c=this._directChild4Ptr(ptr,true,"deletePointAt");c.deletePointAt(ptr.slice(1),autodel);if(autodel&&!c.countVertices()){this.removeChild(cn);}};IONIC.geom.CCG.prototype.removeChild=function(i){var cn,c;if(typeof i==="number"){cn=this.countChildren();if(i>=cn){throw"Trying to remove geometry #"+i+" out of a composed geometry consisting of "+
cn+" children";}
return this._c.splice(i,1);}else{switch(i.length){case 2:this.removeChild(i[0]);break;case 3:c=this._directChild4Ptr(i,true,"removeChild");c.removeChild(i.slice(1));break;default:throw"Unexpected pointer for removeChild(): "+i;}}};IONIC.geom.CCG.prototype.setPointAt=function(ptr,pt){var cn=ptr[0];var c=this._directChild4Ptr(ptr,true,"setPointAt");c.setPointAt(ptr.slice(1),pt);};IONIC.geom.CCG.prototype.getStartPointer=function(){throw this+" does not override getStartPointer(). It should.";};IONIC.geom.CCG.prototype.getEndPointer=function(){var cc=this.countChildren();var lc=cc-1;if(lc<0){return this.getStartPointer();}else{return[lc].concat(this.getChild(lc).getEndPointer());}};IONIC.geom.CCG.prototype.vertexIdxToPointer=function(idx){var i,n,cc,ccn;for(i=0,n=this.countChildren();i2?c.pointerToVertexIdx(ptr.slice(1)):ptr[1];var total=0;for(var i=0;i1&&c){c=c._directChild4Ptr(ptr,ex,"getCurveForPointer");ptr=ptr.slice(1);}
return c;};IONIC.geom.CCG.prototype.getCurveEndPointer=function(ptr){var cn=ptr[0];var c=this._directChild4Ptr(ptr,true,"getCurveEndPointer");if(ptr.length>2){return[cn].concat(c.getCurveEndPointer(ptr.slice(1)));}else{return[cn].concat(c.getCurveEndPointer());}};IONIC.geom.CCG.prototype.forEachPair=function(fun){this.doForEachPair(fun);};IONIC.geom.CCG.prototype.doForEachPair=function(fun,parentPtr){parentPtr=(parentPtr?parentPtr.concat([0]):[0]);this.forEachChild(function(child){child.doForEachPair(fun,parentPtr);parentPtr[parentPtr.length-1]++;});};
IONIC.geom.GeometryTypes=function(){throw"The GeometryTypes type is not meant to be instanciated.";};IONIC.geom.GeometryTypes.TYPE_POINT=0xbeadfeed;IONIC.geom.GeometryTypes.TYPE_BOX=0xdeadbeef;IONIC.geom.GeometryTypes.TYPE_MULTIPOINT=0xdeaffade;IONIC.geom.GeometryTypes.TYPE_MULTI_LINE_STRING=0xdaddadee;IONIC.geom.GeometryTypes.TYPE_LINE_STRING=0xfadebedd;IONIC.geom.GeometryTypes.TYPE_LINEAR_RING=0xfaadbade;IONIC.geom.GeometryTypes.TYPE_POLYGON=0x000decaf;IONIC.geom.GeometryTypes.TYPE_MULTIPOLYGON=0x00dadada;IONIC.geom.GeometryTypes.get=function(geomData){if(geomData._tp){return geomData._tp;}
var t;if(geomData instanceof IONIC.api.geom.Box){t=IONIC.geom.GeometryTypes.TYPE_BOX;}
else if(geomData instanceof IONIC.api.geom.Point){t=IONIC.geom.GeometryTypes.TYPE_POINT;}
else if(geomData instanceof IONIC.api.geom.Polygon){t=IONIC.geom.GeometryTypes.TYPE_POLYGON;}
else if(geomData instanceof IONIC.api.geom.MultiPolygon){t=IONIC.geom.GeometryTypes.TYPE_MULTIPOLYGON;}
else if(geomData instanceof IONIC.api.geom.MultiLineString){t=IONIC.geom.GeometryTypes.TYPE_MULTI_LINE_STRING;}
else if(geomData instanceof IONIC.api.geom.LineString){t=IONIC.geom.GeometryTypes.TYPE_LINE_STRING;}
else if(geomData instanceof IONIC.api.geom.MultiPoint){t=IONIC.geom.GeometryTypes.TYPE_MULTIPOINT;}
else{throw"Unrecognized geometry type: "+geomData;}
geomData._tp=t;return t;}
IONIC.geom.JGTFTool=function(){IONIC.misc.errorInstantiate("IONIC.geom.JGTFTool");};IONIC.geom.JGTFTool.TYPES_MAP={"point":IONIC.geom.GeometryTypes.TYPE_POINT,"box":IONIC.geom.GeometryTypes.TYPE_BOX,"multipoint":IONIC.geom.GeometryTypes.TYPE_MULTIPOINT,"linestring":IONIC.geom.GeometryTypes.TYPE_LINE_STRING,"multilinestring":IONIC.geom.GeometryTypes.TYPE_MULTI_LINE_STRING,"linearring":IONIC.geom.GeometryTypes.TYPE_LINEAR_RING,"polygon":IONIC.geom.GeometryTypes.TYPE_POLYGON,"multipolygon":IONIC.geom.GeometryTypes.TYPE_MULTIPOLYGON};IONIC.geom.JGTFTool.typeStringToType=function(ts){return IONIC.geom.JGTFTool.TYPES_MAP[ts];};IONIC.geom.JGTFTool.typeToTypeString=function(type){var tm=IONIC.geom.JGTFTool.TYPES_MAP;for(var id in tm){if(tm.hasOwnProperty(id)){if(tm[id]==type){return id;}}}};IONIC.geom.JGTFTool.COMPRESSION_NORMAL=1<<0;IONIC.geom.JGTFTool.geometryToJGTF=function(geomData,cardinality,compression){if(typeof cardinality==="undefined"){cardinality=2;}
if(typeof compression==="undefined"){compression=IONIC.geom.JGTFTool.COMPRESSION_NORMAL;}
if(cardinality!=2){throw"Can only write in 2D data";}
if(compression!=IONIC.geom.JGTFTool.COMPRESSION_NORMAL){throw"Unknown compression mode: "+compression;}
var type=IONIC.geom.GeometryTypes.get(geomData);var data;var epsgId=geomData.epsgId;switch(type){case IONIC.geom.GeometryTypes.TYPE_POINT:data=[geomData.x,geomData.y];break;case IONIC.geom.GeometryTypes.TYPE_BOX:data=[geomData.minx,geomData.miny,geomData.maxx,geomData.maxy];break;case IONIC.geom.GeometryTypes.TYPE_LINE_STRING:case IONIC.geom.GeometryTypes.TYPE_MULTIPOINT:data=geomData.points.slice();data.arrayOfDoubles=true;break;case IONIC.geom.GeometryTypes.TYPE_MULTI_LINE_STRING:data=IONIC.geom.JGTFTool._extractMultiLineStringPts(geomData);break;case IONIC.geom.GeometryTypes.TYPE_POLYGON:data=IONIC.geom.JGTFTool._extractPolygonPts(geomData);break;case IONIC.geom.GeometryTypes.TYPE_MULTIPOLYGON:data=[];var cs=geomData.getChildren();for(var i=0;imaxx?x:maxx;maxy=y>maxy?y:maxy;}
this.envelope=IONIC.api.geom.Box.newInstance(minx,miny,maxx,maxy,this.epsgId);}
return this.envelope;};IONIC.geom.edit.Chunk.prototype.forEachSegment=function(callback){if(this.pointCount<2){return;}
switch(this.geometryType){case IONIC.geom.GeometryTypes.TYPE_MULTI_LINE_STRING:case IONIC.geom.GeometryTypes.TYPE_LINE_STRING:case IONIC.geom.GeometryTypes.TYPE_POLYGON:case IONIC.geom.GeometryTypes.TYPE_MULTIPOLYGON:var n=this.pointCount-1;for(var i=0;i=ptCount){upperBound=ptCount;lowerBound=Math.max(0,upperBound-chunkSize);}}
if(lowerBound<0){pts=curve.getPoints(ptCount+lowerBound,ptCount).concat(curve.getPoints(0,upperBound));IONIC.geom.edit.Chunk._addIndicesAndPointers
(idxs,ptrs,curveStartIdxInGeom,curveStartPtrInGeom,ptCount+lowerBound,ptCount);IONIC.geom.edit.Chunk._addIndicesAndPointers
(idxs,ptrs,curveStartIdxInGeom,curveStartPtrInGeom,0,upperBound);}else if(upperBound>ptCount){pts=curve.getPoints(lowerBound,ptCount).concat(curve.getPoints(0,(upperBound-ptCount)+1));IONIC.geom.edit.Chunk._addIndicesAndPointers
(idxs,ptrs,curveStartIdxInGeom,curveStartPtrInGeom,lowerBound,ptCount);IONIC.geom.edit.Chunk._addIndicesAndPointers
(idxs,ptrs,curveStartIdxInGeom,curveStartPtrInGeom,0,(upperBound-ptCount));}else{pts=curve.getPoints(lowerBound,upperBound);IONIC.geom.edit.Chunk._addIndicesAndPointers
(idxs,ptrs,curveStartIdxInGeom,curveStartPtrInGeom,lowerBound,upperBound);}}
return new IONIC.geom.edit.Chunk(pts,idxs,ptrs,type,epsgId,chunkSize,curveStartPtrInGeom,null,wholeRing,requestedPointer,IONIC.geom.edit.GeometryPointer.set(requestedPointer,0,idxInCurve));};
IONIC.geom.edit.GeometryEditionBuffer=function(verticesFetcher,verticesProvider){this.verticesFetcher=verticesFetcher;this.verticesProvider=verticesProvider;};IONIC.geom.edit.GeometryEditionBuffer.newInstance=function(verticesFetcher,verticesProvider){return new IONIC.geom.edit.GeometryEditionBuffer(verticesFetcher,verticesProvider);};IONIC.geom.edit.GeometryEditionBuffer.prototype.getGeometryType=function(){return this.verticesFetcher.getGeometryType();};IONIC.geom.edit.GeometryEditionBuffer.prototype.findNearestPointerInfo=function(point){return this.verticesFetcher.findNearestPointerInfo(point);};IONIC.geom.edit.GeometryEditionBuffer.prototype.getCurrentChunk=function(){return this.verticesProvider.getCurrentChunk();};IONIC.geom.edit.GeometryEditionBuffer.prototype.selectChunkForPointer=function(ptr){return this.verticesProvider.selectChunkForPointer(ptr);};IONIC.geom.edit.GeometryEditionBuffer.prototype.hasNextChunk=function(){return this.verticesProvider.hasNextChunk(this);};IONIC.geom.edit.GeometryEditionBuffer.prototype.hasPreviousChunk=function(){return this.verticesProvider.hasPreviousChunk(this);};IONIC.geom.edit.GeometryEditionBuffer.prototype.getGeometryObject=function(){return this.verticesFetcher.getGeometryObject();};IONIC.geom.edit.GeometryEditionBuffer.prototype.setGeometryObject=function(geom,ptrOfInterest){return this.verticesFetcher.setGeometryObject(geom,ptrOfInterest);};
IONIC.geom.edit.GeometryPointer=function(){throw"The IONIC.geom.edit.GeometryPointer type is static and is not meant to be instanciated.";};IONIC.geom.edit.GeometryPointer.copy=function(p){return p.slice();};IONIC.geom.edit.GeometryPointer.add=function(p0,p1){var pCopy=p0.slice();if(typeof p1!=="number"){throw"Cannot YET add non-number to multi-dimensional pointer";}
pCopy[pCopy.length-1]+=p1;return pCopy;};IONIC.geom.edit.GeometryPointer.set=function(p,rank,value){var pc;if(rank<\/div>';};jsGraphics.prototype.drawEditableGeometryVertex=function(x,y,w,h,zIndex,geometryIdx,pointer,vertexIdInGeom,mapViewId,layerDesignator,onMouseClickHandlerName,onMouseDownHandlerName,onMouseUpHandlerName,noVtxIdx){this.mkVertexDiv(x,y,w,h,zIndex,geometryIdx,pointer,mapViewId,layerDesignator,onMouseClickHandlerName,onMouseDownHandlerName,onMouseUpHandlerName);if(!noVtxIdx){var oldColor=this.getColor();this.setColor("#000000");this.setFont('verdana,geneva,helvetica,sans-serif',String.fromCharCode(0x30,0x39,0x70,0x78),Font.PLAIN);this.drawString(vertexIdInGeom,x,y+(h/2));this.setColor(oldColor);}};
IONIC.defns("feature");IONIC.feature.WFSInfoTool=function(){IONIC.misc.errorInstantiate("IONIC.feature.WFSInfoTool");};IONIC.feature.WFSInfoTool.ServiceInfo=function(url,insertOp,updateOp,deleteOp){this._url=url;this._ins=insertOp;this._upd=updateOp;this._del=deleteOp;};IONIC.feature.WFSInfoTool.ServiceInfo.prototype.getServiceUrl=function(){return this._url;};IONIC.feature.WFSInfoTool.ServiceInfo.prototype.supportsInsert=function(){return!!this._ins;};IONIC.feature.WFSInfoTool.ServiceInfo.prototype.supportsUpdate=function(){return!!this._upd;};IONIC.feature.WFSInfoTool.ServiceInfo.prototype.supportsDelete=function(){return!!this._del;};IONIC.feature.WFSInfoTool.ServiceInfo.prototype.isTransactional=function(){return this.supportsInsert()||this.supportsUpdate()||this.supportsDelete();};IONIC.feature.WFSInfoTool.ServiceInfo.fromTransportFormat=function(tfsi){return new IONIC.feature.WFSInfoTool.ServiceInfo(tfsi.url,tfsi.insertOp,tfsi.updateOp,tfsi.deleteOp);};IONIC.feature.WFSInfoTool._RT=new IONIC.misc.RequestTool();IONIC.feature.WFSInfoTool.withServiceInfo=function(url,callback){if(!callback){return;}
var fullUrl=IONIC.misc.getWebappBaseUrl()+"/wfsInfo.do"+"?serverUrl="+escape(url);IONIC.feature.WFSInfoTool._RT.withUrl(fullUrl,"GET",function(success,obj){if(success){callback(IONIC.feature.WFSInfoTool.ServiceInfo.fromTransportFormat(obj));}});};
IONIC.feature.FeaturePanelConfig=function(name,ns){this.name=name;this.ns=ns;this.properties=[];};IONIC.feature.FeaturePanelConfig._RT=IONIC.misc.RequestTool.newInstance();IONIC.feature.FeaturePanelConfig._pool=[];IONIC.feature.FeaturePanelConfig._getGetPanelConfigurationUrl=function(name,ns,featureServerUrl){return IONIC.misc.getWebappBaseUrl()+"/getFeaturePanelConfig.do"+"?featureTypeName="+escape(name)+"&featureTypeNamespace="+escape(ns)+"&serverUrl="+escape(featureServerUrl)+"&sourceType="+escape("FeatureServer");}
IONIC.feature.FeaturePanelConfig.withFeaturePanelConfig=function(name,ns,featureServerUrl,callback){var cacheConfig=IONIC.feature.FeaturePanelConfig._getFeaturePanelConfigFromPool(name,ns);if(cacheConfig){return callback(true,cacheConfig);}
var url=IONIC.feature.FeaturePanelConfig._getGetPanelConfigurationUrl(name,ns,featureServerUrl);var putInPool=function(success,config){IONIC.feature.FeaturePanelConfig._pool.push(config);callback(success,config);};IONIC.feature.FeaturePanelConfig._RT._withUrl(url,"GET",function(success,config){putInPool(success,IONIC.feature.FeaturePanelConfig.fromTransportFormat(name,ns,config));});};IONIC.feature.FeaturePanelConfig._getFeaturePanelConfigFromPool=function(name,namespace){var found=IONIC.misc.findItem(null,IONIC.feature.FeaturePanelConfig._pool,function(unused,poolConfig){return(poolConfig.getName()===name&&poolConfig.getNamespace()===namespace);});if(found){return found[0];}
return null;};IONIC.feature.FeaturePanelConfig.prototype._getPropertyConfig=function(name,ns){var prop;for(var i=0,n=this.properties.length;i=0){saveDescriptor.maxNbFeatures=maxNbFeatures;}
IONIC.feature.DataManager.getForm(saveDescriptor).submit();};IONIC.feature.DataManager.getForm=function(saveDescriptor){var form,jsonText,trampolineName,jsCallbackErrorCode;if(!IONIC.feature.DataManager._form){form=document.createElement("form");form.style.display="none";form.method="post";form.name=gensym("data_manager_form_");form.target=IONIC.misc.getTransitFrame(IONIC.feature.DataManager).name;form.enctype="multipart/form-data";form.action=IONIC.misc.getWebappBaseUrl()+"/downloadFeatureData.do";jsonText=document.createElement("input");jsonText.type="hidden";jsonText.name="jsonText";form.appendChild(jsonText);IONIC.feature.DataManager._form_jsonText=jsonText;trampolineName=gensym("trampolineDataManager");top[trampolineName]=function(object){alert('Error: '+object.errorMessage+'. '+object.stackTrace);};jsCallbackErrorCode=document.createElement("input");jsCallbackErrorCode.type="hidden";jsCallbackErrorCode.name="jsCallbackErrorCode";jsCallbackErrorCode.value="function (object) {\n"+" top ['"+trampolineName+"'] (object);\n}";form.appendChild(jsCallbackErrorCode);document.body.appendChild(form);IONIC.feature.DataManager._form=form;}
IONIC.feature.DataManager._form_jsonText.value=JSON.stringify(saveDescriptor);return IONIC.feature.DataManager._form;};
IONIC.feature.FilterDef=function(){IONIC.misc.errorInstantiate("FilterDef");};IONIC.feature.FilterDef.OGC_FILTER="ogcFilter";IONIC.feature.FilterDef.PROPERTIES_FILTER="properties";IONIC.feature.FilterDef.OUTPROPERTIES_FILTER="outproperties";IONIC.feature.FilterDef.IDS_ENTRY="ids";IONIC.feature.FilterDef.EXPR_ENTRY="expr";IONIC.feature.FilterDef.OP_LOG_OR="or";IONIC.feature.FilterDef.OP_LOG_AND="and";IONIC.feature.FilterDef.OP_LOG_NOT="not";IONIC.feature.FilterDef.OP_SPAT_EQUAL="sp_eql";IONIC.feature.FilterDef.OP_SPAT_DISJOINT="sp_disjoint";IONIC.feature.FilterDef.OP_SPAT_TOUCHES="sp_touches";IONIC.feature.FilterDef.OP_SPAT_WITHIN="sp_within";IONIC.feature.FilterDef.OP_SPAT_OVERLAPS="sp_overlaps";IONIC.feature.FilterDef.OP_SPAT_CROSSES="sp_crosses";IONIC.feature.FilterDef.OP_SPAT_INTERSECTS="sp_intersects";IONIC.feature.FilterDef.OP_SPAT_CONTAINS="sp_contains";IONIC.feature.FilterDef.OP_SPAT_DWITHIN="sp_dwithin";IONIC.feature.FilterDef.OP_SPAT_BEYOND="sp_beyond";IONIC.feature.FilterDef.OP_SPAT_BBOX="sp_bbox";IONIC.feature.FilterDef.OP_COMP_EQUAL="==";IONIC.feature.FilterDef.OP_COMP_NOT_EQUAL="!=";IONIC.feature.FilterDef.OP_COMP_LESS="<";IONIC.feature.FilterDef.OP_COMP_GREATER=">";IONIC.feature.FilterDef.OP_COMP_LESSOE="<=";IONIC.feature.FilterDef.OP_COMP_GREATEROE=">=";IONIC.feature.FilterDef.OP_COMP_LIKE="like";IONIC.feature.FilterDef.OP_COMP_NULL="isnull";IONIC.feature.FilterDef.OP_COMP_BETWEEN="isbetween";IONIC.feature.FilterDef.OP_FUNCTION="function";IONIC.feature.FilterDef.FUNCTION_PARAM_TYPE_GEOMETRY="geometry";IONIC.feature.FilterDef.FUNCTION_PARAM_TYPE_STRING="string";IONIC.feature.FilterDef.FUNCTION_PARAM_TYPE_PROPERTY="property";
IONIC.feature.FeatureEditionTool=function(serverUrl,featureName,featureNamespace){IONIC.misc.RequestTool.call(this);this.serverUrl=serverUrl;this.featureName=featureName;this.featureNamespace=featureNamespace;var myAn={};var pubAn=IONIC.feature.FeatureEditionTool.DEFAULT_ACTION_PATHS;for(var id in pubAn){if(pubAn.hasOwnProperty(id)){myAn[id]=pubAn[id];}}
this._actionNames=myAn;};IONIC.misc.extendType(IONIC.feature.FeatureEditionTool,IONIC.misc.RequestTool);IONIC.feature.FeatureEditionTool.newInstance=function(serverUrl,featureName,featureNamespace){return new IONIC.feature.FeatureEditionTool(serverUrl,featureName,featureNamespace);};IONIC.feature.FeatureEditionTool.DEFAULT_ACTION_PATHS={"getFeatures":"getFeatures","newFeature":"createFeature","selectFeature":"selectFeature","updateFeature":"updateFeature","deleteFeature":"deleteFeature","releaseFeature":"releaseFeature","fetchSatelliteGeometries":"fetchSatelliteGeometries"};IONIC.feature.FeatureEditionTool.prototype.getServerUrl=function(){return this.serverUrl;};IONIC.feature.FeatureEditionTool.prototype.getFeatureTypeName=function(){return this.featureName;};IONIC.feature.FeatureEditionTool.prototype.getFeatureTypeNamespace=function(){return this.featureNamespace;};IONIC.feature.FeatureEditionTool.prototype._buildActionBaseUrl=function(actionName){return IONIC.misc.getWebappBaseUrl()+"/"+this._actionNames[actionName]+".do?"+"featureName="+escape(this.featureName)+
(this.featureNamespace?("&featureNameSpace="+escape(this.featureNamespace)):"")+"&serverUrl="+escape(this.serverUrl)+"&sourceType="+escape("FeatureServer");};IONIC.feature.FeatureEditionTool.prototype.setActionPath=function(name,path){this._actionNames[name]=path;};IONIC.feature.FeatureEditionTool.prototype.getGetFeaturesUrl=function(){return this._buildActionBaseUrl("getFeatures")+"&outputFormat="+escape("json");};IONIC.feature.FeatureEditionTool.prototype.getGetFeatureByIdUrl=function(id,epsgId){return this._buildActionBaseUrl("getFeatures")+"&featureId="+escape(id)+"&outputFormat="+escape("json")+"&epsgId="+escape(epsgId);};IONIC.feature.FeatureEditionTool.prototype.getSelectFeatureUrl=function(id,epsgId){return this._buildActionBaseUrl("selectFeature")+
(id?"&featureId="+escape(id):"&createFeature="+escape(true))+"&twoDimensional="+escape(true)+"&epsgId="+escape(epsgId);};IONIC.feature.FeatureEditionTool.prototype.getReleaseFeatureUrl=function(id){return this._buildActionBaseUrl("releaseFeature")+"&featureId="+escape(id);};IONIC.feature.FeatureEditionTool.prototype.getNewFeatureUrl=function(id,epsgId){return this._buildActionBaseUrl("newFeature")+
(id?("&featureId="+escape(id)):"")+"&twoDimensional="+escape(true)+"&epsgId="+escape(epsgId);};IONIC.feature.FeatureEditionTool.prototype.getDeleteFeatureUrl=function(id){return this._buildActionBaseUrl("deleteFeature")+"&featureId="+escape(id);};IONIC.feature.FeatureEditionTool.prototype.getUpdateFeatureUrl=function(id,lockTime,epsgId){return this._buildActionBaseUrl("updateFeature")+
(id?"&featureId="+escape(id):"")+"&twoDimensional="+escape(true)+"&epsgId="+escape(epsgId)+"&lockTime="+escape(lockTime);};IONIC.feature.FeatureEditionTool.prototype.getSatelliteGeometriesUrl=function(point,srsBox,outputEpsgId,maxVertices,outerShapesOnly,geomPName,geomPNamespace){return this._buildActionBaseUrl("fetchSatelliteGeometries")+"&logicalX="+escape(point[0])+"&logicalY="+escape(point[1])+"&srsBox="+escape(srsBox.commaRepresentation())+"&epsgId="+escape(outputEpsgId)+"&maxVertices="+escape(maxVertices)+"&outerShapesOnly="+escape(outerShapesOnly)+"&geometryPropertyName="+escape(geomPName)+"&geometryPropertyNamespace="+escape(geomPNamespace)+"&outputFormat="+escape("json");};IONIC.feature.FeatureEditionTool.prototype.withFeatureTypeInfo=function(callback){var thisRef=this;IONIC.feature.FeatureTypeInfoPool.withFeatureTypeInfo(this.getServerUrl(),this.getFeatureTypeName(),this.getFeatureTypeNamespace(),function(fti){thisRef._featureTypeDescriptor=fti;callback(fti);});};IONIC.feature.FeatureEditionTool.prototype.withNewFeature=function(id,epsgId,callback){IONIC.feature.FeatureTypeInfoPool.withFeatureTypeInfo(this.getServerUrl(),this.getFeatureTypeName(),this.getFeatureTypeNamespace(),function(fti){var feature=fti.newFeature();callback(feature);});};IONIC.feature.FeatureEditionTool.prototype.finalizeUpdatePropertiesFilters=function(propertiesFilters){return propertiesFilters;};IONIC.feature.FeatureEditionTool.prototype.withUpdatedFeature=function(feature,epsgId,callback){var url=this.getUpdateFeatureUrl(feature.getId(),0,epsgId);var thisRef=this;var updateMaterial={"update":IONIC.feature.FeatureSerializationTool.featureToTransportFormat
(feature._getDirtyClone(),this.getServerUrl())};this.withUrl
(url,"POST",function(success,featureDataWrapper,respText){if(!featureDataWrapper.featureData.id){throw"After update, the server returned no ID. This cannot be!";}
var ps=featureDataWrapper.featureData.properties;if(feature.getId()!==featureDataWrapper.featureData.id){feature.setId(featureDataWrapper.featureData.id);}
for(var i=0,n=ps.length;i=0)){subtype=type.substr(colIdx+1);type=type.substr(0,colIdx);}
var editor;switch(type){case"int":case"double":case"float":editor=IONIC.feature.edit.NumberPEditor.newInstance(this);break;case"geometry":editor=IONIC.feature.edit.GeomPEditor.newInstance(this,subtype);break;case"date":editor=IONIC.feature.edit.DatePEditor.newInstance(this);break;case"dateTime":editor=IONIC.feature.edit.DateTimePEditor.newInstance(this);break;case"enum":editor=IONIC.feature.edit.BaseEnumPEditor.newInstance(this,pDesc.values,subtype);break;case"sequence":editor=IONIC.feature.edit.BaseSequencePEditor.newInstance(this,subtype,pDesc.complexType);break;case"string":default:editor=IONIC.feature.edit.PEditor.newInstance(this);break;}
return editor;};IONIC.feature.AbstractFeaturePanel.prototype._getPreferredEpsgId=function(){var view=this.getView();var epsgId;if(view){epsgId=view.getSrsBox().epsgId;}else{epsgId=4326;}
return epsgId;};
IONIC.feature.edit.PEditor=function(panel){this.panel=panel;this.baseSize=30;this.setInteractiveState(IONIC.feature.edit.PEditor.STATE_DISABLED);};IONIC.feature.edit.PEditor.newInstance=function(panel){return new IONIC.feature.edit.PEditor(panel);};IONIC.feature.edit.PEditor.STATE_INTERACTIVE=0xBEAD;IONIC.feature.edit.PEditor.STATE_READONLY=0xDEAD;IONIC.feature.edit.PEditor.STATE_DISABLED=0xBEEF;IONIC.feature.edit.PEditor.prototype.getPanel=function(){return this.panel;};IONIC.feature.edit.PEditor.prototype.getDomHelper=function(){return this.getPanel().getDomHelper();};IONIC.feature.edit.PEditor.prototype.getFeatureEditionPanel=function(){return this.getPanel();};IONIC.feature.edit.PEditor.prototype.propagateValue=function(v){this.getPanel().acceptPropertyValue(this,v);};IONIC.feature.edit.PEditor.prototype._retrieveAssociatedPropertyValue=function(){var feat=this.getPanel().getFeature();var propQN=this.getPanel().getEditorAssociatedPropertyQName(this);return feat.getValueQN(propQN);};IONIC.feature.edit.PEditor.prototype.makeComponent=function(){var thisRef=this;var dh=this.getDomHelper();var c=dh.elt("input.basePropertyEditor");c.type="text";c.size=this.baseSize;c.onchange=function(){var v=c.value;if(v.length===0){v=undefined;}
thisRef.propagateValue(v);};return c;};IONIC.feature.edit.PEditor.prototype.getLabelText=function(){if(this._labelText){return this._labelText;}
var qn=this.getPanel().getEditorAssociatedPropertyQName(this);if(!qn){throw"This IONIC.feature.edit.PEditor instance doesn't seem to be associated to a panel.";}
return(this._labelText=this._decorateLabelText(qn.getName()));};IONIC.feature.edit.PEditor.prototype.setLabelText=function(text,force){this._labelText=force?text:this._decorateLabelText(text);this.getLabel().innerHTML=this._labelText;};IONIC.feature.edit.PEditor.prototype._decorateLabelText=function(text){var p=this.getPanel();var fti=IONIC.feature.FeatureTypeInfoPool.getFeatureTypeInfoOrFail(p.getFeatureTypeName(),p.getFeatureTypeNamespace());var qn=p.getEditorAssociatedPropertyQName(this);if(!qn){throw"This IONIC.feature.edit.PEditor instance doesn't seem to be associated to a panel.";}
var pDesc=fti.getPropertyInfo(qn.getName(),qn.getNamespace());if(pDesc.mandatory){return"[*] "+text;}else{return text;}};IONIC.feature.edit.PEditor.prototype.makeLabelWithText=function(txt){var dh=this.getDomHelper();return dh.elt("span.basePropertyLabel",dh.txt(txt));};IONIC.feature.edit.PEditor.prototype.makeLabel=function(){return this.makeLabelWithText(this.getLabelText());};IONIC.feature.edit.PEditor.prototype.getComponent=function(){if(!this.component){this.component=this.makeComponent();}
return this.component;};IONIC.feature.edit.PEditor.prototype.getLabel=function(){if(!this.label){this.label=this.makeLabel();}
return this.label;};IONIC.feature.edit.PEditor.prototype.displayValue=function(value){this.getComponent().value=((typeof value==="string")?value:"");};IONIC.feature.edit.PEditor.prototype.reset=function(){this.getComponent().value="";};IONIC.feature.edit.PEditor.prototype.setInteractiveState=function(state){this._state=state;this.applyInteractiveStateToComponent(state);};IONIC.feature.edit.PEditor.prototype.isEditable=function(){return this._state===IONIC.feature.edit.PEditor.STATE_INTERACTIVE;};IONIC.feature.edit.PEditor.prototype.applyInteractiveStateToComponent=function(state){this._setHTMLInputInteractiveState(this.getComponent(),state);};IONIC.feature.edit.PEditor.prototype._setHTMLInputInteractiveState=function(elt,state){switch(state){case IONIC.feature.edit.PEditor.STATE_INTERACTIVE:elt.disabled=false;elt.readOnly=false;break;case IONIC.feature.edit.PEditor.STATE_READONLY:elt.disabled=false;elt.readOnly=true;break;case IONIC.feature.edit.PEditor.STATE_DISABLED:elt.disabled=true;elt.readOnly=true;break;default:throw"Unrecognized state: "+state;}};
IONIC.feature.edit.NumberPEditor=function(panel){IONIC.feature.edit.PEditor.call(this,panel);this.baseSize=10;};IONIC.misc.extendType(IONIC.feature.edit.NumberPEditor,IONIC.feature.edit.PEditor);IONIC.feature.edit.NumberPEditor.newInstance=function(panel){return new IONIC.feature.edit.NumberPEditor(panel);};IONIC.feature.edit.NumberPEditor.prototype.makeComponent=function(){var thisRef=this;var c=IONIC.feature.edit.PEditor.prototype.makeComponent.call(this);c.onchange=function(){var v=c.value;if(v)
v=v.replace(",",".");if(v.length===0){v=undefined;}else{v=+v;}
if(isNaN(v)){v=undefined;}
thisRef.propagateValue(v);};return c;};IONIC.feature.edit.NumberPEditor.prototype.displayValue=function(value){this.getComponent().value=((typeof value==="number"&&!isNaN(value))?value:"");};IONIC.feature.edit.NumberPEditor.prototype.reset=function(){this.getComponent().value=0;};
IONIC.feature.edit.DatePEditor=function(panel){IONIC.feature.edit.PEditor.call(this,panel);};IONIC.misc.extendType(IONIC.feature.edit.DatePEditor,IONIC.feature.edit.PEditor);IONIC.feature.edit.DatePEditor.newInstance=function(panel){return new IONIC.feature.edit.DatePEditor(panel);};IONIC.feature.edit.DatePEditor.prototype.makeComponent=function(){var thisRef=this;var dh=this.getDomHelper();var inpYear=dh.elt("input");var inpMonth=dh.elt("input");var inpDay=dh.elt("input");var pDiv=dh.elt("div");inpYear.size=4;inpMonth.size=inpDay.size=2;inpYear.id=gensym();inpMonth.id=gensym();inpDay.id=gensym();var calendarBut=dh.elt("img.featureEditionDateButton");calendarBut.src="/ioniciasclient/images/features/editing/editors/calendar.gif";calendarBut.title="Open calendar"
calendarBut.alt="calendar"
calendarBut.id=gensym();var c=new CalendarPopup();this.pid=gensym();var cbn=this.panel._pid+"_"+this.pid;window[cbn]=function(y,m,d){inpYear.value=String(y);inpMonth.value=String(m);inpDay.value=String(d);thisRef.propagateValue(IONIC.feature.edit.DatePEditor.getDateDescriptor(inpYear,inpMonth,inpDay).toDate());};c.setReturnFunction(cbn);c.showNavigationDropdowns();this.calendar=c;inpYear.onchange=inpMonth.onchange=inpDay.onchange=function(){thisRef.getPanel().acceptValue
(thisRef,IONIC.feature.edit.DatePEditor.getDateDescriptor(inpYear,inpMonth,inpDay).toDate());};calendarBut.onclick=function(){if(thisRef.getPanel().holdsFeature()){c.showCalendar(calendarBut.id,IONIC.feature.edit.DatePEditor.getDateDescriptor(inpYear,inpMonth,inpDay).toString());}
return false;};var cpnt=dh.elt("table.featureEditionDateEditor",dh.elt("tbody",dh.elt("tr",dh.elt("td",dh.elt("div.featureEditionDateEditorInputs",inpDay,inpMonth,inpYear)),dh.elt("td",calendarBut))));this.inpYear=inpYear;this.inpMonth=inpMonth;this.inpDay=inpDay;return cpnt;};IONIC.feature.edit.DatePEditor.prototype.displayValue=function(date){if(!date){this.inpYear.value=this.inpMonth.value=this.inpDay.value="";}else{this.inpYear.value=date.getFullYear();this.inpMonth.value=date.getMonth()+1;this.inpDay.value=date.getDate();}};IONIC.feature.edit.DatePEditor.prototype.reset=function(){this.displayValue(new Date());};IONIC.feature.edit.DatePEditor.prototype.applyInteractiveStateToComponent=function(state){this.getComponent();this._setHTMLInputInteractiveState(this.inpYear,state);this._setHTMLInputInteractiveState(this.inpMonth,state);this._setHTMLInputInteractiveState(this.inpDay,state);};IONIC.feature.edit.DatePEditor.getDateDescriptor=function(inpYear,inpMonth,inpDay){return{"year":parseInt(inpYear.value),"month":parseInt(inpMonth.value),"day":parseInt(inpDay.value),"toDate":function(){return new Date(Date.UTC(this.year,this.month-1,this.day,0,0,0));},"isValid":function(){return(!isNaN(this.year)&&!isNaN(this.month)&&!isNaN(this.day));},"toString":function(){if(isNaN(this.year)||isNaN(this.month)||isNaN(this.day))
return null;else
return this.year+'-'+this.month+'-'+this.day;}};};IONIC.feature.edit.DatePEditor.offsetToString=function(offset){var hrs=""+Math.floor(Math.abs(offset)/60);var mins=""+Math.floor(Math.abs(offset)%60);if(hrs.length==1)
hrs="0"+hrs;if(mins.length==1)
mins="0"+mins;return(offset<0?"-":"+")+hrs+":"+mins;};
IONIC.feature.edit.DateTimePEditor=function(panel){IONIC.feature.edit.DatePEditor.call(this,panel);};IONIC.misc.extendType(IONIC.feature.edit.DateTimePEditor,IONIC.feature.edit.DatePEditor);IONIC.feature.edit.DateTimePEditor.newInstance=function(panel){return new IONIC.feature.edit.DateTimePEditor(panel);};
IONIC.feature.edit.GeomPEditor=function(panel,geomType){IONIC.feature.edit.PEditor.call(this,panel);this._gt=geomType;this._valid=undefined;this._chosenButtons=IONIC.feature.edit.GeomPEditor.AVAILABLE_BUTTONS.slice();};IONIC.misc.extendType(IONIC.feature.edit.GeomPEditor,IONIC.feature.edit.PEditor);IONIC.feature.edit.GeomPEditor.newInstance=function(panel,geomType){return new IONIC.feature.edit.GeomPEditor(panel,geomType);};IONIC.feature.edit.GeomPEditor.NEW_BUTTON="new";IONIC.feature.edit.GeomPEditor.EDIT_BUTTON="edit";IONIC.feature.edit.GeomPEditor.DELETE_BUTTON="delete";IONIC.feature.edit.GeomPEditor.AVAILABLE_BUTTONS=[IONIC.feature.edit.GeomPEditor.NEW_BUTTON,IONIC.feature.edit.GeomPEditor.EDIT_BUTTON,IONIC.feature.edit.GeomPEditor.DELETE_BUTTON];IONIC.feature.edit.GeomPEditor.prototype._hasButton=function(b){var bs=this._chosenButtons;for(var i=0,n=bs.length;i=(ei.left+ei.width)||my<(ei.top)||my>=(ei.top+ei.height)){elt.setVisibility(false);}}else{elt.setVisibility(false);}};elt.getPosInfo=function(){return this._posInfo;};elt.setPosInfo=function(i){this._posInfo=i;};elt.setVisibility=function(flag){this.style.display=flag?"":"none";};return elt;};IONIC.feature.edit.GeomPEditor.ManagementToolbar.prototype.showTypesList=function(posInfo){var tlElt=this._getTypesListElement();var st=tlElt.style;st.top=posInfo.top+"px";st.left=posInfo.left+"px";tlElt.setVisibility(true);tlElt.setPosInfo(ElementPosition.get(tlElt));};IONIC.feature.edit.GeomPEditor.ManagementToolbar.prototype._makeComponent=function(){var thisRef=this;var dh=this.getEditor().getDomHelper();var cpnt=dh.elt("div.managementToolbar");var edit=this.createImageItem("edit",null,"edit.gif","Edit current geometry","edit current");edit.registerStyle(IONIC.ui.TBItem.DISABLED_STYLE,{fileName:"noedit.gif",title:"You cannot edit the current geometry",alt:"can't edit current"});edit.setEnabled(false);edit.onactivate=function(event){thisRef.getEditor().editAssociatedGeometry();};var dlete=this.createImageItem("delete",null,"delete.gif","Delete current geometry","delete current");dlete.registerStyle(IONIC.ui.TBItem.DISABLED_STYLE,{fileName:"nodelete.gif",title:"You cannot delete the current geometry",alt:"can't delete current"});dlete.setEnabled(false);dlete.onactivate=function(event){if(confirm("Really delete?")){thisRef.getEditor().propagateValue(undefined);}};var create=this.createImageItem("create",null,"create.gif","Create a new geometry","create new");create.registerStyle(IONIC.ui.TBItem.DISABLED_STYLE,{fileName:"nocreate.gif",title:"You cannot create a new geometry",alt:"can't create new"});create.setEnabled(false);create.onactivate=function(event){thisRef.showTypesList(ElementPosition.get(create.getComponent()));};dh.append(cpnt,create.getComponent(),edit.getComponent(),dlete.getComponent());this._mgmtItems=[create,edit,dlete];return cpnt;};IONIC.feature.edit.GeomPEditor.prototype.getEnvelope=function(){try{var geom=this._retrieveAssociatedPropertyValue();return geom.getEnvelope();}catch(e){return null;}};
IONIC.feature.edit.BaseEnumPEditor=function(panel,customEnum,enumType){this.customEnum=customEnum;this.enumType=enumType;IONIC.feature.edit.PEditor.call(this,panel);};IONIC.misc.extendType(IONIC.feature.edit.BaseEnumPEditor,IONIC.feature.edit.PEditor);IONIC.feature.edit.BaseEnumPEditor.newInstance=function(panel,customEnum,enumType){return new IONIC.feature.edit.BaseEnumPEditor(panel,customEnum,enumType);};IONIC.feature.edit.BaseEnumPEditor.prototype.getEnumName=function(){return" value -";};IONIC.feature.edit.BaseEnumPEditor.prototype.applySubstitutionResolver=function(resolver){var opts=this.getComponent().options;for(var i=0,n=opts.length;ie1.name){return 1;}else return 0;});for(var i=0;i=ehs.length){throw"Handler index out-of-bounds: "+idx;}else{ehs[idx]=undefined;}}};IONIC.api.maps.Map.prototype._triggerHandlers=function(eventname,evt){var ehs=this._ehs[eventname];var i,n;if(ehs){for(i=0,n=ehs.length;i0){ld=this.layerDescriptors[0];epsgIds=epsgIds.concat(ld.getNativelySupportedSrses());}
var i,layerEpsgIds;for(i=1;i=0;i--){curLd=lds[i];if(curLd.isBasemap()){this.removeLayerDescriptor(curLd);}}};IONIC.api.maps.Map.prototype.destroyAllLayerDescriptors=function(){this.destroyAllMapLayerDescriptors();this.destroyAllUtilityLayerDescriptors();};IONIC.api.maps.Map.prototype.destroyAllMapLayerDescriptors=function(){var cur,dh=this.getDomHelper();while(this.getMapLayerDescriptors().length){cur=this.getMapLayerDescriptors()[0];this.removeLayerDescriptor(cur);cur.destroy(dh);}};IONIC.api.maps.Map.prototype.destroyAllUtilityLayerDescriptors=function(){var cur,dh=this.getDomHelper();while(this.getUtilityLayerDescriptors().length){cur=this.getUtilityLayerDescriptors()[0];this.removeUtilityLayerDescriptor(cur);cur.destroy(dh);}};IONIC.api.maps.Map.prototype.getLayersCount=function(){return this.layerDescriptors.length;};IONIC.api.maps.Map.prototype._findLayer=function(layerDesignator){var ldd=layerDesignator;var match,item;if(ldd instanceof IONIC.maps.AbstractLayerDescriptor){item=IONIC.misc.findItem(ldd,this.layerDescriptors);if(!item){item=IONIC.misc.findItem(ldd,this.utilityLayerDescriptors);}
return item;}else if(typeof ldd==="string"){if((match=/^g_(\d+)uuid$/.exec(ldd))){item=IONIC.misc.findItem(ldd,this.layerDescriptors,null,IONIC.api.maps.Map._UUID_GETTER);if(!item){item=IONIC.misc.findItem(ldd,this.utilityLayerDescriptors,null,IONIC.api.maps.Map._UUID_GETTER);}
return item;}}};IONIC.api.maps.Map._UUID_GETTER=function(ld){return ld.uuid;};IONIC.api.maps.Map.prototype.findLayer=function(layerDesignator){var found;if(layerDesignator instanceof IONIC.maps.AbstractLayerDescriptor){if(this._findLayer(layerDesignator)){return layerDesignator;}}else{found=this._findLayer(layerDesignator);if(found){return found[0];}else{return undefined;}}};IONIC.api.maps.Map.prototype.replaceLayer=function(previous,replacement,callback){var prevData=this._findLayer(previous);this.removeLayerDescriptor(prevData[0]);this.insertLayerDescriptorAt(replacement,prevData[1],false,callback);};IONIC.api.maps.Map.prototype.onAddMapLayerFailed=function(message){message=message||"";alert('Cannot add layer'+(message?(" ("+message+")"):""));};IONIC.api.maps.Map.prototype.insertLayerDescriptorAt=function(layerDescriptor,position,norefresh,callback){if(position>this.layerDescriptors.length){throw"Cannot set layer at position "+position+". There are currently only "+
this.layerDescriptors.length+" layers.";}
var self=this;var mapNeedsRefresh=false;var transformedCurrentBox;var attached=false;var proceedInsertFailed=function(message){if(attached){throw"Illegal state: proceedInsertFailed() called while the layer is already attached to the map";}
self.onAddMapLayerFailed(message);self.layerDescriptors.splice(position,1);layerDescriptor.setMap(null);};var proceedAttachToMap=function(){layerDescriptor.attachToMap(self);attached=true;self.onLayerAdded.fire(layerDescriptor,position);self._checkLayerScaleRangeVisibility(layerDescriptor);var i,n;for(i=position+1,n=self.layerDescriptors.length;i