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

Smooth markers refresh for navigation support #1890

Open
Alessandro-Minerba opened this issue Feb 29, 2024 · 1 comment
Open

Smooth markers refresh for navigation support #1890

Alessandro-Minerba opened this issue Feb 29, 2024 · 1 comment

Comments

@Alessandro-Minerba
Copy link

Hi, I'm quite new to the folium library and I'm implementing a map on a PyQt6 application for real time navigation support.
First of all great job, it looks really good for a fresh new developer.
Regarding my issue, I made some researches and I understood there's no way to have a smooth way to update markers position without reloading the entire map, which creates a bad looking flashing during the route.
There's any chance in the future to have this feature available in the library?
Thank you in advance.

@hansthen
Copy link
Collaborator

hansthen commented Apr 7, 2024

You could have a look at the Realtime plugin. This plugin allows you to update the map without reloading it. For this to work however, you need to also develop an HTTP server (or something similar, like Flask, Django or FastAPI) that will calculate the current map state and return it as JSON.

from flask import Flask

app = Flask(__name__)

@app.route("/navigate")
def navigate():
    return calculate_state()

# and from some other part of your code in another thread
app.run(host='0.0.0.0', port=5000, debug=True)    

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

No branches or pull requests

2 participants