mirror of
https://github.com/Esri/offline-editor-js.git
synced 2025-12-15 15:20:05 +00:00
reconstitute graphics Layer filled out. No on click event listener
This commit is contained in:
parent
4854605498
commit
10c76d2404
@ -262,7 +262,9 @@ require([
|
||||
if(_isOnline == false){
|
||||
var fLayer = JSON.parse(localStorage.offlineLayerDef);
|
||||
var fFeatures = JSON.parse(localStorage.offlineFeature);
|
||||
reconstituteGraphicsLayer(fLayer,fFeatures);;
|
||||
reconstituteGraphicsLayer(fLayer,fFeatures,function(result){
|
||||
initEditing(result);
|
||||
});
|
||||
}
|
||||
})
|
||||
|
||||
@ -405,7 +407,7 @@ require([
|
||||
|
||||
}
|
||||
|
||||
function reconstituteGraphicsLayer(featureLayer,featuresArr){
|
||||
function reconstituteGraphicsLayer(featureLayer,featuresArr,callback){
|
||||
|
||||
if(featureLayer == null){
|
||||
alert("No features available available locally.")
|
||||
@ -420,8 +422,19 @@ require([
|
||||
|
||||
}
|
||||
|
||||
featureLayer = new FeatureLayer(featureDefinition);
|
||||
featureLayer = new FeatureLayer(featureDefinition,{
|
||||
mode: FeatureLayer.MODE_SNAPSHOT,
|
||||
outFields: ["OBJECTID","BSID","ROUTES","STOPNAME"]
|
||||
});
|
||||
// Set the graphics to red boxes to make it easy to click on them
|
||||
// on a mobile device.
|
||||
featureLayer.setRenderer(new SimpleRenderer(defaultSymbol));
|
||||
var mapListen = map.on("update-end",function(evt){
|
||||
console.log("Feature has been added back to the map while offline.")
|
||||
mapListen.remove();
|
||||
})
|
||||
map.addLayer(featureLayer);
|
||||
callback(true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user