Open Infrastructure Map, a view of infrastructure data in OpenStreetMap
Add CT/PT icons, translation tweaks
Russ Garrett6d29e64e356b
diff --git a/web/locales/en/translation.json b/web/locales/en/translation.jsonindex 406aaf4..26d600e 100644--- a/web/locales/en/translation.json+++ b/web/locales/en/translation.json@@ -39,7 +39,9 @@"statcom": "Static VAR compensator","synchronous-condenser": "Synchronous condenser","filter": "Filter",- "compensator-other": "Other compensator"+ "compensator-other": "Other compensator",+ "current-transformer": "Current transformer",+ "potential-transformer": "Potential transformer"},"telecoms": {"communication-line": "Telecoms line",@@ -120,7 +122,8 @@"design": "Design","material": "Material","line-attachment": "Line attachment",- "line-management": "Line management"+ "line-management": "Line management",+ "transformer-type": "Transformer type"},"nav": {"about": "about",@@ -197,7 +200,7 @@"water": "Water","labels": "Labels","title": "Layers",- "other_pipelines": "Other Pipelines"+ "other-pipelines": "Other Pipelines"},"construction": "under construction","disused": "disused"diff --git a/web/src/friendlynames.ts b/web/src/friendlynames.tsindex 0bec2bf..422197b 100644--- a/web/src/friendlynames.ts+++ b/web/src/friendlynames.ts@@ -34,7 +34,7 @@ export default function friendlyNames(): { [key: string]: string } {water_pumping_station: t('names.water.pumping-station', 'Pumping station'),water_well: t('names.water.well', 'Water well'),water_reservoir: t('names.water.reservoir', 'Water reservoir'),- pipeline_inner: t('names.pipeline_other', 'Other Pipeline'),- pipeline_case: t('names.pipeline_other', 'Other Pipeline')+ pipeline_inner: t('names.pipeline', 'Pipeline'),+ pipeline_case: t('names.pipeline', 'Pipeline')}}diff --git a/web/src/icons/power_transformer_current.svg b/web/src/icons/power_transformer_current.svgnew file mode 100644index 0000000..f5322d8--- /dev/null+++ b/web/src/icons/power_transformer_current.svg@@ -0,0 +1,11 @@+<?xml version="1.0" encoding="UTF-8" standalone="no"?>+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">+<svg width="100%" height="100%" viewBox="0 0 50 74" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:2;">+ <g transform="matrix(1,0,0,1,1.13106,0)">+ <g id="Layer_1">+ <path d="M22.491,35.259C16.56,35.259 11.744,30.135 11.744,23.823C11.744,17.511 16.56,12.385 22.491,12.385M22.491,58.134C16.56,58.134 11.744,53.009 11.744,46.697C11.744,40.385 16.56,35.259 22.491,35.259M23.205,12.385L35.994,12.385M23.205,58.134L35.994,58.134M23.869,5.672L23.869,68.328" style="fill:white;"/>+ <path d="M22.491,35.259C16.56,35.259 11.744,30.135 11.744,23.823C11.744,17.511 16.56,12.385 22.491,12.385M22.491,58.134C16.56,58.134 11.744,53.009 11.744,46.697C11.744,40.385 16.56,35.259 22.491,35.259M23.205,12.385L35.994,12.385M23.205,58.134L35.994,58.134M23.869,5.672L23.869,68.328" style="fill:none;stroke:white;stroke-width:9px;"/>+ <path d="M22.491,35.259C16.56,35.259 11.744,30.135 11.744,23.823C11.744,17.511 16.56,12.385 22.491,12.385M22.491,58.134C16.56,58.134 11.744,53.009 11.744,46.697C11.744,40.385 16.56,35.259 22.491,35.259M23.205,12.385L35.994,12.385M23.205,58.134L35.994,58.134M23.869,5.672L23.869,68.328" style="fill:none;stroke:rgb(59,59,59);stroke-width:3.51px;stroke-miterlimit:1.5;"/>+ </g>+ </g>+</svg>diff --git a/web/src/icons/power_transformer_potential.svg b/web/src/icons/power_transformer_potential.svgnew file mode 100644index 0000000..70e2bc8--- /dev/null+++ b/web/src/icons/power_transformer_potential.svg@@ -0,0 +1,10 @@+<?xml version="1.0" encoding="UTF-8" standalone="no"?>+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">+<svg width="100%" height="100%" viewBox="0 0 50 60" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:2;">+ <g transform="matrix(0.893147,0,0,0.951135,2.67136,1.46599)">+ <g id="Layer_1">+ <path d="M16.263,17.435C19.73,17.435 22.546,14.619 22.546,11.152C22.546,7.684 19.73,4.869 16.263,4.869M16.263,42.565C19.73,42.565 22.546,39.75 22.546,36.283C22.546,32.815 19.73,30 16.263,30M16.263,55.131C19.73,55.131 22.546,52.316 22.546,48.848C22.546,45.381 19.73,42.565 16.263,42.565M16.263,30C19.73,30 22.546,27.185 22.546,23.717C22.546,20.25 19.73,17.435 16.263,17.435M16.263,4.869L3.419,4.869M16.263,55.131L3.419,55.131M33.627,42.567C30.16,42.567 27.345,39.751 27.345,36.284C27.345,32.816 30.16,30.001 33.627,30.001M33.627,30.001C30.16,30.001 27.345,27.186 27.345,23.719C27.345,20.251 30.16,17.436 33.627,17.436M46.581,17.433L33.737,17.433M46.581,42.567L33.737,42.567" style="fill:none;stroke:white;stroke-width:9.76px;"/>+ <path d="M16.263,17.435C19.73,17.435 22.546,14.619 22.546,11.152C22.546,7.684 19.73,4.869 16.263,4.869M16.263,42.565C19.73,42.565 22.546,39.75 22.546,36.283C22.546,32.815 19.73,30 16.263,30M16.263,55.131C19.73,55.131 22.546,52.316 22.546,48.848C22.546,45.381 19.73,42.565 16.263,42.565M16.263,30C19.73,30 22.546,27.185 22.546,23.717C22.546,20.25 19.73,17.435 16.263,17.435M16.263,4.869L3.419,4.869M16.263,55.131L3.419,55.131M33.627,42.567C30.16,42.567 27.345,39.751 27.345,36.284C27.345,32.816 30.16,30.001 33.627,30.001M33.627,30.001C30.16,30.001 27.345,27.186 27.345,23.719C27.345,20.251 30.16,17.436 33.627,17.436M46.581,17.433L33.737,17.433M46.581,42.567L33.737,42.567" style="fill:none;stroke:rgb(59,59,59);stroke-width:3.5px;stroke-miterlimit:1.5;"/>+ </g>+ </g>+</svg>diff --git a/web/src/infopopup.ts b/web/src/infopopup.tsindex 10489e1..8ad9403 100644--- a/web/src/infopopup.ts+++ b/web/src/infopopup.ts@@ -44,6 +44,7 @@ function fieldName(key: string) {material: t('info.material'),line_attachment: t('info.line-attachment'),line_management: t('info.line-management'),+ transformer_type: t('info.transformer-type'),repd_id: 'REPD ID'}[key] || titleCase(key))diff --git a/web/src/key/key.ts b/web/src/key/key.tsindex 53ce375..d385119 100644--- a/web/src/key/key.ts+++ b/web/src/key/key.ts@@ -131,7 +131,7 @@ class KeyControl implements IControl {mount(pane, this.petroleumTable())pane.appendChild(el('h3', t('key.water', 'Water')))mount(pane, await this.waterTable())- pane.appendChild(el('h3', t('key.other_pipelines', 'Other Pipelines')))+ pane.appendChild(el('h3', t('layers.other-pipelines', 'Other Pipelines')))mount(pane, this.otherPipelineTable())this._pane = pane@@ -231,6 +231,8 @@ class KeyControl implements IControl {t('names.power.transformer-3', 'Transformer (3 windings)'),await this.sprite('power_transformer_3_winding')],+ [t('names.power.current-transformer'), await this.sprite('power_transformer_current')],+ [t('names.power.potential-transformer'), await this.sprite('power_transformer_potential')],[t('names.power.switch-disconnector', 'Disconnector'), await this.sprite('power_switch_disconnector')],[t('names.power.switch-breaker', 'Circuit breaker'), await this.sprite('power_switch_circuit_breaker')],[t('names.power.switch-other', 'Other switch'), await this.sprite('power_switch')],diff --git a/web/src/openinframap.ts b/web/src/openinframap.tsindex c7cc666..c115281 100644--- a/web/src/openinframap.ts+++ b/web/src/openinframap.ts@@ -92,7 +92,7 @@ export default class OpenInfraMap {new Layer('S', t('layers.heatmap', 'Solar Generation'), 'heatmap_', false),new Layer('T', t('layers.telecoms', 'Telecoms'), 'telecoms_', false),new Layer('O', t('layers.petroleum', 'Oil & Gas'), 'petroleum_', false),- new Layer('I', t('layers.other_pipelines', 'Other Pipelines'), 'pipeline_', false),+ new Layer('I', t('layers.other-pipelines', 'Other Pipelines'), 'pipeline_', false),new Layer('W', t('layers.water', 'Water'), 'water_', false),new Layer('L', t('layers.labels', 'Labels'), 'place_', true)],diff --git a/web/src/style/common.ts b/web/src/style/common.tsindex 1a416f7..ad536a3 100644--- a/web/src/style/common.ts+++ b/web/src/style/common.ts@@ -53,7 +53,7 @@ export type OIMSymbolOptions = {textOffset?: numbericonImage: ExpressionSpecification | stringiconScale?: number // Icon scale at max icon zoom- iconMinScale?: number // Icon scale at initial icon zoom+ iconMinScale?: ExpresisonSpecification | number // Icon scale at initial icon zoomiconMaxZoom?: number}@@ -94,7 +94,7 @@ export function oimSymbol(options: OIMSymbolOptions): LayerSpecificationWithZInd'icon-size': interpolate(['zoom'],[- [options.minZoom, options.iconMinScale || iconScale * 0.8],+ [options.minZoom, options.iconMinScale || ['*', iconScale, 0.8]],[iconMaxZoom, iconScale]]),@@ -123,6 +123,7 @@ export function oimSymbol(options: OIMSymbolOptions): LayerSpecificationWithZInd}}}+export const substance: ExpressionSpecification = coalesce(get('substance'), get('type'), '')export const construction_p: ExpressionSpecification = coalesce(get('construction'), false)export const disused_p: ExpressionSpecification = coalesce(get('disused'), false)diff --git a/web/src/style/style_oim_power.ts b/web/src/style/style_oim_power.tsindex e05d142..bcaf2cb 100644--- a/web/src/style/style_oim_power.ts+++ b/web/src/style/style_oim_power.ts@@ -663,12 +663,26 @@ export default function layers(): LayerSpecificationWithZIndex[] {minZoom: 14,source: 'power',sourceLayer: 'power_transformer',- iconImage: if_(- any(has('voltage_tertiary'), ['==', ['to-number', get('windings')], 3]),- 'power_transformer_3_winding',+ iconImage: case_(+ [+ [+ any(has('voltage_tertiary'), ['==', ['to-number', get('windings')], 3]),+ 'power_transformer_3_winding'+ ],+ [['==', get('transformer_type'), 'current'], 'power_transformer_current'],+ [['==', get('transformer_type'), 'potential'], 'power_transformer_potential']+ ],'power_transformer'),iconMinScale: 0.1,+ iconScale: match(+ get('transformer_type'),+ [+ ['current', 0.6],+ ['potential', 0.6]+ ],+ 1+ ),textMinZoom: 17,textField: transformer_label,textOffset: 3