IceNav-v3 icon indicating copy to clipboard operation
IceNav-v3 copied to clipboard

Waypoints Management

Open jgauchia opened this issue 1 year ago • 2 comments

Summary

Add the option to save/load waypoints in GPX format.

jgauchia avatar Jun 09 '23 23:06 jgauchia

As a corollary to this, is it possible to pass an array of lat/lon/icons (and maybe labels) to have them overlaid on the PNGs as they're rendered and still have them scaled and rendered properly? Bonus points if you can register a click handler when a point is selected. I looked in the code and didn't find a way to do this, but I haven't checked it out and run it.

There's some non-obvious math in just scaling wgs84 latlongs to screen coordinates due to that annoying curvature of the planet. What works well at a tile center works poorly near tile boundaries and they can be hard to keep in place when the map moves. It may take more than Pythagorean to make it look right, depending on how the tiles are generated.

It needs to be high performance as there could be many hundreds of points on a map. Other than not being able to handle selection events, I considered generating a transparent png overlay and merging them at tile load time, but that's hard to keep dynamic, such as being able to selectively disable some from view or change their icons on the fly.

Im hoping this code is already there and you can point me to adding such icons and handlers. I'm in the early stages of an ESP32.project and am "shopping" for blocks of code I can reuse and I really like the looks of this project.

I really like the code. Very clean!

robertlipe avatar Apr 30 '24 19:04 robertlipe

Hi thank you for your comments (sorry for my English).

As a corollary to this, is it possible to pass an array of lat/lon/icons (and maybe labels) to have them overlaid on the PNGs as they're rendered and still have them scaled and rendered properly? Bonus points if you can register a click handler when a point is selected. I looked in the code and didn't find a way to do this, but I haven't checked it out and run it.

The version in the master branch uses pre-generated tiles in PNG format. Currently, in the dev branch, I'm implementing vector maps (thanks to another ESP32 GPS project that I've found in github) that are generated directly on the ESP. I see it "possible" to add labels to overlay them on the map, either in the current PNG format or in the one I'm working on, as well as adding a handler for the touch input. Currently, none of that is in the code, but it would be a good challenge.

This is an example of the vector map.

vectorial

There's some non-obvious math in just scaling wgs84 latlongs to screen coordinates due to that annoying curvature of the planet. What works well at a tile center works poorly near tile boundaries and they can be hard to keep in place when the map moves. It may take more than Pythagorean to make it look right, depending on how the tiles are generated.

Understood, my knowledge in GPS position handling, conversions, etc., is somewhat limited. I'll keep that in mind as the project evolves.

It needs to be high performance as there could be many hundreds of points on a map. Other than not being able to handle selection events, I considered generating a transparent png overlay and merging them at tile load time, but that's hard to keep dynamic, such as being able to selectively disable some from view or change their icons on the fly.

In the dev branch, I'm already working on adding elements to the map screen. In fact, it's possible to deactivate or activate some of the already present elements such as zoom level, speed, etc. To make it dynamic, as you suggest, we would need to implement a way to store them along with either GPS coordinates or screen coordinates and then display them. I don't think it would affect performance much, but yes, it's another big challenge.

Im hoping this code is already there and you can point me to adding such icons and handlers. I'm in the early stages of an ESP32.project and am "shopping" for blocks of code I can reuse and I really like the looks of this project.

This project is like a hobby for me. I started it quite a few years ago, if I remember correctly, in 2013. It began with an Atmega, then a NavSpark, and now with an ESP (since the latter has a bit more power). Since then, I've been gradually implementing things, and I'm still in the process of changing part of the original code created for Atmega to use it with ESP. You mentioned you're starting a project with ESP? What is it about (if you don't mind me asking)? I have no problem exchanging opinions, ideas, code, and so on.

I really like the code. Very clean!

Thank you very much! My programming level is limited, and I'm trying to learn little by little. Originally, I wasn't going to show or share this project, but thanks to the advice of some friends, I decided to publish it. It's clear that my dedication to it is not complete, but I'm gradually improving, learning, and more.

Any other questions, inquiries, or suggestions, feel free to let me know.

jgauchia avatar May 01 '24 08:05 jgauchia