map.setExtent and TiledMapService

1058
2
10-14-2011 07:10 AM
KenDoman
Occasional Contributor II
I have a map with a Tiled and a Dynamic layer. I have a query that queries one of the features on the dynamic layer, puts the results in a table, including a link that zooms to the extent of each feature returned. Basically, I use map.setExtent() on the extent of the feature. It works pretty good.

Here's my problem. I have a polygon that's much longer North/South than East/West (Utility repair along a north/south road, for example). when I run map.setExtent() on the extent of the polygon, it centers on the polygon and mostly shows it, but because of the tiled layer service, it cuts off the northern and southern tips of the polygon.

When I use the identify task and the popup tool on the same polygon, and click the zoom to link, it zooms out to the next lower LOD on the tiled map service, which shows the entire polygon just fine.
Any idea how I can implement this with my query results?
0 Kudos
2 Replies
HemingZhu
Occasional Contributor III
I have a map with a Tiled and a Dynamic layer. I have a query that queries one of the features on the dynamic layer, puts the results in a table, including a link that zooms to the extent of each feature returned. Basically, I use map.setExtent() on the extent of the feature. It works pretty good.

Here's my problem. I have a polygon that's much longer North/South than East/West (Utility repair along a north/south road, for example). when I run map.setExtent() on the extent of the polygon, it centers on the polygon and mostly shows it, but because of the tiled layer service, it cuts off the northern and southern tips of the polygon.

When I use the identify task and the popup tool on the same polygon, and click the zoom to link, it zooms out to the next lower LOD on the tiled map service, which shows the entire polygon just fine.
Any idea how I can implement this with my query results?


You could use map.setExtent(extent, true). It will guaranted the whole polygon show completely on the map.
0 Kudos
KenDoman
Occasional Contributor II
Great, thanks!
0 Kudos