albar965 / littlenavmap

Little Navmap is a free flight planner, navigation tool, moving map, airport search and airport information system for Flight Simulator X, Microsoft Flight Simulator 2020, Prepar3D and X-Plane.
https://albar965.github.io/littlenavmap.html
GNU General Public License v3.0
1.23k stars 161 forks source link

Default plugin in webserver #1129

Open miuratv opened 4 weeks ago

miuratv commented 4 weeks ago

Hi, it's possibile to load by default the "ol-map" plugin in the web based interface? Every time i reload the page it gets deactivated. I'd like to have it always on.

u-an-i commented 4 weeks ago

Hi, hi @albar965 ,

we can make the ol-map plugin the default for everyone on startup or
we can save the selection state of every plugin in the browser local storage (which persists until it is explicitly cleared when instructing to clear the browser cache) and attempt to enable/disable the saved selected/deselected plugins on load of the page.

We can even do both :)

Did the ol-map have limitations wrt display of some features ? I apologize for my asking, I haven't used the web server in a while (and don't want to spend the time to boot up FS and everything to test now).

Your call, @albar965 :)

I can handle implementation within this week I guess (though it likely won't result in a release of a new lnm version this week @miuratv ), anyone else is welcome to contribute too of course (but tell before 2 people attempt the same thing :) ).

albar965 commented 4 weeks ago

OL as default make sense IMO.

The only small issue I see is that the OL map always jumps back to coordinates 0/0 when starting or switching pages. There are also no updates if a user changes the map settings or adds user features.

Any way to add an auto update and fix the 0/0 issue?

Alex

u-an-i commented 4 weeks ago

0/0 I guess is doable.

About the update: this might be the limitation I remember: the ol-map uses tiles and caches them. The cache might have to get invalidated completely or cleverly where necessary.

I'll have a look if i can figure these things out.

KOKAProduktion commented 3 weeks ago

Hiho guys!

Please forgive my silence. A lot has happened and I'm currently quite occupied but I'm always reading the stream and dreaming on re-joining you guys someday :)

I understand that you'd like to modify the packaged ol-map JS bundle in order to fix its static initialization. The source repo is KOKAProduktion/littlenavmap-openlayers and the lines you're probably looking for are here: https://github.com/KOKAProduktion/littlenavmap-openlayers/blob/6723fee95b4d5055c87b37ee71c15635b3faea37/src/index.js#L48

I'm sorry that I can't take up any tasks at the moment to help out myself but please let me know if you have questions or issues. I'll try my best to answer/help as much as possible...

All the best and high five for keeping the flame burning! You guys are awesome!

Cheers!

albar965 commented 3 weeks ago

Just merged #1131 and cherry picked this into release/3.0 but see no changes. Still starting at 0/0 and even a reload takes me back to old map.

Edit: just noticed another PR around. Hold on. PR is for OL repo.

u-an-i commented 3 weeks ago

@albar965 when you switch between menus (Map, Aircraftn Flightplan, ...) the map now remains in its last state.

The initial load when (re-)loading the whole webpage is not affected.

I need the PR in the ol repo from @KOKAProduktion for that.

albar965 commented 3 weeks ago

Ok. Will wait.

albar965 commented 3 weeks ago

And please do not use the master branch of LNM and atools. 😉

u-an-i commented 3 weeks ago

yes, I already got the message :)

u-an-i commented 2 weeks ago

@albar965 this one is done in release/3.0 branch now.