Zoom doesn't work

1239
9
Jump to solution
10-03-2014 07:54 AM
BrentHoskisson
Occasional Contributor III

I don't understand how there have been no complaints about zooming in the javascript api.   You can take any tiled sample.  Draw a box around an area you want to zoom to (shift + mouse move).  It will either go too far or not far enough.  How hard is it to find the extent of the box and zoom to those coordinates???

I am in IE 10.

You can use as an example Home Extent .   And pick any state and draw a box to zoom in.  It will not honor your box coordinates.  What gives?

How can I specify coordinates or a box and have the tiled service actually zoom to that exact area?

0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus

Tiled map service have predefined LODs (Levels of Display) that the map service is cached at and the zoom function will always go to the nearest LOD for that map service. If you do not like this than you can take the performance hit and use Dynamic map services instead.

View solution in original post

0 Kudos
9 Replies
RobertScheitlin__GISP
MVP Emeritus

Tiled map service have predefined LODs (Levels of Display) that the map service is cached at and the zoom function will always go to the nearest LOD for that map service. If you do not like this than you can take the performance hit and use Dynamic map services instead.

0 Kudos
BrentHoskisson
Occasional Contributor III

You're kidding right?  Other API's don't force a Level of Display (Silverlight for example).

0 Kudos
BrentHoskisson
Occasional Contributor III

So how would someone - say - zoom to a parcel when there is a tiled service (aerial photo) in the background?

0 Kudos
KenBuja
MVP Esteemed Contributor

With tiled map services, the map will only show at specific scales. The image below show the levels of detail of the World Topographic Map service. When you attempt to zoom to an exact shape, the map will almost certain not be able to zoom to that scale. Instead, it has to zoom to the closest available scale.

If you were working with dynamic map services instead, you would be able to zoom to an exact shape.

scales.png

0 Kudos
BrentHoskisson
Occasional Contributor III

With tiled map services, the map will only show at specific scales.

And you guys are happy with that?  I didn't know I was so spoiled not having to work with the javascript API.   How do you reliably zoom to a parcel?

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

You add more LODs if the parcel is small and the Tiled Map Service does not zoom in far enough, or you use dynamic map services instead (as we have both mentioned). It is really not a big issue, other APIs like Flex did the same thing.

0 Kudos
KenBuja
MVP Esteemed Contributor

Before making the switch to JavaScript, I wrote Flex applications. I was used to that behavior and was surprised to see that Silverlight doesn't do it like that.

For zooming into a specific objects (like a parcel), I include the fit Boolean in the setExtent method to make sure the object is completely inside the new extent

map.setExtent(objectExtent, true);

TracySchloss
Frequent Contributor

If you don't like this, just wait until you discover that not all of the base maps that ESRI offers let you zoom in the same amount! 

I also came from FLEX, so from my perspective, having only specific scales available to you based on tiles is normal.  I see it more as a limitation of using a tiled service, not as a restriction of the API itself.

0 Kudos
BrentHoskisson
Occasional Contributor III

Well, thanks for your comments, anyway.  I suppose I shouldn't be surprised.  ESRI has never been known for being consistent across platforms.

I guess it goes to show that you don't complain about things you don't have that you never knew were possible.  And you take for granted things that you use everyday that you didn't know were not possible in other places.

I didn't realize four years ago when I was designing layers for my Silverlight app how critical my tiling structure choices should have been.

0 Kudos