Select to view content in your preferred language

Info Window Problem with Picture Marker Symbol

1577
5
03-23-2011 10:46 PM
SreejithSS
New Contributor
I could not able to get graphics object on mouse click event of Picture Marker Symbol ,Please help me
Tags (2)
0 Kudos
5 Replies
FaizanTayyab
Deactivated User
Can you explain more as to what you are trying to achieve and some code will help.
0 Kudos
shakesvongreen
Emerging Contributor
I could not able to get graphics object on mouse click event of Picture Marker Symbol ,Please help me


I also need to capture click event of picture marker symbol. I still research how to do it.
0 Kudos
MehulChoksey
Esri Contributor
Guessing without looking at code: try event.currentTarget instead of event.target to see if it works...
0 Kudos
DerrickMartin
Emerging Contributor
Has anyone had any luck getting this to work?  Tried mehu11111's suggestion, but that doesn't work either. It seems that when using the PictureMarkerSymbol, the click event returns a MapPoint and not the actual Graphic element. It looks like the currentTarget references the entire FeatureLayer. I'm trying to take some of the attributes of the clicked element to use for further processing but as the click even only returns a MapPoint, that doesn't give me the attributes. Any ideas???

CODE:

<esri:FeatureLayer id="gwcLayer"
          url="http://agsserver.com/ArcGIS/rest/services/NJ_GWC/MapServer/6"
          visible="true"
          outFields="
  • "

  •           click="gwcLayer_clickHandler(event)"
              useAMF="false" />

    DOESN'T WORK:

    protected function gwcLayer_clickHandler(event:MouseEvent):void
       {
        var gr:Graphic = Graphic(event.target);
        ...
       
       }

    Fails as the event is a MapPoint which can't be casted to a Graphic

    DOESN'T WORK:

    protected function gwcLayer_clickHandler(event:MouseEvent):void
       {
        var gr:Graphic = Graphic(event.currentTarget);
        ...
       
       }

    Fails because the currentTarget is the entire FeatureLayer and not the clicked element...
    0 Kudos
    BenKane
    Regular Contributor
    Did you ever get this figured out?  I am having the same problem.
    0 Kudos