You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.
When you download an offline map you provide the MGLTilePyramidOfflineRegion initialiser a bounds struct which downloads a specific part of a map.
When you use the offline map, the user is able to scroll around and sees blank tiles for parts outside the map that have been downloaded.
It should be possible to restrict the map to only pan within certain bounds.
You could implement - (void)mapView:(MGLMapView *)mapView regionDidChangeAnimated:(BOOL)animated, but then you have to manually check if the current visible screen bounds is outside the downloaded bounds.
In the previous version of the Mapbox SDK this was possible with a certain method where you would pass in the NE en SW coordinate and you couldn't scroll past those.
Platform: iOS Mapbox SDK version: 3.2.2
Steps to trigger behavior
Download an offline map
Show it on a map
Scroll around
Expected behavior
You can only scroll within the bounds that have been downloaded.
Actual behavior
You can scroll everywhere, so you get to see blank tiles when the app runs in offline mode.
The text was updated successfully, but these errors were encountered:
Previous discussion in #2457. This is complicated by the fact that this SDK allows rotation and tilting, whereas that wasn’t possible with the old SDK. In some cases, it would be OK for the user to see beyond the bounds by rotating and tilting, whereas for the case you describe, that would be suboptimal. Another consideration is that we intend to eventually allow offline regions to be non-rectangular, at which point the -mapView:regionDidChangeAnimated: approach would be easier to work with, and #2457 would be even easier.
This is one of the critical features for stay.com.
Our logic is based around a particular city. We load annotations and map for one city. So we need to restrict user from panning outside the city area.
For starters, I’ve implemented the simplest possible API for restricting movement in #5584. With this API, it should be possible to implement logic to restrict gestures based on regions already downloaded for offline use, but we should keep this ticket open to investigate more concise or automatic approaches.
When you download an offline map you provide the
MGLTilePyramidOfflineRegion
initialiser a bounds struct which downloads a specific part of a map.When you use the offline map, the user is able to scroll around and sees blank tiles for parts outside the map that have been downloaded.
It should be possible to restrict the map to only pan within certain bounds.
You could implement
- (void)mapView:(MGLMapView *)mapView regionDidChangeAnimated:(BOOL)animated
, but then you have to manually check if the current visible screen bounds is outside the downloaded bounds.In the previous version of the Mapbox SDK this was possible with a certain method where you would pass in the NE en SW coordinate and you couldn't scroll past those.
Platform: iOS
Mapbox SDK version: 3.2.2
Steps to trigger behavior
Expected behavior
You can only scroll within the bounds that have been downloaded.
Actual behavior
You can scroll everywhere, so you get to see blank tiles when the app runs in offline mode.
The text was updated successfully, but these errors were encountered: