I've noticed that the Identify widget's popup always tends to go right over the feature that is being identified and cannot be moved. Is there a way to enable functionality to move the Identify (InfoWindow) popup around to a more favorable position?
-
1I know exactly what he is asking for and can answer this question.– jbchurchillNov 17, 2014 at 20:27
-
Could this be taken off of "on hold" please?– jbchurchillNov 17, 2014 at 21:07
-
@jbchurchill I just re-opened it.– PolyGeo ♦Nov 17, 2014 at 21:37
2 Answers
This might help. For popup you can create a new instance and assign it to the map constructor options.
var newEsriPopup = new esriPopup({
offsetY: 50,
offsetX: 50
}, domConstruct.create("div"));
var map = new Map("map", {
infoWindow: newEsriPopup
});
Chances are you already have a line like this first one in this block that connects the click event with the identifytask event function.
map.on("click", executeIdentifyTask);
map.on("click", makePopupDraggable);
identifyTask = new IdentifyTask("http://your.arcgisserver.com:6080/arcgis/rest/services/folder/service/MapServer");
Add another one that makes the popup moveable (draggable) as the second line above and put this function (below) somewhere up above these lines of code (but still within the require block).
function makePopupDraggable() {
var popupDiv, dnd;
popupDiv = document.querySelector(".esriPopup");
if (popupDiv) {
dnd = new dojo.dnd.Moveable(dom.byId(popupDiv));
}
return dnd;
}
-
A variation of this approach is now available in the latest release of CMV: github.com/cmv/cmv-app/releases/tag/v1.3.2.– tmcgeeDec 13, 2014 at 23:53