posm / OpenMapKitAndroid

http://openmapkit.org
BSD 3-Clause "New" or "Revised" License
128 stars 38 forks source link

Create and Select Nodes (POI Creation) #31

Closed mberg closed 8 years ago

mberg commented 9 years ago

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.

dalekunce commented 9 years ago

@mberg this is tied to #11

hallahan commented 9 years ago

Do we want this high priority or save it for later?

dalekunce commented 9 years ago

Let's push this to a later sprint. This is a good self contained piece of work.

hallahan commented 9 years ago

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:

  1. Improve the way markers are indexed in the SDK by putting them in a separate QuadTree that lives in the ItemizedIconOverlay.
  2. Somehow extend the ItemizedIconOverlay to reference the QuadTree in the OSMModel instead of it's own internal simple list.

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.

hallahan commented 9 years ago

I'm going to move forward with option 2 -- should be more straightforward. Perhaps subclass ItemizedIconOverlay to reference the QuadTree.

hallahan commented 9 years ago

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
uber-marker gaia-marker
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

hallahan commented 9 years ago

Point on Map ®

2015-08-11 20 20 54

mberg commented 9 years ago

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 .

hallahan commented 9 years ago

Agreed. If the map pans marker to center, selection is fine with Uber approach as well.

dalekunce commented 9 years ago

Agree with @mberg the uber approach is probably the best.

hallahan commented 9 years ago

Getting markers on the map via OSM JTSModel QuadTree.

2015-08-12 00 02 09

hallahan commented 9 years ago

Sorts the markers by latitude so higher markers are covered by lower markers.

2015-08-12 00 15 23

mberg commented 9 years ago

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 .

hallahan commented 9 years ago

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.

hallahan commented 9 years ago

Notes on Marker Selecton showing where the logic to pan the map and show the marker is in the SDK.

hallahan commented 9 years ago

Nodes are getting added.

2015-08-14 21 27 10

hallahan commented 9 years ago

Buttons to Add Tags. Buttons to Delete and Move markers. 2015-08-18 19 33 27

hallahan commented 9 years ago

Selecting a marker turns it orange. 2015-08-19 17 49 57