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 all 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
56 changes: 56 additions & 0 deletions scripts/taginfo_template.json
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,62 @@
"doc_url": "https://openmaptiles.org/schema/#class",
"icon_url": "https://github.com/raw/ZeLonewolf/openstreetmap-americana/main/icons/poi_military_plane.svg"
},
{
"key": "aerialway",
"value": "cable_car",
"object_types": ["way"],
"description": "Cable cars are represented by a solid magenta line that splits in two at high zoom.",
"doc_url": "https://openmaptiles.org/schema/#aerialway"
},
{
"key": "aerialway",
"value": "chair_lift",
"object_types": ["way"],
"description": "Chairlifts are represented by a solid magenta line that splits in two at high zoom.",
"doc_url": "https://openmaptiles.org/schema/#aerialway"
},
{
"key": "aerialway",
"value": "gondola",
"object_types": ["way"],
"description": "Aerial gondolas are represented by a solid magenta line that splits in two at high zoom.",
"doc_url": "https://openmaptiles.org/schema/#aerialway"
},
{
"key": "aerialway",
"value": "mixed_lift",
"object_types": ["way"],
"description": "Mixed aerial lifts are represented by a solid magenta line that splits in two at high zoom.",
"doc_url": "https://openmaptiles.org/schema/#aerialway"
},
{
"key": "aerialway",
"value": "drag_lift",
"object_types": ["way"],
"description": "Drag lifts are represented by a dashed magenta line that splits in two at high zoom.",
"doc_url": "https://openmaptiles.org/schema/#aerialway"
},
{
"key": "aerialway",
"value": "platter",
"object_types": ["way"],
"description": "Platter lifts are represented by a dashed magenta line that splits in two at high zoom.",
"doc_url": "https://openmaptiles.org/schema/#aerialway"
},
{
"key": "aerialway",
"value": "j-bar",
"object_types": ["way"],
"description": "J-bar lifts are represented by a dashed magenta line that splits in two at high zoom.",
"doc_url": "https://openmaptiles.org/schema/#aerialway"
},
{
"key": "aerialway",
"value": "t-bar",
"object_types": ["way"],
"description": "T-bar lifts are represented by a dashed magenta line that splits in two at high zoom.",
"doc_url": "https://openmaptiles.org/schema/#aerialway"
},
{
"key": "aeroway",
"value": "runway",
Expand Down
3 changes: 3 additions & 0 deletions src/constants/color.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ 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(310, 41%, 59%)";
export const aerialwayLabel = "hsl(310, 71%, 29%)";

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: "Aerial lifts",
entries: AerialwayLayers.legendEntries,
},
{
name: "Aviation",
entries: AerowayLayers.legendEntries,
Expand Down
144 changes: 144 additions & 0 deletions src/layer/aerialway.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
"use strict";

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

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

let lineWidth = [
"interpolate",
["exponential", aerialwayExp],
["zoom"],
12,
1.2,
14.9999,
2.4,
15,
1.2,
16,
1.2,
20,
2.4,
];
let lineGapWidth = [
"interpolate",
["exponential", aerialwayExp],
["zoom"],
12,
0,
15,
0,
16,
1,
20,
16,
];

let casingLineWidth = [
"interpolate",
["exponential", aerialwayExp],
["zoom"],
12,
2,
15.9999,
4,
16,
2,
20,
4,
];
let casingLineGapWidth = [
"interpolate",
["exponential", aerialwayExp],
["zoom"],
12,
0,
16,
0,
20,
14.4,
];

export const lift = {
id: "lift",
type: "line",
paint: {
"line-color": Color.aerialwayLine,
"line-width": lineWidth,
"line-gap-width": lineGapWidth,
},
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 liftCasing = {
id: "lift_casing",
type: "line",
paint: {
"line-color": Color.backgroundFill,
"line-width": casingLineWidth,
"line-gap-width": casingLineGapWidth,
Copy link
Member

Choose a reason for hiding this comment

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

The legend doesn’t correctly implement line-gap-width, making this legend entry look misleading: #770.

Roosevelt Island Tramway

},
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": lineWidth,
"line-gap-width": lineGapWidth,
"line-dasharray": [5, 1],
},
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 legendEntries = [
{
description: "Aerial tramway or chairlift",
layers: [lift.id],
},
{
description: "Drag lift",
layers: [dragLift.id],
},
];
8 changes: 7 additions & 1 deletion 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 @@ -135,7 +136,9 @@ export function build(locales) {
lyrRail.railway.fill(),

lyrOneway.road,
lyrOneway.link
lyrOneway.link,

lyrAerialway.dragLift
);

layers.push(lyrBuilding.building);
Expand Down Expand Up @@ -199,6 +202,9 @@ export function build(locales) {

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

lyrBoundary.countryLabelLeft,
lyrBoundary.countryLabelRight,
lyrWater.waterwayLabel,
Expand Down
Loading