Select to view content in your preferred language

Navigation through maps with sample viewer

526
1
06-14-2010 12:41 AM
DavideRodomonti
Emerging Contributor
Hi I want to build an application modifying the sampleviewer to navigate thought maps and buildings.
Example:
In the general map I have buildings and when I click on one of them(that has a field where is stored as value the map service name of the building) I want that the Flex Sample Viewer switches the mapservice from the general map to the building map..
Is there any sample of code that showes how to realize it?

Thanks in advance,

David
Tags (2)
0 Kudos
1 Reply
RobertScheitlin__GISP
MVP Emeritus
David,

   There are several ways you could do this depending on what you want as far as user experience.

1. You could just add the new map service to the existing map and then have a button to remove it when the user wanted to return to the normal map.

2. Use the removeAllLayers command of the map and add just the desired layer (pretty complicated to get the map map back to it's original state and probably not the desired user experience)

3. Set the visibility of all the other map layers to false, after the new layer is added and then have a button to revert.

4. Have your standard map component and then a second map component that is not visible that would get the new map service added and be set to visible when desired and vice versa.

As far as the code and user interaction to get an event fired for any of the the above routes. I would add a graphics layer that had a mouse over and mouse double click event attached to the extent of the area that the map defines. The graphics symbology would be completely transparent or nearly transparent until the mouse is over and then it would change to 100 percent alpha and maybe have to text on the screen that says to view area double click. The double click would avoid the use just click on the area and only wanting to pan or zoom.
0 Kudos