Select to view content in your preferred language

Allow users to move popup (infowindow) around

1452
1
11-25-2014 09:06 AM
EdwardSohn2
New Contributor III

What is the best way to allow users to move the popups (infowindows) around and still keep the anchor on the feature.

Currently the popups (infowindows) are fixed on the map and user cannot move them.

.

0 Kudos
1 Reply
DavidBlanchard
Esri Contributor

There is no easy way to accomplish this, any solution will require a considerable amount of work on your part.

The info-window is just an HTML Div Element, therefore you can use Dojo's dnd/moveable module to move this div around. As for the anchor remaining in place, this will require you to come up with some code that listens to the Dojo events, then recalculates the positioning of the div which forms the anchor. This will probably not be trivial, and I can't offer any tips for this as I've never attempted such a thing.

An issue I can think of is that the div that contains the anchor and the info-window will start covering the map as it will get larger as you move it further from the anchor point. This will prevent you from interacting with the map. You may want to look into using pointer-events CSS properties, but these are only supported in IE9+.

0 Kudos