Skip to content

Commit

Permalink
code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
zdila committed Dec 28, 2023
1 parent 78adcce commit 035df28
Show file tree
Hide file tree
Showing 18 changed files with 31 additions and 41 deletions.
2 changes: 1 addition & 1 deletion style/AerialwayNames.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Rule, Style, TextSymbolizer } from "jsxnik/mapnikConfig";
import { Rule, Style } from "jsxnik/mapnikConfig";
import { TextSymbolizerEx } from "./TextSymbolizerEx";
import { SqlLayer } from "./SqlLayer";

Expand Down
36 changes: 15 additions & 21 deletions style/Aeroways.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ import { RuleEx } from "./RuleEx";
import { SqlLayer } from "./SqlLayer";

export function Aeroways() {
const aeroBgLine = { stroke: colors.aeroway };
const aeroFgLine = { stroke: "white", strokeWidth: 1 };

return (
<>
<SqlLayer
Expand All @@ -13,29 +16,20 @@ export function Aeroways() {
/>

<Style name="aeroways">
{(() => {
const aeroBgLine = { stroke: colors.aeroway };
const aeroFgLine = { stroke: "white", strokeWidth: 1 };

return (
<>
<RuleEx minZoom={11} maxZoom={11}>
<LineSymbolizer {...aeroBgLine} strokeWidth={3} />
<LineSymbolizer {...aeroFgLine} strokeWidth={0.5} strokeDasharray="3,3" />
</RuleEx>
<RuleEx minZoom={11} maxZoom={11}>
<LineSymbolizer {...aeroBgLine} strokeWidth={3} />
<LineSymbolizer {...aeroFgLine} strokeWidth={0.5} strokeDasharray="3,3" />
</RuleEx>

<RuleEx minZoom={12} maxZoom={13}>
<LineSymbolizer {...aeroBgLine} strokeWidth={5} />
<LineSymbolizer {...aeroFgLine} strokeDasharray="4,4" />
</RuleEx>
<RuleEx minZoom={12} maxZoom={13}>
<LineSymbolizer {...aeroBgLine} strokeWidth={5} />
<LineSymbolizer {...aeroFgLine} strokeDasharray="4,4" />
</RuleEx>

<RuleEx minZoom={14}>
<LineSymbolizer {...aeroBgLine} strokeWidth={8} />
<LineSymbolizer {...aeroFgLine} strokeDasharray="6,6" />
</RuleEx>
</>
);
})()}
<RuleEx minZoom={14}>
<LineSymbolizer {...aeroBgLine} strokeWidth={8} />
<LineSymbolizer {...aeroFgLine} strokeDasharray="6,6" />
</RuleEx>
</Style>
</>
);
Expand Down
2 changes: 1 addition & 1 deletion style/BuildingNames.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Style, TextSymbolizer } from "jsxnik/mapnikConfig";
import { Style } from "jsxnik/mapnikConfig";
import { TextSymbolizerEx } from "./TextSymbolizerEx";
import { Placements } from "./Placements";
import { RuleEx } from "./RuleEx";
Expand Down
2 changes: 1 addition & 1 deletion style/CountryNames.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { DebugSymbolizer, Format, Layer, Placement, Rule, Style } from "jsxnik/mapnikConfig";
import { Format, Rule, Style } from "jsxnik/mapnikConfig";
import { Borders } from "./Borders";
import { DatasourceEx } from "./DatasourceEx";
import { SqlLayer } from "./SqlLayer";
Expand Down
2 changes: 1 addition & 1 deletion style/DatasourceEx.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Datasource, Layer, Parameter, StyleName } from "jsxnik/mapnikConfig";
import { Datasource, Parameter } from "jsxnik/mapnikConfig";

type Props = {
params: Record<string, string>;
Expand Down
2 changes: 1 addition & 1 deletion style/FeatureLines.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { LinePatternSymbolizer, LineSymbolizer, Style } from "jsxnik/mapnikConfig";
import { colors, hsl } from "./colors";
import { hsl } from "./colors";
import { RuleEx } from "./RuleEx";
import { SqlLayer } from "./SqlLayer";
import { seq } from "./utils";
Expand Down
2 changes: 1 addition & 1 deletion style/Geonames.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Rule, Style, TextSymbolizer } from "jsxnik/mapnikConfig";
import { Rule, Style } from "jsxnik/mapnikConfig";
import { TextSymbolizerEx } from "./TextSymbolizerEx";
import { ShpLayer } from "./ShpLayer";

