Select to view content in your preferred language

Zoom To Query Issues

689
3
11-23-2010 10:55 AM
EmilyLaMunyon
Deactivated User
Hello,

I have gotten a query results in a table to work, now I am moving on to zooming to a query result on a map. I am working with the Flash 4 samples and seem to have the query returning the correct results, however, I always seem to have a problem getting my map/layers to display. What am I missing?

Thanks!
Tags (2)
0 Kudos
3 Replies
Drew
by
Frequent Contributor
The reason why your map is not showing up is because all your layers have a min scale and the map being generated is probably outside the min scale of 1:100,000 as defined in your township layer.


Adjust or remove the min scale on your township layer, refresh your map service and clear the rest cache.
That should fix your issue.

You can test the current problem by zooming in on your map. You will notice the features eventually come into view.

Drew
0 Kudos
Drew
by
Frequent Contributor
The reason why your query is not zooming to the feature is because your returned gemetry is a MapPoint and a MapPoint does not have an extent.  So the GraphicUtil.getGraphicsExtent(featureSet.features); method is returning null because its unable to calculate.

I cant say for sure but that method might return an extent if there is more than 1 MapPoint returned, but i think a single result (like you have) will always return null if its a map point.
Try searching "zoom to point" in the forums and I am sure you will stumble on some code similar to this thread.. http://forums.arcgis.com/threads/7847-Zoom-to-a-single-point!?highlight=zoom+point

Drew
0 Kudos
EmilyLaMunyon
Deactivated User
Thanks Drew!! You are right, the code does not work with a point, but does with a polygon feature. I appreciate your help:)
0 Kudos