posm / OpenMapKitAndroid

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

Field paper overlay #45

Closed dalekunce closed 8 years ago

dalekunce commented 9 years ago

Would be really nice to overlay the field paper tasks on top of the map. This is a hugely needed piece based on field trials. Layer should be toggle blend. Would also like to extend this to include an arrow with direction to where the user should be editing.

hallahan commented 9 years ago

I'm thinking this would be quite straightforward actually. @mojodna could make a Field Papers endpoint that lets us download MBTiles. I could build in an MBTile downloader in the app and pop that in as a layer.

mojodna commented 9 years ago

MBTiles export would be a useful feature in its own right.

@hallahan potentially simplifying, would a single GeoTIFF be sufficient (since that's what would be tiled into the MBTiles archive)?

Obvs. working with MBTiles in the Mapbox Android SDK is straightforward, but perhaps you have some other tricks up your sleeve?

hallahan commented 9 years ago

Mapbox Android SDK does not support this. I agree GeoTIFF makes more sense.

mojodna commented 9 years ago

There (should) already be a link to the GeoTIFF, but it's probably directly to the random filename, so I'll make sure there's also predictable one given an atlas id (which you can pick up from the QR code using zxing).

hallahan commented 8 years ago

Since we're going to have to stick with this old mapping lib for the scope of the current phase, I'm thinking I can make a custom line rendering class similar to how I do OSM lines. I can read the vertices from the field paper map.geojson and draw that on the map. Instead of doing label placement, I can have a bit of text in the UI showing which field paper the map center is panned to. Probably a better UX anyway, since a statically placed label won't always be viewable.

hallahan commented 8 years ago

I'm going to whack on this feature next so we can actually see some field papers integration. Seeing the bounds of a page will really make things clearer for the user.

hallahan commented 8 years ago

We're now able to determine the field paper title and page number that the center of the map is in.

2016-04-21 21 06 24

hallahan commented 8 years ago

Trying out the built in PathOverlay to draw coordinates found in the GeoJSON.

2016-04-21 22 16 00

It is kinda funky, sometimes paths don't get drawn when in a high zoom level. Also, it seems to hurt the map panning performance, especially when zoomed in. But, at least it's good to see the vector drawn to help me figure out UX that makes sense.

One thing that is obvious is that as-is, seeing the page number in the upper left corner of the screen doesn't seem good enough to know which page we're looking at corresponds.

We could:

  1. Just draw some labels in the boxes! I could mod the marker functionality to put text in there. However, I worry how well that will perform.
  2. Light up the box to a color and have the text in the upper left correspond to that color. Then, wherever the user taps or selects something, that box is the one to light up instead of just always being the center.
hallahan commented 8 years ago

I'm going with option 2. Label placement is pretty involved to do it right, and it's not worth it doing this with a deprecated library (will suck up too much time).

hallahan commented 8 years ago

2016-04-22 21 56 49

hallahan commented 8 years ago

For now, the field paper pages show up when you check out a deployment in the Deployment Details. There is no toggle for it, though that could be done fairly easily. The top black text view showing the page will show up only when a page is selected (by either being in the center of the map or tapped). This means that we don't show that text if you, for example, panned the map outside of the atlas on a different basemap... Which is good, avoids confusion.

hallahan commented 8 years ago

Done via #145