Making Feature layers un-editable in HTML5 offline edit mode
Folks,
We've started to tinker with the offline editing mode of the html5 viewer (1.2) and are having some fun working out what it can and can't do etc...
One thing that raises it's ugly head - unless I've overlooked something simple, is the fact that you have to serve up a bunch of top feature layers ie. roads, rivers, lakes etc.. for location purposes, but I don't want the user to be able to edit these. I have 3 fire layers I want them to edit and eventually sync back to the server when back online - not the topo layers... Can these be disabled from edit mode??
any advice appreciated - or this can be added as an enhancement request please if it cannot be done.
cheers
Gareth
-
Hi Gareth,
Currently the only way a feature layer can be configured to be editable or not is via configuration in ArcGIS server.
It's not a good idea in general to configure editability of a layer on client side because of security concerns but
if all you want is to disable editing tools in viewer for a certain layer you could intercept a layer after being loaded,
check if the layer is one of the layers you like to disable then set the Editable property of the layer to false.
The trick is finding the right event to listen to based on your scenario, for example if your scenario is switching from online to offline you could listen to FeatureLayerOfflineEvent
but if your scenario is loading the viewer offline initially then you would probably need to listen to SiteServiceLayersLoadedEvent as well.
As you suggested a feature could also be requested to encapsulate all that and has a configurable layer list where will be set as un-editable in the viewer.
Hope that helps
0
Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.
Kommentare
1 Kommentar