Skip to content

Commit

Permalink
v1.2.0 (#65)
Browse files Browse the repository at this point in the history
* setup full typescript support

* primary language exists on construction

* first review cleanup

* second review cleanup

* UP gitignore

* UP gitignore

* UP typedoc and config

* UP the prepare npm script is no longer copying demos to doc

* FIX inheritance pattern of some Controls due to ML update

* FIX Marker now requires an option object

* WIP polyline layer helper

* REM log

* ADD adding a poliline layer

* mock the gpx/kml parser

* mock the gpx/kml parser

* gpx and kml converters; better prettier support; upgrade packages; vite testing

* adjust package lock

* cleanup part 1

* cleanup part 2

* comment link error

* FIX throwing when the string is not valid XML

* FIX gpx/kml now throwing if content was xml but not of gpx/kml kind

* ADD a function to convert from either gpx or kml

* ADD integrate KML/GPX parser to addPolyline method

* DOC added more comment

* FIX DOMParser issues due to different behviors in Node (testing) and Browser

* ADD demos to use map.addPolyline

* ADD addPolyline examples

* ENH better examples

* ENH linting

* Update src/Map.ts

Co-authored-by: Craig O'Connor <[email protected]>

* REM unnecessary @param and @return

* REM some unnecessary '?' to option objects

* ADD polyline blur and gap width options

* ADD dash pattern interpreter into actual dash array

* Update src/converters/xml.ts

Co-authored-by: Craig O'Connor <[email protected]>

* Update src/Map.ts

Co-authored-by: Craig O'Connor <[email protected]>

* ENH code readability

* Update src/converters/xml.ts

Co-authored-by: Craig O'Connor <[email protected]>

* Update src/tools.ts

Co-authored-by: Craig O'Connor <[email protected]>

* ENH now supporting all the languages supported by OMT

* REM geojson-validation

* FIX example

* Support for Customize language (#58)

* ADD visitor language

* WIP language logic revamp

* ADD language from style metadata

* ENH language definition

* REM got rid of commented code

* ENH adjusted the size of secondary lang with visitor language mode

* Update src/Map.ts

Co-authored-by: Craig O'Connor <[email protected]>

* Update src/Map.ts

Co-authored-by: Craig O'Connor <[email protected]>

* ENH from review

* ENH added things from review

---------

Co-authored-by: Craig O'Connor <[email protected]>

* Add polygon helper (#56)

* ADD visitor language

* ADD helper for addong polygon from geojson

* ADD map.addPolygon

* REM some data

* Update src/Map.ts

Co-authored-by: Craig O'Connor <[email protected]>

* ENH unused import

* Update src/Map.ts

Co-authored-by: Craig O'Connor <[email protected]>

* Update src/Map.ts

Co-authored-by: Craig O'Connor <[email protected]>

* ENH from review

---------

Co-authored-by: Craig O'Connor <[email protected]>

* Add minimap control (#54)

* first attempt

* reduce typescript warnings

* reduce typescript warnings

* add final todo

* zoom ceiling; bounds bug fix; pitch off by default; unique style; simplify; etc.

* fix key

* simplify typescript

* review part 1; cleaner types; better comments

* remove zoomCeiling; its essentially minZoom

* improve readability of minimap options input

* bug fix; adjustments

* add style downwind functions; requested changes

* slight adjustment

* set lang fix

* improve types

---------

Co-authored-by: Craig O'Connor <[email protected]>

* Dev points (#59)

* WIP point layer helper

* WIP better clusters

* WIP changed point helper options

* ADD color ramps with builtins

* WIP simpler set of options

* ADD non linear resampling on color ramps

* ADD color ramp doc

* ADD outline color for points

* ADD point outline settings

* REM colorRamp arg and use only pointColor instead

* DONE Map.addPoint

* Dev points (#61)

* WIP point layer helper

* WIP better clusters

* WIP changed point helper options

* ADD color ramps with builtins

* WIP simpler set of options

* ADD non linear resampling on color ramps

* ADD color ramp doc

* ADD outline color for points

* ADD point outline settings

* REM colorRamp arg and use only pointColor instead

* DONE Map.addPoint

* ADD radius and weight being both zoom and property driven

* ADD zoom comensation param to point helper

* FIX minmaxzoom and added MapTiler cloud source with uuid

* DOC polyline helper section in readme

* WIP readme

* DOC done with documenting helpers

* DOC color ramp doc

* DOC fix

* DOC

* ENH cleaning unused types

* ENH updating eslint

* FIX dependecy audit

* ENH export types and a better style path

* ENH refectoring to place the helpers in a dedicated place

* FIX typo

* TS moduleResolution is now "Bundler" (#62)

* WIP point layer helper

* WIP better clusters

* WIP changed point helper options

* ADD color ramps with builtins

* WIP simpler set of options

* ADD non linear resampling on color ramps

* ADD color ramp doc

* ADD outline color for points

* ADD point outline settings

* REM colorRamp arg and use only pointColor instead

* DONE Map.addPoint

* ADD radius and weight being both zoom and property driven

* ADD zoom comensation param to point helper

* FIX minmaxzoom and added MapTiler cloud source with uuid

* DOC polyline helper section in readme

* WIP readme

* DOC done with documenting helpers

* DOC color ramp doc

* DOC fix

* DOC

* ENH cleaning unused types

* ENH updating eslint

* FIX dependecy audit

* ENH export types and a better style path

* ENH refectoring to place the helpers in a dedicated place

* ENH changed TypeScript moduleResolution from Node to Bundler

* Update to Maplibre gl v3.5.2 (#63)

* WIP point layer helper

* WIP better clusters

* WIP changed point helper options

* ADD color ramps with builtins

* WIP simpler set of options

* ADD non linear resampling on color ramps

* ADD color ramp doc

* ADD outline color for points

* ADD point outline settings

* REM colorRamp arg and use only pointColor instead

* DONE Map.addPoint

* ADD radius and weight being both zoom and property driven

* ADD zoom comensation param to point helper

* FIX minmaxzoom and added MapTiler cloud source with uuid

* DOC polyline helper section in readme

* WIP readme

* DOC done with documenting helpers

* DOC color ramp doc

* DOC fix

* DOC

* ENH cleaning unused types

* ENH updating eslint

* FIX dependecy audit

* ENH export types and a better style path

* ENH refectoring to place the helpers in a dedicated place

* ENH changed TypeScript moduleResolution from Node to Bundler

* UP now using Maplibre v3.5.2 (strict)

* VER v1.2.0

* ADD gh action for formatting and linting during PR

* ENH better linting and formatting rules

---------

Co-authored-by: Craig O'Connor <[email protected]>
Co-authored-by: Craig O'Connor <[email protected]>
  • Loading branch information
3 people authored Nov 1, 2023
1 parent 2c7e345 commit 87568d2
Show file tree
Hide file tree
Showing 7 changed files with 138 additions and 56 deletions.
1 change: 0 additions & 1 deletion .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ module.exports = {
rules: {
"@typescript-eslint/ban-ts-comment": "warn",
"prettier/prettier": "error",
"@typescript-eslint/no-explicit-any": "warn"
},
ignorePatterns: tsConfig.exclude,
};
11 changes: 11 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
## Objective
What is the goal?

## Description
What changed, how and why?

## Acceptance
How were changes tested?

## Checklist
- [ ] I have added relevant info to the CHANGELOG.md
24 changes: 24 additions & 0 deletions .github/workflows/format-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Format and Lint

on: [pull_request]

jobs:
format-and-lint:
runs-on: ubuntu-latest
steps:
- name: Check out Git repository
uses: actions/checkout@v3

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 18

- name: Install Node.js dependencies
run: npm ci

- name: Formatting with Prettier
run: npm run format

- name: Linting with ESLint
run: npm run lint
145 changes: 94 additions & 51 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,37 +1,77 @@
# Changelog

## [v1.1.1](https://github.com/maptiler/maptiler-sdk-js/releases/tag/v1.1.1)
- VER update to `[email protected]`

## [v1.1.0](https://github.com/maptiler/maptiler-sdk-js/releases/tag/v1.1.0)
- VER updated from `[email protected]` to `[email protected]` (this includes the switch to WebGL2)
- UP made the few necessary changes acording to updating the ML v3. No braking change for SDK API
- FIX the MapTiler logo rel name and its nofollow feature
- ADD bringing back Map's `options.transformRequest` and `.setTransformRequest()`


## [v1.0.12](https://github.com/maptiler/maptiler-sdk-js/releases/tag/v1.0.12)
- ADD a new language flag `Language.STYLE_LOCK` to force keep the language form the style and prevent any further update. Can be at a sigle map instance level (via constuctor option `language`) or via global config (`config.primaryLanguage`)
- FIX the fallback language was `{name:latin}`, it is now replaced by `{name}`, which is for the local name (present by default for many places while `latin` is less frequent).

## [v1.0.11](https://github.com/maptiler/maptiler-sdk-js/releases/tag/v1.0.11)
- DOC update for `Map`'s `option.maptilerLogo` that was a bit unclear
- FIX now exporting `MaptilerNavigationControl`

## [v1.0.10](https://github.com/maptiler/maptiler-sdk-js/releases/tag/v1.0.10)
- ADD terrain growing animation on enabling/disabling
- ADD `Map` custom event `loadWithTerrain`
- ADD `Map` lifecycle methods `.onLoadAsync()` and `.onLoadWithTerrainAsync()`
- DOC readme section was added about the event an methods above
- VER updated from `[email protected]` to `[email protected]`
- VER updated from `[email protected]` to `[email protected]`, which changes slightly the look of the reference documentation.
- VER updated from `[email protected]` to `[email protected]`
- VER updated from `[email protected]` to `[email protected]` as well as all the Rollup plugins

## [v1.0.9](https://github.com/maptiler/maptiler-sdk-js/releases/tag/v1.0.9)
- FIX: if the geolocate option is missing from `Map` constructor, then it's considered `false`

- FIX: The instance types for the following MapLibre classes are now fully exported:
# MapTiler SDK Changelog

## DEVEL
### New Features
### Bug Fixes
### Others

## 1.2.0
### New Features
- Added the Minimap control https://github.com/maptiler/maptiler-sdk-js/pull/54
- Added vector layer helpers to create easier:
- point layer (https://github.com/maptiler/maptiler-sdk-js/pull/61)
- heatmap layer (https://github.com/maptiler/maptiler-sdk-js/pull/61)
- polyline layer, including parsing from GPX/KML (https://github.com/maptiler/maptiler-sdk-js/pull/51)
- polygon layer (https://github.com/maptiler/maptiler-sdk-js/pull/56)
- Add the `ColorRamp` class to create and customize color ramps, as well as `ColorRampCollection` with many predefined ones (as part of https://github.com/maptiler/maptiler-sdk-js/pull/61)
- Improved the language management for increased compatibility with [MapTiler Customize](https://cloud.maptiler.com/maps/editor/) (https://github.com/maptiler/maptiler-sdk-js/pull/58)
### Bug Fixes
- Fixed type export (https://github.com/maptiler/maptiler-sdk-js/pull/47)
### Others
- Upgrade to MapLibre v3.5.2 (https://github.com/maptiler/maptiler-sdk-js/pull/63)
- Update of TypeScript configuration `moduleResolution` to `Bundler` (https://github.com/maptiler/maptiler-sdk-js/pull/62)

## 1.1.2
### Bug Fixes
- Now using a fixed version of MapLibre GL. No longer use `^` because this caused issues as MapLibre made minor/patch update that were not backward compatible

## 1.1.1
### Others
- Update to `[email protected]`

## 1.1.0
### New Features
- Bringing back Map's `options.transformRequest` and `.setTransformRequest()`
### Bug Fixes
- Fixed the MapTiler logo rel name and its nofollow feature
- Made the few necessary changes acording to updating the ML v3. No braking change for SDK API
### Others
- Updated from `[email protected]` to `[email protected]` (this includes the switch to WebGL2)


## 1.0.12
### New Features
- Added a new language flag `Language.STYLE_LOCK` to force keep the language form the style and prevent any further update. Can be at a sigle map instance level (via constuctor option `language`) or via global config (`config.primaryLanguage`)
### Bug Fixes
- The fallback language was `{name:latin}`, it is now replaced by `{name}`, which is for the local name (present by default for many places while `latin` is less frequent).

## 1.0.11
### Bug Fixes
- Now exporting `MaptilerNavigationControl`
### Others
- Documentation update for `Map`'s `option.maptilerLogo` that was a bit unclear

## 1.0.10
### New Features
- Terrain growing animation on enabling/disabling
- Added `Map` custom event `loadWithTerrain`
- Added `Map` lifecycle methods `.onLoadAsync()` and `.onLoadWithTerrainAsync()`
### Others
- Readme section was added about the event an methods above
- Updated from `[email protected]` to `[email protected]`
- Updated from `[email protected]` to `[email protected]`, which changes slightly the look of the reference documentation.
- Updated from `[email protected]` to `[email protected]`
- Updated from `[email protected]` to `[email protected]` as well as all the Rollup plugins

## 1.0.9
### New Features
- Added new styles:
- `MapStyle.STREETS.NIGHT`
- `MapStyle.WINTER.DARK`
- `MapStyle.OUTDOOR.DARK`
### Bug Fixes
- If the geolocate option is missing from `Map` constructor, then it's considered `false`
- The instance types for the following MapLibre classes are now fully exported:
- `NavigationControl`
- `GeolocateControl`
- `AttributionControl`
Expand All @@ -55,8 +95,7 @@
- `VectorTileSource`
- `VideoSource`
- `MapMLGL`

- FIX: The following class have been extended to provide greater compatibility with SDK,s MapL
- The following class have been extended to provide greater compatibility with SDK,s MapL
- `Popup`
- `Marker`
- `Style`
Expand All @@ -75,40 +114,44 @@
- `FullscreenControl`
- `TerrainControl`

- ADD: new styles:
- `MapStyle.STREETS.NIGHT`
- `MapStyle.WINTER.DARK`
- `MapStyle.OUTDOOR.DARK`

## [v1.0.8](https://github.com/maptiler/maptiler-sdk-js/releases/tag/v1.0.8)
- FIX: Since v1.0.7, the `Map` primary language (when custom) was no longer persistant on style update.
## 1.0.8
### Bug Fixes
- Since v1.0.7, the `Map` primary language (when custom) was no longer persistant on style update.

## [v1.0.7](https://github.com/maptiler/maptiler-sdk-js/releases/tag/v1.0.7)
## 1.0.7
### New Features
- The `apiKey` can now be specified in the `Map` constructor (will propagate to `config`)
- The `language` can now be speficifed in the `Map` constructo (will **not** propagete to `config` and will apply only to this specific instance)
- `Map` now has the method `.getSdkConfig()` to retrieve the config object.
- `Map` now has the method `.getMaptilerSessionId()` to retrieve the MapTiler session ID

Both `.getSdkConfig()` and `.getMaptilerSessionId()` are handy for layers or control built outside of the SDK that still need some of the configuration to interact with the server. Those components do not always have access to the internal of the SDK (especially that the config is scoped) but can access to the `Map` instance to which they are added with the implementation of the `.onAdd()` method.

## [v1.0.6](https://github.com/maptiler/maptiler-sdk-js/releases/tag/v1.0.6)
## 1.0.6
### New Features
- Now exposing `MaptilerGeolocateControl` for external initialization if needed
- Now exposing `MaptilerTerrain` for external initialization if needed

## [v1.0.5](https://github.com/maptiler/maptiler-sdk-js/releases/tag/v1.0.5)
## 1.0.5
### New Features
- Terrain elevation is now using MapTiler's `terrain-rgb-v2`

## [v1.0.4](https://github.com/maptiler/maptiler-sdk-js/releases/tag/v1.0.4)
## 1.0.4
### Others
- Improved the geolocate control behavior by not zooming out

## [v1.0.3](https://github.com/maptiler/maptiler-sdk-js/releases/tag/v1.0.3)
## 1.0.3
### Bug Fixes
- Fixed the usage of relative path style JSON (in `Map` constructor and `.setStyle()`)

## [v1.0.2](https://github.com/maptiler/maptiler-sdk-js/releases/tag/v1.0.2)
## 1.0.2
### Bug Fixes
- Fixed the dependency scheme of MapLibre import.

## [v1.0.1](https://github.com/maptiler/maptiler-sdk-js/releases/tag/v1.0.1)
## 1.0.1
### Others
- Reducing the NPM size by ignoring documentation images

## [v1.0.0](https://github.com/maptiler/maptiler-sdk-js/releases/tag/v1.0.0)
## 1.0.0
### Others
- First public version!
10 changes: 6 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@maptiler/sdk",
"version": "1.1.2",
"version": "1.2.0",
"description": "The Javascript & TypeScript map SDK tailored for MapTiler Cloud",
"module": "dist/maptiler-sdk.mjs",
"types": "dist/maptiler-sdk.d.ts",
Expand Down Expand Up @@ -36,10 +36,12 @@
"scripts": {
"build": "rm -rf dist/* && NODE_ENV=production rollup -c",
"dev": "rm -rf dist/* && NODE_ENV=development rollup -c -w",
"format": "prettier --write \"src/**/*.{js,ts,tsx}\"",
"lint": "eslint --fix \"src/**/*.{js,ts}\"",
"format:fix": "prettier --write \"src/**/*.{js,ts,tsx}\"",
"format": "prettier -c \"src/**/*.{js,ts,tsx}\"",
"lint:fix": "eslint --fix \"src/**/*.{js,ts}\"",
"lint": "eslint \"src/**/*.{js,ts}\"",
"doc": "rm -rf docs/* && typedoc --out docs && cp -r images docs/",
"prepare": "npm run format && npm run lint && npm run build && npm run test",
"prepare": "npm run format:fix && npm run lint:fix && npm run build && npm run test",
"test:dev": "vitest dev",
"test": "vitest run"
},
Expand Down
2 changes: 2 additions & 0 deletions src/Map.ts
Original file line number Diff line number Diff line change
Expand Up @@ -747,6 +747,7 @@ export class Map extends maplibregl.Map {
setPaintProperty(
layerId: string,
name: string,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
value: any,
options?: StyleSetterOptions,
): this {
Expand All @@ -770,6 +771,7 @@ export class Map extends maplibregl.Map {
setLayoutProperty(
layerId: string,
name: string,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
value: any,
options?: StyleSetterOptions,
): this {
Expand Down
1 change: 1 addition & 0 deletions src/tools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export function enableRTL() {

// This comes from:
// https://github.com/maplibre/maplibre-gl-js/blob/v2.4.0/src/util/util.ts#L223
// eslint-disable-next-line @typescript-eslint/no-explicit-any
export function bindAll(fns: Array<string>, context: any): void {
fns.forEach((fn) => {
if (typeof context[fn] !== "function") return;
Expand Down

0 comments on commit 87568d2

Please sign in to comment.