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 was archived by the owner on Aug 8, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
MGLCoordinateBounds is a simple struct that contains no logic of its own. It’s up to routines that work with MGLCoordinateBoundses to do the right thing. An MGLCoordinateBounds with a southwest corner at (−1, 1) and a northeast corner at (1, −1) would cover almost the entire world by spanning the antemeridian. I’m not sure if either MapKit or the Mapbox iOS SDK handles that situation correctly, but those are the semantics I’d expect.
MGLCoordinateBounds is named after UIView.bounds and related properties in UIKit. It’s actually a bit more awkward to name variables around “a bounds” and “multiple bounds” than around “a box” and “multiple boxes”, but I don’t have a strong opinion either way.
We have the opportunity to rename it to that class since removing CoordinateBounds is a breaking change to setVisibleBounds() anyhow.
So that means it's going to be renamed to LatLngBounds then? Also, we'll need to first add Deprecation to both CoordinateBounds and BoundingBox for a release so that we don't break apps.
@bleege What about setVisibleBounds that currently takes CoordinateBounds? To deprecate we will need to duplicate the JNI code to read from both the old and the new class.
@bleege this was with the first iteration of MapboxMap in #3145, there I needed to migrate our public api from MapView to MapboxMap, since this feature was going to change to CameraUpdateFactory.newLatLngBounds , I just removed it from MapVIew and integrated the latter in #3754.
Activity
ljbade commentedon Nov 2, 2015
However I think I prefer the name
CoordinateBoundsas is it more clearly states it is in lat/lon units.BoundingBoxsounds more like pixel units.@tobrun @bleege which name do you prefer?
tobrun commentedon Nov 2, 2015
Same preference here.
Now we are on this subject:
If not correctly inserted the following method will not show the correct region:
ljbade commentedon Nov 2, 2015
@tobrun
BoundingBoxdoes have aisValidfunction. But I can't see a reason for a "negative" bounding box.We should at the least print a warning or throw an exception.
@incanus on iOS what happens if you accidentally make a backwards
CoordinateBounds?1ec5 commentedon Nov 3, 2015
MGLCoordinateBoundsis a simple struct that contains no logic of its own. It’s up to routines that work withMGLCoordinateBoundses to do the right thing. AnMGLCoordinateBoundswith a southwest corner at (−1, 1) and a northeast corner at (1, −1) would cover almost the entire world by spanning the antemeridian. I’m not sure if either MapKit or the Mapbox iOS SDK handles that situation correctly, but those are the semantics I’d expect.MGLCoordinateBoundsis named afterUIView.boundsand related properties in UIKit. It’s actually a bit more awkward to name variables around “a bounds” and “multiple bounds” than around “a box” and “multiple boxes”, but I don’t have a strong opinion either way.ljbade commentedon Nov 3, 2015
@1ec5 perhaps a CoordBoundingBox or LatLngBoundingBox?
bleege commentedon Nov 3, 2015
Perhaps we should have used
LatLngBoundsas that's what's used in the Google Maps API. 😉1ec5 commentedon Nov 3, 2015
That’s the principle by which we chose the iOS SDK name: follow platform (vendor) conventions.
ljbade commentedon Nov 3, 2015
@1ec5 @bleege We have the opportunity to rename it to that class since removing
CoordinateBoundsis a breaking change tosetVisibleBounds()anyhow.bleege commentedon Nov 3, 2015
So that means it's going to be renamed to
LatLngBoundsthen? Also, we'll need to first add Deprecation to bothCoordinateBoundsandBoundingBoxfor a release so that we don't break apps.ljbade commentedon Nov 3, 2015
@bleege What about
setVisibleBoundsthat currently takesCoordinateBounds? To deprecate we will need to duplicate the JNI code to read from both the old and the new class.ljbade commentedon Nov 6, 2015
I notice Google Maps
LatLngis immutable. I wonder what the benefit is.ljbade commentedon Nov 6, 2015
@1ec5 Recommends making LatLng immutable. I will do the same with
LatLngZoomandProjectedMeters.Going to take this as an opportunity to refactor JavaDoc the geometry package.
@tobrun This might impact your test cases.
ljbade commentedon Nov 6, 2015
We also need to fully implement wrap around in
LatLngBounds.From the Google docs:
The bounds conceptually includes all points where:
@tobrun We are going to have to remove
isValid, and also fixup the various methods to take this into account.We also need to carefully follow Google's definition of
getCenter()andincluding()20 remaining items
[android] #2896 - Remove coordinatebounds as API for MapboxMap, repla…
[android] #2896 - Remove coordinatebounds as API for MapboxMap, repla…
tobrun commentedon Feb 8, 2016
This has landed in a1aca1b
bleege commentedon Feb 8, 2016
@tobrun Can you link to the PR too? Makes tracking things easier. Thanks!
tobrun commentedon Feb 9, 2016
@bleege this was with the first iteration of
MapboxMapin #3145, there I needed to migrate our public api fromMapViewtoMapboxMap, since this feature was going to change toCameraUpdateFactory.newLatLngBounds, I just removed it fromMapVIewand integrated the latter in #3754.