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.
MGLMultiPoint is both an abstract superclass and a concrete class for multipoints #5201
annotationsAnnotations on iOS and macOS or markers on AndroidiOSMapbox Maps SDK for iOSmacOSMapbox Maps SDK for macOSrefactorrelease blockerBlocks the next final release
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.
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.
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:
MGLPointAnnotation instead of MGLPoint (for compatibility with MKPointAnnotation)
MGLPolyline instead of MGLLineString (for compatibility with MKPolyline)
MGLShape instead of MGLGeometry (for compatibility with MKShape and to avoid confusion with MGLGeometry.h)
MGLShapeCollection instead of MGLFeatureCollection
changed the title [-]Fix ios/osx geometry class hierarchy[/-][+]MGLMultiPoint is both an abstract superclass and a concrete class for multipoints[/+]on Oct 5, 2016
Noting that in #6524 we've formally added a convenience initializer so that an MGLMultiPoint can be created with coordinates and count (like its siblings) and changed the documentation in the header to remove the language about it being abstract. These changes in addition to adding a private method to produce the mbgl representation of the shape allow us to use MGLMultiPoint to init an MGLGeoJSONSource.
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.
annotationsAnnotations on iOS and macOS or markers on AndroidiOSMapbox Maps SDK for iOSmacOSMapbox Maps SDK for macOSrefactorrelease blockerBlocks the next final release
Activity
1ec5 commentedon Jun 1, 2016
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
1ec5 commentedon Jul 18, 2016
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.
incanus commentedon Oct 4, 2016
From #6565 (review), when #6565 is landed, we should clean up the abstract class checks mentioned there as part of this cleanup.
1ec5 commentedon Oct 5, 2016
Now that #6565 has landed, we no longer treat MGLMultiPoint as an abstract class. The next step is to either:
isMemberOfClasschecks.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:
[-]Fix ios/osx geometry class hierarchy[/-][+]MGLMultiPoint is both an abstract superclass and a concrete class for multipoints[/+]boundsj commentedon Oct 11, 2016
Noting that in #6524 we've formally added a convenience initializer so that an
MGLMultiPointcan be created with coordinates and count (like its siblings) and changed the documentation in the header to remove the language about it being abstract. These changes in addition to adding a private method to produce thembglrepresentation of the shape allow us to useMGLMultiPointto init anMGLGeoJSONSource.1ec5 commentedon Oct 18, 2016
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.
1ec5 commentedon Oct 21, 2016
#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.