Hello and good morning GeoNet,
I currently have bookmarks for a few dozen points.
I would like to be able to select a bookmark and have it open the popup of its respected point.
Is there any easy way to do this? Not-so-easy way to do this?
I am aware of this post here but it does not seem like the same question that I have was ever answered: https://community.esri.com/thread/104876
Any help is greatly appreciated. Thank you.
Solved! Go to Solution.
nvm!
I got it to work. I was using the wrong button.
If you use the create button in the bookmark widgets setting dialog then you have to add the code to a different file.
in the WebmapBookmarks.js replace the _onBookmarkClick function:
_onBookmarkClick: function (bookmark) {
require(['esri/geometry/Extent'], lang.hitch(this, function (Extent) {
if (false !== bookmark.isSaveExtent) {
var ext = bookmark.extent, sr;
if (ext.spatialReference) {
sr = new SpatialReference(ext.spatialReference);
} else {
sr = new SpatialReference({ wkid: 4326 });
}
this.map.setExtent(new Extent(ext));
this.map.setExtent(new Extent(ext)).then(lang.hitch(this, function(){
var currentMapCenter = this.map.extent.getCenter();
var scrPnt = this.map.toScreen(currentMapCenter);
this.map.emit("click", {mapPoint: currentMapCenter, screenPoint: scrPnt});
}));
}
//layers
if (true === bookmark.isSaveLayers) {
utils.layerInfosRestoreState(bookmark.layerOptions);
}
}));
},
Phil,
Don't forget to re-mark this one as answered.