Propedeuse Art Academy
MSc Geo Information Science
Internship Geo Web Visualization
Maptime Amsterdam & Utrecht
Web Cartographer
Freelance Web Map Developer
I make maps
online
interactive
Back-end to front-end
Implement all through code
Introduction |
Raster tiles |
Vector tiles |
Web Mapping in JavaScript |
Leaflet.js, MapboxGL.js, D3.js |
Take a small break |
Leaflet part 1 | 30 min |
Leaflet part 2 | 30 min |
Leaflet part 3 | 30 min |
Leaflet part 4 | 30 min |
Show & tell |
At the end of this workshop, you will have your own web page with an interactive map! Including custom data and different background maps, of the area you want to show! Your web page will be hosted on Github, so you can immediately share your progress with all your family and friends!
For beginners means: if you have NO knowledge of JavaScript, HTML, CSS and Leaflet.js this workshop will help you get started!
The realization of the interactive map as an experience, not just a map design.[source]
Analogue paper maps
Digital maps | VS | Web Maps |
---|---|---|
Data | Tiles, styles and servers | |
On the computer | View in a browser | |
Calculate, analyze | scroll, pan, zoom |
Digital maps & GIS software
1996 Mapquest first with a web service!
2004 - Endoxon found a way for quick online mapping!
2005 Google Maps took over!
The solution?
All tiles size 256x256 pixels
Placed in a grid, sharing boundaries
Seamless map
All these little tiles load way faster than one big map!
We call this slippy maps
Each zoom level has its own set of tiles!
Zoom level 0: 1 tile for the whole world.
Increases exponentially...
Zoom level 1: 4 tiles
Zoom level 2: 16 tiles
etc.
Tiles are styled and rendered in advance
Tiles are just images on the web
http://tile.openstreetmap.org/5/16/10.png
/z/x/y
styling per zoom level
Lot's and lot's of geo data!
No interaction with objects
No information available about objects
Multiple visualizations = multiple tile sets
elaborate & hard styling syntax
the newest technology!
Arrays in a 256 x 256 matrix
Same tiling schema as Raster png tiles.
Binary format
No colours
Simplifies geometries
Rendering is done on client side
Custom styles on client side
Small tile size. Fast
High resolution.
Direct access to feature information.
the rendering happens in your browser with the help of your device's graphics processing unit (GPU).
+ rotating and tilting the map (3D)
+ smooth/infinite zooming
WebGL is widely supported in modern browsers
Based on the binary protocal buffer (.pbf) from Google.
Standard already used by Esri.
Web Mercator projection, Google tiling scheme.
.mvt - .pbf
.mbtiles
About Vector-tiles from Mapbox
Open map tiles alternative
Cartiqo our own alternative
Start with Making a web page
Or use Code Academy
Puts it all together,
Tiles, content, interaction
Including a JavaScript library in your code is like copying and pasting someone else's code into yours. You have access to everything in that library.
In our case, it's a bunch of cool tools to make web maps and give them familiar functionality.
Data, styled, tiles, server:
Base Layer
Additional Data:
Vector Layers
Interface and Interaction
Zoom, panning, clicking etc.
When to use what?!
Leaflet.js for simple light weight raster web maps
OpenLayers for more elaborate raster web map with more functionality
ArcGIS Javascript API if your client uses ESRI software
D3.js for data driven info graphics
MapboxGL.js for vector tiles
MapLibre for vector tiles open source alternative
Mapbox Studio for easy cloud solutions
CARTO and buisness intellegence & cloud solutions
HERE Maps and Google Maps API for navigation, Google services and commercial goals
Turf.js for geospatial computation in the browser
Open source vs closed source
Amount of Interactivity or GIS functionality
Amount of data to show
Raster vs Vector
projection
Leaflet for Raster tile maps
MapboxGL.js / MapLibre for Vector Tile maps
D3.js for geo data visualizations
An Open-Source JavaScript Library for Mobile-Friendly Interactive Maps
simplicity, performance and usability
Developed by: Vladimir Agafonkin.
Weighing about 38 KB of JS.
Has all the mapping features most developers ever need.
Can be extended with Plugins
Well documented
Provide data for you.
Provide the basemap.
Its not GIS
Leaflet is a framework
let map = L.map('mapid').setView([51.505, -0.09], 13);
L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', {
attribution: '© OpenStreetMap contributors'
}).addTo(map);
// ADD a WMS layer
let cbs = L.tileLayer.wms('https://geodata.nationaalgeoregister.nl/wijkenbuurten2018/wms', {
'layers': 'cbs_buurten_2018',
'styles': 'wijkenbuurten2018:wijkenbuurten_thema_buurten_gemeentewijkbuurt_percentage_eenpersoonshuishoudens',
'srs': 'EPSG:28992',
'format': 'image/png',
'transparent': true,
'opacity': 0.5
}).addTo(map);
Base Layer
Raster
Data Layer / Feature Layer
Vector
Use EPSG:28992 > Government in Netherlands obliged to use it!
December 2020: Mapbox GL JS v2 is not free anymore
more infoPrevious Mapbox GL JS v1 is still available under the free and open BSD3 license
var map = new maplibregl.Map({
container: 'map',
style: 'https://api.maptiler.com/maps/streets/style.json?key=get_your_own_OpIi9ZULNHzrESv6T2vL', // stylesheet location
center: [-74.5, 40], // starting position [lng, lat]
zoom: 9 // starting zoom
});
{
"version": 8,
"name": "Mijn eigen Stijl",
"sprite": "url",
"glyphs": "url/{fontstack}/{range}.pbf",
"sources": {...},
"layers": [
{
"id": "background",
"type": "background",
"paint": { "background-color":"#FFFFFF" }
},
{
"id":"water",
"source": "osm",
"source-layer":"water",
"paint":{
"fill-color":"#0000ff"
}
},
{...}
]
}
Customized background maps
Interactive data
WebGL rendering
3D maps
Provided data
Commercial projects
Data Driven Documents
A JavaScript library for manipulating documents based on data
D3 helps you bring data to life using HTML, SVG, and CSS.
Developed by Mike Bostock
Allows you to bind data to the DOM and apply data-driven transformations to the document
HTML, SVG, and CSS
Fast
supports large datasets
Dynamic, interaction, animation
Text-based, mathematical representation of an image.
Vector Graphics
Can be searched, indexed, scripted, and compressed!
a slippy map creator
Not based on tiles!!
Charts (pie, line), Tables, Maps, Networks, animation & interactivity
Set up a simple HTML page and add Leaflet.js
Add a Base Map
Adding markers, circles, polygons
Change the projection
Add custom data
With Syntax Highlighting!
Watch your line indentation!
Not to big datasets
Remove any un-used attributes!
Attribute names are crucial! Simple, short. No spaces. No symbols
Export to GeoJSON: WGS84 or EPSG:4326
Points, Polygons or Lines?
Running a local server
C:\Python27\ArcGIS10.5\python -m SimpleHTTPServer
Use the INTERNET!
Use the Leaflet documentation!
StackOverflow is awesome!
Use the D3.js documentation!
Use bl.ocks.org
Ask me
There is more to find on the Internet
Do not keep yourself to the assignments!!
Leaflet part 1 | 30 min |
Leaflet part 2 | 30 min |
Leaflet part 3 | 30 min |
Leaflet part 4 | 30 min |
Show & tell |
Feedback please?
Stay in touch or questions:
niene@this-way.nl
@BNiene |
NieneB |
NieneB.nl |
Niene Boeijen |
volvo_343_dl_1980 |
In random order:
Webmapper
All contributors from Mapschool.io
Maptime Boston
Lyzi Diamond
Wikipedia
Leaflet.js
D3.js
Webmapper
Waag Society
Maptime Amsterdam
Maptime Utrecht
Maptime IO
Code Academy
tutorials of Scott Murray
Noah Veltman
Mike Bostock
Giphy
BFRO
Alan McConchie
Beth Schechter