Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Commit

Permalink
sample point & shape annotation adds at startup
Browse files Browse the repository at this point in the history
  • Loading branch information
incanus committed May 27, 2015
1 parent 1ae97a4 commit 9722c92
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions macosx/main.mm
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,27 @@ int main() {
map.setStyleURL(newStyle.first);
view.setWindowTitle(newStyle.second);

map.addPointAnnotation(mbgl::LatLng(45, -120), "default_marker");

__block mbgl::Map& map_ = map;

dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
mbgl::FillProperties fillProperties;
fillProperties.fill_color = mbgl::Color({{ 1, 0, 0, 1 }});
fillProperties.stroke_color = mbgl::Color({{ 0, 0, 0, 1 }});
fillProperties.opacity = 0.25;

mbgl::StyleProperties shapeProperties;
shapeProperties.set<mbgl::FillProperties>(fillProperties);

map_.addShapeAnnotation({
mbgl::LatLng(44, -122),
mbgl::LatLng(46, -122),
mbgl::LatLng(46, -121),
mbgl::LatLng(44, -122)
}, shapeProperties);
});

view.run();

[reachability stopNotifier];
Expand Down

0 comments on commit 9722c92

Please sign in to comment.