-
Notifications
You must be signed in to change notification settings - Fork 1.3k
flesh out annotation add/remove client API #992
Comments
The plan is to have |
Some brain-dumping on the behind-the-scenes stuff that needs to happen for annotation management. Storage
Addition process
Removal process
|
Misunderstanding of http://stackoverflow.com/questions/8882231/mkmapview-zoom-to-annotations-annotationvisiblerect The original intention isn't supported directly in MapKit:
It can only zoom to those: mapView.showAnnotations(mapView.annotations, animated: true) So we should add |
Annotations client API coming together as: typedef const std::string AnnotationID;
typedef const std::vector<const LatLng> AnnotationSegment;
struct BoundingBox {
LatLng sw = {0, 0};
LatLng ne = {0, 0};
};
void setDefaultPointAnnotationSymbol(const std::string);
AnnotationID addPointAnnotation(const LatLng, const std::string symbol = "");
const std::vector<AnnotationID> addPointAnnotations(const std::vector<LatLng>, const std::vector<const std::string> symbols = {{}});
void movePointAnnotationToFront(AnnotationID);
void reorderPointAnnotations();
AnnotationID addShapeAnnotation(const std::vector<AnnotationSegment>);
const std::vector<AnnotationID> addShapeAnnotations(const std::vector<const std::vector<AnnotationSegment>>);
void removeAnnotation(AnnotationID);
void removeAnnotations(const std::vector<AnnotationID>);
const std::vector<AnnotationID> getAnnotationsInBoundingBox(BoundingBox) const;
const BoundingBox getBoundingBoxForAnnotations(const std::vector<AnnotationID>) const; |
What will |
The idea there is the reversal of |
Kind of a way to separate z-ordering from some sort of selection state, because platforms might expect single or multiple state selection, but we should leave it up to them what this means for z-ordering. |
Ah, I see — the name seems slightly unintuitive to me, but beyond tossing in "zIndex" someplace (meh) I don't have any suggestions. Would an individual |
I guess you'd be getting down to marker z-indices at that point, which I can't really think of pressing use case for. |
@1ec5 This is in now, at least stubbed out. We'll drop the z-indexing related stuff for now per #991 (comment) so this takes care of adds, removes, regions, and basic symbology. mapbox-gl-native/include/mbgl/map/map.hpp Lines 143 to 152 in 3c04aeb
|
BTW moving to |
Work on this is basically wrapped into #893, but is progressing. We have point annotation addition and dynamic symbology. |
Ok, point annotation add, remove, dynamic symbology, and bbox querying is in as of 3ce0fb9. The point API remains as described above, other than returned ID's actually being |
We've got all the critical stuff here captured elsewhere and/or the API is all built out in existing points and soon-to-lands shapes (#1655). |
This is the API where platforms (i.e. iOS
MGLMapView
internals) talk to core for manipulating point and shape annotations.Points
LatLng
with optional symbol name (from style sprite sheet) upfrontShapes
std::vector<LatLng>
and draw properties (stroke width, stroke color, fill color) upfront. Need a way to specify interior polygon holes.Both
LatLng
bounding box (enables e.g.-annotationsInMapRect:
)annotationVisibleRect
)LatLng
, meaning zooming to exactly a bounding box might have a marker partway off the edge of the screen.TBD for iOS b1
-insertOverlay:aboveOverlay:
or-insertOverlay:atIndex:
)iOS b2 or beyond
-addOverlay:level:
with values likeMKOverlayLevelAboveRoads
orMKOverlayLevelAboveLabels
. In our case, this would more likely be a style layer name passed as a string. Also enables e.g.-overlaysInLevel:
./cc @1ec5
The text was updated successfully, but these errors were encountered: