I have two feature layers - Regions and Sites. I am trying to show energy usage stats based on map clicks. My flex app has a container which has a map view and some charts. When user clicks on region map should zoom into region and then display sites as points. Charts should show data on energy consumption usage for that region. If user then clicks on a site, charts should show energy consumption for that site. As I am capturing the click using MapClick, it cannot seem to distinguish between whether I am clicking region or site. I have the feature layers set up with a relationship query and it all works fine except I cannot capture clicks on sites! Can someone help or point me in the direction of an example that tells me what I am doing wrong? I guess I need to add another event to capture site clicks but how i do distinguish that it is a click on that layer and not a map click as all clicks on the map are registered as map clicks! Hope someone can help
Hi, examine the MapMouseEvent that you get back on a mouse click, it has a property 'OriginalTarget' that should give you a clue as to what was clicked on, or look at the event.currentTarget property as well.