Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[mylocation] fix missing lon; add locate & find-marker buttons #3699

Merged
merged 4 commits into from
Dec 23, 2024

Conversation

thinkpoop
Copy link
Contributor

@thinkpoop thinkpoop commented Dec 22, 2024

Link to app

Fix for Longitude ending up undefined

The map (leaflet.js) uses "lng" for longitude, while the MyLocation.json uses "lon". When re-loading the lat/lon from JSON, the original code wasn't mapping "lon" to "lng".

To recreate using BangleJS.com/apps version:

  1. Open the interface, add a marker, and click save.
  2. Re-open the interface and click save without clicking on the map.
  3. MyLocation.json will have an undefined longitude; quick test is just re-open the interface again and it'll give an error in the console about it.

Adding Locate and Find Marker buttons

Adding a "Locate" button to center on your current location and a "Find" button to center on your marker's location.

What the Locate button looks like before setting a marker
MyLocation_Locate button before setting marker

What both buttons look like after setting a marker
MyLocation_Locate and FindMarker Buttons after setting marker

Copy link
Collaborator

@bobrippling bobrippling left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice spot - one small question

apps/mylocation/interface.html Outdated Show resolved Hide resolved
@thinkpoop thinkpoop marked this pull request as ready for review December 22, 2024 21:49
@bobrippling
Copy link
Collaborator

Thanks!

@bobrippling bobrippling merged commit bb1ac19 into espruino:master Dec 23, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants