DEPRECATED-mapbox-ios-sdk
DEPRECATED-mapbox-ios-sdk copied to clipboard
Precision of zoomWithLatitudeLongitudeBoundsSouthWest
Hi,
I'm experiencing an issue with the precision of zoomWithLatitudeLongitudeBoundsSouthWest. As you can see below, my map start with a bounding box of (12.965657,-49.285990 66.833126,28.444060) and when I call zoom to current, there are an unexpected latitude change.
My current use-case is to save a bounding box to retrieve later. This is the simplest code to explain the problem.
# XCODE console output
2014-12-02 19:37:17.344 MyViewer[24944:433989] 12.965657 -49.285990 66.833126 28.444060
2014-12-02 19:37:44.773 MyViewer[24944:433989] 4.722490 -49.285990 63.320088 28.444060
- (void)mapViewRegionDidChange:(RMMapView *)mapView
{
RMSphericalTrapezium sphericalTrapezium = [mapView latitudeLongitudeBoundingBox];
NSLog(@"%f %f %f %f", sphericalTrapezium.southWest.latitude, sphericalTrapezium.southWest.longitude,
sphericalTrapezium.northEast.latitude, sphericalTrapezium.northEast.longitude);
}
- (void)zoomToCurrent
{
RMSphericalTrapezium sphericalTrapezium = [mapView latitudeLongitudeBoundingBox];
CLLocationCoordinate2D southWest = CLLocationCoordinate2DMake(sphericalTrapezium.southWest.latitude, sphericalTrapezium.southWest.longitude);
CLLocationCoordinate2D northEast = CLLocationCoordinate2DMake(sphericalTrapezium.northEast.latitude, sphericalTrapezium.northEast.longitude);
[mapboxview.mapView zoomWithLatitudeLongitudeBoundsSouthWest:southWest northEast:northEast animated:NO];
}
Do you have any ideas?
Thanks
@incanus Do you have any update on this? :smile:
@incanus I would like to help solve the problem but I do not know where to look? Could you give me a starting point?
Thanks
I have a similar issue, but only when using with devices that do not have HD retina display (anything before iPhone 6).
The code is quite basic:
override func viewWillAppear(animated: Bool) {
//stuff...
//this works on iPhone 6 and 6 Plus, but not on other phones
mapView.zoomWithLatitudeLongitudeBoundsSouthWest(CLLocationCoordinate2DMake(sw_latitude,sw_longitude), northEast: CLLocationCoordinate2DMake(ne_latitude, ne_longitude), animated: true)
}
I make a similar call outside of viewWillAppear and it works fine across all devices.