Skip to content

feat: support flutter_map v8#2

Closed
JaffaKetchup wants to merge 2 commits intokekland:mainfrom
JaffaKetchup:fm-v8
Closed

feat: support flutter_map v8#2
JaffaKetchup wants to merge 2 commits intokekland:mainfrom
JaffaKetchup:fm-v8

Conversation

@JaffaKetchup
Copy link

This is still a work in progress.

  • double tileSize -> int tileDimension is the biggest change throughout; I'm not 100% sure where the boundary is to stop renaming and changing the type - I guess the stylesheet must keep "tileSize"?
  • The vector tile layer does not yet support unbounded horizontal scrolling

At some point, some coordination is planned to create a more versatile flutter_map tile layer, which can be more easily extended for a raster layer within FM, and other vector layers. This will mean a reduction of copied code, benefit from updates to the tile layer handler, and mean unbounded horizontal scrolling will be free. Other existing plugins can also take advantage of this.

@kekland
Copy link
Owner

kekland commented Feb 26, 2025

I guess the stylesheet must keep "tileSize"?

Should be ok to rename it to tileDimension everywhere (including in shaders), if it'll benefit the consistency. The spec doesn't have a notion of "tileSize", it's up to the implementation.

and mean unbounded horizontal scrolling will be free

How does flutter_map handle this? Does it:

a) Draw each tile multiple times - e.g. draw each tile separately for each visible repetition of the world

b) Draw the entire world again - meaning, we render the world once, and then re-use the same world texture for the repetitions

First one would result in some performance penalties with the current implementation, since it'll require additional draw calls. However, the second one should be OK in terms of performance, since we can take the ui.Image that was created as a part of the "main world rendering", and then re-use that image to paint the visible world repetitions

@aytunch
Copy link

aytunch commented Mar 8, 2026

Hi, any updates on the GPU vector tiles along with latest flutter_map
Thanks @JaffaKetchup @kekland

@JaffaKetchup
Copy link
Author

JaffaKetchup commented Mar 10, 2026

Hey @aytunch!

Please correct me if I'm wrong @kekland, but in the end, the main vector tiles library released a prerelease which seems to be looking very promising https://pub.dev/packages/vector_map_tiles/versions/10.0.0-beta.2. So I think this probably won't be worked on any more (by this I mean this PR and this library). I would look to use that prerelease instead - although it does need flutter_gpu which is in preview (Flutter GPU (view)) so your mileage in production may vary.

In terms of the better integration with flutter_map through the Modern Tile Layer, fleaflet/flutter_map#2120 is open. However, I'm the only person working on it at the moment, and (fully understandably!) the maintainers of the main plugin don't want to get involved with it until it's pretty much ready to go. And it's a long way off from that since they do lots of special things that make it hard to have any reasonable base. So whilst I really do want to keep working on it, I'm struggling to find motivation to progress any further without any more certainty.
I'm considering a much smaller scope rewrite of just the very very basics of the TileLayer + TileProvider interaction using some of the ideas from fleaflet/flutter_map#2120 that are already written. This should do the extent of my needs (better interface for plugins affecting tile sourcing). And hopefully it would be easier to me to 'sell' to them. But they'll still have to duplicate some amount of the TileLayer code, which was the other aim for the PR - maybe that's a step too far though.

@kekland
Copy link
Owner

kekland commented Mar 11, 2026

Hi @JaffaKetchup @aytunch!

Yep, for the meantime I decided not to pursue this any further due to:

  • main vector tiles plugin already working pretty well with gpu rendering
  • enormous scope of the project
  • personal issues and inability to commit any time to projects like this atm

I may revisit this later in the future, but for now I'd recommend using the already existing vector tiles plugin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants