Select to view content in your preferred language

Restrict View Port Bounds in Flex Viewer 2.x

4518
19
01-10-2011 02:58 AM
BrendanCunningham
Emerging Contributor
Hi,
Is there a quick way to restrict the Max & Min bounding coordinates for a map application?
I have a very localized Flex Viewer application and I don't want end users zooming out or away from the project area. Ideally if they try to pan past a certain bounding coordinate range then they will not be allowed to do so.
Thanks all,
Brendan
Tags (2)
0 Kudos
19 Replies
JonFisher
Emerging Contributor
Hi,
Is there a quick way to restrict the Max & Min bounding coordinates for a map application?
I have a very localized Flex Viewer application and I don't want end users zooming out or away from the project area. Ideally if they try to pan past a certain bounding coordinate range then they will not be allowed to do so.
Thanks all,
Brendan


I've wondered the same thing, and while I haven't found a way to prevent panning, you can:

  1. control the map LODs using the LOD tag: http://help.arcgis.com/en/webapps/flexviewer/help/mainconfig.htm

  2. set both initialextent and fullextent to your study area

  3. potentially you could use the splash screen to let users know there's nothing to see outside of the study area, and to use the full extent button to return if they get lost


Ultimately I've found that it's not as big a deal as I was worried about, as most users who pan away from the map area quickly see that it's not very rewarding 😉
0 Kudos
DasaPaddock
Esri Regular Contributor
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Brendan,

   Here is the FlexViewer 2.x Version of the constrained map code that is adapted from Mansour's blog that Dasa mentioned.
0 Kudos
AyieKepong
Emerging Contributor
Robert,

This code is function or not in FlexViewer 2.3.1? because i already running this code but not successful  yet. or must added some configuration to apply at Flexviewer 2.3.1?

Thanks
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Wan,

   I just tested in Flex Viewer 2.3.1 and it works as expected. If you have not changed the extent in the MapManagerSkin.mxml as the instructions say that you optionally can then the map will be constrained to the extend of the United States.
0 Kudos
AyieKepong
Emerging Contributor
Ok Robert.

It works now.

Thanks a lot Robert.
0 Kudos
AyieKepong
Emerging Contributor
Robert,

Sorry, I've a question about this map constraints.

I already set map constrain extend. For example, map will be constrained to the State A. When I make a query and the data list also come from others state for example State B.

So, when I click that result row, map will stop because the data is out of map constrain extend and looks like 'hang'. Do you have any suggestion for me to solve this problem? or I can popup some message to tell users that the data is out of map area constraint.

Thanks
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Wan,

   Why not add to the users query an additional SQL portion that states " AND STATE = 'x'" that way there are no results returned.
0 Kudos
AyieKepong
Emerging Contributor
Ok Robert,

Thanks for the ideas. I just want to know if there have any ideas to solve this matter.
Anyway I think I must go through using added SQL statement as I'm was thinking yesterday and the same idea with you.

Thanks Robert for your reply.
0 Kudos