Open Infrastructure Map, a view of infrastructure data in OpenStreetMap
Switch base layer
Russ Garrettd8b849179c21
diff --git a/dist/about.html b/dist/about.htmlindex e1a6f0b..19141d4 100644--- a/dist/about.html+++ b/dist/about.html@@ -37,8 +37,6 @@<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>.@@ -69,7 +67,9 @@<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>.</p>+ 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><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 anddiff --git a/src/style/style.json b/src/style/style.jsonindex 7bc430f..888dcd6 100644--- a/src/style/style.json+++ b/src/style/style.json@@ -24,7 +24,7 @@"sources": {"openmaptiles": {"type": "vector",- "url": "https://api.maptiler.com/tiles/v3/tiles.json?key=4HQAZUSrAg563kYxgVEy"+ "url": "https://tiles.russss.dev/services/osm"},"openinframap": {"type": "vector",@@ -32,7 +32,7 @@}},"sprite": "https://openinframap.org/style/sprite",- "glyphs": "https://api.maptiler.com/fonts/{fontstack}/{range}.pbf?key=4HQAZUSrAg563kYxgVEy",+ "glyphs": "https://glfonts.lukasmartinelli.ch/fonts/{fontstack}/{range}.pbf","layers": [],"id": "openinframap"}diff --git a/src/style/style_labels.js b/src/style/style_labels.jsindex c93739b..141ead4 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': ['Metropolis Regular', 'Noto Sans Regular'],+ 'text-font': ['Open 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': ['Metropolis Regular', 'Noto Sans Regular'],+ 'text-font': ['Open 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': ['Metropolis Regular', 'Noto Sans Regular'],+ 'text-font': ['Open 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': ['Metropolis Regular', 'Noto Sans Regular'],+ 'text-font': ['Open 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': ['Metropolis Regular', 'Noto Sans Regular'],+ 'text-font': ['Open 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': ['Metropolis Regular', 'Noto Sans Regular'],+ 'text-font': ['Open 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': ['Metropolis Regular', 'Noto Sans Regular'],+ 'text-font': ['Open 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': ['Metropolis Light Italic', 'Noto Sans Italic'],+ 'text-font': ['Open 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': ['Metropolis Regular', 'Noto Sans Regular'],+ 'text-font': ['Open 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': ['Metropolis Regular', 'Noto Sans Regular'],+ 'text-font': ['Open 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.jsindex a271a56..a6e5bdb 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], 99], ['>', ['zoom'], 4]],- ['all', ['>', ['coalesce', ['get', 'voltage'], 0], 49], ['>', ['zoom'], 5]],- ['all', ['>', ['coalesce', ['get', 'voltage'], 0], 24], ['>', ['zoom'], 6]],+ ['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], 9], ['>', ['zoom'], 7]],['>', ['zoom'], 10],],@@ -262,8 +262,18 @@ const power_ref_visible_p = [],];-const plant_label_visible_p = [- 'any',+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',['>', ['coalesce', ['get', 'output'], 0], 1000],['all', ['>', ['coalesce', ['get', 'output'], 0], 750], ['>', ['zoom'], 5]],['all', ['>', ['coalesce', ['get', 'output'], 0], 250], ['>', ['zoom'], 6]],@@ -290,16 +300,6 @@ 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,7 +518,6 @@ 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,@@ -632,6 +631,7 @@ 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,6 +662,7 @@ const layers = [],'icon-size': 0.5,'text-field': '{ref}',+ 'text-font': ['Open Sans Regular'],'text-size': ['step',// Set visibility by using size@@ -688,6 +689,7 @@ 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',@@ -757,6 +759,7 @@ 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,@@ -773,6 +776,7 @@ const layers = [paint: text_paint,layout: {'text-field': line_label,+ 'text-font': ['Open Sans Regular'],'symbol-placement': 'line','symbol-spacing': 400,'text-size': 10,@@ -797,6 +801,7 @@ 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],@@ -817,6 +822,7 @@ 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': [@@ -848,7 +854,6 @@ 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',@@ -856,6 +861,7 @@ 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.jsindex 7b96116..f9a2bd7 100644--- a/src/style/style_oim_telecoms.js+++ b/src/style/style_oim_telecoms.js@@ -46,6 +46,7 @@ const layers = [14, 1],'text-field': operator_text,+ 'text-font': ['Open Sans Regular'],'text-size': {"stops": [[11, 0],@@ -72,6 +73,7 @@ const layers = [paint: text_paint,layout: {'text-field': operator_text,+ 'text-font': ['Open Sans Regular'],'text-size': {"stops": [[11, 0],@@ -92,6 +94,7 @@ const layers = [paint: text_paint,layout: {'text-field': '{name}',+ 'text-font': ['Open Sans Regular'],'symbol-placement': 'line','symbol-spacing': 400,'text-size': 10,