Repository navigation
Adding draw on map for search example - #983
Conversation
0ec2f58 to
3dd76a8
Compare
5ac2a21 to
9db590c
Compare
9db590c to
0e0250b
Compare
LukasPaczos
left a comment
There was a problem hiding this comment.
Looks great! Besides below comments, could you try to limit the usage of the MapboxMap#getStyle and pass the loaded style object around instead to encourage best practices wrt Style object usage?
0e0250b to
8bdbebe
Compare
Done |
f3835cb to
20c6424
Compare
2045e78 to
59cd093
Compare
59cd093 to
96c5dc5
Compare
|
Ok @LukasPaczos . Finally got around to finishing up refactoring on this. Re-based into the latest commit. |
|
|
||
| // If drawing polygon, add the first screen touch point to the end of | ||
| // the LineLayer list so that it's | ||
| if (!drawSingleLineOnly) { |
There was a problem hiding this comment.
Needed because the example offers a button to toggle between drawing just a line or drawing a line+polygon.
There was a problem hiding this comment.
The line geometry doesn't have to be closed.
There was a problem hiding this comment.
Also, the source doesn't seem to be updated after this addition anyway.
There was a problem hiding this comment.
Needed because the example offers a button to toggle between drawing just a line or drawing a line+polygon.
Made ⬆️ comment because I was looking at the wrong if (!drawSingleLineOnly) { statement.
Regarding the one you're talking about, I close the line geometry because if I don't, the end result of drawing a polygon looks like 👇
I'd rather close the line geometry to have it follow all edges of the polygon (see below), rather than the line geometry being "open".
There was a problem hiding this comment.
Ah alright, this makes perfect sense.
3e275bb to
9a570c0
Compare
|
Ok, @LukasPaczos . Did another round of edits based on your review. |


This pr adds an example of using
View.OnTouchListenerto draw a line/polygon on the map. This can be combined withTurfJoins.pointsWithinPolygon()to find certain data/Features within the search polygon. The drawn line could also be combined with the Mapbox MapMatching API to clean up the handdrawn line.