Closed mberg closed 8 years ago
@mberg this is tied to #11
Do we want this high priority or save it for later?
Let's push this to a later sprint. This is a good self contained piece of work.
I did a comprehensive code review of the Mapbox Android SDK regarding the architecture of drawing markers on the map and collision detection from touch events.
In conclusion, the way that all of this works is not efficient at all, and some sort of spatial index will be needed for the Markers if we are to load any significant data set of OSM POIs. Doing this should be straight forward when referencing the code review.
Because a lot of work goes into rendering markers and capturing touch events with them, it will be best to improve the SDK itself rather than implementing them from scratch.
Right now, all of the OSM geometry is put in a QuadTree spatial index, including standalone nodes (POIs). The issue is, this index is referenced for a draw call on the OSMOverlay
, which does not have marker support. Markers go in an ItemizedIconOverlay
, which is separate. Right now, all of the items (markers) are referenced from a simple list.
We could take 1 of 2 approaches:
ItemizedIconOverlay
.The next step is to analyze the implications of both approaches regarding how OpenMapKit's model integrates with the Mapbox Android SDK renderer. We need to know which way is easier and less hacky.
I'm going to move forward with option 2 -- should be more straightforward. Perhaps subclass ItemizedIconOverlay to reference the QuadTree.
Marker placement is not a trivial UX. Taking the typical approach, the user can select and drag around a marker, but on a touch screen, the finger covers the marker--and then you don't see what is happening on the screen...
I've seen two approaches address this problem:
Uber | Gaia GPS |
---|---|
![]() |
![]() |
There is a static marker over the center point of the map. The user moves the map, and the marker is placed in the central cross-hair. | There is a circle around the marker, and the user can drag the marker by touching any point in the circle. |
If we take the Uber approach, when the user touches an existing marker, the map pans the marker to be in the center point. The map is in a marker placement mode, and the user pans the map to place the marker.
If we take the Gaia GPS approach, the user touches an existing marker, the marker then gets a circle around the marker. The circle can then be dragged into the new marker location.
Opinions? @dalekunce
Point on Map ®
I personally think the uber approach allows a higher level of precision once you get used to it.
Try playing around with geodk. Dropping points is a bit clunky.
Option two works well for point selection but that's obviously a different route
On Tuesday, August 11, 2015, Nicholas Hallahan notifications@github.com wrote:
Point on Map ®
[image: 2015-08-11 20 20 54] https://cloud.githubusercontent.com/assets/556367/9209556/08380fa8-402c-11e5-8346-04fccfd2b479.png
— Reply to this email directly or view it on GitHub https://github.com/AmericanRedCross/OpenMapKit/issues/31#issuecomment-130055239 .
Agreed. If the map pans marker to center, selection is fine with Uber approach as well.
Agree with @mberg the uber approach is probably the best.
Getting markers on the map via OSM JTSModel QuadTree.
Sorts the markers by latitude so higher markers are covered by lower markers.
Can you drop the icon size too?
On Tue, Aug 11, 2015 at 7:16 PM, Nicholas Hallahan <notifications@github.com
wrote:
Sorts the markers by latitude so higher markers are covered by lower markers.
[image: 2015-08-12 00 15 23] https://cloud.githubusercontent.com/assets/556367/9213921/ae5d0c06-404c-11e5-969c-9988cf64b4b0.png
— Reply to this email directly or view it on GitHub https://github.com/AmericanRedCross/OpenMapKit/issues/31#issuecomment-130117913 .
Icons have not yet been delt with. I've gone through the details of the icon glyphs (Maki Markers) in the code review. I'm going to look at what the tag is to render the appropriate icon.
Notes on Marker Selecton showing where the logic to pan the map and show the marker is in the SDK.
Nodes are getting added.
Buttons to Add Tags. Buttons to Delete and Move markers.
Selecting a marker turns it orange.
OMK currently only supports selections of ways.
Ability to select a node for tagging and passing to ODK.
This will enable checkins to villages, schools, waterpoints, etc that are normally just nodes.