Select to view content in your preferred language

how to capture click event on marker ? I am using SimpleMarkerSymbol to show marker

2951
3
Jump to solution
04-18-2017 06:48 AM
PushprajSingh
New Contributor

At the time of clicking the markers, the app should retrieves the id from the selected marker to make further requests. Currently I'm able to pin the markers succesfuly where as the following key question still to be answered

  1. Is there any way to capture SimpleMarkerSymbol click event?
  2. Is there any way to attach data attribures to the marker that will be used while the click event is dispatched?
0 Kudos
1 Solution

Accepted Solutions
KellyHutchins
Esri Frequent Contributor

I think this question should be posted in the ArcGIS API for JavaScript community since it looks like a developer question. 

You can't assign attributes and click events to the symbol you assign them to the graphic instead and then the graphic is displayed using the SimpleMarkerSymbol you specify. Here's a sample showing how to display graphics on a map that have associated attributes. 

Feature collection | ArcGIS API for JavaScript 3.20 

View solution in original post

3 Replies
KellyHutchins
Esri Frequent Contributor

I think this question should be posted in the ArcGIS API for JavaScript community since it looks like a developer question. 

You can't assign attributes and click events to the symbol you assign them to the graphic instead and then the graphic is displayed using the SimpleMarkerSymbol you specify. Here's a sample showing how to display graphics on a map that have associated attributes. 

Feature collection | ArcGIS API for JavaScript 3.20 

PushprajSingh
New Contributor

Thank you Kelly,

I have tried Feature collection also but it has not produce any result. 

I have one more query :

Can you please tell how to develop the feature API . For example 

var featureLayer = new FeatureLayer("https://sampleserver3.arcgisonline.com/ArcGIS/rest/services/SanFrancisco/311Incidents/MapServer/0").

My concern is how can I develop following my own URL/API 

https://sampleserver3.arcgisonline.com/ArcGIS/rest/services/SanFrancisco/311Incidents/MapServer/0''

Thanks in advance

0 Kudos
KellyHutchins
Esri Frequent Contributor

You can use ArcGIS Server or created a hosted layer using ArcGIS Online

Publish hosted feature layers—ArcGIS Online Help | ArcGIS 

0 Kudos