Sorry, I have not had much free time to work on my widget projects.I updated the Zillow widget with a clear button. I've found that users don't always want to clear results when a widget is closed, so I think this is a good compromise.Now if you wanted to do this on widget close, I add a clear method to the ViewManagervManager.clearLayer();You can tie the widget close event to a function that can call this method when the widget is closed if you like.Hope that helps.
<?xml version="1.0" encoding="utf-8"?> <viewer:BaseWidget xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx" xmlns:viewer="com.esri.viewer.*" xmlns:main="widgets.Zillow.main.*" xmlns:ui="widgets.Zillow.main.view.ui.*" layout="absolute" widgetConfigLoaded="basewidget_widgetConfigLoadedHandler(event)"> <fx:Declarations> <main:ZillowContext contextView="{this}" /> </fx:Declarations> <fx:Script> <![CDATA[ protected function basewidget_widgetConfigLoadedHandler(event:Event):void { if (configXML) { var zwsid:String = configXML.zwsid; vManager.zwsid = zwsid; vManager.map = map; } } ]]> </fx:Script> <fx:Style source="assets/zillowwidget.css" /> <viewer:WidgetTemplate id="wTemplate" width="300" height="315" minHeight="315" minWidth="300"> <ui:ViewManager id="vManager" width="100%" height="100%" /> </viewer:WidgetTemplate> </viewer:BaseWidget>
var wgs:MapPoint = new MapPoint(attr.longitude, attr.latitude, new SpatialReference(4326)); var mp:MapPoint = WebMercatorUtil.geographicToWebMercator(wgs) as MapPoint;
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.