Select to view content in your preferred language

Identify features in NavMenu

1371
12
08-02-2010 11:58 PM
ManuelFrias
Regular Contributor
Hi,

From the code Robert shared some time ago (http://gis.calhouncounty.org/SFVDemo) I am using the NavMenu which provides a shortcut to the navigation buttons.

I would like to add a new button which would mimic the IdentifyWidget. I added a new public static const to SiteContainer.mxml

  public static const WIDGET_SHOW_INFO:String    ="widgetShowInfo";


which will then call the  public static const SHOW_INFOWINDOW in AppEvent.as

What I find tricky  is how to make the infoData object.

var infoData:Object =
         *       {
         *          icon: icon,              //a Image object
         *          title: "a title string",
         *          content: "a string",
         *          link: "http://a.url.com",
         *          point: point,            //a Point object
         *          geometry: geom           //a Geometry object
         *       };


I looked at IdentifyWidget.mxml and thought I would try to replicate everything in there.

Is there an easier way or should I just go on?

Thanks,
Manolo
Tags (2)
0 Kudos
12 Replies
ManuelFrias
Regular Contributor
Hi Robert,

Almost! That code identified the visible layer but it returned an error "invalid layer specified" six times (I have seven map services).

Then I added the following line:

if (identifyLayerOption == "visible" && dynamicLayer.visibleLayers.length > 0)


and I don't get the error but now it identifies all layers in the one map service. The service where there is one visible layer 😞

Manolo
0 Kudos
ManuelFrias
Regular Contributor
I got it,

I removed the "invalid layer specified" error by commenting out Alert.show in function onFault. I don't know why this error appeared but it might be because I had modified the MapMapneger to show the cursor when clinking on a button.

Then it identified also my tiled layers which I didn't want to. I solved it by assigning "" to url when a tiledLayer was identified.

I attached the final mxml for those who want to experiment/improve/use it.

Thank you Robert for pointing me in the right direction.

And now, how do I assign your points? Don't tell me is not ready yet in this new forum.

Manolo
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Manolo,

   Yep, they don't have it worked out yet so just remember to come back later when they do.
0 Kudos