Slide 1

Slide 1 text

An introduction to Utrecht JavaScript Meetup 2014-06-10 Tom Kruijsen

Slide 2

Slide 2 text

Brightin

Slide 3

Slide 3 text

No content

Slide 4

Slide 4 text

No content

Slide 5

Slide 5 text

Appuccino

Slide 6

Slide 6 text

Maps

Slide 7

Slide 7 text

No content

Slide 8

Slide 8 text

Google Maps OpenLayers Leaflet

Slide 9

Slide 9 text

Google Maps OpenLayers Leaflet

Slide 10

Slide 10 text

Google Maps OpenLayers Leaflet

Slide 11

Slide 11 text

Creating a map

Slide 12

Slide 12 text

#map { width: 600px; height: 400px; }

Slide 13

Slide 13 text

var map = L.map('map').setView([52.1551862, 5.3872315], 13); L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png').addTo(map);

Slide 14

Slide 14 text

No content

Slide 15

Slide 15 text

Map Data

Slide 16

Slide 16 text

OpenStreetMap MapBox PDOK

Slide 17

Slide 17 text

OpenStreetMap MapBox PDOK

Slide 18

Slide 18 text

No content

Slide 19

Slide 19 text

No content

Slide 20

Slide 20 text

L.tileLayer('http://{s}.tiles.mapbox.com/v3/tomkr.id/{z}/{x}/ {y}.png').addTo(map);

Slide 21

Slide 21 text

OpenStreetMap MapBox PDOK

Slide 22

Slide 22 text

No content

Slide 23

Slide 23 text

var RD = new L.Proj.CRS.TMS( 'EPSG:28992', '+proj=sterea +lat_0=52.15616055555555 +lon_0=5.38763888888889 +k=0.9999079 +x_0=155000 +y_0=463000 +ellps=bessel +units=m +towgs84=565.2369,50.0087,465.658,-0.406857330322398,0.350732676542563,- 1.8703473836068,4.0812 +no_defs', [-285401.92,22598.08,595401.9199999999,903401.9199999999], { resolutions: [3440.640, 1720.320, 860.160, 430.080, 215.040, 107.520, 53.760, 26.880, 13.440, 6.720, 3.360, 1.680, 0.840, 0.420] }); var map = L.map('map',{ continuousWorld: true, crs: RD }).setView([52.1551862, 5.3872315], 8); L.tileLayer('http://geodata.nationaalgeoregister.nl/tms/1.0.0/ brtachtergrondkaart/{z}/{x}/{y}.png', { continuousWorld: true, tms: true }).addTo(map);

Slide 24

Slide 24 text

No content

Slide 25

Slide 25 text

var RD = new L.Proj.CRS.TMS( 'EPSG:28992', '+proj=sterea +lat_0=52.15616055555555 +lon_0=5.38763888888889 +k=0.9999079 +x_0=155000 +y_0=463000 +ellps=bessel +units=m +towgs84=565.2369,50.0087,465.658,-0.406857330322398,0.350732676542563,- 1.8703473836068,4.0812 +no_defs', [-285401.92,22598.08,595401.9199999999,903401.9199999999], { resolutions: [3440.640, 1720.320, 860.160, 430.080, 215.040, 107.520, 53.760, 26.880, 13.440, 6.720, 3.360, 1.680, 0.840, 0.420] });

Slide 26

Slide 26 text

No content

Slide 27

Slide 27 text

No content

Slide 28

Slide 28 text

var map = L.map('map',{ continuousWorld: true, crs: RD }).setView([52.1551862, 5.3872315], 8); L.tileLayer('http://geodata.nationaalgeoregister.nl/tms/1.0.0/ brtachtergrondkaart/{z}/{x}/{y}.png', { continuousWorld: true, tms: true }).addTo(map);

Slide 29

Slide 29 text

OpenStreetMap MapBox PDOK

Slide 30

Slide 30 text

Layers

Slide 31

Slide 31 text

Markers Shapes GeoJSON

Slide 32

Slide 32 text

No content

Slide 33

Slide 33 text

var marker = L.marker([52.1599990, 5.3843390]).addTo(map)

Slide 34

Slide 34 text

Markers Shapes GeoJSON

Slide 35

Slide 35 text

No content

Slide 36

Slide 36 text

var circle = L.circle([52.1551862, 5.3872315], 300, { color: 'red', fillOpacity: 0.5 }).addTo(map);

Slide 37

Slide 37 text

Markers Shapes GeoJSON

Slide 38

Slide 38 text

No content

Slide 39

Slide 39 text

{ "type": "Feature", "geometry": { "type": "LineString", "coordinates": [[5.3843390, 52.1599990],[5.3872315, 52.1551862]] }, "properties": { "color": "green" } }

Slide 40

Slide 40 text

var geojson = L.geoJson(data, { style: function (feature) { return { color: feature.properties.color, weight: 5, opacity: 0.65 }; } }).addTo(map);

Slide 41

Slide 41 text

Markers Shapes GeoJSON

Slide 42

Slide 42 text

More!

Slide 43

Slide 43 text

Popups Events Controls

Slide 44

Slide 44 text

An introduction to Utrecht JavaScript Meetup 2014-06-10 Tom Kruijsen