Logo for USW coursework by Stanley Skarshaug

GIS and the Spatial Web

Leaflet

Shapes

Implementing data sources into leaflet

Drawing on the map

On the map above I have demonstrated the use of a polygon, line and circle to draw shapes on the map. Click the button labeled "Molde" to toggle the visibility of these shapes. The toggle switch will change color to indicate the current state, and when it is turned on, the map will zoom to fit the shapes, and center the map on the Molde area.

By clicking on the polygon and circle shape a info window will breafly appear showing information about the locations.

GeoJSON Data

The map also demonstrates the use of GeoJSON data to represent geographical features. By clicking on the button labeled "Norway outline", you will toggle the visibility of a GeoJSON shape outlining Norway. This data is loaded from a GeoJSON file and displayed on the map.

The GeoJSON file was created by loading a KML file into QGIS and exporting it as GeoJSON.

Notes

The student included this to demonstrate the use of similar functionality that was made using the Google Maps API. Using the links below you can compare the implementations.