Skip to content

Commit

Permalink
styles package v2 initial commit. (#132)
Browse files Browse the repository at this point in the history
* styles package v2 initial commit.

* 5 new styles light, dark, data light, data grayscale, data dark replace old styles.
* all style code uses TypeScript
* add tests for validation and formatting of themes
* licensing details related to styles
* include git sha in app build nabber
  • Loading branch information
bdon committed Sep 20, 2023
1 parent cbbce88 commit 972035e
Show file tree
Hide file tree
Showing 10 changed files with 2,074 additions and 855 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/app.yml
Expand Up @@ -20,9 +20,9 @@ jobs:
node-version: 18.x
- run: echo "VITE_GIT_SHA=$(git rev-parse --short HEAD)" >> app/.env
- name: Check styles
run: npm install && npx tsc
run: npm install && npx tsc --noEmit
working-directory: styles
- run: npm install && npx tsc && npx vite build
- run: npm install && npx tsc --noEmit && npx vite build
working-directory: app
- uses: peaceiris/actions-gh-pages@v3
if: ${{ github.ref == 'refs/heads/main' }}
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/maven.yml
Expand Up @@ -28,4 +28,7 @@ jobs:
- name: Ensure code formatted with mvn spotless:apply
working-directory: tiles
run: mvn spotless:check
- name: Check styles
run: npm install && npx tsc --noEmit && npm test
working-directory: styles
- run: python .github/check_examples.py
14 changes: 12 additions & 2 deletions LICENSE.md
@@ -1,3 +1,5 @@
# Code Licenses and Attribution

# The BSD 3-Clause License (BSD-3-Clause)

Copyright 2019-2023 Protomaps
Expand All @@ -12,8 +14,16 @@ Redistribution and use in source and binary forms, with or without modification,

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

---
Parts of schema adapted from:
# Visual Design

The visual design of the Protomaps styles was created by Geraldine Sarmiento for Protomaps LLC and released under a Creative Commons 0 (CC0) license.




# Tile Schema

The organization of layers and tags is adapted from the Tilezen project.

https://github.com/tilezen/vector-datasource
https://github.com/tilezen/vector-datasource/blob/master/docs/LICENSE-SCHEMA.md
Expand Down
5 changes: 4 additions & 1 deletion app/src/MapViewComponent.tsx
Expand Up @@ -13,6 +13,8 @@ import { PMTilesVectorSource } from "ol-pmtiles";
import { useGeographic } from "ol/proj";
import { stylefunction } from "ol-mapbox-style";

const GIT_SHA = (import.meta.env.VITE_GIT_SHA || "main").substr(0, 8);

// maplibre GL JS has a bug related to style diffing.
let cachebuster = 0;

Expand Down Expand Up @@ -217,7 +219,8 @@ export default function MapViewComponent() {
<button onClick={() => setShowStyleJson(!showStyleJson)}>
get style JSON
</button>
<a href="/visualtests/">visual tests</a>
<a href="/visualtests/">visual tests</a>|
<a target="_blank" href="https://github.com/protomaps/basemaps">{GIT_SHA}</a>
</nav>
<div className="split" onKeyPress={handleKeyPress}>
{renderer == "maplibregl" ? (
Expand Down

0 comments on commit 972035e

Please sign in to comment.