JaffaKetchup / flutter_map_tile_caching

Plugin for flutter_map providing advanced & performant caching and bulk downloading functionality, with many options for region shapes and extra tools
https://pub.dev/packages/flutter_map_tile_caching
GNU General Public License v3.0
117 stars 73 forks source link

How to download offline map for a particular City or area #154

Closed pnilkanth12 closed 5 months ago

pnilkanth12 commented 5 months ago

What do you want implemented?

Hi, I see this flutter_map_tile_caching for flutter and it's great. user can select area over map and those area can download but my point is suppose I want map download and view as offline mode particular city or area like user search from Map.

What other alternatives are available?

No response

Can you provide any other information?

E.g. I'm from India so I just give you example User search Mumbai city in map and user can download Mumbai city map and view as offline mode.

Severity

Obtrusive: No workarounds are available, and this is essential to me

JaffaKetchup commented 5 months ago

Hi @pnilkanth12, This is out of scope, as it's way beyond just passing in some coordinates. You'll need to find a way to get the coordinates of the border of a city given it's name - you can then use the CustomPolygonRegion to download this exactly, or do some maths to convert it to a bounding box and download it as a RectangleRegion. A good place to start might be Nominatim, which uses the OpenStreetMap data. Note that you should be careful when using its APIs and check the ToS first. For example, this query returns a GeoJson response for all places that match "Mumbai": https://nominatim.openstreetmap.org/search.php?q=Mumbai&polygon_geojson=1&format=geojson. You can view how this looks here: https://nominatim.openstreetmap.org/ui/search.html?q=mumbai.

pnilkanth12 commented 5 months ago

Okay, Thanks for suggestion.