Skip to content

Commit

Permalink
chore: added osm background to some demos
Browse files Browse the repository at this point in the history
  • Loading branch information
claustres committed Nov 4, 2024
1 parent dbc5b09 commit 035f87b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
9 changes: 6 additions & 3 deletions demo/contourlines.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ async function run () {
zoomControl: false,
fullscreenControl: true
})
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
attribution: '© OpenStreetMap contributors'
}).addTo(map)

// define function for a dynamic color rendering according entered altitude
function dynamicColor(z, f) {
Expand All @@ -29,7 +32,7 @@ async function run () {
dataLayer: "contour",
symbolizer: new protomapsL.LineSymbolizer({
color: dynamicColor,
width: 1.1,
width: 2.5,
opacity: 0.4,
}),
filter: (z,f) => { return f.props.height > 0 && f.props.nth_line in [5, 10] == true}
Expand All @@ -38,8 +41,8 @@ async function run () {
dataLayer: "contour",
symbolizer: new protomapsL.LineSymbolizer({
color: dynamicColor,
width: 0.6,
opacity: 0.3,
width: 1.5,
opacity: 0.4,
}),
filter: (z,f) => { return f.props.height > 0 && f.props.nth_line in [5, 10] == false}
},
Expand Down
3 changes: 3 additions & 0 deletions demo/osm-boundaries.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ async function run () {
zoomControl: false,
fullscreenControl: true
})
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
attribution: '© OpenStreetMap contributors'
}).addTo(map)

// function to adapt boundaries color regarding the admin_level
function dynamicColor(z, f) {
Expand Down

0 comments on commit 035f87b

Please sign in to comment.