Feature Layer on click

2378
6
Jump to solution
01-22-2016 05:26 AM
GlenReid
New Contributor II

Based on the following sample:

Feature layer with popup | ArcGIS API for JavaScript

I created this:

FeatureLayer Select - JSFiddle

I don't understand how this is working -- I removed the map.on("click") event as it was always being called twice.  It seems as if there is some default onClick event that is applied.

Thanks.

0 Kudos
1 Solution

Accepted Solutions
TimWitt2
MVP Alum

Glen,

having a popup for your map/feature layer is your first on click event. Once you add an on click event for your feature layer, that will be your 2nd.

I hope this is what you are asking

Tim

View solution in original post

6 Replies
TimWitt2
MVP Alum

Glen,

having a popup for your map/feature layer is your first on click event. Once you add an on click event for your feature layer, that will be your 2nd.

I hope this is what you are asking

Tim

GlenReid
New Contributor II

Thanks Tim.  Is there any way to remove the popup click event?

0 Kudos
TimWitt2
MVP Alum

I think the best question would be, what do you want to achieve?

0 Kudos
GlenReid
New Contributor II

Once the user zooms to a selected feature, I'll be adding new features to the map (another feature layer) within that selected area of interest.  The user will then select features from new layer.  I will add an event to handle the selection (e.g. on drawend).  I don't want the popup click event still active.

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Glen,

   Sure there is a setInfoWindowOnClick method you can set to false.

Map | API Reference | ArcGIS API for JavaScript | setInfoWindowOnClick

GlenReid
New Contributor II

Robert -- that did it, thanks!

0 Kudos