I am having some trouble with the measurement widget that I can't seem to get to the root cause of. Hoping someone might have seen this issue before.
I have the search widget and the measurement widget in the same app and I am getting some weird behavior.
1) If a user uses the search widget to return a result.
2) and then pans to a different area on the map.
3) and then uses the measurement tool to measure a distance or an area. When the user clicks the second position using the measurement tool. The map pans back to the area of the original result returned by the search widget.
This behavior can be seen here.
Thanks for any help.
Rich
Solved! Go to Solution.
Hi Richard,
The javascriptis compressed and cryptic to understand completely. And I find that on each click the map changes the extent. There is some code in the bootstrapmap like below which I think is causing the problem
var n = function(n) { var t = n._map.infoWindow.location; t && !n._popupBlocked && (n._popupBlocked = !0, window.setTimeout(function() { n._repositionMapForInfoWin(t), n._popupBlocked = !1 }, n._popupRecenterDelayer)) }; this.counter = 0; this._map.on("click", o.hitch(this, function() { this._map.infoWindow.isShowing && n(this) }));
From the code above I believe, the map repositions on every click if the infowindow is showing.
Hope this helps.
Thejus
Richard,
This would be better asked in the Web AppBuilder for ArcGIS group
This application wasn't built with the web app builder even though some of the buttons look like those generated with the Web AppBuilder.
This is an application built on top of version 3.14 of the JavaScript API that uses the measurement and search dijits:
esri/dijit/Measurement
esri/dijit/Search
Thanks again!
Rich
Richard,
I am impressed! Your site looks awesome! I could not really tell the difference.
Thanks!
Hi Richard,
The javascriptis compressed and cryptic to understand completely. And I find that on each click the map changes the extent. There is some code in the bootstrapmap like below which I think is causing the problem
var n = function(n) { var t = n._map.infoWindow.location; t && !n._popupBlocked && (n._popupBlocked = !0, window.setTimeout(function() { n._repositionMapForInfoWin(t), n._popupBlocked = !1 }, n._popupRecenterDelayer)) }; this.counter = 0; this._map.on("click", o.hitch(this, function() { this._map.infoWindow.isShowing && n(this) }));
From the code above I believe, the map repositions on every click if the infowindow is showing.
Hope this helps.
Thejus
Thejus,
Thanks for giving me something to go on. I will take a look at this area of the code.
Rich
Thesus,
That was most certainly the issue. My mind would never have gone there. The issue actually has nothing to do with the search widget. It has to do with the popped up info window.
Now to fix the behavior!
Thanks again!
Rich