flutter-vector-map-tiles icon indicating copy to clipboard operation
flutter-vector-map-tiles copied to clipboard

[StyleReader] add support for field "tiles" in sources.

Open T-moz opened this issue 2 years ago • 3 comments

According to various map styles specification, the sources properties can ether hold a field url or a field tiles.

  • https://docs.geotools.org/stable/userguide/extension/mbstyle/spec/sources.html
  • https://developer.tomtom.com/map-display-api/documentation/mapstyles/map-style-specification#source-properties
  • https://maplibre.org/maplibre-style-spec/sources/#sources

Currently tiles is not supported. The StyleReader. _readProviderByName makes the assomption that url is not null, but in the spec, url is not required.

T-moz avatar Jul 18 '23 09:07 T-moz

Why do you need it? How would you use it?

greensopinion avatar Aug 19 '23 21:08 greensopinion

I need it! This is the first part of the json file I need to use:

{ "version": 8, "name": "Xyz (local)", "metadata": { "mapbox:type": "template" }, "sources": { "openmaptiles": { "type": "vector", "attribution": "(c) xyz", "scheme": "xyz", "tiles": [ "https://services.xyz.nl/api/map/nl/{z}/{x}/{y}" ], "minzoom": 0, "maxzoom": 14 } }, "sprite": "https://services.xyz.nl/sprite", "glyphs": "https://services.xyz.nl/api/fonts/nl/{fontstack}/{range}", "layers": [ { "id": "basemap-background", "type": "background", "minzoom": 0, "paint": { "background-color": "rgba(245, 249, 236, 1)" } }, { "id": "basemap-park", "type": "fill",

This style file is according to the mapbox specs defined here: https://docs.mapbox.com/style-spec/reference/sources/

Henk-Keijzer avatar Dec 10 '23 10:12 Henk-Keijzer

I've just merged a change that might do what you want: https://github.com/greensopinion/flutter-vector-map-tiles/blame/main/lib/src/style/style.dart#L108C7-L116

Feel free to provide feedback on this issue, and close it if it's working for you now.

greensopinion avatar Jan 14 '24 19:01 greensopinion