Comments (3)
@achourasia i was thinking about this over the weekend. I think the above description is actually outside the scope of the folium project, if you wanting to use flask to serve data via a map interface in the above described way i would actually skip folium and go straight to a JS leaflet map/UI with a flask backend, leveraging a geo json/jsonp response. Folium is great for simple map plotting but you are talking about some serious data.
There is however twos ways you could do it in folium.
-
Add two buttons, one to go forward in time, one to go back, these time are from an array list. These buttons call a function to create a folium map with the geojson, or update the map with a new geojson. And thus when you change time using the buttons a different geojson gets loaded.
-
Add all the layers to the folium map, then make it possible to only select one from the map controls (similar to the wms layers), then hide the other ones.
the above two ways are a bit of a hack, and it would actually be easier to just do this in leaflet and JS...
a simple google search found something very similar...
http://dwilhelm89.github.io/LeafletSlider/ with source here
https://github.com/hallahan/LeafletPlayback
http://zevross.com/blog/2014/08/12/add-a-before-after-map-slider-to-a-leaflet-map/
http://leafletjs.com/plugins.html
from folium.
Thanks for the thought and links. Yes going directly from FLASK or for that matter any server to leaflet is a good idea. The key reason for me to use Folium is have everything could be shipped as a Python app and no need to mess around with JS, etc. While Folium concept is nice, but anything dynamic requires server support and it does not have to be a heavy application. The examples I mentioned above are not that complicated, its just that instead of cooking data single time, we are cooking on demand. My thinking is that such an example could potentially provide a wider utility for Folium, but if this is out of scope, thats fine with me.
from folium.
@achourasia i think its out side the scope for right now, unless you did one of the options above, i.e button to reload the map with different data in it, or load all the data then just select which layer to use.
Will close for now, but certainly reopen or generate new issues if you have any.
from folium.
Related Issues (20)
- map fit size of virtual screen of selenium HOT 4
- ImageOverlay with four corners
- Confine a marker(flag picture) into a specific area(territory) HOT 1
- Problem with rendering of map in version 0.15.0 on Streamlit HOT 3
- Stamen Map Tiles No Longer Work: Migrating to New Hosting Service? HOT 2
- [Question] Can VectorGrid Slicer be used to deal with many CircleMarkers ? HOT 5
- folium.plugins.MeasureControl is not working HOT 3
- When using MeasureControl, the mouse selection jumps off the map HOT 2
- There is a roadmap to return coordinates updated from marker HOT 1
- [Question] Does Folium support 3d terrain? HOT 1
- i need help, don't want show the legend HOT 1
- ValueError: Locations is empty. HOT 1
- SideBySideLayers not displaying the layers HOT 1
- change color MarkerCluster HOT 2
- Stamen tiles doesn`t show up in Folium Map HOT 1
- export / save Folium map as static image (PNG) HOT 4
- Geocoder can be generalized to work with non-Nominatim providers HOT 6
- Problem adding layers by for loop HOT 3
- Max zoom level no longer working from 0.14.0 to 0.15.1 (defaults to 18) HOT 1
- Customize Timestampedgeojson legend HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from folium.