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

OpenMapTiles 3.13 Features: Highway shields, Interstate filtering #72

Merged
merged 104 commits into from
Jan 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
104 commits
Select commit Hold shift + click to select a range
888d5ed
Implement highway shields and interstate filtering
ZeLonewolf Jan 2, 2022
a880119
Refactor to separate definitions to separate file
ZeLonewolf Jan 3, 2022
fd025ce
Initial framework for multiple-shield definition
ZeLonewolf Jan 3, 2022
ce92ef5
Refactor to allow for wide shield fallback
ZeLonewolf Jan 3, 2022
188dec2
Fix bug in special case code
ZeLonewolf Jan 3, 2022
3e3d545
Add support for multiple shield widths
ZeLonewolf Jan 3, 2022
850f27e
Remove console logging
ZeLonewolf Jan 3, 2022
f0a4b13
Add narrow/wide US route shield
ZeLonewolf Jan 4, 2022
b247900
Adding GA highway shields
ZeLonewolf Jan 4, 2022
d46172d
Add Ohio highway shields
ZeLonewolf Jan 4, 2022
7c831b6
Add IA, MS shields
ZeLonewolf Jan 4, 2022
717b2da
Add recolor support for historic US 66
ZeLonewolf Jan 4, 2022
e17306e
Add Georgia special shields
ZeLonewolf Jan 5, 2022
abfec69
Build dev maplibre from source rather than vendoring
ZeLonewolf Jan 5, 2022
1be9b43
Refactor font size/type
ZeLonewolf Jan 5, 2022
fdc8449
Remove duplicate code
ZeLonewolf Jan 6, 2022
1cb0297
Remove superfluous smoothing parameters
ZeLonewolf Jan 6, 2022
3471b04
Remove unused code
ZeLonewolf Jan 6, 2022
2757c9f
Remove highway exit functions not ready for prime time
ZeLonewolf Jan 6, 2022
29e3503
Fix 1.0x text scaling
ZeLonewolf Jan 6, 2022
7cb4897
Prettier
ZeLonewolf Jan 6, 2022
379565c
Pittsburgh loop proper colors
ZeLonewolf Jan 6, 2022
ba0485c
Update style/layer/highway_shield.js
ZeLonewolf Jan 6, 2022
a9606d9
Update style/layer/highway_shield.js
ZeLonewolf Jan 6, 2022
0c2f4fd
Prettier should ignore the built maplibre
ZeLonewolf Jan 7, 2022
2c3280b
Refactor shield drawing
ZeLonewolf Jan 7, 2022
d44e85d
Fix concurrency spacing
ZeLonewolf Jan 7, 2022
2d11c14
Fix generic shields
ZeLonewolf Jan 7, 2022
7557c9c
Prettier
ZeLonewolf Jan 7, 2022
a2046f4
Restore Pittsburgh belt shield colors
ZeLonewolf Jan 8, 2022
bc7e3ba
Change shield loading to one-time load
ZeLonewolf Jan 8, 2022
0ed6869
Fix shield spacing
ZeLonewolf Jan 8, 2022
9e81a31
Simplify code; no need to pass canvas around
ZeLonewolf Jan 8, 2022
6f6e4e4
Prettier
ZeLonewolf Jan 8, 2022
2a1d6b4
Refactoring shield text code & partial banner implementation
ZeLonewolf Jan 9, 2022
4d4600d
Move shield text drawing function to text class
ZeLonewolf Jan 9, 2022
f8fe9f9
Consolidate text drawing in shield_text.js
ZeLonewolf Jan 9, 2022
d680577
Cleanup/refactor of shield drawing/scaling code
ZeLonewolf Jan 11, 2022
2199b8f
Add support for US:US:Alternate:Truck:Business
ZeLonewolf Jan 11, 2022
7d92980
Remove unneeded debug logging
ZeLonewolf Jan 12, 2022
b69b270
Fix Pittsburge dot routes
ZeLonewolf Jan 12, 2022
2c006f5
Convert shield drawing code to top baseline
ZeLonewolf Jan 12, 2022
25ee55c
Fix shield modifier backdrop and fix shield paddings
ZeLonewolf Jan 12, 2022
6a2dcec
Improve scaling of banners
ZeLonewolf Jan 12, 2022
d375391
Add business interstates
ZeLonewolf Jan 13, 2022
64d495b
Add horizontal line for business interstates
ZeLonewolf Jan 14, 2022
ccfd32f
Refactor to move shield-specific code to its own files
ZeLonewolf Jan 14, 2022
9cb2377
Fix 1x scaling
ZeLonewolf Jan 15, 2022
9ccc43a
Add Kansas highway shields
ZeLonewolf Jan 15, 2022
d32f4f1
Add highway shields for California
ZeLonewolf Jan 15, 2022
a245b0f
Add Minnesota highway shields
ZeLonewolf Jan 15, 2022
62b503d
Remove duplication in producing the font specification
ZeLonewolf Jan 15, 2022
e2005b6
Use common function for font-setting
ZeLonewolf Jan 15, 2022
4729918
Prettier
ZeLonewolf Jan 15, 2022
1c02a9a
Add shields for EU routes
Mashin6 Jan 15, 2022
bff2805
Add shield for Hungary
Mashin6 Jan 15, 2022
6b8022d
Add CA county routes
ZeLonewolf Jan 15, 2022
97496e5
Merge branch 'main' into openmaptilers-new-features-test
ZeLonewolf Jan 15, 2022
b44f811
Adding NJ county route networks except the insane ones
ZeLonewolf Jan 16, 2022
ab19785
Suppress text-required shields with no ref
ZeLonewolf Jan 16, 2022
ff271b2
Fix bannered route drawing for 2x scaling
ZeLonewolf Jan 16, 2022
d6d29a7
Fix bannered shield drawing at 1x scaling
ZeLonewolf Jan 16, 2022
90cd980
Fix Penna Turn Pike special case where the shield changes on blank ref
ZeLonewolf Jan 16, 2022
64dac62
Add shield for Switzerland
Mashin6 Jan 16, 2022
3156e41
Render New Mexico state shields as a basic circle
ZeLonewolf Jan 16, 2022
70d67c6
Remove unneeded NM shield
ZeLonewolf Jan 17, 2022
37988c9
Add Hawaii highway shields
ZeLonewolf Jan 17, 2022
d64c0d0
Promote our achievements in the README
ZeLonewolf Jan 17, 2022
0891041
Prettier
ZeLonewolf Jan 17, 2022
7dfa099
Add Ohio Turnpike
jleedev Jan 17, 2022
0068d9a
Add NYS Thruway
jleedev Jan 17, 2022
a1c3871
Add shield for Italy
Mashin6 Jan 18, 2022
f539942
Add shield for Slovakia
Mashin6 Jan 18, 2022
f41202a
Add shields for Czechia
Mashin6 Jan 18, 2022
94cedad
Add white stroke to US-CA shields
ZeLonewolf Jan 19, 2022
1433fc9
Fix non-retina shield selection
ZeLonewolf Jan 19, 2022
6627643
Refactor and fix null pointer exceptions
ZeLonewolf Jan 20, 2022
3331b82
Use text-letter-spacing for shield separation
ZeLonewolf Jan 20, 2022
4076aa1
Render Expressways in their own style (#82)
adamfranco Jan 20, 2022
0cb39d1
Add elliptical shield constraints
ZeLonewolf Jan 21, 2022
ce9c58f
Merge branch 'openmaptilers-new-features-test' of github.com:ZeLonewo…
ZeLonewolf Jan 21, 2022
5715648
Fix null pointer exception & improve circle shield padding
ZeLonewolf Jan 21, 2022
5c7a5a7
Fix 2/3 digit shield scaling
ZeLonewolf Jan 21, 2022
138e2cf
Washington (State) highway shield (#83)
Pengor Jan 21, 2022
5d10bde
Shrink US/I shields by 50%
ZeLonewolf Jan 21, 2022
5f1e4eb
Resized shields to 20x
ZeLonewolf Jan 21, 2022
7be3896
Fix NPE on banners
ZeLonewolf Jan 22, 2022
085ac65
Adding shield for Austria
Mashin6 Jan 23, 2022
4a9c7a0
Adding shield for Slovenia
Mashin6 Jan 23, 2022
f8445fc
refactor shield drawing to reduce scaling
zekefarwell Jan 24, 2022
50a62e9
Add shields for Croatia
Mashin6 Jan 24, 2022
0cb8923
Add new eu shields
ZeLonewolf Jan 24, 2022
2937780
padding adjustments for new shield scale
zekefarwell Jan 24, 2022
a97037b
Resize and optimize shields for 20px baseline
ZeLonewolf Jan 25, 2022
a003836
Europe shield paddings
ZeLonewolf Jan 25, 2022
2f18762
fix for no ref shields like PA turnpike and NY thruway not displaying
zekefarwell Jan 25, 2022
8a42aa7
NY & PA shield padding
zekefarwell Jan 25, 2022
2cfefa1
shield padding for GA, HI, KS, MN, OH, SC, VA, WA
zekefarwell Jan 25, 2022
d2f3cc2
fix shield banner height
zekefarwell Jan 25, 2022
92d6c5b
fix for PA belt shields not rendering
zekefarwell Jan 25, 2022
292ef59
run prettier
zekefarwell Jan 25, 2022
9ccc050
Make map object available for debugging
jleedev Jan 25, 2022
96c401e
Merge branch 'shield-whackamole' into openmaptilers-new-features-test
zekefarwell Jan 26, 2022
a0eb4f5
switch tile set from MapTiler Planet to OpenMapTiles. Resolves #87
zekefarwell Jan 26, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 1 addition & 3 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,9 @@ jobs:
node-version: 16.x
- name: Install and Build 🔧
run: |
sudo apt install -y xmlstarlet
cd style
npm install
sed 's/<your MapTiler key>/53iZvB2drcamS0Ge0xiD/g' config.default.js > config.js
make sprites js/maplibre-gl.js
make sprites
# MapTiler key 53iZvB2drcamS0Ge0xiD only allows requests from zelonewolf.github.io

- name: Deploy 🚀
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ The purpose of the Americana style is to:
- Challenge the status quo by showcasing innovation and invention
- Promote collaboration and common purpose in the American mapping community

The Americana style is the first digital map to achieve concurrent, state-specific highway shields arranged along the path of road. Representative highway shield rendering is of considerable cartographic importance to the American community. We do this proudly in an open source project using vector tile technology.

## Contributor's Guide

_Contributors welcome!_
Expand Down
3 changes: 3 additions & 0 deletions style/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
build
sprites
js/maplibre-gl.js
15 changes: 3 additions & 12 deletions style/Makefile
Original file line number Diff line number Diff line change
@@ -1,16 +1,7 @@
clean:
rm -rf sprites build icons/us_* rebusurance.zip
rm -rf build
rm -rf sprites

rebusurance.zip:
curl -s -L https://github.com/1ec5/rebusurance/releases/download/v1.0.0/rebusurance-v1.0.0.zip --output rebusurance.zip


build/rebusurance-v1.0.0: rebusurance.zip
unzip -q rebusurance.zip "*/image2d/*.svg" -d build

sprites: build/rebusurance-v1.0.0
scripts/import_rebusurance.sh
sprites: clean
mkdir -p sprites
npx spritezero sprites/sprite@2x icons/ --retina
npx spritezero sprites/sprite icons/
Expand All @@ -21,5 +12,5 @@ config.js:
code_format:
npx prettier --write .

run: sprites config.js js/maplibre-gl.js
run: sprites config.js
npx browser-sync -w --port 1776
46 changes: 42 additions & 4 deletions style/americana.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
import config from "./config.js";

import * as Util from "./js/util.js";
import * as Shield from "./js/shield.js";
import * as ShieldDef from "./js/shield_defs.js";

import * as lyrBackground from "./layer/background.js";
import * as lyrBoundary from "./layer/boundary.js";
Expand Down Expand Up @@ -37,12 +39,14 @@ americanaLayers.push(
lyrBoundary.country,

lyrRoad.motorwayTunnel.casing(),
lyrRoad.trunkExpresswayTunnel.casing(),
lyrRoad.trunkTunnel.casing(),

lyrRoad.motorwayLinkTunnel.casing(),
lyrRoad.trunkLinkTunnel.casing(),

lyrRoad.motorwayTunnel.fill(),
lyrRoad.trunkExpresswayTunnel.fill(),
lyrRoad.trunkTunnel.fill(),

lyrRoad.motorwayLinkTunnel.fill(),
Expand All @@ -52,9 +56,13 @@ americanaLayers.push(
lyrOneway.tunnelLink,

lyrRoad.motorway.casing(),
lyrRoad.trunkExpressway.casing(),
lyrRoad.trunk.casing(),
lyrRoad.primaryExpressway.casing(),
lyrRoad.primary.casing(),
lyrRoad.secondaryExpressway.casing(),
lyrRoad.secondary.casing(),
lyrRoad.tertiaryExpressway.casing(),
lyrRoad.tertiary.casing(),

lyrRoad.motorwayLink.casing(),
Expand All @@ -64,18 +72,27 @@ americanaLayers.push(
lyrRoad.trunkLink.fill(),

lyrRoad.tertiary.fill(),
lyrRoad.tertiaryExpressway.fill(),
lyrRoad.secondary.fill(),
lyrRoad.secondaryExpressway.fill(),
lyrRoad.primary.fill(),
lyrRoad.primaryExpressway.fill(),
lyrRoad.trunk.fill(),
lyrRoad.trunkExpressway.fill(),
lyrRoad.motorway.fill(),
lyrRoad.interstate.fill(),

lyrRoad.motorwayLink.surface(),
lyrRoad.trunkLink.surface(),

lyrRoad.tertiary.surface(),
lyrRoad.tertiaryExpressway.surface(),
lyrRoad.secondary.surface(),
lyrRoad.secondaryExpressway.surface(),
lyrRoad.primary.surface(),
lyrRoad.primaryExpressway.surface(),
lyrRoad.trunk.surface(),
lyrRoad.trunkExpressway.surface(),
lyrRoad.motorway.surface(),

lyrOneway.road,
Expand All @@ -84,31 +101,40 @@ americanaLayers.push(

var bridgeLayers = [
lyrRoad.tertiaryBridge.casing(),
lyrRoad.tertiaryExpresswayBridge.casing(),
lyrRoad.tertiaryLinkBridge.casing(),
lyrRoad.tertiaryBridge.fill(),
lyrRoad.tertiaryExpresswayBridge.fill(),
lyrRoad.tertiaryLinkBridge.fill(),
lyrRoad.tertiaryBridge.surface(),
lyrRoad.tertiaryLinkBridge.surface(),

lyrRoad.secondaryBridge.casing(),
lyrRoad.secondaryExpresswayBridge.casing(),
lyrRoad.secondaryLinkBridge.casing(),
lyrRoad.secondaryBridge.fill(),
lyrRoad.secondaryExpresswayBridge.fill(),
lyrRoad.secondaryLinkBridge.fill(),
lyrRoad.secondaryBridge.surface(),
lyrRoad.secondaryLinkBridge.surface(),

lyrRoad.primaryBridge.casing(),
lyrRoad.primaryExpresswayBridge.casing(),
lyrRoad.primaryLinkBridge.casing(),
lyrRoad.primaryBridge.fill(),
lyrRoad.primaryExpresswayBridge.fill(),
lyrRoad.primaryLinkBridge.fill(),
lyrRoad.primaryBridge.surface(),
lyrRoad.primaryLinkBridge.surface(),

lyrRoad.trunkBridge.casing(),
lyrRoad.trunkExpresswayBridge.casing(),
lyrRoad.trunkLinkBridge.casing(),
lyrRoad.trunkBridge.fill(),
lyrRoad.trunkLinkBridge.fill(),
lyrRoad.trunkBridge.fill(),
lyrRoad.trunkExpresswayBridge.fill(),
lyrRoad.trunkBridge.surface(),
lyrRoad.trunkExpresswayBridge.surface(),
lyrRoad.trunkLinkBridge.surface(),

lyrRoad.motorwayBridge.casing(),
Expand Down Expand Up @@ -156,7 +182,11 @@ americanaLayers.push(

lyrPark.label,

lyrHighwayShield.interstate,
lyrHighwayShield.motorway,
lyrHighwayShield.trunk,
lyrHighwayShield.primary,
lyrHighwayShield.secondary,
lyrHighwayShield.tertiary,

lyrPlace.state,
lyrPlace.city,
Expand Down Expand Up @@ -195,14 +225,22 @@ var style = {
},
};

var map = new maplibregl.Map({
var map = (window.map = new maplibregl.Map({
container: "map", // container id
hash: true,
antialias: true,
style: style,
center: [-94, 40.5], // starting position [lng, lat]
zoom: 4, // starting zoom
attributionControl: false,
}));

map.on("styledata", function () {
ShieldDef.loadShields(map.style.imageManager.images);
});

map.on("styleimagemissing", function (e) {
Shield.missingIconLoader(map, e);
});

map.addControl(
Expand All @@ -212,4 +250,4 @@ map.addControl(
})
);
map.addControl(new maplibregl.NavigationControl(), "top-left");
document.querySelector("#map canvas").focus();
map.getCanvas().focus();
2 changes: 1 addition & 1 deletion style/config.default.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Go to Account->Keys and create a key to paste here:
*/
const MAPTILER_KEY = "<your MapTiler key>";

const OPENMAPTILES_URL = `https://api.maptiler.com/tiles/v3/tiles.json?key=${MAPTILER_KEY}`;
const OPENMAPTILES_URL = `https://api.maptiler.com/tiles/v3-openmaptiles/tiles.json?key=${MAPTILER_KEY}`;

export default {
OPENMAPTILES_URL,
Expand Down
4 changes: 0 additions & 4 deletions style/icons/diamond.svg

This file was deleted.

3 changes: 3 additions & 0 deletions style/icons/shield40_eu_at_2.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions style/icons/shield40_eu_at_3.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions style/icons/shield40_eu_ch_2.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions style/icons/shield40_eu_cz_2.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions style/icons/shield40_eu_cz_prim_2.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions style/icons/shield40_eu_hu_2.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions style/icons/shield40_eu_hw_2.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions style/icons/shield40_eu_hw_3.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions style/icons/shield40_eu_it_2.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions style/icons/shield40_eu_it_3.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions style/icons/shield40_eu_it_4.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions style/icons/shield40_eu_sk_2.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions style/icons/shield40_eu_sl_2.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions style/icons/shield40_us_ca_2.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions style/icons/shield40_us_ca_3.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions style/icons/shield40_us_county.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions style/icons/shield40_us_ga_2.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions style/icons/shield40_us_ga_3.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
56 changes: 56 additions & 0 deletions style/icons/shield40_us_hi.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.