-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Remove CoordinateBounds #2896
Comments
Same preference here. Now we are on this subject:
If not correctly inserted the following method will not show the correct region: mapView.setVisibleCoordinateBounds(new CoordinateBounds(mMyLocation, mAddressLatLng), new RectF(100, 0, 100, 0), true); |
|
@1ec5 perhaps a CoordBoundingBox or LatLngBoundingBox? |
Perhaps we should have used |
That’s the principle by which we chose the iOS SDK name: follow platform (vendor) conventions. |
So that means it's going to be renamed to |
@bleege What about |
I notice Google Maps |
We also need to fully implement wrap around in From the Google docs:
@tobrun We are going to have to remove We also need to carefully follow Google's definition of |
Should also check for any valuable use of annotations we can add. |
@tobrun I have started the initial refactor in There is still a lot of TODOs. Do you mind looking at the implementations of the various calculation functions as they will all need fixes to handle proper longitude wrapping, and to match Google's definitions. The unit tests will also need fixing up. Also tests should be added for various configs including wrapping longitude, and invalid latitude. |
@ljbade next thing after Sirius for me is writing testcases for CI integration, I will pick this up ;) |
@ljbade Please be VERY careful here. This has the likely hood of being a breaking change. I'd recommend making use of Deprecated so that people have time to adjust. |
Yeah I'm going to deprecate existing two bounding box classes and replace with new LatLngBounds. Old classes will not have any choice changed and continue to work exactly the same. |
Would love to see this land, currently I need to work around this issue by applying this code: // FIXME cleanup this method if fix for BoundingBox lands, currently not possible to determine SW and NE without BoundingBox
private void createMarkerAndMoveViewport(final MapView mapView, LatLng start, LatLng stop, String stopText) {
final Marker destination = mapView.addMarker(new MarkerOptions().position(stop).title(stopText));
List<LatLng> coordinates = new ArrayList<>();
coordinates.add(start);
coordinates.add(stop);
BoundingBox box = BoundingBox.fromLatLngs(coordinates);
LatLng southWest = new LatLng(box.getLatSouth(), box.getLonWest());
LatLng northEast = new LatLng(box.getLatNorth(), box.getLonEast());
Resources resources = mapView.getResources();
float hMargin = resources.getDimension(R.dimen.marker_horizontal_margin);
float tMargin = resources.getDimension(R.dimen.marker_top_margin);
float bMargin = resources.getDimension(R.dimen.marker_bottom_margin);
mapView.setVisibleCoordinateBounds(new CoordinateBounds(southWest, northEast), new RectF(hMargin, tMargin, hMargin, bMargin), true);
// Save search
HistoryItem entry = new HistoryItem();
entry.key = stopText;
entry.latitude = stop.getLatitude();
entry.longitude = stop.getLongitude();
entry.save();
} |
Going to pick this up in migration from MapView to MapboxMap in #3145 |
This has landed in a1aca1b |
@tobrun Can you link to the PR too? Makes tracking things easier. Thanks! |
The
CoordinateBounds
class is the same asBoundingBox
and should be merged.Also
BoundingBox
should implementoffset
from #1948The text was updated successfully, but these errors were encountered: