Another rookie question about this topic!I've made the changes to MapManager as mentioned and I can successfully search with what appears to be the bounding coordinates as given with an example with the code change. I don't know if I missed this somewhere, but what changes would I need to make to be able to search on an X,Y instead of bounding coords?The application is for a utility billing software we use, we push centroids of the parcel with x,y to the database for the utility billing. We have then added a button that will pass a query string to pull up a web map of the location. Alternatively we could use the other examples of passing a parcel ID, but if there are parcel changes (we do not maintain the parcels) then we would not get a result. By passing x,y we are guaranteeing that the map will at least zoom to where the parcel used to be.Thanks,Scott
var layers:ArrayCollection = map.layers as ArrayCollection; for each (var layer:Layer in layers) { if (layer.name.toLowerCase() == "imagery") { layer.visible = false; } else { layer.visible = true; } }
Justin, I think it is going to have something to do with your zoom code and timing issues. Post the code that you are using in the MapLoadComplete.
if (ExternalInterface.available) { var result:URLVariables = new URLVariables(); var urlSubstring:String = ExternalInterface.call("window.location.search.substring", 1); if (urlSubstring && urlSubstring.length > 0 != "debug=true") { result.decode(urlSubstring); // Parse URL var qValue:String if (result["excavationpermit"]) { qValue = result["excavationpermit"]; var queryTask:QueryTask = new QueryTask(); var query:Query = new Query(); query.returnGeometry = true; query.where = "order_no = '" + qValue + "'"; queryTask.url = "http://df21pce00255325/ArcGIS/rest/services/Common_Utilities/FeatureServer/0"; queryTask.execute(query, new AsyncResponder(onResult, onFault)); function onResult(featureSet:FeatureSet, token:Object = null):void { if (featureSet.features.length == 0) { Alert.show("Excavation Permit Not Found. Please Try Again."); } else { //uninon the sel graphic extents and zoom var unionExtent:Extent; var myFirstGraphic:Graphic = featureSet.features[0]; unionExtent = Polygon(myFirstGraphic.geometry).extent; for each (var myGraphic1:Graphic in featureSet.features) { unionExtent = unionExtent.union(Polygon(myGraphic1.geometry).extent); } map.extent = unionExtent; // Zoom to queried polygon map.scale = 250; // make sure the whole extent is visible if (!map.extent.contains(unionExtent)) { map.level--; } //turn on required layers var layers:ArrayCollection = map.layers as ArrayCollection; for each (var layer:Layer in layers) { if (layer.name.toLowerCase() == "imagery") { layer.visible = false; } else { layer.visible = true; } } } } function onFault(info:Object, token:Object = null):void { Alert.show("Excavation Permit Not Found. Please Try Again."); } } } }
Justin, Glad to hear you have it working.
AppEvent.addListener(AppEvent.DATA_PUBLISH, sharedDataUpdated);
ViewerContainer.addEventListener(AppEvent.DATA_PUBLISH, sharedDataUpdated);
popUpRenderer.setStyle("skinClass", widgets.eSearch.PopUpRendererSkin);
Nathan,Why are you trying it this old way? The eSearch Widget has this built in now with not changes to the map manager code.
Membros conectados podem postar, seguir atualizações e mais. Novo aqui? Registre uma conta gratuita.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.