Select to view content in your preferred language

Limiting zoom and pan?

2709
7
01-08-2013 02:39 PM
AlastairMoore
Emerging Contributor
Hi all,

I'm building a mobile app for iOS and Android using ArcGIS. The app is a tour app that shows the user locations in a certain area. I'd like to limit the panning and zooming to a certain level. Is this possible and if so how?

Thanks very much!
Tags (2)
0 Kudos
7 Replies
AnthonyGiles
Honored Contributor
Alastair,

You can limit the scale by using LODS in your main config, have a look at the bottom of this page:

http://help.arcgis.com/en/webapps/flexviewer/help/index.html#//01m300000018000000

Regards

Anthony
0 Kudos
AlastairMoore
Emerging Contributor
Hi Anthony,

Thanks for your response but I'm not sure if this relates to the ArcGIS Flex component. I'm not actually using the ArcGIS Viewer for Flex, I'm using the Flex component so would need to be able to configure this in Actionscript/MXML using the API.

Many thanks,

Alastair
0 Kudos
AnthonyGiles
Honored Contributor
Alastair,

Sorry i didnt realise that you were not using the viewer. The map class has a LODs function, see:

http://resources.arcgis.com/en/help/flex-api/apiref/com/esri/ags/Map.html#lods

Regards

Anthony
0 Kudos
AlastairMoore
Emerging Contributor
Thanks very much for your help, Anthony, that's sorted the zoom!

I'm curious regarding the LODs - is the resolution/scale set by the map? (I'm using this for my TiledMapServiceLayer - http://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer) As I tried a number of different values for the resolution/scale but it was only when I wrote out the map.lods array to view the default LODs and used those that my map would display.

How about limiting panning? 🙂 I'm guessing this might not be quite as straight forward.

Cheers,

Alastair
0 Kudos
AnthonyGiles
Honored Contributor
Alastair,

I would guess that because the map is a tiled service you will be limit to the pre cached scales in the service.

For panning try setting pan.enabled to false:

http://resources.arcgis.com/en/help/flex-api/apiref/com/esri/ags/Map.html#panEnabled

Regards

Anthony
0 Kudos
KenBuja
MVP Esteemed Contributor
Take a look at the code in Monsour's blog about constraining the map extent. You can see it here in action.
0 Kudos
AlastairMoore
Emerging Contributor
Take a look at the code in Monsour's blog about constraining the map extent. You can see it here in action.


Hi Kenbuja,

Thanks for the link. I did look at that yesterday but it seems that the code doesn't work with the latest Flex/ArcGIS API. No matter, it's a minor point and one I'm sure my client won't mind too much. I'll approach this issue if/when it arises!
0 Kudos