reconstitute graphics Layer filled out. No on click event listener

This commit is contained in:
Andy Gup 2014-06-06 17:21:36 -06:00
parent 4854605498
commit 10c76d2404

View File

@ -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);
}
}