Skip to content

Commit

Permalink
Merge branch 'main' into clay-oneway
Browse files Browse the repository at this point in the history
  • Loading branch information
claysmalley committed Jun 18, 2023
2 parents a0190df + dfb544b commit 97510c2
Show file tree
Hide file tree
Showing 19 changed files with 215 additions and 860 deletions.
2 changes: 0 additions & 2 deletions .cargo/config.toml

This file was deleted.

58 changes: 58 additions & 0 deletions .github/workflows/deploy-preview.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Deploy PR Preview
on:
pull_request:
branches: [main]
types:
- opened
- reopened
- synchronize
permissions:
contents: read
pages: write
pull-requests: write
id-token: write
concurrency: preview-${{ github.ref }}
jobs:
deploy-preview:
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@v3
- name: Use Node.js 18.x
uses: actions/setup-node@v3
with:
node-version: 18.x
- name: Install and Build 🔧
run: |
npm ci --include=dev
npm run build
npm run style
npm run shields
cp src/configs/config.aws.js src/config.js
- name: Deploy via S3
uses: jakejarvis/s3-sync-action@master
with:
args: --acl public-read --follow-symlinks --delete --exclude '.git/*' --exclude '.github/*'
env:
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: ${{ secrets.AWS_REGION }}
SOURCE_DIR: "./dist"
DEST_DIR: pr/${{ github.event.pull_request.number }}
- name: Comment Pull Request
uses: thollander/[email protected]
with:
message: |
PR Preview:
* [Map](https://preview.ourmap.us/pr/${{ github.event.pull_request.number }}/)
* [Shield Test](https://preview.ourmap.us/pr/${{ github.event.pull_request.number }}/shieldtest.html)
* [style.json](https://preview.ourmap.us/pr/${{ github.event.pull_request.number }}/style.json)
* [shields.json](https://preview.ourmap.us/pr/${{ github.event.pull_request.number }}/shields.json)
* [taginfo.json](https://preview.ourmap.us/pr/${{ github.event.pull_request.number }}/taginfo.json)
Sprite Sheets:
![Sprites 1x](https://preview.ourmap.us/pr/${{ github.event.pull_request.number }}/sprites/sprite.png)
![Sprites 2x](https://preview.ourmap.us/pr/${{ github.event.pull_request.number }}/sprites/[email protected])
comment_tag: pr_preview
8 changes: 3 additions & 5 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ permissions:
contents: read
pages: write
id-token: write
concurrency: preview-${{ github.ref }}
jobs:
# TODO remove old PRs from s3 bucket automatically
build-and-deploy:
runs-on: ubuntu-latest
environment:
Expand All @@ -22,17 +24,13 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: 18.x
- name: Build Shield Library 🛡️
run: |
cd shieldlib
npm ci --include=dev
npm run build
- name: Install and Build 🔧
run: |
npm ci --include=dev
cp src/configs/config.aws.js src/config.js
npm run build
npm run style
npm run shields
- name: Upload 🏗
uses: actions/upload-pages-artifact@v1
with:
Expand Down
8 changes: 8 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,10 @@ server which is beyond the scope of this guide.
[20]: https://cloud.maptiler.com/maps/
[21]: https://openmaptiles.org/schema/

### Running your own tile server

For production usages, consider running your own tile server. Thanks to advances in technology, it is possible to run an OpenMapTiles tile server for a modest cost. See the diary entry [Host an OpenMapTiles Vector Tile Server on AWS for $19.75/month](https://www.openstreetmap.org/user/ZeLonewolf/diary/401697) for more details.

## Running the Americana style

### In development...
Expand Down Expand Up @@ -380,3 +384,7 @@ For consistency, POI icons use the following color palette:
| Airport | Medium Purple C | <img src="doc-img/pantone_medium_purple_c.svg" height=18 width=50 /> Purple | 78 0 142 | #4e008e |
| Transport | Pantone 234 C | <img src="doc-img/pantone_234_c.svg" height=18 width=50 /> Mauve | 162 0 103 | #a20067 |
| Knockout | | <img src="doc-img/background.svg" height=18 width=50 /> Lt Grayish Orange | 249 245 240 | #f9f5f0 |

## Fonts

Fonts for style labels are packaged and defined in [fontstack66](https://github.com/osm-americana/fontstack66), Americana's font package.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,7 @@ Americana displays custom route shields for routes in all U.S. states and territ
<img src="doc-img/shield_map_world.svg" width="500" alt="Countries">

We are hoping that it will support more countries; you can [help us](https://github.com/ZeLonewolf/openstreetmap-americana/projects/1)!

## Tile Server

Although the source code in this repository is dedicated to the public domain under a CC0 waiver, it is configured by default to load map tiles from a privately-donated community [tile server](https://tile.ourmap.us). This server is available for use by other hobbyist and community projects with constraints. See the [tile server usage policy](TILE_USAGE.md) for more details. This usage policy describes the allowable usage of the tiles for other projects, separate from this style or the application being developed in this repository.
41 changes: 41 additions & 0 deletions TILE_USAGE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Tile Usage Policy

Tile Usage Policy for OpenStreetMap Americana Community Vector Tile Server

**Effective Date: June 12, 2023**

Thank you for using the OpenStreetMap Americana [Community Vector Tile Server](https://tile.ourmap.us) (referred to as "the Server"). By accessing and using the tiles provided by the Server, you agree to comply with the following Tile Usage Policy:

1. Purpose:
The Server aims to support hobbyists, small community groups, and individuals who require vector tiles for their projects or development of custom map styles. The Server is a community resource provided at no cost, but limitations may apply based on server capacity and financial constraints.

2. Attribution:
When using tiles from the Server, you must provide proper attribution to [OpenStreetMap](https://wiki.osmfoundation.org/wiki/Licence/Attribution_Guidelines#OpenStreetMap_Attribution_Guideline) and [OpenMapTiles](https://github.com/openmaptiles/openmaptiles/blob/master/LICENSE.md) as required by their respective attribution policies.

3. Personal and Non-Commercial Use:
The Server is primarily intended for personal, non-commercial use. You are welcome to use the tiles for personal or community projects, educational purposes, or non-profit initiatives that do not generate revenue. There are several [guides](https://www.openstreetmap.org/user/ZeLonewolf/diary/401697) available for commercial users that desire to run a vector tile server at low cost. Note that this policy only applies to the tile server usage. Anyone is free to use the OSM Americana on their own tile server, even for a commercial endeavor.

4. Domain Whitelisting:
Tile usage from localhost and \*.github.io is permitted, which are common ways that most developers will access the tile server when starting a new project. If you wish to use the tiles under your own domain name, please contact the Americana team on [Slack](https://osmus.slack.com/archives/C01V02K52UX) (preferred) or [GitHub](https://github.com/ZeLonewolf/openstreetmap-americana) and provide your domain name(s) in order to add your domain to the CORS (Cross-Origin Resource Sharing) white list. This will allow you to fetch tiles directly from your domain. This whitelist is subject to the discretion and may be modified or removed at any time, however, permission is routinely given for community and hobby projects.

5. Usage Limits:
To ensure fair usage and prevent abuse, the Server may enforce limits on tile requests for individual users or domains. If your usage exceeds reasonable levels or begins to strain the server's resources, the administrator reserves the right to restrict or terminate access to the Server. Users whose usage becomes excessive may be requested to set up their own tile server.

6. Financial Considerations:
The Server is operated on a limited budget and funded out of pocket by the administrator. While it strives to be freely accessible, financial constraints may necessitate restrictions on usage. If the costs associated with providing tiles become prohibitive, the administrator may need to limit or suspend service temporarily or permanently. Users who can afford to host their own tile server are encouraged to do so.

7. No Guarantees:
The Server is provided on an "as-is" basis, and no guarantees or warranties are offered regarding its availability, performance, or accuracy of the tiles. The administrator will make reasonable efforts to maintain the service, but interruptions or downtime may occur due to various factors beyond their control.

8. Modifications and Termination:
The administrator reserves the right to modify or terminate the Server or this Tile Usage Policy at any time without prior notice. The administrator may also modify or update the CORS white list as needed.

9. Compliance with OpenStreetMap Guidelines:
All users of the Server are expected to comply with the OpenStreetMap licensing terms, guidelines, and community norms. Additionally, the OpenStreetMap Americana project has adopted the OpenStreetMap US Code of Conduct, which applies where applicable. Any violation of these terms may result in the immediate termination of access to the Server.

10. Feedback and Support:
The administrator appreciates feedback, bug reports, and suggestions to improve the Server via [Slack](https://osmus.slack.com/archives/C01V02K52UX) or [GitHub]. However, support resources may be limited. Users are encouraged to seek assistance from the OpenStreetMap community or other relevant forums for additional support.

By using the tiles provided by the OpenStreetMap Americana Community Vector Tile Server, you acknowledge and agree to the terms outlined in this Tile Usage Policy. Failure to comply with these terms may result in the revocation of access to the Server.

Please note that this Tile Usage Policy is subject to change at any time and for any reason.
7 changes: 2 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"scripts": {
"build:shieldlib": "cd shieldlib && node scripts/build.js",
"build:code": "exec ts-node scripts/build",
"build": "run-s clean-build sprites fonts build:shieldlib build:code taginfo status_map",
"build": "run-s clean-build sprites build:shieldlib build:code taginfo status_map",
"clean": "run-s clean:shieldlib clean:code clean-download clean-build",
"clean-download": "shx rm -rf download",
"clean-build": "shx rm -rf dist build",
Expand All @@ -23,14 +23,11 @@
"code_format": "run-s code_format:prettier code_format:svgo",
"code_format:prettier": "prettier --write --list-different .",
"code_format:svgo": "svgo -q -f icons/",
"fonts:install_glyph_builder": "cargo install [email protected]",
"fonts:build": "node scripts/fonts",
"fonts": "run-s fonts:install_glyph_builder fonts:build",
"presprites": "shx rm -rf dist/sprites",
"serve": "ts-node scripts/serve",
"shields": "node scripts/generate_shield_defs.js -o dist/shields.json",
"sprites": "node scripts/sprites.js",
"start": "run-s clean-build build:shieldlib sprites fonts shields serve",
"start": "run-s clean-build build:shieldlib sprites shields serve",
"stats": "node scripts/stats.js",
"style": "node scripts/generate_style.js -o dist/style.json",
"status_map": "node scripts/status_map.js",
Expand Down
8 changes: 0 additions & 8 deletions scripts/FONTS.md

This file was deleted.

10 changes: 1 addition & 9 deletions scripts/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,4 @@ export const build = (
buildOptions: BuildOptions = {}
): Promise<BuildContext[]> => buildWith("build", buildOptions);

const mainModule = pathToFileURL(process.argv[1]).toString();
const isMain = import.meta.url === mainModule;

if (isMain) {
await build({
// defaults to undefined, but force it to get optimized out
define: { "window.LIVE_RELOAD": "false" },
});
}
await build();
168 changes: 0 additions & 168 deletions scripts/fonts.js

This file was deleted.

Loading

0 comments on commit 97510c2

Please sign in to comment.