Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removing infoTemplate on setMapClickMode #902

Open
4 tasks
apatriz opened this issue Apr 19, 2019 · 2 comments
Open
4 tasks

Removing infoTemplate on setMapClickMode #902

apatriz opened this issue Apr 19, 2019 · 2 comments

Comments

@apatriz
Copy link

apatriz commented Apr 19, 2019

How often can you reproduce it?

  • [x ] Always
  • Sometimes
  • Rarely
  • Unable
  • I didn’t try

Description:
When there is no defaultMapClickMode for the app and setting mapClickMode to anything other than 'identify', the Identify widget will remove the infoTemplate property from all graphicsLayers in the setMapClickMode method. This creates side-effects in widgets that may use the infoTemplate property.

Steps to reproduce:

  1. add any FeatureLayer(s) as operational layers and set infoTemplates on them
  2. set defaultMapClickMode: '' in config to remove the default 'identify' mapClickMode (i.e. left-clicking the map will NOT execute identify)
  3. left click a feature layer feature to open the infoTemplate (this is default functionality for featurelayers)
  4. publish the mapClickMode topic from another widget topic.publish('mapClickMode/setCurrent', 'draw')
  5. reset the mapClickMode to default topic.publish('mapClickMode/setDefault')
  6. left click a feature in a feature layer and no infoTemplate will be shown

Expected results:

InfoTemplates that are set on Feature Layers should always be available and not removed

Actual results:
All infoTemplates are removed from all FeatureLayers on the map

Environment:

Software Version
CMV Version v 2.0.0 beta.2
Browser Chrome (latest)
Operating system Windows 10
@tmcgee
Copy link
Member

tmcgee commented Apr 22, 2019

There may be an issue identified here when the defaultMapClickMode is set to an empty string. I suspect that isn't a common scenario - at least not one that I recall having been discussed here in the last 5+ years.

Regarding this statement,

InfoTemplates that are set on Feature Layers should always be available and not removed

If the Feature Layer infoTemplates were always available, they would interfere with widgets such as Drawing/Editing tools - The infoWindow popping up unexpectedly when attempting to draw or edit a feature is disruptive. Draw and Edit are just examples. There are many contributed tools that interact with the map in a similar fashion that would be affected by this change in behavior.

Over the years, there have been many "challenges" identified in the approach taken by Esri within the 3.x API with regards to interacting with graphics on top of the map.This includes features from a Feature layer. CMV has addressed this in a specific way that has worked for many years with few compromises in functionality. Esri revisited and improved this approach in the 4.x API and is investing close to zero time in the 3.x API. As we move forward with working with the 4.x API, I highly doubt the CMV team will be re-examining how we interact with the 3.x API.

@apatriz
Copy link
Author

apatriz commented Apr 25, 2019

Completely agree with the 'challenges' of working with graphics in 3.x and regarding the time invested in 3.x functionality vs moving forward with 4.x.

Regarding defaultMapClickMode -- it can often lead to poor UX (at least in my client's scenario) when panning around the map and accidental left-click events will register an identify popup with no results, or generally unwanted identify popups.
We decided to keep 'identify' as a right-click menu option, and leave left-click with default functionality -- setting defaultMapClickMode to empty string. Understand this may be an uncommon case.

setInfoWindowOnClick is what I use to toggle the default graphic popup behavior that might interfere in custom widgets (or Draw, Edit, Measurement, etc.).

I can see the issue with modifying all the community widgets to use the above method, but it may be possible to use that method in Identify, rather than removing the infoTemplate ? Not sure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants