Open Infrastructure Map, a view of infrastructure data in OpenStreetMap
More poweeer tweaks
Russ Garrett5a9fb935a509
diff --git a/web/src/icons/power_generator.svg b/web/src/icons/power_generator.svgnew file mode 100644index 0000000..02e9d04--- /dev/null+++ b/web/src/icons/power_generator.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 100 100" 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:1.5;">+ <g transform="matrix(0.928178,0,0,0.928178,3.59111,3.59301)">+ <circle cx="50" cy="50" r="50" style="fill:rgb(235,235,235);stroke:black;stroke-width:6.73px;"/>+ </g>+ <g transform="matrix(0.165807,0,0,0.327873,-23.4894,-52.4604)">+ <path d="M229.957,316.755C231.816,315.277 233.668,313.79 235.52,312.303M235.52,312.303C248.281,302.079 261.055,291.794 274.773,282.87M274.773,282.87C286.904,274.978 299.941,268.09 314.027,264.47M314.027,264.47C326.877,261.186 340.351,260.939 353.28,263.956M353.28,263.956C367.341,267.196 380.415,273.829 392.534,281.519M392.534,281.519C406.301,290.244 419.087,300.427 431.787,310.619M431.787,310.619C444.606,320.888 457.372,331.289 471.041,340.419M471.041,340.419C483.18,348.545 496.187,355.772 510.294,359.823M510.294,359.823C523.043,363.484 536.522,364.24 549.547,361.605M549.547,361.605C563.572,358.831 576.686,352.539 588.801,345.102M588.801,345.102C602.613,336.61 615.404,326.571 628.054,316.458M628.054,316.458C637.471,308.931 646.839,301.337 656.49,294.11" style="fill:none;stroke:black;stroke-width:24.06px;stroke-linejoin:miter;stroke-miterlimit:2;"/>+ </g>+</svg>diff --git a/web/src/style/style_oim_power.ts b/web/src/style/style_oim_power.tsindex 2fe1281..3b56bd8 100644--- a/web/src/style/style_oim_power.ts+++ b/web/src/style/style_oim_power.ts@@ -1,4 +1,4 @@-import { text_paint, underground_p, font, local_name } from './common.js'+import { text_paint, underground_p, font, local_name, oimSymbol } from './common.js'import {all,has,@@ -156,16 +156,15 @@ const substation_visible_p: ExpressionSpecification = all(['>', voltage, 200],all(['>', voltage, 200], ['>', zoom, 6]),all(['>', voltage, 100], ['>', zoom, 7]),- all(['>', voltage, 25], ['>', zoom, 9]),- all(['>', voltage, 9], ['>', zoom, 10]),- ['>', zoom, 11]+ all(['>', voltage, 9], ['>', zoom, 9]),+ ['>', zoom, 10]),any(['!=', get('substation'), 'transition'], ['>', zoom, 12]))const substation_radius: ExpressionSpecification = interpolate(zoom, [[- 5,+ 5.5,interpolate(voltage, [[0, 0],[200, 1],@@ -178,11 +177,10 @@ const substation_radius: ExpressionSpecification = interpolate(zoom, [[10, 1],[30, 3],[100, 4],- [300, 6],[500, 8]])],- [20, 5]+ [20, 8]])// Determine the minimum zoom a point is visible at (before it can be seen as an@@ -702,30 +700,32 @@ const layers: LayerSpecificationWithZIndex[] = ['text-max-angle': 10}},- {+ oimSymbol({+ zorder: 265,+ id: 'power_generator_symbol',+ minZoom: 11,+ source: 'power',+ sourceLayer: 'power_generator',+ filter: all(match(get('source'), [[['wind', 'solar'], false]], true), has('output')),+ textField: get('name'),+ iconImage: 'power_generator',+ textMinZoom: 13,+ iconScale: 0.3,+ iconMinScale: 0.1+ }),+ oimSymbol({zorder: 266,id: 'power_wind_turbine',- type: 'symbol',+ minZoom: 11,source: 'power',- 'source-layer': 'power_generator',+ sourceLayer: 'power_generator',filter: ['==', get('source'), 'wind'],- minzoom: 11,- paint: text_paint,- layout: {- 'icon-image': 'power_wind',- 'icon-anchor': 'bottom',- 'icon-size': interpolate(zoom, [- [11, 0.5],- [21, 3]- ]),- 'icon-allow-overlap': true,- 'text-field': step(zoom, '', [[12, get('name')]]),- 'text-font': font,- 'text-offset': [0, 1],- 'text-anchor': 'top',- 'text-optional': true- }- },+ textField: get('name'),+ iconImage: 'power_wind',+ textMinZoom: 12,+ iconScale: 2,+ iconMinScale: 0.5+ }),{zorder: 267,id: 'power_wind_turbine_point',@@ -736,7 +736,10 @@ const layers: LayerSpecificationWithZIndex[] = [minzoom: 9,maxzoom: 11,paint: {- 'circle-radius': 1.5,+ 'circle-radius': interpolate(zoom, [+ [9, 0.5],+ [11, 2]+ ]),'circle-color': '#444444'}},@@ -752,11 +755,11 @@ const layers: LayerSpecificationWithZIndex[] = [paint: {'circle-radius': substation_radius,'circle-color': voltage_color('voltage'),- 'circle-stroke-color': '#333',+ 'circle-stroke-color': ['interpolate-hcl', ['linear'], zoom, 8, '#eee', 12, '#333'],'circle-stroke-width': interpolate(zoom, [- [5, 0.1],+ [5, 0],[8, 0.5],- [15, 2]+ [20, 2]]),'circle-opacity': power_opacity,'circle-stroke-opacity': power_opacity