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

ImageRenderer and scale between 1 and 4 #71

Closed
Sprechen opened this issue Jan 2, 2023 · 3 comments
Closed

ImageRenderer and scale between 1 and 4 #71

Sprechen opened this issue Jan 2, 2023 · 3 comments

Comments

@Sprechen
Copy link

Sprechen commented Jan 2, 2023

Hi guys,
First of all thank you for developing this very interesting library.
I'm using this library directly in flutter_map for better performance and custom tile loading, instead of the "classical" vector_map_tiles.
I was wondering why you put in the code of ImageRenderer the assert fo the scale parameter, enforcing it between 1 and 4.
Currently, I have forked your project and removed this restriction, using a scale parameter up to 16.
I'm using the flutter_map as a full screen widget and, for my data source, I'm limited to use a maxNativeZoom to 14. With this limitation, I wasn't able to obtain nice and high resolution tiles of the map on zoom between 16 and 19, also working with the zoomScaleFactor and zoom parameters in the render method, and the scale parameter maximum value was too limiting.

Have you any other solution to improve this setup?

Thank you!

@greensopinion
Copy link
Owner

Hey thanks for the issue! Looking back at the commit that introduced the restriction, it looks like I put it there as an arbitrary sanity check. Likely we had no use-case for having a scale > 4. Feel free to issue a PR to relax the constraint!

I'm really interested to hear more about your use-case and how using this library directly instead of vector_map_tiles improves performance. If you have a repo demonstrating improvements I'd love to see it!

@Sprechen
Copy link
Author

At this moment I cannot provide a repo, but basically we cached the generated tiles as standard png and served them directly since the second request. Since we have a complete control on the tile request, with this method we can also mixed both local and remote loading (so from a local mbtiles repository or from traditional raster tile sever). I know that with this method the storage usage is extremely increased, but in some situation, as a specific app for some specific devices, this is not a problem.

I also noticed that there are some other asserts in the tile_model.dart file. A couple of times, I see an exception thrown by these asserts (unfortunately I can't provide you steps to reproduce the problem, since it hasn't happen in a systematic way). This problem caused a "gray" rendered tile, of course. Maybe, also in this case, it is possible to "relax" this assertions and, at least, provide a partially rendered tile (maybe without all of the intended details), that's probably better than nothing! Anyway, I will try to investigate on this problem.

@greensopinion
Copy link
Owner

Closing since this issue is stale. We can reopen if/when needed.

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

No branches or pull requests

2 participants