osm_flutter
osm_flutter copied to clipboard
Zoom to bounding box and restrict
Is this feature available perhaps? I wish to zoom to a country bounding box and not let the user zoom out. Android library has
map.zoomToBoundingBox(getCountryBoundingBox(), false) map.setScrollableAreaLimitDouble(getCountryBoundingBox())
Perhaps available in this flutter lib?
zoom with bounding box is not available in the plugin but i will add this feature in init configuration and in separate method
i will publish new version 0.8.2
that contain set camera area limit of the map
i added new attribute areaLimit
in MapController to limit area when map initialize
and i create 2 other method limitArea
and removeLimitArea
after init of the map
for ios i will added in next version
new version 0.8.2
was published now
and also i will add zoomBoundingBox soon
thank you
i will keep this issue open until i finish all the feature in android/ios/web
Hey! With limitArea
you have opened up new possibilities. Could you explain more how do we get the east west north south attributes and use it to fit a certain portion of the map in screen ? Do we calculate from the geopoint ?
the east west north south are 2 geoPoint = (south,west) are min latitude,longitude and north,east are max lat,lon you can get them from nominatim endpoint like this https://nominatim.openstreetmap.org/search?q=$country&format=json and key:boundingbox also this web app to get boundingbox : https://boundingbox.klokantech.com/ this is gist contain json with all boundingbox of countries: https://gist.github.com/graydon/11198540#gistcomment-2824611
bad news is that this feature will available only for android/web because ios sdk have some limitation i will try to implemented by my own but it will in the future