Select to view content in your preferred language

Polygon help!

1190
11
08-20-2010 10:04 AM
LeesaJones
Emerging Contributor
Hi, new esri developer here, need some help implementing a feature.  I want to only display a map inside a given polygon and not allow map clicks or display of map data outside this polygon.  Any ideas?
Tags (2)
0 Kudos
11 Replies
RobertScheitlin__GISP
MVP Emeritus
vjones,

   This is definitely not going to be a cake walk especially for a flex beginner but here is a link to what I think you are after.

http://thunderheadxpler.blogspot.com/2009/01/constraining-map-extent.html
0 Kudos
LeesaJones
Emerging Contributor
Thank you Robert - this is almost there and part of what I want to do.  The other part is I would like to display only the polygon like you do on your site where you display only Calhoun County.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
vJones,

   Only my county displays because I am using my map services not esri's and I don't have any other data than my county in those map services.
0 Kudos
LeesaJones
Emerging Contributor
Let me add a little detail of what I have tried so far.

First of all the polygon is derived from several other polygon and merged together to make one polygon.  With this approach I am not quite there because the resultant polygon does not encompass all the features in the area... I can work on resolving that later.

I am able to shade the resultant polygon - thats a good thing, however I want the opposite.  I would like to shade everything but the resultant polygon.

Will I have to create work outside of flex to accomplish this or is this something I can acomplish within flex. 

Also note I am not using flex viewer.

Any help you provide will be greatly appreciated.
0 Kudos
LeesaJones
Emerging Contributor
vJones,

   Only my county displays because I am using my map services not esri's and I don't have any other data than my county in those map services.



Ohhhh - that explains why its so perfect. 

Do you know of a way where I can combine several polygons and grey out everything outside of the resultant polygon?
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
vjones,

   Seems like that was discussed with Mansour and there was not a good way to do it. (Mansour is one of the main core developers of the AGS Flex API).
0 Kudos
LeesaJones
Emerging Contributor
Thank you for your prompt reply - looks like I will have to settle with highlighting the polygon.  One more question - Is there a correct way to combine polygons where it ends up looking like one continuous polygon instead of broken when there is a river or a rail road?
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
vjones,

   Have you merged the polygons in ArcMap?
0 Kudos
LeesaJones
Emerging Contributor
No, actually I was doing it in mxml by querying the cached map server for the selected features I wanted and taking the feature set that was returned and adding each feature ring that was returned to the polygon. 

Let me know if you wish for me to post the code.
0 Kudos