Skip to content

SarahNadineH/Testmap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 

Repository files navigation

geojson-leaflet

Minimal example to serve static geoJSON on a Leaflet map

We assume you have your project files in QGis and want to put them on a webpage. This should get you started, without the need for any plugin. The project is not aiming at production-ready geodata deployments, but to showcase a project before the heavy development starts off.

You can export the the desired layers in QGis into geojson format. The file will look similar to:

{
  "type": "FeatureCollection",
  "name": "data"
  ...
}

Simply add

var data = {
  "type": "FeatureCollection",
  "name": "data"
  ...
}

This makes the geojson available in javascript, without asynchrounous requests. The advantage is that the file can be opened by the browser, without the need for a webserver. In production, it is highly recommended to install apache or nginx to serve the files, or even better run a Flask server to request only the needed data. To be fully scalable, you can replace the whole data management as implemented here by GeoServer or Mapserver.

We tried to put as many comments into the files as possible, to get you as easily started as possible.

About

Testmap

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages