Support

What is LayerChangeEventListener and what do I do with it?

LayerChangeEventListener is an interface that can ideally be implemented on a view. Once one of the static methods, onEventMainThread or onEventAsync, are implemented, you will then need to register the LayerChangeEventListener on the LayerClient as such:

layerClient.registerEventListener(this);

Here's an example implementation of onEventMainThread:


public void onEventMainThread(LayerChangeEvent event) {
   List changes = event.getChanges();
   for (LayerChange change: changes) {
    switch (change.getChangeType()) {
       case INSERT:
       // Object was created
        System.out.println("Object was created.");
       break;

       case UPDATE:
       // Object was update
        System.out.println("Object was updated.");
       break;

       case DELETE:
       // Object was deleted
        System.out.println("Object was deleted.");
       break;
   }
   break;
   }
}
Have more questions? Submit a request