-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathrijksdriehoek.html
93 lines (91 loc) · 4.32 KB
/
rijksdriehoek.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>MapBox-gl EPSG:28992 (RD)</title>
<script src='https://api.tiles.mapbox.com/mapbox-gl-js/v0.49.0/mapbox-gl.js'></script>
<link href='https://api.tiles.mapbox.com/mapbox-gl-js/v0.49.0/mapbox-gl.css' rel='stylesheet' />
</head>
<body>
<table>
<tr><td>
The Dutch projection EPSG:28992, aka 'Rijkdriekhoekmeting' has a corresponding z-x-y-grid defined as a grid bounded by coordinates:<br>
min-x: -285401.920<br>
min-y: 22598.080<br>
max-x: 595401.920<br>
max-y: 903401.920<br>
This corresponds to a square grid width of 595401.920 - -285401.920 = 880802 meters and height of 880802 meters.
</td>
<td>
The WebMercator projection EPSG:3857, has a corresponding z-x-y grid defined as grid bounded by coordinates:<br>
min-x: -20037508.3428<br>
min-y: -20037508.3428<br>
max-x: 20037508.3428<br>
max-y: 20037508.3428<br>
This corresponds to a square grid width of 20037508.3428 - -20037508.3428 = 40075016.6856 x 40075016.6856 meters.
</td>
</tr></table><p></p>
Below is a map at mapbox zoom-level 0, attached to a WMTS service that serves tiles in EPSG:28992. Note that the image can be blurry at intermediate zoom levels. Intermediate zoom levels are not supported by most other map viewers<br>
In order to fully support this and other projections, mapbox-gl would need some additional extensions for the following modules:
<ul>
<li>GeoJSON: geojson geographic coordinates need to be transformed internally so that geographic coordinates inside the projected area are transformed to the correct mapbox-gl screen location</li>
<li>WMS: WMS requests originating from mapbox-gl contain a BBOX parameter. The values for this parameter should be transformed to support the new projection</li>
<li>Vector tiles: when preparing vector tile sets, the vector coordinates should be transformed to the new projection </li>
<li>Mouse and click position: When converting mouse and click positions to geographic coordinates, the positions should be transformed to account for the new projection</li>
<li>Scale bar: the scalebar should take into account the new projection</li>
</ul>
<style>
#maprd {
position:absolute;
width: 100%;
height: 600px;
border: 1px solid gray;
}
</style>
<div id="maprd"></div>
<script>
var map = new mapboxgl.Map({
container: 'maprd',
zoom: 0,
center: [0, 0],
renderWorldCopies: false,
style: {
"version" : 8,
"name": "Rijksdriehoek OpenTopo",
"sources": {
"brtachtergrondkaart" : {
"type": "raster",
"tilesize": 256,
"tiles": ["https://geodata.nationaalgeoregister.nl/tiles/service/tms/1.0.0/brtachtergrondkaart/EPSG:28992/{z}/{x}/{y}.png"],
"attribution":"PDOK",
"scheme": "tms",
"maxzoom":14
},
"opentopo" : {
"type": "raster",
"tilesize": 256,
"tiles" : ["https://geodata.nationaalgeoregister.nl/tiles/service/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=opentopo&STYLE=_null&TILEMATRIXSET=EPSG%3A28992&TILEMATRIX=EPSG%3A28992%3A{z}&TILEROW={y}&TILECOL={x}&FORMAT=image%2Fpng"],
"attribution":"PDOK",
"scheme": "xyz",
"maxzoom":14
}
},
"layers" : [
{
"id": "BRT Achtergrondkaart",
"type" : "raster",
"source":"brtachtergrondkaart"
},
{
"id": "OpenTopo",
"type":"raster",
"source": "opentopo"
}]
}
});
//map.on("moveend",() => map.setZoom(Math.round(map.getZoom())))
</script>
</body>
</html>