-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix match-media experiments to work on maps4html.org
- Loading branch information
prushfor
authored and
prushfor
committed
Nov 16, 2024
1 parent
efcd455
commit fdc97bc
Showing
7 changed files
with
253 additions
and
175 deletions.
There are no files selected for viewing
21 changes: 17 additions & 4 deletions
21
styling/media-queries/match-media/map-projection/darkTheme.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,19 @@ | ||
const sheet = new protomapsL.Sheet(` | ||
<html> | ||
<body> | ||
<svg id="icon_0" width="99px" height="97px" xmlns="http://www.w3.org/2000/svg"> | ||
<image href="data:image/svg+xml;base64,PHN2ZyBpZD0iaWNvbl82NCIgd2lkdGg9IjE2cHgiIGhlaWdodD0iMTZweCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICAgICAgPGltYWdlIGhyZWY9ImRhdGE6aW1hZ2UvcG5nO2Jhc2U2NCxpVkJPUncwS0dnb0FBQUFOU1VoRVVnQUFBQkFBQUFBUUNBWUFBQUFmOC85aEFBQUFDWEJJV1hNQUFBN0VBQUFPeEFHVkt3NGJBQUFBMlVsRVFWUjRuTldQTVdvQ1lSQ0Z2MElDZ2xZaFZnRUwzZmNyZGlsczBteVJUdkFLa2xaSXdKM2ZpTjE2aGhoeUFCRkVjZ2J2WUtFbmtCUkpiNWtFSlRheXNNdFd5WVBYRFBPOW1RZC9YcjVHSlRkc1Rhb21wdm12TzBZbVB1T1FRcjRQeE5yRXR3L29wQzdITFM1TVRFd3NEdmFPdHdOOERCRGIwenh5eklkMWJoSkQraTFLWHN4T1lJSjN2a0dZM2ozZ1BnRmVqUnRjWnVvK2ROeWVCM2l4Skt0TXZQeUNtMGc4bS9neXNYOXlsRlBoT0tUZ3hZYzVYZ2ZYRkkrVnhKMkpkeE85MUlDQmFFZU83dm44b2M2VkQzak1YT1AvNkFmS0Ywd3dXeU9Oc3dBQUFBQkpSVTVFcmtKZ2dnPT0iIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIvPgogICAgPC9zdmc+" width="99" height="97" /> | ||
</svg> | ||
</body> | ||
</html> | ||
`); | ||
const pmtilesRules = new Map(); | ||
pmtilesRules.set( | ||
const pmtilesRulesReady = sheet.load().then(() => { | ||
pmtilesRules.set( | ||
'https://maps4html.org/experiments/vector-tiles/pmtiles/spearfish.pmtiles?theme=dark', | ||
{ theme: { theme: 'dark' } } | ||
); | ||
export { pmtilesRules }; | ||
{ theme: { theme: 'dark' } } | ||
); | ||
return pmtilesRules; | ||
}); | ||
|
||
export { pmtilesRules, pmtilesRulesReady }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 25 additions & 12 deletions
37
styling/media-queries/match-media/map-projection/lightTheme.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,27 @@ | ||
const sheet = new protomapsL.Sheet(` | ||
<html> | ||
<body> | ||
<svg id="icon_0" width="99px" height="97px" xmlns="http://www.w3.org/2000/svg"> | ||
<image href="data:image/svg+xml;base64,PHN2ZyBpZD0iaWNvbl82NCIgd2lkdGg9IjE2cHgiIGhlaWdodD0iMTZweCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICAgICAgPGltYWdlIGhyZWY9ImRhdGE6aW1hZ2UvcG5nO2Jhc2U2NCxpVkJPUncwS0dnb0FBQUFOU1VoRVVnQUFBQkFBQUFBUUNBWUFBQUFmOC85aEFBQUFDWEJJV1hNQUFBN0VBQUFPeEFHVkt3NGJBQUFBMlVsRVFWUjRuTldQTVdvQ1lSQ0Z2MElDZ2xZaFZnRUwzZmNyZGlsczBteVJUdkFLa2xaSXdKM2ZpTjE2aGhoeUFCRkVjZ2J2WUtFbmtCUkpiNWtFSlRheXNNdFd5WVBYRFBPOW1RZC9YcjVHSlRkc1Rhb21wdm12TzBZbVB1T1FRcjRQeE5yRXR3L29wQzdITFM1TVRFd3NEdmFPdHdOOERCRGIwenh5eklkMWJoSkQraTFLWHN4T1lJSjN2a0dZM2ozZ1BnRmVqUnRjWnVvK2ROeWVCM2l4Skt0TXZQeUNtMGc4bS9neXNYOXlsRlBoT0tUZ3hZYzVYZ2ZYRkkrVnhKMkpkeE85MUlDQmFFZU83dm44b2M2VkQzak1YT1AvNkFmS0Ywd3dXeU9Oc3dBQUFBQkpSVTVFcmtKZ2dnPT0iIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIvPgogICAgPC9zdmc+" width="99" height="97" /> | ||
</svg> | ||
</body> | ||
</html> | ||
`); | ||
const pmtilesRules = new Map(); | ||
pmtilesRules.set( | ||
'https://data.source.coop/protomaps/openstreetmap/tiles/v3.pmtiles', | ||
{ theme: { theme: 'light' } } | ||
); | ||
pmtilesRules.set( | ||
const pmtilesRulesReady = sheet.load().then(() => { | ||
pmtilesRules.set( | ||
'https://data.source.coop/protomaps/openstreetmap/tiles/v3.pmtiles', | ||
{ theme: { theme: 'light' } } | ||
); | ||
pmtilesRules.set( | ||
'https://maps4html.org/experiments/vector-tiles/pmtiles/spearfish.pmtiles?theme=light', | ||
{ theme: { theme: 'light' } } | ||
); | ||
pmtilesRules.set( | ||
'https://api.protomaps.com/tiles/v3/{z}/{x}/{y}.mvt?key=41392fb7515533a5', | ||
{ theme: { theme: 'light' } } | ||
); | ||
export { pmtilesRules }; | ||
{ theme: { theme: 'light' } } | ||
); | ||
pmtilesRules.set( | ||
'https://api.protomaps.com/tiles/v3/{z}/{x}/{y}.mvt?key=41392fb7515533a5', | ||
{ theme: { theme: 'light' } } | ||
); | ||
return pmtilesRules; | ||
}); | ||
|
||
export { pmtilesRules, pmtilesRulesReady }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 17 additions & 4 deletions
21
styling/media-queries/match-media/prefers-color-scheme/darkTheme.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,19 @@ | ||
const sheet = new protomapsL.Sheet(` | ||
<html> | ||
<body> | ||
<svg id="icon_0" width="99px" height="97px" xmlns="http://www.w3.org/2000/svg"> | ||
<image href="data:image/svg+xml;base64,PHN2ZyBpZD0iaWNvbl82NCIgd2lkdGg9IjE2cHgiIGhlaWdodD0iMTZweCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICAgICAgPGltYWdlIGhyZWY9ImRhdGE6aW1hZ2UvcG5nO2Jhc2U2NCxpVkJPUncwS0dnb0FBQUFOU1VoRVVnQUFBQkFBQUFBUUNBWUFBQUFmOC85aEFBQUFDWEJJV1hNQUFBN0VBQUFPeEFHVkt3NGJBQUFBMlVsRVFWUjRuTldQTVdvQ1lSQ0Z2MElDZ2xZaFZnRUwzZmNyZGlsczBteVJUdkFLa2xaSXdKM2ZpTjE2aGhoeUFCRkVjZ2J2WUtFbmtCUkpiNWtFSlRheXNNdFd5WVBYRFBPOW1RZC9YcjVHSlRkc1Rhb21wdm12TzBZbVB1T1FRcjRQeE5yRXR3L29wQzdITFM1TVRFd3NEdmFPdHdOOERCRGIwenh5eklkMWJoSkQraTFLWHN4T1lJSjN2a0dZM2ozZ1BnRmVqUnRjWnVvK2ROeWVCM2l4Skt0TXZQeUNtMGc4bS9neXNYOXlsRlBoT0tUZ3hZYzVYZ2ZYRkkrVnhKMkpkeE85MUlDQmFFZU83dm44b2M2VkQzak1YT1AvNkFmS0Ywd3dXeU9Oc3dBQUFBQkpSVTVFcmtKZ2dnPT0iIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIvPgogICAgPC9zdmc+" width="99" height="97" /> | ||
</svg> | ||
</body> | ||
</html> | ||
`); | ||
const pmtilesRules = new Map(); | ||
pmtilesRules.set( | ||
const pmtilesRulesReady = sheet.load().then(() => { | ||
pmtilesRules.set( | ||
'https://maps4html.org/experiments/vector-tiles/pmtiles/spearfish.pmtiles?theme=dark', | ||
{ theme: { theme: 'dark' } } | ||
); | ||
export { pmtilesRules }; | ||
{ theme: { theme: 'dark' } } | ||
); | ||
return pmtilesRules; | ||
}); | ||
|
||
export { pmtilesRules, pmtilesRulesReady }; |
37 changes: 25 additions & 12 deletions
37
styling/media-queries/match-media/prefers-color-scheme/lightTheme.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,27 @@ | ||
const sheet = new protomapsL.Sheet(` | ||
<html> | ||
<body> | ||
<svg id="icon_0" width="99px" height="97px" xmlns="http://www.w3.org/2000/svg"> | ||
<image href="data:image/svg+xml;base64,PHN2ZyBpZD0iaWNvbl82NCIgd2lkdGg9IjE2cHgiIGhlaWdodD0iMTZweCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICAgICAgPGltYWdlIGhyZWY9ImRhdGE6aW1hZ2UvcG5nO2Jhc2U2NCxpVkJPUncwS0dnb0FBQUFOU1VoRVVnQUFBQkFBQUFBUUNBWUFBQUFmOC85aEFBQUFDWEJJV1hNQUFBN0VBQUFPeEFHVkt3NGJBQUFBMlVsRVFWUjRuTldQTVdvQ1lSQ0Z2MElDZ2xZaFZnRUwzZmNyZGlsczBteVJUdkFLa2xaSXdKM2ZpTjE2aGhoeUFCRkVjZ2J2WUtFbmtCUkpiNWtFSlRheXNNdFd5WVBYRFBPOW1RZC9YcjVHSlRkc1Rhb21wdm12TzBZbVB1T1FRcjRQeE5yRXR3L29wQzdITFM1TVRFd3NEdmFPdHdOOERCRGIwenh5eklkMWJoSkQraTFLWHN4T1lJSjN2a0dZM2ozZ1BnRmVqUnRjWnVvK2ROeWVCM2l4Skt0TXZQeUNtMGc4bS9neXNYOXlsRlBoT0tUZ3hZYzVYZ2ZYRkkrVnhKMkpkeE85MUlDQmFFZU83dm44b2M2VkQzak1YT1AvNkFmS0Ywd3dXeU9Oc3dBQUFBQkpSVTVFcmtKZ2dnPT0iIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIvPgogICAgPC9zdmc+" width="99" height="97" /> | ||
</svg> | ||
</body> | ||
</html> | ||
`); | ||
const pmtilesRules = new Map(); | ||
pmtilesRules.set( | ||
'https://data.source.coop/protomaps/openstreetmap/tiles/v3.pmtiles', | ||
{ theme: { theme: 'light' } } | ||
); | ||
pmtilesRules.set( | ||
const pmtilesRulesReady = sheet.load().then(() => { | ||
pmtilesRules.set( | ||
'https://data.source.coop/protomaps/openstreetmap/tiles/v3.pmtiles', | ||
{ theme: { theme: 'light' } } | ||
); | ||
pmtilesRules.set( | ||
'https://maps4html.org/experiments/vector-tiles/pmtiles/spearfish.pmtiles?theme=light', | ||
{ theme: { theme: 'light' } } | ||
); | ||
pmtilesRules.set( | ||
'https://api.protomaps.com/tiles/v3/{z}/{x}/{y}.mvt?key=41392fb7515533a5', | ||
{ theme: { theme: 'light' } } | ||
); | ||
export { pmtilesRules }; | ||
{ theme: { theme: 'light' } } | ||
); | ||
pmtilesRules.set( | ||
'https://api.protomaps.com/tiles/v3/{z}/{x}/{y}.mvt?key=41392fb7515533a5', | ||
{ theme: { theme: 'light' } } | ||
); | ||
return pmtilesRules; | ||
}); | ||
|
||
export { pmtilesRules, pmtilesRulesReady }; |
Oops, something went wrong.