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

shape annotations #1655

Closed
wants to merge 91 commits into from
Closed
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
91 commits
Select commit Hold shift + click to select a range
a2c7e00
refactor annotation adding for shapes; move to some unordered_maps
incanus May 20, 2015
b977a57
basic roughing out of shape paints & feature creation
incanus May 20, 2015
ed50422
split out multiple layers in live tiles
incanus May 20, 2015
fb65df2
abstract tile(s) feature creation to handle built-up shapes; move to …
incanus May 22, 2015
450d4b3
abstract zoom
incanus May 22, 2015
6a82560
reserve sizes; fix line accumulation
incanus May 22, 2015
4a06861
better-looking line width
incanus May 22, 2015
c54e00d
move to fill for now
incanus May 22, 2015
1d1eb84
expose & carry along shape annotation style properties
incanus May 26, 2015
1ae97a4
basic working runtime shape styling
incanus May 27, 2015
9722c92
sample point & shape annotation adds at startup
incanus May 27, 2015
e5db77b
add missing include for find_if
incanus May 27, 2015
94f7e2f
track stale annotation tile pre-style load
incanus May 27, 2015
c47f629
apply round line join for annotations
incanus May 28, 2015
b023d8d
support adding multiple shapes at once
incanus May 28, 2015
1297656
fix annotation removal
incanus May 28, 2015
b63b436
proper deletion cleanup
incanus May 28, 2015
15ea397
partial fix to tile-spanning features
incanus May 29, 2015
53b558b
roughing out basic Cocoa types
incanus May 30, 2015
1847681
add shape styling delegate callbacks
incanus May 30, 2015
129159b
tighten up shape delegate methods
incanus May 30, 2015
20a489b
add shape includes to umbrella header
incanus May 30, 2015
f7b7afe
add concrete MGLPointAnnotation
incanus May 31, 2015
a3f32ea
clean up MGLMultiPoint & descendents
incanus May 31, 2015
1c23ac8
flesh out Cocoa shapes API & use in demo app
incanus May 31, 2015
5c3448a
remove todo comment
incanus Jun 1, 2015
bf6be3c
fix annotations bounds search for >+/-85 latitude
incanus Jun 1, 2015
8626f91
avoid dupes in annotations bounds queries
incanus Jun 1, 2015
b51f5e8
fix problems with multiple point annotations
incanus Jun 1, 2015
da01318
allow annotation bounds filtering by type
incanus Jun 1, 2015
376ad5e
extend annotation bounds querying for shapes
incanus Jun 1, 2015
2a0d31c
implement MGLOverlay & bounds intersection
incanus Jun 2, 2015
e25a561
comment out API docs gen for now to try tests
incanus Jun 2, 2015
2862ee4
update GYP for .m -> .mm
incanus Jun 2, 2015
93521b8
fix temp OS X shape add
incanus Jun 2, 2015
9506583
flesh out some basic Cocoa shape API docs
incanus Jun 2, 2015
c3656fd
Revert "comment out API docs gen for now to try tests"
incanus Jun 2, 2015
d135461
Merge remote-tracking branch 'origin/master' into shape-annotations
incanus Jun 2, 2015
b7e26f3
only notify delegate on actual annotation deselection
incanus Jun 2, 2015
820d2da
don't allow Cocoa selection of non-point annotations
incanus Jun 2, 2015
d6ced9e
more proper feature type
incanus Jun 2, 2015
e9eb7dc
add comment about polygon closure
incanus Jun 4, 2015
c6fee9a
add former, untouched GeoJSONVT lib
incanus Jun 4, 2015
3696718
GeoJSONVT: split out GeoJSON parsing to allow direct feature passing
incanus Jun 4, 2015
7e0c53a
GeoJSONVT: expose conversion/projection functions for callers
incanus Jun 4, 2015
1ba430a
GeoJSONVT: temporarily(?) get rid of mutex
incanus Jun 4, 2015
9ba634f
GeoJSONVT: fix rounding bug
incanus Jun 4, 2015
9f25e6f
split out shape handling to GeoJSONVT shape tilers
incanus Jun 4, 2015
3239b84
build up annotation render tiles at point of need
incanus Jun 4, 2015
eefd44c
invalidate all annotation for now
incanus Jun 4, 2015
386567c
add test shapes in iOS demo app
incanus Jun 4, 2015
68e412d
we handle this at the core level
incanus Jun 4, 2015
60ff8e4
add default case to appease pedantic compilers
incanus Jun 4, 2015
f9a1c60
APPARENTLY NOT PEDANTIC ENOUGH
incanus Jun 4, 2015
6d90a8a
cast for more pedantic warnings on Linux
incanus Jun 4, 2015
395a5db
differentiate shapes
incanus Jun 4, 2015
a590995
sort points above shapes
incanus Jun 4, 2015
56b89c5
clean up shape tilers on deletion
incanus Jun 4, 2015
9b86c21
properly query annotation bounds
incanus Jun 4, 2015
d1797dc
fix tile invalidation for shapes addition & deletion
incanus Jun 5, 2015
62f40a1
adjustments to shape tiler structure & locking
incanus Jun 5, 2015
9290460
properly constrain latitude for shape points
incanus Jun 5, 2015
3ce8045
add note about no holes
incanus Jun 5, 2015
f3eb68c
clean up point/shape-only routines
incanus Jun 5, 2015
e9fcb6e
fix polyline parsing error
incanus Jun 5, 2015
0e574c6
spacing
incanus Jun 5, 2015
e92d1ff
remove bad check
incanus Jun 5, 2015
715be6f
preserve detail to max zoom
incanus Jun 5, 2015
9d864ce
simplify constructor
incanus Jun 5, 2015
8161621
use nicer operator overloading
incanus Jun 6, 2015
ee9ab21
properly iterate all shape geometries
incanus Jun 6, 2015
6345fcf
tile points can be (slightly, up to buffer distance) negative
incanus Jun 7, 2015
0d0527e
fix bug with min/max point validity
incanus Jun 7, 2015
43ccb9b
turn off debug logging for GeoJSONVT
incanus Jun 7, 2015
9383dac
Merge remote-tracking branch 'origin/master' into shape-annotations
incanus Jun 7, 2015
fe2d84c
remove OS X test annotations
incanus Jun 8, 2015
333e11a
Merge remote-tracking branch 'origin/master' into shape-annotations
incanus Jun 8, 2015
c638825
rename method
incanus Jun 8, 2015
38927c7
MGLBounds -> MGLCoordinateBounds
incanus Jun 8, 2015
2c9a886
move to annotation style value type getter
incanus Jun 8, 2015
74db485
properly use max zoom
incanus Jun 11, 2015
c39de8a
move to split GeoJSONVT
incanus Jun 11, 2015
a6da538
remove debug log line
incanus Jun 11, 2015
9ed12f4
move to external, submodule geojsonvt
incanus Jun 15, 2015
0d14311
Merge branch 'master' into shape-annotations
1ec5 Jun 15, 2015
e99661f
patch up GeoJSONVT setup
incanus Jun 15, 2015
58661c4
Merge branch 'shape-annotations' of github.com:mapbox/mapbox-gl-nativ…
incanus Jun 15, 2015
77c99f3
add geojsonvt submodule for Android Linux
incanus Jun 16, 2015
82ee46e
Merge remote-tracking branch 'origin/master' into shape-annotations
incanus Jun 16, 2015
e45bacf
move to shared private header
incanus Jun 16, 2015
effd91c
fix missing GYP include
incanus Jun 16, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions include/mbgl/map/map.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include <mbgl/util/chrono.hpp>
#include <mbgl/map/update.hpp>
#include <mbgl/map/mode.hpp>
#include <mbgl/style/style_properties.hpp>
#include <mbgl/util/geo.hpp>
#include <mbgl/util/noncopyable.hpp>
#include <mbgl/util/vec.hpp>
Expand All @@ -13,6 +14,7 @@
#include <functional>
#include <vector>
#include <memory>
#include <unordered_map>

namespace mbgl {

Expand Down Expand Up @@ -118,6 +120,8 @@ class Map : private util::noncopyable {
uint32_t addPointAnnotation(const LatLng&, const std::string& symbol);
std::vector<uint32_t> addPointAnnotations(const std::vector<LatLng>&,
const std::vector<std::string>& symbols);
uint32_t addShapeAnnotation(const std::vector<LatLng>&,
const StyleProperties&);
void removeAnnotation(uint32_t);
void removeAnnotations(const std::vector<uint32_t>&);
std::vector<uint32_t> getAnnotationsInBounds(const LatLngBounds&);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

#include <mbgl/util/variant.hpp>
#include <mbgl/style/types.hpp>
#include <mbgl/style/piecewisefunction_properties.hpp>

#include <array>
#include <string>
Expand Down
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");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remember to pull these changes out before merging.

Copy link
Contributor Author

@incanus incanus May 27, 2015 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


__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
Loading