if(FlexGlobals.topLevelApplication.geoLong != null && FlexGlobals.topLevelApplication.geoLat != null) { //Remove the glow ModelEdit.instance.editor.attributeInspector.activeFeature.filters = []; //Remove attribute inspector okButton.dispatchEvent(new MouseEvent(MouseEvent.CLICK, true, false)); var geoLocateIt:MapPoint = new MapPoint(FlexGlobals.topLevelApplication.geoLong, FlexGlobals.topLevelApplication.geoLat, Model.instance.map.spatialReference); var geoLocateWebMerc:* = WebMercatorUtil.geographicToWebMercator(geoLocateIt); (ModelEdit.instance.editor.attributeInspector.activeFeature.geometry as MapPoint).update(geoLocateWebMerc.x, geoLocateWebMerc.y, Model.instance.map.spatialReference); //HOW DO I AVOID REFRESHING THE FEATURELAYER (ModelEdit.instance.editor.attributeInspector.activeFeature.graphicsLayer as FeatureLayer).refresh(); (ModelEdit.instance.editor.attributeInspector.activeFeature.graphicsLayer as FeatureLayer).applyEdits(null, [ModelEdit.instance.editor.attributeInspector.activeFeature], null); (ModelEdit.instance.editor.attributeInspector.activeFeature.graphicsLayer as FeatureLayer).addEventListener(FeatureLayerEvent.EDITS_COMPLETE, editCompleteHdlr) }
Solved! Go to Solution.
var geom:MapPoint = ModelEdit.instance.editor.attributeInspector.activeFeature.geometry as MapPoint; geom.update(geoLocateWebMerc.x, geoLocateWebMerc.y, Model.instance.map.spatialReference); ModelEdit.instance.editor.attributeInspector.activeFeature.geometry = geom;
On a mobile I have a feature layer and am trying to move a point feature to my current GPS location. The following is a code snippet. I'm finding the only way I can get the point to reposition is if I refresh() the featurelayer. Is there any way to avoid needing to do this?
if(FlexGlobals.topLevelApplication.geoLong != null && FlexGlobals.topLevelApplication.geoLat != null) { //Remove the glow ModelEdit.instance.editor.attributeInspector.activeFeature.filters = []; //Remove attribute inspector okButton.dispatchEvent(new MouseEvent(MouseEvent.CLICK, true, false)); var geoLocateIt:MapPoint = new MapPoint(FlexGlobals.topLevelApplication.geoLong, FlexGlobals.topLevelApplication.geoLat, Model.instance.map.spatialReference); var geoLocateWebMerc:* = WebMercatorUtil.geographicToWebMercator(geoLocateIt); (ModelEdit.instance.editor.attributeInspector.activeFeature.geometry as MapPoint).update(geoLocateWebMerc.x, geoLocateWebMerc.y, Model.instance.map.spatialReference); //HOW DO I AVOID REFRESHING THE FEATURELAYER (ModelEdit.instance.editor.attributeInspector.activeFeature.graphicsLayer as FeatureLayer).refresh(); (ModelEdit.instance.editor.attributeInspector.activeFeature.graphicsLayer as FeatureLayer).applyEdits(null, [ModelEdit.instance.editor.attributeInspector.activeFeature], null); (ModelEdit.instance.editor.attributeInspector.activeFeature.graphicsLayer as FeatureLayer).addEventListener(FeatureLayerEvent.EDITS_COMPLETE, editCompleteHdlr) }
Thanks
--Rory
var geom:MapPoint = ModelEdit.instance.editor.attributeInspector.activeFeature.geometry as MapPoint; geom.update(geoLocateWebMerc.x, geoLocateWebMerc.y, Model.instance.map.spatialReference); ModelEdit.instance.editor.attributeInspector.activeFeature.geometry = geom;
On a mobile I have a feature layer and am trying to move a point feature to my current GPS location. The following is a code snippet. I'm finding the only way I can get the point to reposition is if I refresh() the featurelayer. Is there any way to avoid needing to do this?
if(FlexGlobals.topLevelApplication.geoLong != null && FlexGlobals.topLevelApplication.geoLat != null) { //Remove the glow ModelEdit.instance.editor.attributeInspector.activeFeature.filters = []; //Remove attribute inspector okButton.dispatchEvent(new MouseEvent(MouseEvent.CLICK, true, false)); var geoLocateIt:MapPoint = new MapPoint(FlexGlobals.topLevelApplication.geoLong, FlexGlobals.topLevelApplication.geoLat, Model.instance.map.spatialReference); var geoLocateWebMerc:* = WebMercatorUtil.geographicToWebMercator(geoLocateIt); (ModelEdit.instance.editor.attributeInspector.activeFeature.geometry as MapPoint).update(geoLocateWebMerc.x, geoLocateWebMerc.y, Model.instance.map.spatialReference); //HOW DO I AVOID REFRESHING THE FEATURELAYER (ModelEdit.instance.editor.attributeInspector.activeFeature.graphicsLayer as FeatureLayer).refresh(); (ModelEdit.instance.editor.attributeInspector.activeFeature.graphicsLayer as FeatureLayer).applyEdits(null, [ModelEdit.instance.editor.attributeInspector.activeFeature], null); (ModelEdit.instance.editor.attributeInspector.activeFeature.graphicsLayer as FeatureLayer).addEventListener(FeatureLayerEvent.EDITS_COMPLETE, editCompleteHdlr) }
Thanks
--Rory