IpswichMapper / SwiftAddress

The fastest way to collect housenumbers for OpenStreetMap
GNU General Public License v3.0
20 stars 1 forks source link

Zoom to current location when map launches / when location is available #1

Closed TurnrDev closed 3 years ago

TurnrDev commented 3 years ago

Firstly, well done! The app looks good, I like that I can place the marker where I like.

image

I know it's early days so this bug might already be fixed but, when loading the app, it loaded at 0, 0 and zoomed out as hell. The behaviour I would expect is to load up at my location. None of the buttons seemed to offer to jump to my location either.

I eagerly await to see where this project goes :)

IpswichMapper commented 3 years ago

It now zooms to zoom level 3.

IpswichMapper commented 3 years ago

I have added some code to try and centre and zoom to your current location when the app starts.

I don't know if it works yet because I haven't tested it on my phone. (My phone takes 5 minutes for GPS to work if I have kept the GPS off for a long time).

TurnrDev commented 3 years ago

Much better, it started zoomed in much closer now! I'm not sure if it follows my current location or not but it's coming along nicely! I'll have to head out tomorrow and give it a try

IpswichMapper commented 3 years ago

It doesn't follow the current location and I don't want it to. This is because the crosshair in the centre of the map is meant to be positioned above the house that you want to add a housenumber of. If the crosshair kept moving that would make it harder to add housenumbers (yes, to add housenumbers efficiently you should be moving while adding them).

Much better, it started zoomed in much closer now!

Yes, that code I wrote was a stab in the dark, luckily it worked, even though I couldn't test it with GPS.

I also have to add the centre to position and reset orientation to North buttons. OSMdroid provides a compass by default which you can add to the map very easily, but when pressed the compass does not reset the orientation to north sadly.

TurnrDev commented 3 years ago

If we're placing the marker on the house, what's the idea of the < and > buttons? I assumed it was place the marker X meters from the centre of the way left or right from the marker 😅

IpswichMapper commented 3 years ago

Almost always, the pattern on the left side of the road is slighly different to the right side of the road.

For example, left side might go like this:

24, 26, 28, 30

Right side might go like this:

19, 21, 23, 25

So the two buttons allow you to keep track of the increments.

Try it: add a housenumber (lets say "24" using left arrow), and then press the left arrow again. You will see "24" as a "hint" in the textbox. You can increment/decrement this using the plus/minus buttons

In fact, you can go further than this.

If you just added "24" using the left arrow, long pressing the left arrow will add 26 immediatelly. (This feature should make it superfast to map housenumbers).

Note, the default increment is 2, but you can change it by swiping up on the "modify increment" option in the keypad (above the back button). So if you were to change it to "4", and your last entered housenumber on the left was "24", then long pressing on the left arrow will automatically add "28". The automatic increment can also be negetive.

IpswichMapper commented 3 years ago

Done. https://github.com/IpswichMapper/SwiftAddress/commit/c498e4bdb38a151672e687ba467613e646101272

The "North orientation" button does not change direction (to show current map orientation) when you pinch and zoom the map, sadly, but it does set the orientation to north. I think making it change direction would be signifcantly more complicated to add.

IpswichMapper commented 3 years ago

just added a new release with the buttons