Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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: 1 addition & 1 deletion components/src/maplibre/MapStyle/SpriteImage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ export default function SpriteImage({ x, y, width, height, data }) {
return (
<div
style={{
backgroundSize: `auto`,
backgroundImage: `url(${img})`,
width: `${width}px`,
height: `${height}px`,
backgroundSize: `${w}px auto`,
backgroundPosition: `${-x}px ${-y}px`
}}
></div>
Expand Down
24 changes: 12 additions & 12 deletions components/src/maplibre/MapStyle/components/Admin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,16 @@ export default function makeAdmin(): any {
['!=', 'coastline', true]
],
paint: {
'line-color': tokens.background,
'line-color': '#ffffff',
'line-blur': 1,
'line-width': {
stops: [
[2, 0],
[3, 2],
[10, 8]
[3, 6],
[10, 7]
]
},
'line-opacity': 0.75
'line-opacity': 0.95
}
},
{
Expand Down Expand Up @@ -56,13 +56,13 @@ export default function makeAdmin(): any {
['!=', 'coastline', true]
],
paint: {
'line-color': tokens.background,
'line-color': 'white',
'line-blur': 1,
'line-width': {
stops: [
[7, 0],
[8, 2],
[10, 4]
[8, 5],
[10, 6]
]
},
'line-opacity': 0.75
Expand All @@ -80,16 +80,16 @@ export default function makeAdmin(): any {
paint: {
'line-color': {
stops: [
[7, '#dedede'],
[10, '#161616']
[7, '#a5a5a5'],
[10, '#3f3b39']
]
},

'line-width': {
stops: [
[2, 0],
[5, 1],
[8, 1],
[7, 1.5],
[12, 3]
]
}
Expand Down Expand Up @@ -126,7 +126,7 @@ export default function makeAdmin(): any {
['!=', 'coastline', true]
],
paint: {
'line-color': 'hsl(37, 34%, 79%)',
'line-color': 'hsl(37, 10%, 75%)',
'line-width': {
stops: [
[7, 1],
Expand All @@ -136,7 +136,7 @@ export default function makeAdmin(): any {
'line-opacity': {
stops: [
[7, 0],
[8, 1]
[7.5, 1]
]
}
}
Expand Down
4 changes: 2 additions & 2 deletions components/src/maplibre/MapStyle/components/Buildings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ export default function makeBuildings(): any {
'fill-color': tokens.building,
'fill-opacity': {
stops: [
[14, 0],
[15, 1]
[15, 0],
[16, 1]
]
}
}
Expand Down
134 changes: 18 additions & 116 deletions components/src/maplibre/MapStyle/components/Landuse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@ export default function makeLanduse(): any {
id: 'background',
type: 'background',
paint: {
'background-color': tokens.background
'background-color': {
stops: [
[8, tokens.background],
[10, 'white']
]
}
}
},
{
Expand Down Expand Up @@ -101,26 +106,14 @@ export default function makeLanduse(): any {
}
}
},
{
id: 'land-burial',
type: 'fill',
'source-layer': 'land',
filter: ['all', ['in', 'kind', 'cemetery', 'grave_yard']],
paint: {
'fill-color': tokens.grass,
'fill-opacity': {
stops: [
[12, 0],
[13, 1]
]
}
}
},
{
id: 'land-leisure',
type: 'fill',
'source-layer': 'land',
filter: ['all', ['in', 'kind', 'miniature_golf', 'playground', 'golf_course']],
filter: [
'all',
['in', 'kind', 'cemetery', 'grave_yard', 'miniature_golf', 'playground', 'golf_course']
],
paint: {
'fill-color': tokens.grass_dark
}
Expand Down Expand Up @@ -153,22 +146,10 @@ export default function makeLanduse(): any {
id: 'land-grass',
type: 'fill',
'source-layer': 'land',
filter: ['all', ['in', 'kind', 'grass', 'grassland', 'meadow', 'wet_meadow']],
paint: {
'fill-color': tokens.grass,
'fill-opacity': {
stops: [
[11, 0],
[12, 1]
]
}
}
},
{
id: 'land-vegetation',
type: 'fill',
'source-layer': 'land',
filter: ['all', ['in', 'kind', 'heath', 'scrub']],
filter: [
'all',
['in', 'kind', 'heath', 'scrub', 'grass', 'grassland', 'meadow', 'wet_meadow']
],
paint: {
'fill-color': tokens.grass,
'fill-opacity': {
Expand All @@ -179,6 +160,7 @@ export default function makeLanduse(): any {
}
}
},

{
id: 'land-sand',
type: 'fill',
Expand Down Expand Up @@ -301,7 +283,7 @@ export default function makeLanduse(): any {
'source-layer': 'water_polygons',
filter: ['==', 'kind', 'water'],
paint: {
'fill-color': tokens.water_ocean,
'fill-color': tokens.water,
'fill-opacity': {
stops: [
[3, 0],
Expand Down Expand Up @@ -403,91 +385,11 @@ export default function makeLanduse(): any {
}
},
{
id: 'site-dangerarea',
id: 'site-any',
type: 'fill',
'source-layer': 'sites',
filter: ['in', 'kind', 'danger_area'],
paint: {
'fill-color': 'hsl(0,0%,50%)',
'fill-outline-color': 'hsl(0,0%,50%)',
'fill-opacity': 0.3
}
},
{
id: 'site-university',
type: 'fill',
'source-layer': 'sites',
filter: ['in', 'kind', 'university'],
paint: {
'fill-color': 'hsl(60,0%,75%)',
'fill-opacity': 0.1
}
},
{
id: 'site-college',
type: 'fill',
'source-layer': 'sites',
filter: ['in', 'kind', 'college'],
paint: {
'fill-color': 'hsl(60,0%,75%)',
'fill-opacity': 0.1
}
},
{
id: 'site-school',
type: 'fill',
'source-layer': 'sites',
filter: ['in', 'kind', 'school'],
paint: {
'fill-color': 'hsl(60,0%,75%)',
'fill-opacity': 0.1
}
},
{
id: 'site-hospital',
type: 'fill',
'source-layer': 'sites',
filter: ['in', 'kind', 'hospital'],
paint: {
'fill-color': 'hsl(0,0%,70%)',
'fill-opacity': 0.1
}
},
{
id: 'site-prison',
type: 'fill',
'source-layer': 'sites',
filter: ['in', 'kind', 'prison'],
paint: {
'fill-color': 'hsl(305,0%,97%)',
'fill-opacity': 0.1
}
},
{
id: 'site-parking',
type: 'fill',
'source-layer': 'sites',
filter: ['in', 'kind', 'parking'],
paint: {
'fill-color': 'hsl(24,0%,95%)'
}
},
{
id: 'site-bicycleparking',
type: 'fill',
'source-layer': 'sites',
filter: ['in', 'kind', 'bicycle_parking'],
paint: {
'fill-color': 'hsl(24,0%,95%)'
}
},
{
id: 'site-construction',
type: 'fill',
'source-layer': 'sites',
filter: ['in', 'kind', 'construction'],
paint: {
'fill-color': 'hsl(0,0%,66%)',
'fill-color': tokens.street_tertiary,
'fill-opacity': 0.1
}
}
Expand Down
52 changes: 17 additions & 35 deletions components/src/maplibre/MapStyle/components/PlaceLabels.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,7 @@ import type { SymbolLayerSpecification } from 'maplibre-gl';
// Ideally majorCities would include Frankfurt and Leipzig, but they're not
// state capitals so they're not available in the versatiles data until z6

const majorCities = [
'Berlin',
'Stuttgart',
'München',
'Frankfurt',
'Hamburg',
'Mainz'
];
const majorCountries = [
'Deutschland',
'Dänemark',
'Frankreich',
'Niederlande',
'Belgien',
'Schweiz',
'Polen',
'Österreich',
'Tschechien',
'Slowakei',
'Italien',
'Ungarn'
];
const majorCities = ['Berlin', 'Stuttgart', 'München', 'Frankfurt', 'Hamburg', 'Mainz'];

// For smaller cities we use the population field to derive our hierarchy,
// though that's limited by the fact that versatiles hard-codes population
Expand Down Expand Up @@ -144,30 +123,30 @@ export default function makePlaceLabels() {
layout: {
'text-size': {
stops: [
[7, 14],
[7, 16],
[15, 20]
]
}
},
paint: {
'text-color': tokens.label_primary
'text-color': tokens.label_secondary
}
},
{
id: 'label-place-major-city',
filter: ['in', 'name_de', ...majorCities],
minzoom: 5,
minzoom: 5.5,
maxzoom: 12,
layout: {
'text-size': {
stops: [
[7, 13],
[15, 21]
[7, 14],
[15, 25]
]
}
},
paint: {
'text-color': tokens.label_secondary
'text-color': tokens.label_tertiary
}
}
].map((el) => {
Expand All @@ -178,7 +157,7 @@ export default function makePlaceLabels() {
'source-layer': 'place_labels',
layout: {
'text-font': tokens.sans_regular,
'text-letter-spacing': 0.05,
'text-letter-spacing': 0.01,
'text-field': '{name_de}',
...el.layout
},
Expand All @@ -196,25 +175,28 @@ export default function makePlaceLabels() {
const boundaryLabels = [
{
id: 'label-boundary-country',
filter: ['all', ['==', 'admin_level', 2], ['in', 'name_de', ...majorCountries]],
filter: [
'all',
['==', 'admin_level', 2],
['!in', 'name_de', 'Jersey', 'Guernsey', 'Insel Man']
],
minzoom: 4,
maxzoom: 8,
layout: {
'text-field': '{name_de}',
'text-letter-spacing': 0.085,
'text-letter-spacing': 0.02,
'text-font': tokens.sans_regular,
'text-transform': 'uppercase',
'text-size': {
stops: [
[4, 11],
[4, 13],
[7, 18]
]
}
},
paint: {
'text-color': tokens.label_tertiary,
'text-halo-color': tokens.background,
'text-halo-width': 2.5,
'text-halo-color': 'white',
'text-halo-width': 2,
'text-halo-blur': 0.5
}
}
Expand Down
Loading