diff --git a/.github/ISSUE_TEMPLATE/other-issue.md b/.github/ISSUE_TEMPLATE/other-issue.md index b104a7ce..48c8e30d 100644 --- a/.github/ISSUE_TEMPLATE/other-issue.md +++ b/.github/ISSUE_TEMPLATE/other-issue.md @@ -8,4 +8,3 @@ assignees: '' --- - diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index fa2de5e5..16b374a5 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -8,4 +8,3 @@ - [ ] Include before/after visuals or gifs if this PR includes visual changes. - [ ] Write tests for all new functionality. - [ ] Add an entry to `CHANGELOG.md` under the `## main` section. - diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 02583f4d..95e0cac2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,8 +14,8 @@ jobs: if: ${{ github.event_name == 'push' || github.event_name == 'pull_request' }} steps: - - uses: actions/checkout@v4 - - run: docker build -t test-docker-image-build . + - uses: actions/checkout@v4 + - run: docker build -t test-docker-image-build . # build the editor build-node: @@ -27,17 +27,17 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-latest, windows-latest, macos-latest] + os: [ ubuntu-latest, windows-latest, macos-latest ] steps: - - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 - with: - node-version-file: '.nvmrc' - - run: npm ci - - run: npm run build - - run: npm run lint - - run: npm run lint-css + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version-file: '.nvmrc' + - run: npm ci + - run: npm run build + - run: npm run lint + - run: npm run lint-css @@ -47,53 +47,53 @@ jobs: if: ${{ github.event_name == 'push' || github.event_name == 'pull_request' }} steps: - - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 - with: - node-version-file: '.nvmrc' - - run: npm ci - - run: npm run build - - name: artifacts/maputnik - uses: actions/upload-artifact@v4 - with: - name: maputnik - path: dist + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version-file: '.nvmrc' + - run: npm ci + - run: npm run build + - name: artifacts/maputnik + uses: actions/upload-artifact@v4 + with: + name: maputnik + path: dist - # Build and upload desktop CLI artifacts - - name: Set up Go - uses: actions/setup-go@v5 - with: - go-version: ^1.23.x - cache-dependency-path: desktop/go.sum - id: go + # Build and upload desktop CLI artifacts + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: ^1.23.x + cache-dependency-path: desktop/go.sum + id: go - - name: Build desktop artifacts - run: npm run build-desktop + - name: Build desktop artifacts + run: npm run build-desktop - - name: Artifacts/linux - uses: actions/upload-artifact@v4 - with: - name: maputnik-linux - path: ./desktop/bin/linux/ + - name: Artifacts/linux + uses: actions/upload-artifact@v4 + with: + name: maputnik-linux + path: ./desktop/bin/linux/ - - name: Artifacts/darwin - uses: actions/upload-artifact@v4 - with: - name: maputnik-darwin - path: ./desktop/bin/darwin/ + - name: Artifacts/darwin + uses: actions/upload-artifact@v4 + with: + name: maputnik-darwin + path: ./desktop/bin/darwin/ + + - name: Artifacts/windows + uses: actions/upload-artifact@v4 + with: + name: maputnik-windows + path: ./desktop/bin/windows/ - - name: Artifacts/windows - uses: actions/upload-artifact@v4 - with: - name: maputnik-windows - path: ./desktop/bin/windows/ - e2e-tests: name: "E2E tests using ${{ matrix.browser }}" strategy: fail-fast: false matrix: - browser: [chrome] + browser: [ chrome ] runs-on: ubuntu-22.04 steps: diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 4a8b5c3c..2cb7f973 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -20,7 +20,7 @@ jobs: - name: Install run: npm ci - - name: Build + - name: Build run: npm run build - name: Upload to GitHub Pages @@ -28,7 +28,7 @@ jobs: with: github_token: ${{ secrets.GITHUB_TOKEN }} publish_dir: dist - + # publish docker to GitHub registry deploy-docker: name: deploy/docker @@ -40,12 +40,12 @@ jobs: fail-fast: false steps: - - name: Login to GitHub Container Registry - uses: docker/login-action@v3 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - uses: actions/checkout@v4 - - run: docker build -t ghcr.io/maplibre/maputnik:main . - - run: docker push ghcr.io/maplibre/maputnik:main + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - uses: actions/checkout@v4 + - run: docker build -t ghcr.io/maplibre/maputnik:main . + - run: docker push ghcr.io/maplibre/maputnik:main diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 944304e9..f41b97ca 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -2,7 +2,7 @@ name: Release on: push: - branches: [main] + branches: [ main ] workflow_dispatch: jobs: @@ -99,4 +99,3 @@ jobs: allowUpdates: true draft: false prerelease: false - diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 00000000..769dc6f2 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,24 @@ +# See https://pre-commit.com for more information +# See https://pre-commit.com/hooks.html for more hooks + +ci: + autoupdate_schedule: monthly + +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v5.0.0 + hooks: + - id: check-added-large-files + - id: check-executables-have-shebangs + - id: check-json + exclude: 'tsconfig(\.node)?\.json' + - id: check-shebang-scripts-are-executable + - id: check-symlinks + - id: check-toml + - id: check-yaml + args: [ --allow-multiple-documents ] + - id: destroyed-symlinks + - id: end-of-file-fixer + - id: mixed-line-ending + args: [ --fix=lf ] + - id: trailing-whitespace diff --git a/CHANGELOG.md b/CHANGELOG.md index a7d15402..36371d57 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -32,4 +32,3 @@ ## 1.7.0 - See release notes at https://maputnik.github.io/blog/2020/04/23/release-v1.7.0 - diff --git a/LICENSE b/LICENSE index b2c9cd8d..c14b849c 100644 --- a/LICENSE +++ b/LICENSE @@ -20,4 +20,3 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - diff --git a/README.md b/README.md index 10f9ce88..3e4e6262 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ Maputnik is written in typescript and is using [React](https://github.com/facebo We ensure building and developing Maputnik works with the [current active LTS Node.js version and above](https://github.com/nodejs/Release#release-schedule). -Check out our [Internationalization guide](./src/locales/README.md) for UI text related changes. +Check out our [Internationalization guide](./src/locales/README.md) for UI text related changes. ### Getting Involved Join the #maplibre or #maputnik slack channel at OSMUS: get an invite at https://slack.openstreetmap.us/ Read the the below guide in order to get familiar with how we do things around here. diff --git a/build/README.md b/build/README.md index 9cf562fc..ccf91361 100644 --- a/build/README.md +++ b/build/README.md @@ -1,6 +1,6 @@ # Build Scripts -This folder holds common build scripts used by some of the Github workflows. +This folder holds common build scripts used by some of the Github workflows. The scripts are borrowed from [maplibre/maplibre-gl-js](https://github.com/maplibre/maplibre-gl-js/tree/bc70bc559cea5c987fa1b79fd44766cef68bbe28/build). diff --git a/cypress/e2e/layers.cy.ts b/cypress/e2e/layers.cy.ts index e782a57e..5de3880b 100644 --- a/cypress/e2e/layers.cy.ts +++ b/cypress/e2e/layers.cy.ts @@ -497,7 +497,7 @@ describe("layers", () => { describe("layereditor jsonlint should error", ()=>{ - + it("add", () => { const id = when.modal.fillLayers({ type: "circle", @@ -515,10 +515,10 @@ describe("layers", () => { }); const sourceText = get.elementByText('"source"'); - + sourceText.click(); sourceText.type("\""); - + const error = get.element('.CodeMirror-lint-marker-error'); error.should('exist'); }); diff --git a/cypress/e2e/map.cy.ts b/cypress/e2e/map.cy.ts index 45befb8a..e200f8d2 100644 --- a/cypress/e2e/map.cy.ts +++ b/cypress/e2e/map.cy.ts @@ -23,7 +23,7 @@ describe("map", () => { ); }); }); - + describe("search", () => { it('should exist', () => { then(get.searchControl()).shouldBeVisible(); diff --git a/cypress/e2e/modals.cy.ts b/cypress/e2e/modals.cy.ts index 6ebdca41..49271238 100644 --- a/cypress/e2e/modals.cy.ts +++ b/cypress/e2e/modals.cy.ts @@ -240,14 +240,14 @@ describe("modals", () => { it("inlcude API key when change renderer", () => { - + when.click("modal:settings.close-modal") when.click("nav:open"); get.elementByAttribute('aria-label', "MapTiler Basic").should('exist').click(); when.click("nav:settings"); - + when.select("modal:settings.maputnik:renderer", "mlgljs"); then(get.inputValue("modal:settings.maputnik:renderer")).shouldEqual( "mlgljs" @@ -259,7 +259,7 @@ describe("modals", () => { ); given.intercept("https://api.maptiler.com/tiles/v3-openmaptiles/tiles.json?key=*", "tileRequest", "GET"); - + when.select("modal:settings.maputnik:renderer", "mlgljs"); then(get.inputValue("modal:settings.maputnik:renderer")).shouldEqual( "mlgljs" @@ -269,7 +269,7 @@ describe("modals", () => { when.waitForResponse("tileRequest").its("request").its("url").should("include", `https://api.maptiler.com/tiles/v3-openmaptiles/tiles.json?key=${tokens.openmaptiles}`); when.waitForResponse("tileRequest").its("request").its("url").should("include", `https://api.maptiler.com/tiles/v3-openmaptiles/tiles.json?key=${tokens.openmaptiles}`); }); - + }); describe("sources", () => { diff --git a/cypress/fixtures/example-layer-style.json b/cypress/fixtures/example-layer-style.json index 5c267e30..8a67d75b 100644 --- a/cypress/fixtures/example-layer-style.json +++ b/cypress/fixtures/example-layer-style.json @@ -15,4 +15,3 @@ } ] } - diff --git a/cypress/fixtures/geojson-raster-style.json b/cypress/fixtures/geojson-raster-style.json index a069d367..84bd8ea6 100644 --- a/cypress/fixtures/geojson-raster-style.json +++ b/cypress/fixtures/geojson-raster-style.json @@ -31,4 +31,4 @@ "glyphs": "https://example.local/fonts/{fontstack}/{range}.pbf", "sprites": "https://example.local/fonts/{fontstack}/{range}.pbf", "layers": [] - } \ No newline at end of file + } diff --git a/cypress/fixtures/geojson-style.json b/cypress/fixtures/geojson-style.json index 0eb43a43..36e482c6 100644 --- a/cypress/fixtures/geojson-style.json +++ b/cypress/fixtures/geojson-style.json @@ -26,4 +26,4 @@ "glyphs": "https://example.local/fonts/{fontstack}/{range}.pbf", "sprites": "https://example.local/fonts/{fontstack}/{range}.pbf", "layers": [] - } \ No newline at end of file + } diff --git a/cypress/fixtures/raster-style.json b/cypress/fixtures/raster-style.json index 8b4d8734..56f7b7e7 100644 --- a/cypress/fixtures/raster-style.json +++ b/cypress/fixtures/raster-style.json @@ -15,4 +15,4 @@ "glyphs": "https://example.local/fonts/{fontstack}/{range}.pbf", "sprites": "https://example.local/fonts/{fontstack}/{range}.pbf", "layers": [] - } \ No newline at end of file + } diff --git a/cypress/support/commands.ts b/cypress/support/commands.ts index 698b01a4..95857aea 100644 --- a/cypress/support/commands.ts +++ b/cypress/support/commands.ts @@ -34,4 +34,4 @@ // visit(originalFn: CommandOriginalFn, url: string, options: Partial): Chainable // } // } -// } \ No newline at end of file +// } diff --git a/src/components/Block.tsx b/src/components/Block.tsx index 63d6635f..193812e0 100644 --- a/src/components/Block.tsx +++ b/src/components/Block.tsx @@ -102,4 +102,3 @@ export default class Block extends React.Component { } } - diff --git a/src/components/Collapse.tsx b/src/components/Collapse.tsx index 945f143d..3a67d530 100644 --- a/src/components/Collapse.tsx +++ b/src/components/Collapse.tsx @@ -31,4 +31,3 @@ export default class Collapse extends React.Component { } } } - diff --git a/src/components/Collapser.tsx b/src/components/Collapser.tsx index bca8e529..9d3334cc 100644 --- a/src/components/Collapser.tsx +++ b/src/components/Collapser.tsx @@ -16,4 +16,3 @@ export default class Collapser extends React.Component { return this.props.isCollapsed ? : } } - diff --git a/src/components/FieldArray.tsx b/src/components/FieldArray.tsx index 1de04ee9..9b1475d3 100644 --- a/src/components/FieldArray.tsx +++ b/src/components/FieldArray.tsx @@ -16,4 +16,3 @@ export default class FieldArray extends React.Component { } } - diff --git a/src/components/FieldAutocomplete.tsx b/src/components/FieldAutocomplete.tsx index 133ce607..beb2e5a6 100644 --- a/src/components/FieldAutocomplete.tsx +++ b/src/components/FieldAutocomplete.tsx @@ -15,4 +15,3 @@ export default class FieldAutocomplete extends React.Component } } - diff --git a/src/components/FieldCheckbox.tsx b/src/components/FieldCheckbox.tsx index 28041ac4..50f1d25a 100644 --- a/src/components/FieldCheckbox.tsx +++ b/src/components/FieldCheckbox.tsx @@ -15,4 +15,3 @@ export default class FieldCheckbox extends React.Component { } } - diff --git a/src/components/FieldColor.tsx b/src/components/FieldColor.tsx index 37d11b1a..094cd7fb 100644 --- a/src/components/FieldColor.tsx +++ b/src/components/FieldColor.tsx @@ -18,4 +18,3 @@ export default class FieldColor extends React.Component { } } - diff --git a/src/components/FieldDynamicArray.tsx b/src/components/FieldDynamicArray.tsx index fc3666b6..efd42ba7 100644 --- a/src/components/FieldDynamicArray.tsx +++ b/src/components/FieldDynamicArray.tsx @@ -13,4 +13,3 @@ export default class FieldDynamicArray extends React.Component } } - diff --git a/src/components/FieldEnum.tsx b/src/components/FieldEnum.tsx index 25a46689..919c23d6 100644 --- a/src/components/FieldEnum.tsx +++ b/src/components/FieldEnum.tsx @@ -3,7 +3,7 @@ import InputEnum, {InputEnumProps} from './InputEnum' import Fieldset from './Fieldset'; -type FieldEnumProps = InputEnumProps & { +type FieldEnumProps = InputEnumProps & { label?: string; fieldSpec?: { doc: string @@ -17,4 +17,4 @@ export default class FieldEnum extends React.Component { } -} \ No newline at end of file +} diff --git a/src/components/FieldFunction.tsx b/src/components/FieldFunction.tsx index f7987c7d..426cdcb8 100644 --- a/src/components/FieldFunction.tsx +++ b/src/components/FieldFunction.tsx @@ -404,4 +404,3 @@ export default class FieldFunction extends React.Component } } - diff --git a/src/components/FieldJson.tsx b/src/components/FieldJson.tsx index ceb4d663..8976ce3a 100644 --- a/src/components/FieldJson.tsx +++ b/src/components/FieldJson.tsx @@ -10,4 +10,3 @@ export default class FieldJson extends React.Component { return } } - diff --git a/src/components/FieldMultiInput.tsx b/src/components/FieldMultiInput.tsx index f9a0aade..5896ce1e 100644 --- a/src/components/FieldMultiInput.tsx +++ b/src/components/FieldMultiInput.tsx @@ -15,4 +15,3 @@ export default class FieldMultiInput extends React.Component } } - diff --git a/src/components/FieldSelect.tsx b/src/components/FieldSelect.tsx index 2e0a7be6..a9863f35 100644 --- a/src/components/FieldSelect.tsx +++ b/src/components/FieldSelect.tsx @@ -18,5 +18,3 @@ export default class FieldSelect extends React.Component { } } - - diff --git a/src/components/FieldSourceLayer.tsx b/src/components/FieldSourceLayer.tsx index 1fc35d04..d17da5a3 100644 --- a/src/components/FieldSourceLayer.tsx +++ b/src/components/FieldSourceLayer.tsx @@ -22,8 +22,8 @@ class FieldSourceLayerInternal extends React.Component { ); } } - diff --git a/src/components/FilterEditor.tsx b/src/components/FilterEditor.tsx index 9cb76cb2..0b6105a8 100644 --- a/src/components/FilterEditor.tsx +++ b/src/components/FilterEditor.tsx @@ -255,8 +255,8 @@ class FilterEditorInternal extends React.Component this.onFilterPartChanged(0, v)} options={[ - ["all", t("every filter matches")], - ["none", t("no filter matches")], + ["all", t("every filter matches")], + ["none", t("no filter matches")], ["any", t("any filter matches")] ]} /> diff --git a/src/components/IconBackground.tsx b/src/components/IconBackground.tsx index b9119989..c822bba1 100644 --- a/src/components/IconBackground.tsx +++ b/src/components/IconBackground.tsx @@ -11,5 +11,3 @@ export default class IconBackground extends React.Component { ) } } - - diff --git a/src/components/IconCircle.tsx b/src/components/IconCircle.tsx index c4b7de27..cb7af8f5 100644 --- a/src/components/IconCircle.tsx +++ b/src/components/IconCircle.tsx @@ -11,5 +11,3 @@ export default class IconCircle extends React.Component { ) } } - - diff --git a/src/components/IconFill.tsx b/src/components/IconFill.tsx index 49a41947..4aee10d4 100644 --- a/src/components/IconFill.tsx +++ b/src/components/IconFill.tsx @@ -11,5 +11,3 @@ export default class IconFill extends React.Component { ) } } - - diff --git a/src/components/IconLayer.tsx b/src/components/IconLayer.tsx index 9839b3ea..ba0980dc 100644 --- a/src/components/IconLayer.tsx +++ b/src/components/IconLayer.tsx @@ -30,4 +30,3 @@ export default class IconLayer extends React.Component { } } } - diff --git a/src/components/IconLine.tsx b/src/components/IconLine.tsx index 6f2ffb7e..62d1fd8c 100644 --- a/src/components/IconLine.tsx +++ b/src/components/IconLine.tsx @@ -11,5 +11,3 @@ export default class IconLine extends React.Component { ) } } - - diff --git a/src/components/IconSymbol.tsx b/src/components/IconSymbol.tsx index 72d082ae..8bc3add6 100644 --- a/src/components/IconSymbol.tsx +++ b/src/components/IconSymbol.tsx @@ -13,6 +13,3 @@ export default class IconSymbol extends React.Component { ) } } - - - diff --git a/src/components/InputArray.tsx b/src/components/InputArray.tsx index b0e940cd..182191c3 100644 --- a/src/components/InputArray.tsx +++ b/src/components/InputArray.tsx @@ -115,4 +115,3 @@ export default class FieldArray extends React.Component } } - - diff --git a/src/components/InputButton.tsx b/src/components/InputButton.tsx index bd8aaaa1..6c66f651 100644 --- a/src/components/InputButton.tsx +++ b/src/components/InputButton.tsx @@ -30,4 +30,4 @@ export default class InputButton extends React.Component { {this.props.children} } -} \ No newline at end of file +} diff --git a/src/components/InputCheckbox.tsx b/src/components/InputCheckbox.tsx index f425f4ac..9483ed87 100644 --- a/src/components/InputCheckbox.tsx +++ b/src/components/InputCheckbox.tsx @@ -34,4 +34,4 @@ export default class InputCheckbox extends React.Component { } -} \ No newline at end of file +} diff --git a/src/components/InputColor.tsx b/src/components/InputColor.tsx index 5b5ffa87..d40284d5 100644 --- a/src/components/InputColor.tsx +++ b/src/components/InputColor.tsx @@ -133,4 +133,3 @@ export default class InputColor extends React.Component { } } - diff --git a/src/components/InputDynamicArray.tsx b/src/components/InputDynamicArray.tsx index 43d3b5df..52a364f9 100644 --- a/src/components/InputDynamicArray.tsx +++ b/src/components/InputDynamicArray.tsx @@ -22,7 +22,7 @@ export type FieldDynamicArrayProps = { } 'aria-label'?: string label: string -} +} type FieldDynamicArrayInternalProps = FieldDynamicArrayProps & WithTranslation; @@ -67,7 +67,7 @@ class FieldDynamicArrayInternal extends React.Component { - const deleteValueBtn= ; @@ -152,4 +152,3 @@ class DeleteValueInputButton extends React.Component } } - diff --git a/src/components/InputEnum.tsx b/src/components/InputEnum.tsx index a8f40d3f..fbb3a329 100644 --- a/src/components/InputEnum.tsx +++ b/src/components/InputEnum.tsx @@ -47,4 +47,3 @@ export default class InputEnum extends React.Component { } } } - diff --git a/src/components/InputMultiInput.tsx b/src/components/InputMultiInput.tsx index 64529c48..bd518d1d 100644 --- a/src/components/InputMultiInput.tsx +++ b/src/components/InputMultiInput.tsx @@ -37,5 +37,3 @@ export default class InputMultiInput extends React.Component } } - - diff --git a/src/components/InputNumber.tsx b/src/components/InputNumber.tsx index a70fc90b..19067aa7 100644 --- a/src/components/InputNumber.tsx +++ b/src/components/InputNumber.tsx @@ -157,7 +157,7 @@ export default class InputNumber extends React.Component { } } - - diff --git a/src/components/InputString.tsx b/src/components/InputString.tsx index bf0f9591..1fa91f49 100644 --- a/src/components/InputString.tsx +++ b/src/components/InputString.tsx @@ -97,5 +97,3 @@ export default class InputString extends React.Component - diff --git a/src/components/LayerList.tsx b/src/components/LayerList.tsx index 9495cae7..3b58d463 100644 --- a/src/components/LayerList.tsx +++ b/src/components/LayerList.tsx @@ -287,9 +287,9 @@ class LayerListContainerInternal extends React.Component - {this.state.areAllGroupsExpanded === true ? - t("Collapse") - : + {this.state.areAllGroupsExpanded === true ? + t("Collapse") + : t("Expand") } diff --git a/src/components/MapMaplibreGl.tsx b/src/components/MapMaplibreGl.tsx index 31e08b9e..93d0cfdd 100644 --- a/src/components/MapMaplibreGl.tsx +++ b/src/components/MapMaplibreGl.tsx @@ -134,7 +134,7 @@ class MapMaplibreGlInternal extends React.Component { underlayClickExits={false} underlayProps={{ // @ts-ignore - onClick: (e: Event) => underlayProps(e) + onClick: (e: Event) => underlayProps(e) }} title={this.props.title} onOpenToggle={() => this.props.onCancel()} diff --git a/src/components/PropertyGroup.tsx b/src/components/PropertyGroup.tsx index 70651c75..efe1c09a 100644 --- a/src/components/PropertyGroup.tsx +++ b/src/components/PropertyGroup.tsx @@ -56,8 +56,8 @@ export default class PropertyGroup extends React.Component { const paint = this.props.layer.paint || {} const layout = this.props.layer.layout || {} - const fieldValue = fieldName in paint - ? paint[fieldName as keyof typeof paint] + const fieldValue = fieldName in paint + ? paint[fieldName as keyof typeof paint] : layout[fieldName as keyof typeof layout] const fieldType = fieldName in paint ? 'paint' : 'layout'; diff --git a/src/components/ScrollContainer.tsx b/src/components/ScrollContainer.tsx index cbff77a9..a48560f0 100644 --- a/src/components/ScrollContainer.tsx +++ b/src/components/ScrollContainer.tsx @@ -11,4 +11,3 @@ export default class ScrollContainer extends React.Component } } - diff --git a/src/components/SingleFilterEditor.tsx b/src/components/SingleFilterEditor.tsx index 1de9ddbc..c2f56159 100644 --- a/src/components/SingleFilterEditor.tsx +++ b/src/components/SingleFilterEditor.tsx @@ -90,4 +90,3 @@ export default class SingleFilterEditor extends React.Component } } - diff --git a/src/components/SpecField.tsx b/src/components/SpecField.tsx index 195842c3..e14b0f3d 100644 --- a/src/components/SpecField.tsx +++ b/src/components/SpecField.tsx @@ -44,4 +44,3 @@ export default class SpecField extends React.Component { } } - diff --git a/src/components/_ExpressionProperty.tsx b/src/components/_ExpressionProperty.tsx index a2760feb..605759c9 100644 --- a/src/components/_ExpressionProperty.tsx +++ b/src/components/_ExpressionProperty.tsx @@ -91,7 +91,7 @@ class ExpressionPropertyInternal extends React.Component { const functionBtn = const error = errors![fieldType+"."+fieldName as any] as any; diff --git a/src/libs/codemirror-mgl.ts b/src/libs/codemirror-mgl.ts index dcff7e43..f078e39b 100644 --- a/src/libs/codemirror-mgl.ts +++ b/src/libs/codemirror-mgl.ts @@ -31,7 +31,7 @@ function tryToParse(text: string) { last_line: parseInt(errorMatch[1], 10), last_column: parseInt(errorMatch[2], 10) }; - + // const loc = hash.loc; found.push({ from: CodeMirror.Pos(loc.first_line - 1, loc.first_column), @@ -49,7 +49,7 @@ CodeMirror.registerHelper("lint", "json", (text: string) => { }); CodeMirror.registerHelper("lint", "mgl", (text: string, opts: any, doc: any) => { - + const found: MarkerRangeWithMessage[] = tryToParse(text); const {context} = opts; diff --git a/src/libs/diffmessage.ts b/src/libs/diffmessage.ts index b4fe9077..b2dcdce2 100644 --- a/src/libs/diffmessage.ts +++ b/src/libs/diffmessage.ts @@ -11,4 +11,4 @@ export function undoMessages(beforeStyle: StyleSpecification, afterStyle: StyleS } export function redoMessages(beforeStyle: StyleSpecification, afterStyle: StyleSpecification) { return diffMessages(beforeStyle, afterStyle).map(m => 'Redo ' + m) -} \ No newline at end of file +} diff --git a/src/libs/source.ts b/src/libs/source.ts index 80487902..838465e5 100644 --- a/src/libs/source.ts +++ b/src/libs/source.ts @@ -24,4 +24,3 @@ export function changeSource(mapStyle: StyleSpecification, sourceId: string, sou sources: changedSources } } - diff --git a/src/libs/zoomcontrol.ts b/src/libs/zoomcontrol.ts index 31619984..94c7795e 100644 --- a/src/libs/zoomcontrol.ts +++ b/src/libs/zoomcontrol.ts @@ -14,10 +14,10 @@ export default class ZoomControl { this._container.setAttribute("data-wd-key", "maplibre:ctrl-zoom"); this.setLabel("Zoom:"); this.addEventListeners(); - + return this._container; } - + updateZoomLevel() { this._textEl!.innerHTML = this._map!.getZoom().toFixed(2); } @@ -29,7 +29,7 @@ export default class ZoomControl { this._textEl = this._container!.querySelector("span"); this.updateZoomLevel(); } - + addEventListeners (){ this._map!.on('render', () => this.updateZoomLevel()); this._map!.on('zoomIn', () => this.updateZoomLevel()); diff --git a/src/locales/README.md b/src/locales/README.md index 088a0708..4188a973 100644 --- a/src/locales/README.md +++ b/src/locales/README.md @@ -46,16 +46,14 @@ The following users can help you with the relevant languages: | ISO Code | Language | User | |----------|--------------------|--------------------------------------------| -| de | German | [@josxha](https://github.com/josxha) | -| en | English | [@HarelM](https://github.com/HarelM) | -| fr | French | [@lhapaipai](https://github.com/lhapaipai) | -| hr | Hebrew | [@HarelM](https://github.com/HarelM) | +| de | German | [@josxha](https://github.com/josxha) | +| en | English | [@HarelM](https://github.com/HarelM) | +| fr | French | [@lhapaipai](https://github.com/lhapaipai) | +| hr | Hebrew | [@HarelM](https://github.com/HarelM) | | it | Italian | [@napo](https://github.com/napo) | -| ja | Japanese | [@keichan34](https://github.com/keichan34) | -| zh | Simplified Chinese | [@jieme](https://github.com/jieme) | +| ja | Japanese | [@keichan34](https://github.com/keichan34) | +| zh | Simplified Chinese | [@jieme](https://github.com/jieme) | You can test the UI in different languages using the dropdown in the top menu Note that Maputnik automatically localize based on browser language settings and stores this language in local storage. You can use incognito mode to check a first time usage. - - diff --git a/src/maplibregl.css b/src/maplibregl.css index 782d7ece..91c4562a 100644 --- a/src/maplibregl.css +++ b/src/maplibregl.css @@ -88,4 +88,3 @@ .maplibregl-ctrl-map { background-image: url('data:image/svg+xml;charset=utf8,