mapbox-gl-native icon indicating copy to clipboard operation
mapbox-gl-native copied to clipboard

MGLMapView.minimumZoomLevel is not working.

Open noramimiyuma opened this issue 9 years ago • 5 comments

Platform: iPhone 7 - iOS 11.1.1

Mapbox SDK version: 3.7.0

Steps to trigger behavior

  1. Run the following code.
- (void)viewDidLoad {
    [super viewDidLoad];
    
    MGLMapView *mapView = [[MGLMapView alloc] initWithFrame:CGRectMake(0, 0, 100, 100) styleURL:[MGLStyle satelliteStreetsStyleURL]];
    
    mapView.maximumZoomLevel = 15;
    mapView.minimumZoomLevel = 10;
    
    mapView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
    
    // Set the map’s center coordinate and zoom level.
    [mapView setCenterCoordinate:CLLocationCoordinate2DMake(59.31, 18.06)
                       zoomLevel:9
                        animated:NO];
    
    [self.view addSubview:mapView];

}

Expected behavior

NSLog(@"%@", @(mapView.minimumZoomLevel)); -> 10

Actual behavior

NSLog(@"%@", @(mapView.minimumZoomLevel)); -> 0

noramimiyuma avatar Nov 29 '17 14:11 noramimiyuma

On the other hand, mapView.maximumZoomLevel can be set value correctly.

noramimiyuma avatar Nov 29 '17 14:11 noramimiyuma

I have the same problem with the same version.

Hugal31 avatar Nov 29 '17 14:11 Hugal31

Fixed in https://github.com/mapbox/mapbox-gl-native/pull/10596

fabian-guerra avatar Nov 30 '17 00:11 fabian-guerra

I fixed that in https://github.com/mapbox/mapbox-gl-native/pull/10596 will be shipped in our next release. I apologize for any inconvenience.

fabian-guerra avatar Nov 30 '17 00:11 fabian-guerra

I sincerely appreciate your prompt handling! We are awaiting your next release.

noramimiyuma avatar Nov 30 '17 02:11 noramimiyuma