//>>built
define("demos/shippingRoutes/src/EcrRenderer",["dojo/_base/kernel","dojo/_base/declare","dojo/_base/array","dojo/_base/lang"],function(_1,_2,_3,_4){return _2(null,{constructor:function(_5,_6){this._options=_5;this._context=_6;},render:function(_7){var o=this._options;return this._render(o,_7);},_render:function(o,_8){if(o instanceof Array){var _9=[];o.sort(function(i1,i2){var d1=i1.depth;var d2=i2.depth;if(d1!=undefined&&d2!=undefined){var _a=parseInt(d1);var _b=parseInt(d2);if(_a==_b){return 0;}if(_a<_b){return -1;}return 1;}return 0;});_3.forEach(o,function(oi,_c,_d){var co=_4.clone(oi);this._callFunctions(co,_8);this._solveReferences(co,_8);var f=this._render(co,_8);if(f!=null){f.setStroke(co.stroke);f.setFill(co.fill);_9.push(f);}},this);return _9;}var co=_4.clone(o);this._callFunctions(co,_8);this._solveReferences(co,_8);var gf=this._renderItem(co,_8);if(gf!=null){gf.setStroke(co.stroke);gf.setFill(co.fill);}return gf;},_renderItem:function(o,_e){return null;},_callFunctions:function(o,_f){for(var _10 in o){if(o.hasOwnProperty(_10)){var v=o[_10];if(typeof v=="function"){o[_10]=v.call(_f,this._context);}else{if(typeof v=="object"){this._callFunctions(v,_f);}}}}},getContext:function(){return this._context;},getContextValue:function(_11){if(this._context){return this._context[_11];}return undefined;},getValue:function(_12,_13){var s=this.getContextValue("store");if((s!=undefined)&&s.isItem(_12)){return s.getValue(_12,_13);}if(_12.hasOwnProperty(_13)){return _12[_13];}return undefined;},_coords:[0,0],getCoordinates:function(_14){var lon=this.getValue(_14,"longitude");var lat=this.getValue(_14,"latitude");var _15=parseFloat(lon);var _16=parseFloat(lat);var a=this._coords;a[0]=_15;a[1]=_16;return a;},_findAttributeValue:function(o,a,_17){var v=undefined;if(_17!=null){v=this.getValue(_17,a);}if(v!=undefined){return v;}v=o[a];if(v!=undefined){return v;}for(var i in o){var ov=o[i];if(typeof (ov)=="object"){var vv=this._findAttributeValue(ov,a,null);if(vv!=undefined){return vv;}}}return undefined;},_solveReferences:function(o,_18){this.__solveReferences(o,o,_18);},__solveReferences:function(oo,o,_19){for(var a in o){var v=o[a];if(typeof (v)=="object"){this.__solveReferences(oo,v,_19);}if(typeof (v)=="string"){var re=/{(.*)}/;if(v.match(re)){v=v.replace(re,"$1");var r=this._findAttributeValue(oo,v,_19);if(r!=undefined){var ps=parseFloat(r);if(isNaN(ps)){o[a]=r;}else{o[a]=ps;}}}}}}});});