geosolutions-it/geonode-mapstore-client

Requirements for GPS Integration on GeoNode MapStore client

Closed this issue · 6 comments

Currently the GeoNode integration does not have the GPS tool integrated.

I would want to have it appear, at least when the user is using a mobile device.
The client is asking also to have the possibility to:

  • configure at which Zoom level the viewer zooms to when you enable GPS tracking
  • when on a mobile device the maps should track the movement of the GPS (i.e. if I am looking at a map on a mobile device and I move to a different position, the maps should recenter at my position)

I need an estimate for these requirements.
Baseline is to enable the GPS control also on GeoNode.

Investigation

These are the expected actions to fullfil the requirements for the Locate plugins on openlayers and leaflet (cesium currently does not support such tool):

  • add Locate plugin and related configuration to GeoNode MapStore client on the Map Viewer (1pt)
  • implement support for configuration of max zoom level in localConfig.json (Locate plugin) (3pt)
  • verify track position (currently the follow mode is enabled by default in mobile and desktop) (2pt tests?)

@simboss I discussed with @tdipisa about the possibility to add some input components to set the zoom property of locate tool via UI to a saved map configuration and we think that this enhancement could be avoided for the moment for the following reasons:

  • this kind of property is usually set at app level via localConfig.json
  • in case of context a configuration of a plugin could be customized so we will replicate this information twice: one for the saved map config and one for the plugin config in the context
  • it could add unnecessary complexity at the current saved map configuration

Note: These investigation are referring to an implementation without UI components.

Implement support for configuration of max zoom level in localConfig (Locate plugin)

configure at which Zoom level the viewer zooms to when you enable GPS tracking

The possibility to configure the zoom level is not available and it needs to be implemented.

Proposal:

We could pass the custom options via localConfig to the Locate Support component and add an implementation to override the default options.

expected configuration of plugin in localConfig.json:

// localConfig.json
[
    {
        "name": "Map",
        "cfg": {
            "tools": ["locate"],
            "toolsOptions": {
                "locate": {
                    "maxZoom": 5
                }
            }
        }
    },
    { "name": "Locate" }
]

This improvement needs to be implemented for openlayers and leaflet.

(optional) I increased the estimate a bit because this could be an occasion to refactor this plugin based on the the new implementation of item Tool in the Map plugin (cc @offtherailz)

Verify track position (follow mode)

when on a mobile device the maps should track the movement of the GPS (i.e. if I am looking at a map on a mobile device and I move to a different position, the maps should recenter at my position)

Recently there were some updates on the Locate plugin about the possibility to improve the track of position (see georchestra/mapstore2-georchestra#53 (comment))

quote by @offtherailz

This works more or less like google maps app navigation (activate and follow until map move, then reset button to re-start following).

The current behaviour is:

  • When you click the locate button the locate tracking is enabled in "Follow mode" and centers the map on the user position.
  • The map follows the user until the user interacts with the map
  • when the user move the map (zoom or pan) the follow mode deactivates and the locate tool is still active, only showing the user's position on the map.
  • Clicking again on the locate tool will activate again the follow mode.
  • A click on the locate tool when "follow mode" is active deactivates the tool at all, removing the user position from the map and stopping following him.

Here a quick test activating the locate tool in the GeoNode MapStore client:

locate-test

If this behaviours is covering the requirement we don't need to perform action for this point.

But maybe we could spend some time do some testing on mobile devices to ensure the tracking is correctly working.

@bruncili @giohappy the PR for the MS issue has been merged in MS master today. You can proceed with the integration in the GN project by involving @allyoucanmap I think.

@allyoucanmap you should be able to go on according to your previous comment on another issue, isn't it? @giohappy please provide your agreement.

@allyoucanmap is aligning mapstore client branches with MapStore master. As soon as this is done we will have GPS and MapSwipe available to be activated inside the mapstore client.
Please @allyoucanmap proceed with the configuration of the puglins as soon as they0re available.

@bruncili @giohappy

I updated the master branch of geonode-mapstore-client https://github.com/GeoNode/geonode-mapstore-client/tree/25f5b94ab7cd2d66f838ae23d96b100ad0bd24c6
and created a PR to include Locate (GPS) and Swipe plugins in the IBF GET-IT client https://github.com/geosolutions-it/GET-IT/pull/86 .

About the current configuration:

  • The Locate and Swipe plugins are only available in the Map view/edit/embed context
  • The maxZoom configuration of Locate can be set here, currently disabled

https://github.com/geosolutions-it/GET-IT/blob/b8f62aef8fad7fe64f006b03dae8d28362539603/meteoblue/static/geonode/js/ms2/utils/ms2_base_plugins.js#L20

merged