1

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?

asked Mar 31, 2017 at 21:25
1

1 Answer 1

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()).
}
answered Apr 9, 2017 at 8:42

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.