Skip to content

Open Infrastructure Map, a view of infrastructure data in OpenStreetMap

Rever to MapTiler as tile source

Russ Garrett5cda62dfde0f
diff --git a/dist/about.html b/dist/about.html
index 19141d4..e1a6f0b 100644
--- a/dist/about.html
+++ b/dist/about.html
@@ -37,6 +37,8 @@
<li>The <a href="https://www.mapbox.com/mapbox-gl-js/api/">Mapbox GL JS</a> web interface</li>
</ul>
+ <p>The background map data is kindly provided by <a href="https://www.maptiler.com/"><img width="150px" src="img/maptiler.png"></a>.</p>
+
<h2>Where's the code?</h2>
<p>You can find some bits of OIM on the
<a href="https://github.com/openinframap/">openinframap Github organisation</a>.
@@ -67,9 +69,7 @@
<p>All the data currently displayed on OpenInfraMap is sourced directly from OpenStreetMap.</p>
<p>If you can consume vector data in Mapbox Vector Tiles format, you can fetch vector data directly
- from the OpenInfraMap tile server using the <a href="/map.json">TileJSON file</a>. The
- <a href="https://plugins.qgis.org/plugins/vector_tiles_reader/">Vector Tiles Reader</a> plugin for QGIS can
- read this, although it can be unreliable.</p>
+ from the OpenInfraMap tile server using the <a href="/map.json">TileJSON file</a>.</p>
<p>If you need relatively small extracts of data, you can use
<a href="https://overpass-turbo.eu/">Overpass Turbo</a> to generate these in GeoJSON and
diff --git a/src/style/style.json b/src/style/style.json
index 888dcd6..2c8c7af 100644
--- a/src/style/style.json
+++ b/src/style/style.json
@@ -24,7 +24,7 @@
"sources": {
"openmaptiles": {
"type": "vector",
- "url": "https://tiles.russss.dev/services/osm"
+ "url": "https://api.maptiler.com/tiles/v3/tiles.json?key=u7opxtdfvwPiFOPwMWeC"
},
"openinframap": {
"type": "vector",
@@ -32,7 +32,7 @@
}
},
"sprite": "https://openinframap.org/style/sprite",
- "glyphs": "https://glfonts.lukasmartinelli.ch/fonts/{fontstack}/{range}.pbf",
+ "glyphs": "https://api.maptiler.com/fonts/{fontstack}/{range}.pbf?key=u7opxtdfvwPiFOPwMWeC",
"layers": [],
"id": "openinframap"
}
diff --git a/src/style/style_labels.js b/src/style/style_labels.js
index 141ead4..c93739b 100644
--- a/src/style/style_labels.js
+++ b/src/style/style_labels.js
@@ -13,7 +13,7 @@ const layers = [
layout: {
'text-anchor': 'center',
'text-field': '{name:latin}\n{name:nonlatin}',
- 'text-font': ['Open Sans Regular'],
+ 'text-font': ['Metropolis Regular', 'Noto Sans Regular'],
'text-justify': 'center',
'text-offset': [0.5, 0],
'text-size': {base: 1, stops: [[12, 9], [17, 17]]},
@@ -37,7 +37,7 @@ const layers = [
layout: {
'text-anchor': 'center',
'text-field': '{name:latin}\n{name:nonlatin}',
- 'text-font': ['Open Sans Regular'],
+ 'text-font': ['Metropolis Regular', 'Noto Sans Regular'],
'text-justify': 'center',
'text-offset': [0.5, 0.2],
'text-size': {base: 1, stops: [[12, 9], [17, 18]]},
@@ -61,7 +61,7 @@ const layers = [
layout: {
'text-anchor': 'center',
'text-field': '{name:latin}\n{name:nonlatin}',
- 'text-font': ['Open Sans Regular'],
+ 'text-font': ['Metropolis Regular', 'Noto Sans Regular'],
'text-justify': 'center',
'text-offset': [0.5, 0.2],
'text-size': {base: 1, stops: [[10, 9], [15, 18]]},
@@ -89,7 +89,7 @@ const layers = [
layout: {
'text-anchor': 'center',
'text-field': '{name:latin}\n{name:nonlatin}',
- 'text-font': ['Open Sans Regular'],
+ 'text-font': ['Metropolis Regular', 'Noto Sans Regular'],
'text-justify': 'center',
'text-offset': [0.5, 0.2],
'text-size': 12,
@@ -117,7 +117,7 @@ const layers = [
layout: {
'text-anchor': 'center',
'text-field': '{name:latin}\n{name:nonlatin}',
- 'text-font': ['Open Sans Regular'],
+ 'text-font': ['Metropolis Regular', 'Noto Sans Regular'],
'text-justify': 'center',
'text-offset': [0.5, 0.2],
'text-size': 14,
@@ -145,7 +145,7 @@ const layers = [
layout: {
'text-anchor': 'center',
'text-field': '{name:latin}\n{name:nonlatin}',
- 'text-font': ['Open Sans Regular'],
+ 'text-font': ['Metropolis Regular', 'Noto Sans Regular'],
'text-justify': 'center',
'text-offset': [0.5, 0.2],
'text-size': 14,
@@ -168,7 +168,7 @@ const layers = [
filter: ['all', ['==', '$type', 'Point'], ['==', 'class', 'state']],
layout: {
'text-field': '{name:latin}\n{name:nonlatin}',
- 'text-font': ['Open Sans Regular'],
+ 'text-font': ['Metropolis Regular', 'Noto Sans Regular'],
'text-size': 15,
visibility: 'visible',
},
@@ -193,7 +193,7 @@ const layers = [
],
layout: {
'text-field': ['case', ['has', 'name:en'], ['get', 'name:en'], ['get', 'name:latin']],
- 'text-font': ['Open Sans Italic'],
+ 'text-font': ['Metropolis Light Italic', 'Noto Sans Italic'],
'text-size': {base: 1, stops: [[0, 9], [6, 13]]},
visibility: 'visible',
},
@@ -218,7 +218,7 @@ const layers = [
],
layout: {
'text-field': ['case', ['has', 'name:en'], ['get', 'name:en'], ['get', 'name:latin']],
- 'text-font': ['Open Sans Regular'],
+ 'text-font': ['Metropolis Regular', 'Noto Sans Regular'],
'text-size': {base: 1, stops: [[0, 10], [6, 12]]},
visibility: 'visible',
},
@@ -244,7 +244,7 @@ const layers = [
layout: {
'text-anchor': 'center',
'text-field': ['case', ['has', 'name:en'], ['get', 'name:en'], ['get', 'name:latin']],
- 'text-font': ['Open Sans Regular'],
+ 'text-font': ['Metropolis Regular', 'Noto Sans Regular'],
'text-size': {base: 1.4, stops: [[0, 10], [3, 12], [4, 14]]},
visibility: 'visible',
},
diff --git a/src/style/style_oim_power.js b/src/style/style_oim_power.js
index a6e5bdb..a271a56 100644
--- a/src/style/style_oim_power.js
+++ b/src/style/style_oim_power.js
@@ -220,9 +220,9 @@ const power_visible_p = [
[
'any',
['>', ['coalesce', ['get', 'voltage'], 0], 199],
- ['all', ['>', ['coalesce', ['get', 'voltage'], 0], 131], ['>', ['zoom'], 4]],
- ['all', ['>', ['coalesce', ['get', 'voltage'], 0], 51], ['>', ['zoom'], 5]],
- ['all', ['>', ['coalesce', ['get', 'voltage'], 0], 23], ['>', ['zoom'], 6]],
+ ['all', ['>', ['coalesce', ['get', 'voltage'], 0], 99], ['>', ['zoom'], 4]],
+ ['all', ['>', ['coalesce', ['get', 'voltage'], 0], 49], ['>', ['zoom'], 5]],
+ ['all', ['>', ['coalesce', ['get', 'voltage'], 0], 24], ['>', ['zoom'], 6]],
['all', ['>', ['coalesce', ['get', 'voltage'], 0], 9], ['>', ['zoom'], 7]],
['>', ['zoom'], 10],
],
@@ -262,18 +262,8 @@ const power_ref_visible_p = [
],
];
-const construction_p = ['get', 'construction'];
-
-const construction_opacity = ['case', construction_p, 0.3, 1];
-
-const construction_label = [
- 'case',
- construction_p,
- ' (under construction) ',
- '',
-];
-
-const plant_label_visible_p = ['any',
+const plant_label_visible_p = [
+ 'any',
['>', ['coalesce', ['get', 'output'], 0], 1000],
['all', ['>', ['coalesce', ['get', 'output'], 0], 750], ['>', ['zoom'], 5]],
['all', ['>', ['coalesce', ['get', 'output'], 0], 250], ['>', ['zoom'], 6]],
@@ -300,6 +290,16 @@ function plant_image() {
return expr;
}
+const construction_p = ['get', 'construction'];
+
+const construction_opacity = ['case', construction_p, 0.3, 1];
+
+const construction_label = [
+ 'case',
+ construction_p,
+ ' (under construction) ',
+ '',
+];
const freq = [
'case',
@@ -518,6 +518,7 @@ const layers = [
source: 'openinframap',
'source-layer': 'power_line',
filter: ['all', ['!', underground_p], power_visible_p],
+ minzoom: 0,
paint: {
'line-color': voltage_color('voltage'),
'line-width': voltage_line_thickness,
@@ -631,7 +632,6 @@ const layers = [
],
'icon-size': ['interpolate', ['linear'], ['zoom'], 13, 0.4, 17, 1],
'text-field': '{ref}',
- 'text-font': ['Open Sans Regular'],
'text-size': [
'step',
// Set visibility by using size
@@ -662,7 +662,6 @@ const layers = [
],
'icon-size': 0.5,
'text-field': '{ref}',
- 'text-font': ['Open Sans Regular'],
'text-size': [
'step',
// Set visibility by using size
@@ -689,7 +688,6 @@ const layers = [
'icon-anchor': 'bottom',
'icon-size': ['interpolate', ['linear'], ['zoom'], 11, 0.5, 14, 1],
'text-field': '{name}',
- 'text-font': ['Open Sans Regular'],
'text-size': ['step', ['zoom'], 0, 12, 9],
'text-offset': [0, 1],
'text-anchor': 'top',
@@ -759,7 +757,6 @@ const layers = [
layout: {
'icon-image': 'power_line_ref',
'text-field': '{ref}',
- 'text-font': ['Open Sans Regular'],
'symbol-placement': 'line-center',
'text-size': 10,
'text-max-angle': 10,
@@ -776,7 +773,6 @@ const layers = [
paint: text_paint,
layout: {
'text-field': line_label,
- 'text-font': ['Open Sans Regular'],
'symbol-placement': 'line',
'symbol-spacing': 400,
'text-size': 10,
@@ -801,7 +797,6 @@ const layers = [
layout: {
'symbol-z-order': 'source',
'text-field': '{ref}',
- 'text-font': ['Open Sans Regular'],
'text-anchor': 'bottom',
'text-offset': [0, -0.5],
'text-size': ['interpolate', ['linear'], ['zoom'], 14, 9, 18, 12],
@@ -822,7 +817,6 @@ const layers = [
'symbol-sort-key': ['-', 10000, ['get', 'voltage']],
'symbol-z-order': 'source',
'text-field': substation_label,
- 'text-font': ['Open Sans Regular'],
'text-anchor': 'top',
'text-offset': [0, 0.5],
'text-size': [
@@ -854,6 +848,7 @@ const layers = [
filter: plant_label_visible_p,
'source-layer': 'power_plant_point',
minzoom: 6,
+ maxzoom: 24,
layout: {
'symbol-sort-key': ['-', 10000, ['get', 'output']],
'symbol-z-order': 'source',
@@ -861,7 +856,6 @@ const layers = [
'icon-image': plant_image(),
'icon-size': ['interpolate', ['linear'], ['zoom'], 6, 0.6, 10, 0.8],
'text-field': plant_label,
- 'text-font': ['Open Sans Regular'],
'text-anchor': 'top',
'text-offset': [0, 1],
'text-size': [
diff --git a/src/style/style_oim_telecoms.js b/src/style/style_oim_telecoms.js
index f9a2bd7..7b96116 100644
--- a/src/style/style_oim_telecoms.js
+++ b/src/style/style_oim_telecoms.js
@@ -46,7 +46,6 @@ const layers = [
14, 1
],
'text-field': operator_text,
- 'text-font': ['Open Sans Regular'],
'text-size': {
"stops": [
[11, 0],
@@ -73,7 +72,6 @@ const layers = [
paint: text_paint,
layout: {
'text-field': operator_text,
- 'text-font': ['Open Sans Regular'],
'text-size': {
"stops": [
[11, 0],
@@ -94,7 +92,6 @@ const layers = [
paint: text_paint,
layout: {
'text-field': '{name}',
- 'text-font': ['Open Sans Regular'],
'symbol-placement': 'line',
'symbol-spacing': 400,
'text-size': 10,