Skip to main content

Zoom map over features

Comments

4 comments

  • Guillaume Ruelle

    One way is to use a Set Map Extent activity. For the "Features" input, just put $query.results... It should be ok.

     

    0
  • Permanently deleted user

    Yes, but SetMatExtent require as input an object of type ESRI.ArcGIS.Client.Geometry.Envelope.

    How can i get this from a Query task that rpovide a ESRI.ArcGIS.Client.Tasks.Featureset object?

    0
  • Permanently deleted user

    Hi Fillippo,

    This is possible using a featureSet that is output from a query, you will need to include a 'GetFeatureSetExtent' activity after the query and before the SetMapExtent activity with the input as the featureSet output from the query.

    N.B. you can include the expand function - .expand in your SetMapExtent activity in order to show a larger area than just the queried feature.

    Also, if your queried feature is a point not a polygon or a line you would need to include a cast activity in order to give your point feature an envelope to be zoomed to.

    I hope that helps,

    Thanks,

    Harry

    0
  • Malcolm Walker
    • Community-Manager

    Thanks @Harry Sturley? .

    If someone is like me wondering about how to use .expand.

    Check this post and see Amanda's answer.

    0

Please sign in to leave a comment.