set map extent
Hello.
I am working with a workflow that was previously working and for some unknown reason has ceased.
The concept is that, after a user clicks on a link on our website, the workflow is initiated using a variable determined by the link clicked. For example, they want to know more about a zoning bylaw 3000. Upon click, the variable argBylaw is assigned a value of 3000. This variable is then used in the workflow to zoom to the extent of the boundary of that polygon feature (Zone Bylaw 3000 boundary) on our webmap.
The problem has been narrowed down (we think) to the SetMapExtent activity at the very end of the workflow sequence.
The argument is: featureSet1.first().Geometry.Extent
This used to work and I am not sure why (or when exactly) it stopped. we use this workflow for 2 different actions. One zooms in, but not to the extent it should, and the other no longer zooms in at all. Has something changed to the syntax requirements? No warnings are thrown in the workflow designer.
Any suggestions are greatly appreciated.
We are using arcServer and viewer for html5.
Thank you!
Suzanne.
0
-
Is the Shape field published with the mapservice? 0 -
Yes. And I actually think I figured out what is going on.
The layer that was being referred to had multiple instances of that value so the zoom was going to the first instance, as it was told to. I changed the layer of reference to a layer that has only one instance of the boundary polygon and it seems to be working.
Thanks for the quick reply though!
Still working on refining this zoom level.
Sometimes the polygon is fully encapsulated in the zoom extent, other times it chooses to zoom a little bit closer and therefore cuts off some of the outer edges of the polygon. Is this because the zoom feature is hard-wired to choose the closest zoom level extent? If so, is there a work around so that the entire polygon feature is displayed and not just the closest set default extent?
TIA0 -
Additionally, the workflow that quit zooming altogether is still being investigated...the above "fix" refers to the workflow that was still zooming, just to the wrong extent. 0 -
I tried to zoom to the polygon using SelectFeatures and then GetFeatureSetExtent and then SetMapExtent. Still not zooming to the extent of the selection... Exact same workflow works (partially, as described above) for another layer kept on same server with same shape and even the same field name... 0 -
Hvae you tried putting an Alert activity in your workflow and display the value of the GetFeatureSetExtent activity to see if you're actually getting a valid extent object? 0 -
Hi Peter, Yes, I can display the value of the resulting feature set, and it is correct (though I can't diplay the value of the resulting envelope created with the GetFGeatureSetExtent because it cannot be read as a string). Also, the SelectFeatures will select the correct feature and add it to a list on the webmap. When this list item is clicked manually, the webmap zooms into the proper extent. It just isn't doing it automatically like it should be... 0 -
For the zoom issue, have you tried setting the Feature Zoom Factor or Feature Zoom Scale for the layer? This setting worked well for me in a similar situation. 0 -
Hi Rebecca. No, I hadn't! However, I just now played around a little with the Zoom Factor and it didn't make a difference :-(
I can't really set the Zoom Scale as the scale will differ for each polygon's geometry (some are huge polygons and some are not)...
I am new to this software so might be missing something very small...
Anybody :-)
Are there any examples of the correct argument format for the SetMapExtent activity in workflow? Is there possibly an argument I can add to "Extent"?
My argument reads: featureSet1.first().Geometry.Extent
I am flying a little bit blind here, and the help documentation is not very helpful...
Maybe there is a better way to pass the featureSet1 variable into the SetMapExtent handler? A middle step perhaps?
TIA0 -
Okay. Here is a clunky fix... I created a buffer using BufferTask which outputs a graphic (enumerable) variable. Using this graphic variable, I was able to zoom to the chosen polygon... still having some issues with the zoom snapping to the nearest scale rather than ensuring the entire polygon is encapsulated in the view port BUT this is progress and so sharing as a "fix".
Thank you all for your suggestions!
Any ideas on fixing the zoom issue would be appreciated, also, any ideas as to WHY this zoom works now with a buffer graphic to zoom to??
Cheers,
Suzanne.0 -
The Feature Zoom Scale setting seems to work well for most of our parcels but I did notice that the zooming is affected by the scale levels in the tiled map service I'm using (ESRI World Topo). The map will snap to the closest scale from the tiled map service rather than honour the specified zoom factor setting. This is less than ideal behaviour (although unavoidable, I think) but in our case it's usually close enough because the World Topo service has several scale levels. 0 -
Suzanne,
The result of the GetFeatureSetExtent activity is an Envelope object, so you should be able to view it in an Alert activity by putting ".ToString()" on the end of the Envelope variable name. It should display a comma seperated list of coordinates for the new extent. So, in your alert activity's Title or Text box, you could just put "myEnvelopeName.toString()" where myEnvelopeName is the name of Envelope you used as the Result of the GetFeatureSetExtent Activity.0 -
Hi Peter, that is excellent to know! Thank you. 0
Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.
Kommentare
12 Kommentare