You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to draw gridlines over the map, and I found a JS plugin, but I'd like to do this with Flutter; does anyone know of an existing solution?
Because I wasn't able to find one, I think I'll have to implement it, and I had some implementation questions:
I'd like to add a raster layer, and I'd like to create/cache the images for it locally, within the app, using Dart. I'm not sure where to write the image files or how to refer to them.
In the examples, I see this code:
static Future<void> addRaster(MapLibreMapController controller) async {
await controller.addSource(
"watercolor",
const RasterSourceProperties(
tiles: [
'https://stamen-tiles.a.ssl.fastly.net/watercolor/{z}/{x}/{y}.jpg'
],
tileSize: 256,
attribution:
'Map tiles by <a target="_top" rel="noopener" href="http://stamen.com">Stamen Design</a>, under <a target="_top" rel="noopener" href="http://creativecommons.org/licenses/by/3.0">CC BY 3.0</a>. Data by <a target="_top" rel="noopener" href="http://openstreetmap.org">OpenStreetMap</a>, under <a target="_top" rel="noopener" href="http://creativecommons.org/licenses/by-sa/3.0">CC BY SA</a>'),
);
await controller.addLayer(
"watercolor", "watercolor", const RasterLayerProperties());
}
My guess is I can get it working from these 2 examples, but I wasn't sure if there was a recommended way of doing this, or if the RasterSourcePropertiestiles property can even use a local filesystem url.
So, should this work? Or are there some gotchas with this approach?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I'm trying to draw gridlines over the map, and I found a JS plugin, but I'd like to do this with Flutter; does anyone know of an existing solution?
Because I wasn't able to find one, I think I'll have to implement it, and I had some implementation questions:
I'd like to add a raster layer, and I'd like to create/cache the images for it locally, within the app, using Dart. I'm not sure where to write the image files or how to refer to them.
In the examples, I see this code:
And I found this helpful issue comment for saving and using local glyphs.
My guess is I can get it working from these 2 examples, but I wasn't sure if there was a recommended way of doing this, or if the
RasterSourceProperties
tiles
property can even use a local filesystem url.So, should this work? Or are there some gotchas with this approach?
Beta Was this translation helpful? Give feedback.
All reactions