Expand Down
2 changes: 1 addition & 1 deletion style/HighwayNames.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Style, TextSymbolizer } from "jsxnik/mapnikConfig";
import { Style } from "jsxnik/mapnikConfig";
import { colors } from "./colors";
import { TextSymbolizerEx } from "./TextSymbolizerEx";
import { RuleEx } from "./RuleEx";
Expand Down
2 changes: 1 addition & 1 deletion style/Housenumbers.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Rule, Style, TextSymbolizer } from "jsxnik/mapnikConfig";
import { Rule, Style } from "jsxnik/mapnikConfig";
import { colors } from "./colors";
import { TextSymbolizerEx } from "./TextSymbolizerEx";
import { SqlLayer } from "./SqlLayer";
Expand Down
1 change: 0 additions & 1 deletion style/LocalityNames.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { Rule, Style, TextSymbolizer } from "jsxnik/mapnikConfig";
import { hsl } from "./colors";
import { TextSymbolizerEx } from "./TextSymbolizerEx";
import { Placements } from "./Placements";
import { RuleEx } from "./RuleEx";
import { SqlLayer } from "./SqlLayer";

export function LocalityNames() {
Expand Down
2 changes: 1 addition & 1 deletion style/Placenames.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Style, TextSymbolizer } from "jsxnik/mapnikConfig";
import { Style } from "jsxnik/mapnikConfig";
import { TextSymbolizerEx } from "./TextSymbolizerEx";
import { Placements } from "./Placements";
import { RuleEx } from "./RuleEx";
Expand Down
2 changes: 1 addition & 1 deletion style/ProtectedAreaNames.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { DebugSymbolizer, Rule, Style, TextSymbolizer } from "jsxnik/mapnikConfig";
import { Rule, Style } from "jsxnik/mapnikConfig";
import { colors } from "./colors";
import { TextSymbolizerEx } from "./TextSymbolizerEx";
import { Placements } from "./Placements";
Expand Down
4 changes: 1 addition & 3 deletions style/ProtectedAreas.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import { LinePatternSymbolizer, LineSymbolizer, PolygonPatternSymbolizer, Style } from "jsxnik/mapnikConfig";
import { colors, hsl } from "./colors";
import { colors } from "./colors";
import { RuleEx } from "./RuleEx";
import { SqlLayer } from "./SqlLayer";
import { TextSymbolizerEx } from "./TextSymbolizerEx";
import { seq, types } from "./utils";

export const nationalParkFilter = "[type] = 'national_park' or ([type] = 'protected_area' and [protect_class] = '2')";

Expand Down
2 changes: 1 addition & 1 deletion style/ShadingAndContours.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { LineSymbolizer, RasterSymbolizer, Rule, Style, TextSymbolizer } from "jsxnik/mapnikConfig";
import { LineSymbolizer, RasterSymbolizer, Rule, Style } from "jsxnik/mapnikConfig";
import { colors } from "./colors";
import { DatasourceEx } from "./DatasourceEx";
import { TextSymbolizerEx } from "./TextSymbolizerEx";
Expand Down
2 changes: 1 addition & 1 deletion style/ValleysRidges.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Placement, Style, TextSymbolizer } from "jsxnik/mapnikConfig";
import { Placement, Style } from "jsxnik/mapnikConfig";
import { TextSymbolizerEx } from "./TextSymbolizerEx";
import { RuleEx } from "./RuleEx";
import { SqlLayer } from "./SqlLayer";
Expand Down
2 changes: 1 addition & 1 deletion style/WaterAreaNames.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Style, TextSymbolizer } from "jsxnik/mapnikConfig";
import { Style } from "jsxnik/mapnikConfig";
import { TextSymbolizerEx } from "./TextSymbolizerEx";
import { Placements } from "./Placements";
import { RuleEx } from "./RuleEx";
Expand Down
2 changes: 1 addition & 1 deletion style/WaterLineNames.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Style, TextSymbolizer } from "jsxnik/mapnikConfig";
import { Style } from "jsxnik/mapnikConfig";
import { TextSymbolizerEx } from "./TextSymbolizerEx";
import { RuleEx } from "./RuleEx";
import { SqlLayer } from "./SqlLayer";
Expand Down
3 changes: 1 addition & 2 deletions style/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import config from "config";
import { Map, RasterSymbolizer, Rule, Style } from "jsxnik/mapnikConfig";
import { Map } from "jsxnik/mapnikConfig";
import { serialize } from "jsxnik/serialize";
import { AerialwayNames } from "./AerialwayNames";
import { Aerialways } from "./Aerialways";
Expand All @@ -20,7 +20,6 @@ import { FeatureLinesMaskable } from "./FeatureLinesMaskable";
import { FeatureNames, Features } from "./features";
import { Fixmes } from "./Fixmes";
import { FontSets } from "./FontSets";
import { Foo } from "./Foo";
import { Geonames } from "./Geonames";
import { HighwayNames } from "./HighwayNames";
import { Highways } from "./Highways";
Expand Down

0 comments on commit 035df28

Please sign in to comment.