AnsweredAssumed Answered

featurelayer have been redrawn when panning the map

Question asked by guriguri113 on Aug 16, 2016

i`m trying to the arcgis javascript featurelayer editing web App.

I had to face two Problem.

Probem 1.

i was tested two featurelayer .

<1>

layer1 =new FeatureLayer(url, {
mode: FeatureLayer.MODE_SNAPSHOT,
outFields: ["*"],
});

layer1's geometrytpye is "polygon"

<2>

layer2 =new FeatureLayer(url, {
mode: FeatureLayer.MODE_ONDEMAND,
outFields: ["*"],
});

layer2's geometrytype is "point"

layer1 was tested graphicMove editing. This layer did not disappear even if the extent has change.

layer2 was also tested graphicMove editing. but... this layer disappear. when map extent changed.

i was tested layer2`s mode MODE_SNAPSHOT.
but...layer2 invisible...

Why should I use two layers of different modes ?


Probrem 2.


When I want to undo the move event to occur and featurelayer.

arcgis sample code was graphic add undoManager.

i want move evt`s undo...

this is my code. how do i fix that? help me.. There is no senior or tell anyone.

realMap.on("layers-add-result", initEditing);


function initEditing(evt) {

var currentLayer = null;
var layers = arrayUtils.map(evt.layers, function(result) {
console.log("result ==== ",result);
return result.layer;
});
console.log("layers", layers);
editToolbar = new Edit(map);
editToolbar.on("deactivate", function(evt) {
eidt_flag = true;
console.log("편집종료 ");
currentLayer.applyEdits(null, [evt.graphic], null);
console.log("Editing was Updated");
});

arrayUtils.forEach(layers, function(layer) {
var editingEnabled = false;
layer.on("click", function(evt) {
var originalFeature=null;
event.stop(evt);
editToolbar.activate(Edit.MOVE , evt.graphic);
editToolbar.on("graphic-first-move", function(evt){
console.log("Move evt === ",move_geo);

});
editToolbar.on("graphic-move-stop", function(evt){
console.log("Stop evt === ",stop_geo);

var operation = new Update({
featureLayer : layer,
preUpdatedGraphics: map.graphics,
postUpdatedGraphics: evt.graphic
});
undoManager.add(operation);
});

Outcomes