Open hhkaos opened 1 year ago
Here some hints to help us fix this
Note: in addition to that repo, another place to look for help could be the GMaps Discord channel
Hello @hhkaos. Thanks for a nice start-up project that helped me to investigate vector maps in flutter. I spent some time on it and discovered a possible solution for your issue. Please try to use this in your example:
VectorTileLayer(
theme: _mapTheme(style, {
ThemeLayerType.symbol,
ThemeLayerType.background,
ThemeLayerType.fill
}),
backgroundTheme: ProvidedThemes.lightTheme()
.copyWith(types: {ThemeLayerType.fill}),
It helped me to display labels.
In a comment below I pasted the code allowing to display World Imagery as a background. Good luck.
If you would like to have World Imagery as a background (raster TileLayer) and vector streets, borders on a map (ThemeLayerType.line), you can use
TileLayer(
urlTemplate: _rasterTileUrlTemplate('World_Imagery'),
tileProvider: CachedNetworkTileProvider(), // can be NetworkTileProvider()
minZoom: 1,
maxZoom: 17,
),
VectorTileLayer(
theme: _mapTheme(style, {
ThemeLayerType.line, // country, city, district, street lines
ThemeLayerType.symbol, // country, city, street labels
}),
tileProviders: TileProviders(
{
'esri': _cachingTileProvider(
_vectorTileUrlTemplate('World_Basemap_v2'),
)
},
),
),
String _vectorTileUrlTemplate(String type) =>
'https://basemaps-api.arcgis.com/arcgis/rest/services/$type/VectorTileServer/tile/{z}/{y}/{x}.pbf?token=$apiKey';
String _rasterTileUrlTemplate(String type) =>
'https://services.arcgisonline.com/ArcGIS/rest/services/$type/MapServer/tile/{z}/{y}/{x}?token=$apiKey';
Additionally, download and use styles from "arcgis-imagery": "ArcGIS:Imagery". They are much better when used with World Imagery.
Results:
In case your map can't be updated (previously downloaded map will be displayed, without labels), please ensure that you removed cache from your device and re-download tiles.
Thank you very much @lukaszszyman !! I had a crazy week and I didn't have time to check, but I will try soon! thanks 🙏
I'm not sure why but labels are not been displayed on any map style: