Dynamic layer zoom or query zoom

518
1
08-23-2018 12:27 PM
EvelynHernandez
Occasional Contributor III

Hello,

I have a Dynamic service in a map where im adding a definitionExpression for getting 1 result applied to 2 layers (the first one is point and the second one is lines).

What i want to achieve is doing a zoom into the feature that im showing with the definition expression on the map, but I dont know if there is a way to do this without doing a query for zooming (and getting the extent) of the polyline layer.

I know if i do a query in the points layer i can set the map zoom into that feature, but is this possible also with a polyline layer?

When i do a query in the polyline layer i have an array of results, so how can i set up the map extend to zoom in the area that i want?

Thanks in advice.

0 Kudos
1 Reply
RobertScheitlin__GISP
MVP Emeritus

Evelyn,

   You just use the executeForExtent method of the QueryTask.