onaio / kujaku

Mapping and check-in library for Android using MapBox SDK
https://ona.io
BSD 2-Clause "Simplified" License
18 stars 11 forks source link

G3.1.3 - Allow the user to toggle between base layers using a MapToggle widget #260

Closed armageddon closed 5 years ago

armageddon commented 5 years ago

As a user I would like to toggle between base layers when looking at a map. e.g. I would like to switch between high res satellite image and a vector tile showing street maps, or to a layer showing altitude

craigappl commented 5 years ago

Support toggling between the Satellite Street layer and the Streets layer.

Here's an example in Mapbox GL JS https://docs.mapbox.com/mapbox-gl-js/example/setstyle/

ekigamba commented 5 years ago

I checked out @craigappl's link on the Mapbox GL JS and it seems the following would be some of the possible base layers:

  1. Streets
  2. Satellite
  3. Light
  4. Dark
  5. Outdoors

only the raster layer for satellite is available as a single layer, the rest are available as a group of layers

This can eventually fall into https://github.com/mapbox/mapbox-plugins-android

The MapToggleWidget can be added as a BaseLayerSwitcherPlugin which will enables a developer to define BaseLayer

A BaseLayer can either be a single or multiple layers and their data sources which are treated as one.

An interface will be provided to define a BaseLayer that automatically shows up on the UI switcher with a given name.

The plugin is enabled handles the user selections.

Technically, these layers will be added either above the background layer which is usually the first layer or as the first layer if no background layer exists in the style.

The only issue is that offline map downloads will not work with these base-layers because they are not originally present in the style

We would have something like on Google Maps(below) but we might not have icons for now. In our case it would be a list of base layer names

Screenshot_2019-05-16-17-30-51-944_com google android apps maps

Screenshot_2019-05-16-17-30-48-911_com google android apps maps