Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add aerialways #755

Merged
merged 23 commits into from
Mar 7, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
7c6d975
add aerialways
claysmalley Feb 1, 2023
7242b75
adjust aerialway width
claysmalley Feb 2, 2023
3082252
rename aerialway legend header
claysmalley Feb 2, 2023
641c94d
Merge branch 'main' into clay-aerialway
claysmalley Feb 3, 2023
4ba0823
Merge branch 'main' into clay-aerialway
claysmalley Feb 3, 2023
f5ab26b
change aerialways to purple and move drag lifts below bridges
claysmalley Feb 3, 2023
d627995
Merge branch 'main' into clay-aerialway
claysmalley Feb 3, 2023
25fdea5
remove casing from drag lifts
claysmalley Feb 3, 2023
d3762bc
bigger aerialway gap width on high zooms
claysmalley Feb 3, 2023
7b7ca1f
add taginfo for aerialways
claysmalley Feb 3, 2023
de90897
thinner drag lift line
claysmalley Feb 4, 2023
0a0758f
Merge branch 'main' into clay-aerialway
claysmalley Feb 6, 2023
5d4bcb0
transition aerialways at z15 from single to double line
claysmalley Feb 6, 2023
261695c
move drag lift out of bridge layers
claysmalley Feb 7, 2023
3db148d
Merge branch 'main' into clay-aerialway
claysmalley Feb 9, 2023
e782544
Merge branch 'main' into clay-aerialway
claysmalley Feb 11, 2023
c0f3513
Merge branch 'main' into clay-aerialway
claysmalley Feb 14, 2023
1420123
Merge branch 'main' into clay-aerialway
ZeLonewolf Feb 25, 2023
71b2cc5
add aerialway text offset
claysmalley Feb 26, 2023
ff112a7
Merge branch 'main' into clay-aerialway
claysmalley Feb 26, 2023
5b21586
negate text offset
claysmalley Mar 6, 2023
c14f467
change aerialways to magenta
claysmalley Mar 6, 2023
81a41fc
change aerialway text-anchor to center
claysmalley Mar 7, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/constants/color.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ export const parkOutline = "hsla(136, 41%, 70%, 50%)";
export const parkLabel = "hsl(136, 71%, 29%)";
export const parkLabelHalo = "hsl(90, 27%, 94%)";

export const aerialwayLine = "hsl(350, 70%, 50%)";

export const airportFill = "hsl(250, 41%, 95%)";
export const airportOutline = "hsl(250, 41%, 79%)";
export const airportRunway = "hsl(250, 41%, 79%)";
Expand Down
5 changes: 5 additions & 0 deletions src/js/legend_config.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import * as ParkLayers from "../layer/park.js";
import * as BuildingLayers from "../layer/building.js";
import * as WaterLayers from "../layer/water.js";
import * as FerryLayers from "../layer/ferry.js";
import * as AerialwayLayers from "../layer/aerialway.js";

