On demand synchronization works in two directions:
Application is able to download the latest data snapshot and to send local changes to a remote source.
Currently the application supports two remote source types: WFS-T and WMS. WMS synchronization works with raster data and only in one direction; download data. WFS-T synchronization works with vector data and in two directions; download and upload. Synchronization works also with feature sources that have blob attributes configured.
Synchronization system is composed of three main elements: Mobile MapWorks Advantage application, Synchronization Service and remote source (WMS, WFS-T).
Graphic below shows how those three components communicate:
In order to get the latest data, the application downloads data as geopackage database using the Synchronization Service. The Synchronization Service communicates with remote source to get the requested data, creates geopackage database and returns it back to the application.All user changes from the application are directly synchronized with remote source (WFS-T), without use of synchronization service.
In order to get the system running you must:
How to deploy synchronization service
Synchronization service is used to generate geopackage. MMW communicate with service to download snapshot of data.
Service restriction:
To use synchronization in your application you must add 'synchronization' section to your configuration and add at least one synchronization definition. Synchronization section is an array of synchronization definitions.
Synchronization definition must contain:
e.g.
"synchronization": [ { "id": "hydrantSync", "localFsd": "hydrantDbBlobFsdId", "remoteFsd": "hydrantWfsFsdId", "service": "syncServiceId", "mode": "once", "options": { "outputCrs": "EPSG:3857", "bbox": [ "-9368962.993942337", "3955864.6340997987", "-9367355.427691216", "3957598.799179017" ], "zoomLevel": "18" } } ]
Sample sync service configuration
{ "id": "syncServiceId", "name": "syncService", "type": "syncService", "url": "http://111.111.111.111/syncservice" }
Basic configuration with one vector that can be synchronized
Configuration with raster and vector offline sources that can be synchronized
To download latest snapshot of data tap on synchronization data button. After tap, application will download latest snapshot of data defined in configuration.
To synchronize your local changes with remote source tap synchronize data button. Application will send changes to the server and after that it will download latest snapshot of data to the device.
Synchronization button inform about actual state of synchronization.
Button with arrow down inform that all outgoing changes are synchronize and only new data snapshot can be downloaded.
Button with arrow up inform that local changes are made and application is ready to synchronize them with remote source.
Map with synchronization button and no data:
Synchronization in progress:
Synchronization finished: