hotosm/tasking-manager

Same available background imagery for project and data quality view

emi420 opened this issue · 3 comments

Is your feature request related to a problem? Please describe.
Background imagery for Data Quality View must be the same than the available for the project.

Related to this, the MAPBOX_TOKEN configuration property for Underpass UI must be also the same.

Describe the solution you'd like
New configuration options must be available in the Underpass UI project for supporting changing the backgrounds trough a configuration property. Then, the options must be passed to component depending on the project's configuration

Describe alternatives you've considered
An alternative is to make all image sources available in the Data Quality View, regarding the project.

Additional context

Screenshot 2023-12-07 at 18 41 41 Screenshot 2023-12-07 at 18 42 03

@varun2948 I added a new property for UnderpassMap config, now you can pass your own sources like this:

const config = {
    API_URL: "http://localhost:8000",
    sources: {
        osm: {
            type: "raster",
            tiles: ["https://a.tile.openstreetmap.org/{z}/{x}/{y}.png"],
            tileSize: 256,
            attribution: "© OpenStreetMap Contributors",
            maxzoom: 19,
          },
    }
};

You'll need to update the select also:

<select onChange={handleMapSourceSelect} ref={styleSelectRef} className="border mt-2 bg-white px-2 py-2 text-sm">
    <option value="osm">OSM</option>
</select>

This new feature enables the use of the same background imagery for both the project's iD editor and the Live Monitoring view.

Can we keep OSM background available and as the default one?

Thanks @royallsilwallz !

Yeah sure @emi420, I'll update it.