//>>built
define("dojox/geo/openlayers/WidgetFeature",["dojo/_base/declare","dojo/dom-style","dojo/_base/lang","dijit/registry","./Feature"],function(k,e,h,l,m){return k("dojox.geo.openlayers.WidgetFeature",m,{_widget:null,_bbox:null,constructor:function(a){this._params=a},setParameters:function(a){this._params=a},getParameters:function(){return this._params},_getWidget:function(){var a=this._params;if(null==this._widget&&null!=a){var b=null;"function"==typeof a.createWidget?b=a.createWidget.call(this):a.dojoType?
(dojo.require(a.dojoType),b=new (h.getObject(a.dojoType))(a)):a.dijitId?b=l.byId(a.dijitId):a.widget&&(b=a.widget);null!=b&&(this._widget=b,"function"==typeof b.startup&&b.startup(),a=b.domNode,null!=a&&e.set(a,{position:"absolute"}));this._widget=b}return this._widget},_getWidgetWidth:function(){var a=this._params;return a.width?a.width:(a=this._getWidget())?e.get(a.domNode,"width"):10},_getWidgetHeight:function(){var a=this._params;return a.height?a.height:(a=this._getWidget())?e.get(a.domNode,
"height"):10},render:function(){var a=this.getLayer(),b=this._getWidget();if(null!=b){var c=this._params,d=c.longitude;c=c.latitude;var g=this.getCoordinateSystem();d=a.getDojoMap().transformXY(d,c,g);var f=this._getLocalXY(d);d=this._getWidgetWidth();c=this._getWidgetHeight();g=f[0]-d/2;f=f[1]-c/2;b=b.domNode;a=a.olLayer.div;b.parentNode!=a&&(b.parentNode&&b.parentNode.removeChild(b),a.appendChild(b));this._updateWidgetPosition({x:g,y:f,width:d,height:c})}},_updateWidgetPosition:function(a){var b=
this._widget;e.set(b.domNode,{position:"absolute",left:a.x+"px",top:a.y+"px",width:a.width+"px",height:a.height+"px"});b.srcNodeRef&&e.set(b.srcNodeRef,{position:"absolute",left:a.x+"px",top:a.y+"px",width:a.width+"px",height:a.height+"px"});h.isFunction(b.resize)&&b.resize({w:a.width,h:a.height})},remove:function(){var a=this._getWidget();a&&(a=a.domNode,a.parentNode&&a.parentNode.removeChild(a))}})});