export const sections = [
{
Expand Down Expand Up @@ -40,6 +41,10 @@ export const sections = [
name: "Railroads",
entries: RailLayers.legendEntries,
},
{
name: "Aerialways",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think “aerialway” is only a real word in OSM English. Both aerial trams and chair lifts count as aerial lifts.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Chairlifts or gondolas on the east coast.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tram sounds like some quaint en_GB thing to me.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aerial lift sounds good to me as a general term.

The two transit-oriented aerial lifts I know of in the United States have tram in their names:

I think "aerial tramway" in US English is reasonably understood to be a transit-oriented aerialway=gondola or aerialway=cable_car. But at a ski resort, I'd definitely call that a gondola.

entries: AerialwayLayers.legendEntries,
},
{
name: "Aviation",
entries: AerowayLayers.legendEntries,
Expand Down
112 changes: 112 additions & 0 deletions src/layer/aerialway.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
"use strict";

import * as Color from "../constants/color.js";

// Exponent base for inter-zoom interpolation
let aerialwayExp = 1.2;

export const lift = {
id: "lift",
type: "line",
paint: {
"line-color": Color.aerialwayLine,
"line-width": [
"interpolate",
["exponential", aerialwayExp],
["zoom"],
12,
0.6,
20,
2.4,
],
"line-gap-width": [
"interpolate",
["exponential", aerialwayExp],
["zoom"],
12,
0.5,
20,
2,
],
},
filter: [
"all",
["==", ["get", "class"], "aerialway"],
[
"in",
["get", "subclass"],
["literal", ["chair_lift", "cable_car", "gondola", "mixed_lift"]],
],
],
layout: {
visibility: "visible",
},
source: "openmaptiles",
"source-layer": "transportation",
};

export const dragLift = {
id: "drag_lift",
type: "line",
paint: {
"line-color": Color.aerialwayLine,
"line-width": [
"interpolate",
["exponential", aerialwayExp],
["zoom"],
12,
1.5,
20,
6,
],
"line-dasharray": [2, 0.5],
},
filter: [
"all",
["==", ["get", "class"], "aerialway"],
[
"in",
["get", "subclass"],
["literal", ["drag_lift", "platter", "j-bar", "t-bar"]],
],
],
layout: {
visibility: "visible",
},
source: "openmaptiles",
"source-layer": "transportation",
};

export const casing = {
id: "aerialway_casing",
type: "line",
paint: {
"line-color": Color.backgroundFill,
"line-width": [
"interpolate",
["exponential", aerialwayExp],
["zoom"],
12,
2.5,
20,
10,
],
},
filter: ["==", ["get", "class"], "aerialway"],
layout: {
visibility: "visible",
},
source: "openmaptiles",
"source-layer": "transportation",
};

export const legendEntries = [
{
description: "Aerial tramway or chairlift",
layers: [lift.id],
},
{
description: "Drag lift",
layers: [dragLift.id],
},
];
5 changes: 5 additions & 0 deletions src/layer/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import * as Label from "../constants/label.js";

import * as lyrAerialway from "./aerialway.js";
import * as lyrAeroway from "./aeroway.js";
import * as lyrBackground from "./background.js";
import * as lyrBoundary from "./boundary.js";
Expand Down Expand Up @@ -199,6 +200,10 @@ export function build(locales) {

layers.push(
//The labels at the end of the list draw on top of the layers at the beginning.
lyrAerialway.casing,
lyrAerialway.dragLift,
lyrAerialway.lift,

lyrWater.waterwayLabel,

lyrTransportationLabel.bridgeSpacer,
Expand Down
47 changes: 26 additions & 21 deletions src/layer/transportation_label.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import * as Label from "../constants/label.js";
import * as Color from "../constants/color.js";

const highwaySelector = ["match", ["get", "class"]];
const classSelector = ["match", ["get", "class"]];

const motorwayToTrunk = ["motorway", "trunk"];
const motorwayToPrimary = [...motorwayToTrunk, "primary"];
Expand All @@ -25,17 +25,19 @@ export const label = {
type: "symbol",
paint: {
"text-color": [
...highwaySelector,
...classSelector,
majorConstruction,
"maroon",
minorConstruction,
"slategray",
"ferry",
Color.waterLineBold,
"aerialway",
Color.aerialwayLine,
"#333",
],
"text-halo-color": [
...highwaySelector,
...classSelector,
"ferry",
Color.waterFill,
Color.backgroundFill,
Expand All @@ -45,17 +47,17 @@ export const label = {
"text-opacity": [
"step",
["zoom"],
[...highwaySelector, "motorway", 1, 0],
[...classSelector, "motorway", 1, 0],
10,
[...highwaySelector, motorwayToTrunk, 1, 0],
[...classSelector, motorwayToTrunk, 1, 0],
11,
[...highwaySelector, motorwayToPrimary, 1, "ferry", 1, 0],
[...classSelector, motorwayToPrimary, 1, "ferry", 1, 0],
12,
[...highwaySelector, motorwayToSecondary, 1, "ferry", 1, 0],
[...classSelector, motorwayToSecondary, 1, ["ferry", "aerialway"], 1, 0],
13,
[...highwaySelector, motorwayToMinor, 1, "ferry", 1, 0],
[...classSelector, motorwayToMinor, 1, ["ferry", "aerialway"], 1, 0],
14,
[...highwaySelector, motorwayToService, 1, "ferry", 1, 0],
[...classSelector, motorwayToService, 1, ["ferry", "aerialway"], 1, 0],
15,
1,
],
Expand All @@ -70,13 +72,14 @@ export const label = {
...majorConstruction,
...minorConstruction,
"ferry",
"aerialway",
],
],
],
layout: {
"text-font": [
...highwaySelector,
"ferry",
...classSelector,
["ferry", "aerialway"],
["literal", ["OpenHistorical Italic"]],
["literal", ["OpenHistorical"]],
],
Expand All @@ -88,33 +91,35 @@ export const label = {
["zoom"],
12,
16,
[...highwaySelector, motorwayToTrunk, 10, 12],
[...classSelector, motorwayToTrunk, 10, 12],
17,
[...highwaySelector, motorwayToSecondary, 10, 12],
[...classSelector, motorwayToSecondary, 10, 12],
],
"text-anchor": [
"step",
["zoom"],
"bottom",
16,
[...highwaySelector, motorwayToTrunk, "center", "bottom"],
[...classSelector, motorwayToTrunk, "center", "bottom"],
17,
[...highwaySelector, motorwayToSecondary, "center", "bottom"],
[...classSelector, motorwayToSecondary, "center", "bottom"],
],
"symbol-sort-key": [
// TODO busway
...highwaySelector,
"motorway",
...classSelector,
"aerialway",
0,
"trunk",
"motorway",
1,
["primary", "ferry"],
"trunk",
2,
"secondary",
["primary", "ferry"],
3,
["tertiary", "minor"],
"secondary",
4,
["tertiary", "minor"],
5,
6,
],
},
source: "openmaptiles",
Expand Down