I make maps
online
interactive
Back-end to front-end
Implement all through code
"Everything is related to everything else, but near things are more related than distant things"Tobler's first law of geography
Our brains organize by location .. why so many relate to maps and geography is that we have no choice but to think and see spatially.
Maps make sense of things
Maps lend order to complex environments
Reveal patterns and relationships
Maps allow us to communicate about location using a
Communicate locations & distances on the Earth's surface
The real shape of the earth is too complex to be useful as a reference for measurement..
3D model
Longitude Latitude
Lon Lat in decimal degrees
GPS
Standard way to store most geodata for the Web:
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [5.2394137,52.0819662]
},
"properties": {
"name": "Hotel Theater Figi"
}
}
Mathematical projection / translation
2D
We store data in EPSG:4326, but display it in EPSG:3857!
Reading materials:
Digital maps | 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?
images
256x256 pixels
Placed in a grid, sharing boundaries
Seamless map
Slippy maps, Google/OSM (XYZ) - TMS - QuadTrees (Microsoft)
All these little tiles load way faster than one big map!
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 just images on the web
http://tile.openstreetmap.org/5/16/10.png
https://{s}.tile.osm.org/{z}/{x}/{y}.png
Tiles are styled and rendered in advance
styling per zoom level
Lot's and lot's of geo data!
country_bounds
xxx
center-line
#0000ff
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
{
"version": 8,
"name": "Mijn eigen Stijl",
"sprite": "url",
"glyphs": "url/{fontstack}/{range}.pbf",
"sources": {...},
"layers": [
{
"id": "background",
"type": "background",
"paint": { "background-color":"#FFFFFF" }
},
{...}
]
}
( ^ this is CSS )
Advanced geospatial analysis for browsers
Creating a simple GeoJSON with Turf.js
let bounds = map.getBounds();
let points = turf.randomPoint(25, {bbox: [-180, -90, 180, 90]});
"But I can't read those labels! Where are my reading glasses?"
puts it all togehter
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
Tangram for vector tiles 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 for Vector Tile maps
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);
WMS, WFS (slow)
GeoJSON
let marker = L.marker([52.372825, 4.900321]).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!
Developed by:
mapboxgl.accessToken = 'yourowntoken';
let map = new mapboxgl.Map({
container: 'map-container',
style: 'style.json',
hash: true,
zoom: 11,
pitch: 60,
bearing: 62.4,
center: [ 4.8, 52.4]
});
{
"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"
}
},
{...}
]
}
Source
Data layers in tile
Style layer in style
Leaflet every source is a layer
Customized background maps
Interactive data
WebGL rendering
The realization of the interactive map as an experience, not just a map design.[source]
Stay in touch!
niene.boeijen@gmail.com |
@BNiene |
NieneB |
NieneB.nl |
Niene Boeijen |
volvo_343_dl_1980 |
Questions ?