Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add pmtiles support #198

Closed
wants to merge 4 commits into from
Closed

add pmtiles support #198

wants to merge 4 commits into from

Conversation

greensopinion
Copy link
Owner

No description provided.

@josxha
Copy link
Contributor

josxha commented Feb 19, 2024

Hi @greensopinion! It's nice to see that you want to add native support for PMTiles to your vector_map_tiles package!
I'm the author of the vector_map_tiles_pmtiles package. If I knew that you have concidered to add support yourself I wouldn't have created the package. 😅

I wanted to share some experience with pmtiles.

  • The max and min zoom are both required for pmtiles, so you could use the values from the header directly.
  • Protomap is sadly not compatible with openmaptiles styles. Have you planned to add a protomaps theme as ProvidedTheme?

@greensopinion
Copy link
Owner Author

@josxha very cool, I wasn't aware of your support for pmtiles! Thanks for pointing that out. I won't merge this change, since you've already got it covered. Feel free to issue a pull request on the README of this package - it would be good to make your plugin more discoverable.

The max and min zoom are both required for pmtiles, so you could use the values from the header directly.

I'm not sure what you mean!

Protomap is sadly not compatible with openmaptiles styles. Have you planned to add a protomaps theme as ProvidedTheme?

What aspect is not compatible? Can you elaborate?

@greensopinion
Copy link
Owner Author

suggested changes: josxha/flutter_map_plugins#34

@josxha
Copy link
Contributor

josxha commented Feb 19, 2024

I won't merge this change, since you've already got it covered. Feel free to issue a pull request on the README of this package - it would be good to make your plugin more discoverable.

Alright, if you change your mind and want to have build-in pmtiles support in the future I'm completely fine with it. Until then I keep maintaining the tile provider package. 👍I'll do a pull request with the documentation tomorrow.

I'm not sure what you mean

I was looking though your implementation and saw that you let the user provide the min and max zoom for the PmTilesVectorTileProvider

PmTilesVectorTileProvider(
      {required this.archive,
      required this.type,
      required this.minimumZoom,
      required this.maximumZoom});

and since both parameters are required fields in the PMTiles header, those values can be used directly from the archive:

  @override
  int get maximumZoom => archive.maxZoom;

  @override
  int get minimumZoom => archive.minZoom;

...but this information doesn't really matter now any more i guess.

What aspect is not compatible? Can you elaborate?

I haven't compared Protomaps and openmaptiles styles in detail yet but if you try to use Protomaps tile data with the included osm libery light theme only some layers get drawn. The result looks something like this:

By using one of the default protomaps themes (e.g. from the node package) all details show up fine. For more information see josxha/flutter_map_plugins#17.
I think same incompatibility is with openmaptiles and mapbox themes if I'm not wrong?


suggested changes: josxha/flutter_map_plugins#34

Thanks I'll check it out tomorrow!

@greensopinion
Copy link
Owner Author

thanks @josxha !

if you try to use Protomaps tile data with the included osm libery light theme only some layers get drawn

Generally the theme has to match the tile data format. From what you've observed, Protomaps vector tiles provide tile data with the same protobuf schema but different conventions, so osm styles don't work with Protomaps.

I think same incompatibility is with openmaptiles and mapbox themes if I'm not wrong?

Mapbox themes work great with open map tiles. You can try it out from the examples project.

I'm going to close this PR off, since there's nothing left to do here.

@josxha
Copy link
Contributor

josxha commented Feb 19, 2024

Mapbox themes work great with open map tiles. You can try it out from the examples project.

Oh, that's nice. Good to know!

Feel free to issue a pull request on the README of this package - it would be good to make your plugin more discoverable.

I opened #200 for it. 👍

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.

2 participants