I've loaded a feature layer into a web map (using javascript api 3.20). I'm trying to use the following to edit an existing points location (by dragging it to a new location) in a feature layer that I have loaded. I'm trying to use:
$(document).on('click', '#movebtn', GeomEdit);
function GeomEdit() {
var editpoint = new Edit(map);
editpoint.activate(Edit.MOVE, <graphic>).
}
This function fires when I click a button WITHIN the infowindow (#movebtn) of the point I clicked.
I am unsure of what I need to put into the graphic parameter to make this work?
What are the requirements?
-
Take a look at this example: developers.arcgis.com/javascript/3/jssamples/…ianbroad– ianbroad2017年04月01日 04:26:55 +00:00Commented Apr 1, 2017 at 4:26
1 Answer 1
if you are use map.infoWindow, you can access selected graphic this way "map.infoWindow.getSelectedFeature()".
note : while you open the infowindow, you must use map.infoWindow.setFeatures([graphic])
so :
$(document).on('click', '#movebtn', GeomEdit);
function GeomEdit() {
var editpoint = new Edit(map);
editpoint.activate(Edit.MOVE, map.infoWindow.getSelectedFeature()).
}
Explore related questions
See similar questions with these tags.