Coder Social home page Coder Social logo

gasolineras-www's Introduction

Spain's petrol stations prices map

Demo

See it in action : http://gasolineras.saliou.name/

What is it?

Simply shows a full screen map with a few buttons :

  • 1 to geolocate your position
  • 4 to display the petrol stations available in the area your map is centered on.
  • When clicking on any of the icons an information popup shows the name of the petrol station and the price of the selected petrol

This is to show case how to use the data generated by https://github.com/kbsali/gasolineras-espana and publicly stored in this repository : https://github.com/kbsali/gasolineras-espana-data.

There are numbers of pages and apps doing this already, but my idea was :

  • there is no need for having to install an app for doing this : it should work for any device having an internet connection and a web browser,
  • as explained here the original data provided by the ministery is, to me, not usable :
  • Zipped CSV files without any logical naming strategy is not helpful,
  • GeoJson seemed to be a raising standard!
  • to learn :
  • python https://github.com/kbsali/gasolineras-espana
  • more about JS in general and Leaflet in particular! :)

Third parties

The page uses :

  • leaflet-vector-layers for loading and plotting the data (and therefore Leaflet too),
  • Bootstrap for the css (it is reponsive and should be seen correctly on mobile devices),
  • MapQuest for the map tiles and routes,
  • and because the amount of data that needs to be downloaded can be pretty big, I use GitSpatial to only retrieve the data of the area shown on the screen.

Todo

  • add a link to the popups to show the route from your current location to the selected station
  • right now opening a popup directly loads the route
  • dynamically group the stations in 3 price groups (cheap, normal, expensive)
  • see servicios.elpais.com/gasolineras/index.html

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.