Skip to content

Commit 96d23f2

Browse files
committed
docs: update README
- Updates "How to install". The command will install `v0.2.0` which will be tagged later. - Explicitly tells `mapbox-gl` v2 and v3 are supported. - Appends a new section "Development". - Includes other minor changes. issue #3
1 parent da80b83 commit 96d23f2

File tree

2 files changed

+49
-9
lines changed

2 files changed

+49
-9
lines changed

README.md

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@ A utility library for [Mapbox GL JS (`mapbox-gl`)](https://docs.mapbox.com/mapbo
88

99
### Prerequisites
1010

11-
This library is supposed to work with `mapbox-gl` version 2 or higher.
11+
This library is intended to work with `mapbox-gl` version 2.x and 3.x.
1212

1313
### How to install
1414

1515
Please add this repository to your dependencies.
1616

1717
```sh
18-
npm install https://github.com/codemonger-io/mapbox-collision-boxes#v0.1.0
18+
npm install https://github.com/codemonger-io/mapbox-collision-boxes#v0.2.0
1919
```
2020

2121
### Usage
@@ -64,8 +64,28 @@ Please refer to [`api-docs/markdown/index.md`](./api-docs/markdown/index.md).
6464
### Viewport padding
6565

6666
Collision boxes collected by [`collectCollisionBoxesAndFeatures`](./api-docs/markdown/mapbox-collision-boxes.collectcollisionboxesandfeatures.md) include constant offsets.
67-
They have the actual screen position + `100`\* along both the x- and y-axes.
67+
They have the actual screen position + `100`[^1] along both the x- and y-axes.
6868
Since the offsets do not matter to hit tests among collision boxes, this library leaves them to avoid unnecessary calculation.
6969
If you want to project collision boxes to the actual screen, you have to subtract `100` from their x- and y-axis values.
7070

71-
\* This constant is defined as `viewportPadding` at https://github.com/mapbox/mapbox-gl-js/blob/e29e113ff5e1f4c073f84b8cbe546006d2fb604f/src/symbol/collision_index.js#L50 which is not exported from `mapbox-gl`.
71+
[^1]: This constant is defined as `viewportPadding` at https://github.com/mapbox/mapbox-gl-js/blob/e29e113ff5e1f4c073f84b8cbe546006d2fb604f/src/symbol/collision_index.js#L50 which is not exported from `mapbox-gl`.
72+
73+
## Development
74+
75+
### Resoving dependencies
76+
77+
```sh
78+
npm ci
79+
```
80+
81+
### Type-checking
82+
83+
```sh
84+
npm run type-check
85+
```
86+
87+
### Building the library
88+
89+
```sh
90+
npm run build
91+
```

README_ja.md

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@ Mapboxマップ上の衝突ボックスを画面座標系で計算する、[Mapb
88

99
### 事前準備
1010

11-
このライブラリは`mapbox-gl`バージョン2以降と一緒に使用する想定です
11+
このライブラリは`mapbox-gl`バージョン2.xおよび3.xと一緒に使用する想定です
1212

1313
### インストール方法
1414

1515
このレポジトリを依存関係に追加してください。
1616

1717
```sh
18-
npm install https://github.com/codemonger-io/mapbox-collision-boxes#v0.1.0
18+
npm install https://github.com/codemonger-io/mapbox-collision-boxes#v0.2.0
1919
```
2020

2121
### 使い方
@@ -53,7 +53,7 @@ const map.on('click', layerId, async event => {
5353

5454
ということで**Mapboxマップ上で特定のシンボルと重なるシンボルを集めることのできるライブラリを開発**することにしました。
5555

56-
より詳しくは[私のブログ投稿](https://codemonger.io/blog/0009-mapbox-collision-boxes/)をご覧ください。
56+
より詳しくは[私のブログ投稿](https://codemonger.io/ja/blog/0009-mapbox-collision-boxes/)をご覧ください。
5757

5858
## APIドキュメント
5959

@@ -64,8 +64,28 @@ const map.on('click', layerId, async event => {
6464
### ビューポートオフセット
6565

6666
[`collectCollisionBoxesAndFeatures`](./api-docs/markdown/mapbox-collision-boxes.collectcollisionboxesandfeatures.md)が集める衝突ボックスは固定のオフセットを含んでいます。
67-
xとyの両軸について実際の画面位置 + `100`\*になっています。
67+
xとyの両軸について実際の画面位置 + `100`[^1]になっています。
6868
オフセットは衝突ボックス同士の衝突判定には影響しないため、このライブラリでは不必要な計算を避けるためにそのままにしてあります。
6969
衝突ボックスを実際の画面に投影したい場合は、xとy軸の値から`100`を引かなければなりません。
7070

71-
\* この定数は`viewportPadding`として https://github.com/mapbox/mapbox-gl-js/blob/e29e113ff5e1f4c073f84b8cbe546006d2fb604f/src/symbol/collision_index.js#L50 に定義されていますが、`mapbox-gl`はエクスポートしていません。
71+
[^1]: この定数は`viewportPadding`として https://github.com/mapbox/mapbox-gl-js/blob/e29e113ff5e1f4c073f84b8cbe546006d2fb604f/src/symbol/collision_index.js#L50 に定義されていますが、`mapbox-gl`はエクスポートしていません。
72+
73+
## 開発
74+
75+
### 依存関係の解決
76+
77+
```sh
78+
npm ci
79+
```
80+
81+
### タイプチェック
82+
83+
```sh
84+
npm run type-check
85+
```
86+
87+
### ライブラリをビルドする
88+
89+
```sh
90+
npm run build
91+
```

0 commit comments

Comments
 (0)