-
Notifications
You must be signed in to change notification settings - Fork 1.3k
MGLMultiPoint is both an abstract superclass and a concrete class for multipoints #5201
Comments
Is it important that the class that represents the Simple Features/GeoJSON multipoint be called “MGLMultiPoint”, as opposed to “MGLSparseMultiPoint”, “MGLDiscreteMultiPoint”, or “MGLPointCollection”? If so, we’d need to bump the major version number to acknowledge this breaking change. It would also be a deviation from MapKit’s class structure, but I think it’s an acceptable and reasonable one, considering that developers rarely interact with MGLMultiPoint by name. /cc @boundsj @friedbunny |
We already don't have a strict correspondence between Simple Features names and class names, for instance MGLShapeCollection, so named for consistency with the MGLShape protocol and to avoid confusion with the MGLFeature protocol. |
From #6565 (review), when #6565 is landed, we should clean up the abstract class checks mentioned there as part of this cleanup. |
Now that #6565 has landed, we no longer treat MGLMultiPoint as an abstract class. The next step is to either:
My preference is for (1), which would allow us to stop the bleeding until we get an opportunity to completely rework the geometry classes as the Android SDK has done in Mapbox Java Services. In the meantime, I don’t think it’d be a problem to represent GeoJSON multipoints using something named “MGLPointCollection” instead of “MGLMultiPoint”. After all, we already have:
|
Noting that in #6524 we've formally added a convenience initializer so that an |
We discovered that #6727 would be a breaking change for Swift applications. That fix was only necessary because MGLMultiPoint is being overloaded as an abstract superclass and a concrete class (this bug). So we’re going to implement the stopgap approach detailed in #5201 (comment) for the v3.4.0 release to avoid breaking existing applications and sample code. |
#6742 implemented a separate class, MGLPointCollection, to represent what GeoJSON calls a multipoint. If the existence of an abstract class named MGLMultiPoint continues to cause confusion, we can consider removing it as a backwards-incompatible change in the future. However, for now, the purely abstract MGLMultiPoint is useful as a way for MGLPolyline and MGLPolygon to share a fairly substantial amount of code. |
As noted in #5200 (comment),
MGLPolyline
andMGLPolygon
should not inherit fromMGLMultiPoint
. Neither a polyline nor a polygon is-a multipoint.The text was updated successfully, but these errors were encountered: