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?

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()).
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.