-
-
Notifications
You must be signed in to change notification settings - Fork 333
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
setLatLngBounds
is poorly named
#1513
Comments
Thanks for sharing your perspective. I think the naming comes from the internal C++ API that is called, not the Android SDK. That said your arguments for changing the API make sense and I would be happy to merge an alternate API before the next release if someone make a PR for it. Related issue which argues to smooth over the differences between the platform SDKs #1462 |
You’re right that it’s a little more complex than I described earlier. So in short, this method is named after something in Google Maps. Consistency with other platforms is one thing, but this method is very inconsistent with other parts of this library and the language it’s written in. After all, Footnotes
|
@1ec5 |
This method has been removed shortly before the release of v6. Therefore reverting the change made in maplibre@0d43206. Reverted in: maplibre/maplibre-native#2024 Discussion in: maplibre/maplibre-native#1513
This didn't make the cut because there was a typo in the method name. A PR with another name is welcome. |
#1455 adds the methods
-[MLNMapView setLatLngBounds:]
and-[MLNMapView clearLatLnBounds]
, which are poorly named. Effectively, the iOS/macOS SDK now has a method named after the Android SDK’sLatLngBounds
class, which makes little sense. That class is analogous to theMLNCoordinateBounds
struct on iOS/macOS, so it should be called something likesetCoordinateBounds
.Better yet, it should be modeled as a property called something more descriptive like
viewableCoordinateBounds
. As it is, this is a write-only property, nearly unprecedented in any Objective-C framework. “Clearing” the coordinate bounds could be tricky becauseMLNCoordinateBounds
is a struct, which can’t nullable (optional) in Objective-C. Typically, this library has dealt with that issue by allowing the property to be set to a magic value of some kind. In this case, MLNGeometry.h could define a constantMLNCoordinateBoundsWorld
that encompasses the entire coordinate system.Regardless, there should not be any symbol with “LatLngBounds” in its name. This violates multiple Cocoa naming conventions, including the prohibition on superfluous abbreviations.
The text was updated successfully, but these errors were encountered: