Giter Club home page Giter Club logo

Comments (3)

birdage avatar birdage commented on May 18, 2024

@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.

  1. 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.

  2. 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.

achourasia avatar achourasia commented on May 18, 2024

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.

birdage avatar birdage commented on May 18, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.