@@ -85,7 +85,8 @@ vec2<double> AnnotationManager::projectPoint(const LatLng& point) {
8585}
8686
8787std::pair<std::vector<TileID>, AnnotationIDs>
88- AnnotationManager::addPointAnnotations (const std::vector<PointAnnotation>& points,
88+ AnnotationManager::addPointAnnotations (const std::vector<LatLng>& points,
89+ const std::vector<std::string>& symbols,
8990 const MapData& data) {
9091 std::lock_guard<std::mutex> lock (mtx);
9192
@@ -102,22 +103,22 @@ AnnotationManager::addPointAnnotations(const std::vector<PointAnnotation>& point
102103
103104 std::vector<TileID> affectedTiles;
104105
105- for (const PointAnnotation& point : points) {
106+ for (size_t i = 0 ; i < points. size (); ++i ) {
106107 const uint32_t annotationID = nextID ();
107108
108109 // track the annotation global ID and its geometry
109110 auto anno_it = annotations.emplace (
110111 annotationID,
111112 std::make_unique<Annotation>(AnnotationType::Point,
112- AnnotationSegments ({ { point. position } })));
113+ AnnotationSegments ({ { points[i] } })));
113114
114115 const uint8_t maxZoom = data.transform .getMaxZoom ();
115116
116117 // side length of map at this zoom
117118 uint32_t z2 = 1 << maxZoom;
118119
119120 // projection conversion into unit space
120- const vec2<double > p = projectPoint (point. position );
121+ const vec2<double > p = projectPoint (points[i] );
121122
122123 uint32_t x = p.x * z2;
123124 uint32_t y = p.y * z2;
@@ -133,7 +134,7 @@ AnnotationManager::addPointAnnotations(const std::vector<PointAnnotation>& point
133134
134135 // at render time we style the annotation according to its {sprite} field
135136 const std::map<std::string, std::string> properties = {
136- { " sprite" , (point. icon . length () ? point. icon : defaultPointAnnotationSymbol) }
137+ { " sprite" , (symbols[i]. length () ? symbols[i] : defaultPointAnnotationSymbol) }
137138 };
138139
139140 auto feature =
0 commit comments