@maptiler/sdk 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintignore +1 -0
- package/.eslintrc.cjs +10 -0
- package/.github/workflows/npm-publish.yml +23 -0
- package/LICENSE +29 -0
- package/demos/maptiler-sdk.css +147 -0
- package/demos/maptiler-sdk.umd.js +3287 -0
- package/demos/simple.html +63 -0
- package/dist/maptiler-sdk.css +147 -0
- package/dist/maptiler-sdk.d.ts +531 -0
- package/dist/maptiler-sdk.min.mjs +1 -0
- package/dist/maptiler-sdk.mjs +1128 -0
- package/dist/maptiler-sdk.mjs.map +1 -0
- package/dist/maptiler-sdk.umd.js +3287 -0
- package/dist/maptiler-sdk.umd.js.map +1 -0
- package/dist/maptiler-sdk.umd.min.js +579 -0
- package/docs/.nojekyll +1 -0
- package/docs/assets/custom.css +118 -0
- package/docs/assets/highlight.css +134 -0
- package/docs/assets/main.js +54 -0
- package/docs/assets/search.js +1 -0
- package/docs/assets/style.css +1257 -0
- package/docs/classes/Map.html +273 -0
- package/docs/classes/Point.html +549 -0
- package/docs/classes/SdkConfig.html +188 -0
- package/docs/demos/maptiler-sdk.css +147 -0
- package/docs/demos/maptiler-sdk.umd.js +3287 -0
- package/docs/demos/simple.html +63 -0
- package/docs/functions/addProtocol.html +146 -0
- package/docs/functions/clearPrewarmedResources.html +92 -0
- package/docs/functions/clearStorage.html +124 -0
- package/docs/functions/getRTLTextPluginStatus.html +92 -0
- package/docs/functions/prewarm.html +92 -0
- package/docs/functions/removeProtocol.html +106 -0
- package/docs/functions/setRTLTextPlugin.html +112 -0
- package/docs/functions/supported.html +97 -0
- package/docs/images/JS-logo.svg +4 -0
- package/docs/images/TS-logo.svg +6 -0
- package/docs/images/maptiler-logo.svg +19 -0
- package/docs/images/maptiler-sdk-logo.afdesign +0 -0
- package/docs/images/maptiler-sdk-logo.svg +66 -0
- package/docs/images/screenshots/alps.gif +0 -0
- package/docs/images/screenshots/grandcanyon.gif +0 -0
- package/docs/images/screenshots/lang-arabic.png +0 -0
- package/docs/images/screenshots/lang-hebrew.png +0 -0
- package/docs/images/screenshots/multilang.gif +0 -0
- package/docs/images/screenshots/static-bounded-europe-1024.png +0 -0
- package/docs/images/screenshots/static-bounded-europe-2048.png +0 -0
- package/docs/images/screenshots/static-bounded-portugal-1024x2048.png +0 -0
- package/docs/images/screenshots/static-bounded-portugal-2048x2048.png +0 -0
- package/docs/images/screenshots/static-with-path.png +0 -0
- package/docs/images/screenshots/style-basic-v2.png +0 -0
- package/docs/images/screenshots/style-bright.png +0 -0
- package/docs/images/screenshots/style-dataviz-dark.png +0 -0
- package/docs/images/screenshots/style-hybrid.png +0 -0
- package/docs/images/screenshots/style-osm.png +0 -0
- package/docs/images/screenshots/style-outdoor.png +0 -0
- package/docs/images/screenshots/style-pastel.png +0 -0
- package/docs/images/screenshots/style-satellite.png +0 -0
- package/docs/images/screenshots/style-streets-v2-dark.png +0 -0
- package/docs/images/screenshots/style-streets-v2-light.png +0 -0
- package/docs/images/screenshots/style-streets-v2.png +0 -0
- package/docs/images/screenshots/style-toner.png +0 -0
- package/docs/images/screenshots/style-topo.png +0 -0
- package/docs/images/screenshots/style-topographique.png +0 -0
- package/docs/images/screenshots/style-voyager.png +0 -0
- package/docs/images/screenshots/style-winter.png +0 -0
- package/docs/index.html +601 -0
- package/docs/modules.html +142 -0
- package/docs/types/LanguageKey.html +90 -0
- package/docs/types/LanguageString.html +90 -0
- package/docs/types/MapOptions.html +90 -0
- package/docs/types/Matrix2.html +90 -0
- package/docs/types/Unit.html +88 -0
- package/docs/variables/AJAXError.html +88 -0
- package/docs/variables/AttributionControl.html +88 -0
- package/docs/variables/CanvasSource.html +88 -0
- package/docs/variables/Evented.html +88 -0
- package/docs/variables/FullscreenControl.html +88 -0
- package/docs/variables/GeoJSONSource.html +88 -0
- package/docs/variables/GeolocateControl.html +88 -0
- package/docs/variables/GeolocationType.html +95 -0
- package/docs/variables/ImageSource.html +88 -0
- package/docs/variables/Language.html +249 -0
- package/docs/variables/LngLat.html +88 -0
- package/docs/variables/LngLatBounds.html +88 -0
- package/docs/variables/LogoControl.html +88 -0
- package/docs/variables/Marker.html +88 -0
- package/docs/variables/MercatorCoordinate.html +88 -0
- package/docs/variables/NavigationControl.html +88 -0
- package/docs/variables/Popup.html +88 -0
- package/docs/variables/RasterDEMTileSource.html +88 -0
- package/docs/variables/RasterTileSource.html +88 -0
- package/docs/variables/ScaleControl.html +88 -0
- package/docs/variables/Style.html +88 -0
- package/docs/variables/TerrainControl.html +88 -0
- package/docs/variables/VectorTileSource.html +88 -0
- package/docs/variables/VideoSource.html +88 -0
- package/docs/variables/config.html +88 -0
- package/docs/variables/maxParallelImageRequests.html +88 -0
- package/docs/variables/version.html +88 -0
- package/docs/variables/workerCount.html +88 -0
- package/docs/variables/workerUrl.html +88 -0
- package/docsmd/.nojekyll +1 -0
- package/docsmd/README.md +710 -0
- package/docsmd/assets/custom.css +118 -0
- package/docsmd/classes/Map.md +292 -0
- package/docsmd/classes/Point.md +603 -0
- package/docsmd/classes/SdkConfig.md +186 -0
- package/docsmd/images/JS-logo.svg +4 -0
- package/docsmd/images/TS-logo.svg +6 -0
- package/docsmd/images/maptiler-logo.svg +19 -0
- package/docsmd/images/maptiler-sdk-logo.afdesign +0 -0
- package/docsmd/images/maptiler-sdk-logo.svg +66 -0
- package/docsmd/images/screenshots/alps.gif +0 -0
- package/docsmd/images/screenshots/grandcanyon.gif +0 -0
- package/docsmd/images/screenshots/lang-arabic.png +0 -0
- package/docsmd/images/screenshots/lang-hebrew.png +0 -0
- package/docsmd/images/screenshots/multilang.gif +0 -0
- package/docsmd/images/screenshots/static-bounded-europe-1024.png +0 -0
- package/docsmd/images/screenshots/static-bounded-europe-2048.png +0 -0
- package/docsmd/images/screenshots/static-bounded-portugal-1024x2048.png +0 -0
- package/docsmd/images/screenshots/static-bounded-portugal-2048x2048.png +0 -0
- package/docsmd/images/screenshots/static-with-path.png +0 -0
- package/docsmd/images/screenshots/style-basic-v2.png +0 -0
- package/docsmd/images/screenshots/style-bright.png +0 -0
- package/docsmd/images/screenshots/style-dataviz-dark.png +0 -0
- package/docsmd/images/screenshots/style-hybrid.png +0 -0
- package/docsmd/images/screenshots/style-osm.png +0 -0
- package/docsmd/images/screenshots/style-outdoor.png +0 -0
- package/docsmd/images/screenshots/style-pastel.png +0 -0
- package/docsmd/images/screenshots/style-satellite.png +0 -0
- package/docsmd/images/screenshots/style-streets-v2-dark.png +0 -0
- package/docsmd/images/screenshots/style-streets-v2-light.png +0 -0
- package/docsmd/images/screenshots/style-streets-v2.png +0 -0
- package/docsmd/images/screenshots/style-toner.png +0 -0
- package/docsmd/images/screenshots/style-topo.png +0 -0
- package/docsmd/images/screenshots/style-topographique.png +0 -0
- package/docsmd/images/screenshots/style-voyager.png +0 -0
- package/docsmd/images/screenshots/style-winter.png +0 -0
- package/images/JS-logo.svg +4 -0
- package/images/TS-logo.svg +6 -0
- package/images/maptiler-logo.svg +19 -0
- package/images/maptiler-sdk-logo.afdesign +0 -0
- package/images/maptiler-sdk-logo.svg +66 -0
- package/images/screenshots/alps.gif +0 -0
- package/images/screenshots/grandcanyon.gif +0 -0
- package/images/screenshots/lang-arabic.png +0 -0
- package/images/screenshots/lang-hebrew.png +0 -0
- package/images/screenshots/multilang.gif +0 -0
- package/images/screenshots/static-bounded-europe-1024.png +0 -0
- package/images/screenshots/static-bounded-europe-2048.png +0 -0
- package/images/screenshots/static-bounded-portugal-1024x2048.png +0 -0
- package/images/screenshots/static-bounded-portugal-2048x2048.png +0 -0
- package/images/screenshots/static-with-path.png +0 -0
- package/images/screenshots/style-basic-v2.png +0 -0
- package/images/screenshots/style-bright.png +0 -0
- package/images/screenshots/style-dataviz-dark.png +0 -0
- package/images/screenshots/style-hybrid.png +0 -0
- package/images/screenshots/style-osm.png +0 -0
- package/images/screenshots/style-outdoor.png +0 -0
- package/images/screenshots/style-pastel.png +0 -0
- package/images/screenshots/style-satellite.png +0 -0
- package/images/screenshots/style-streets-v2-dark.png +0 -0
- package/images/screenshots/style-streets-v2-light.png +0 -0
- package/images/screenshots/style-streets-v2.png +0 -0
- package/images/screenshots/style-toner.png +0 -0
- package/images/screenshots/style-topo.png +0 -0
- package/images/screenshots/style-topographique.png +0 -0
- package/images/screenshots/style-voyager.png +0 -0
- package/images/screenshots/style-winter.png +0 -0
- package/package.json +71 -0
- package/readme.md +609 -0
- package/rollup.config.js +161 -0
- package/scripts/replace-path-with-content.js +51 -0
- package/src/CustomGeolocateControl.ts +193 -0
- package/src/CustomLogoControl.ts +59 -0
- package/src/Map.ts +897 -0
- package/src/MaptilerNavigationControl.ts +66 -0
- package/src/Point.ts +336 -0
- package/src/TerrainControl.ts +87 -0
- package/src/config.ts +92 -0
- package/src/defaults.ts +20 -0
- package/src/index.ts +171 -0
- package/src/language.ts +139 -0
- package/src/mapstyle.ts +38 -0
- package/src/style/style_template.css +146 -0
- package/src/style/svg/v6-compass.svg +12 -0
- package/src/style/svg/v6-fullscreen-off.svg +7 -0
- package/src/style/svg/v6-fullscreen.svg +7 -0
- package/src/style/svg/v6-geolocate-active-error.svg +10 -0
- package/src/style/svg/v6-geolocate-active.svg +7 -0
- package/src/style/svg/v6-geolocate-background.svg +8 -0
- package/src/style/svg/v6-geolocate-disabled.svg +10 -0
- package/src/style/svg/v6-geolocate.svg +7 -0
- package/src/style/svg/v6-terrain-on.svg +7 -0
- package/src/style/svg/v6-terrain.svg +7 -0
- package/src/style/svg/v6-zoom-minus.svg +7 -0
- package/src/style/svg/v6-zoom-plus.svg +7 -0
- package/src/tools.ts +45 -0
- package/src/unit.ts +1 -0
- package/tsconfig.json +11 -0
- package/typedoc.css +118 -0
- package/typedoc.json +13 -0
|
@@ -0,0 +1,603 @@
|
|
|
1
|
+
[MapTiler SDK - v1.0.0](../README.md) / Point
|
|
2
|
+
|
|
3
|
+
# Class: Point
|
|
4
|
+
|
|
5
|
+
a point
|
|
6
|
+
|
|
7
|
+
**`Param`**
|
|
8
|
+
|
|
9
|
+
**`Param`**
|
|
10
|
+
|
|
11
|
+
## Table of contents
|
|
12
|
+
|
|
13
|
+
### Constructors
|
|
14
|
+
|
|
15
|
+
- [constructor](Point.md#constructor)
|
|
16
|
+
|
|
17
|
+
### Properties
|
|
18
|
+
|
|
19
|
+
- [x](Point.md#x)
|
|
20
|
+
- [y](Point.md#y)
|
|
21
|
+
|
|
22
|
+
### Methods
|
|
23
|
+
|
|
24
|
+
- [add](Point.md#add)
|
|
25
|
+
- [angle](Point.md#angle)
|
|
26
|
+
- [angleTo](Point.md#angleto)
|
|
27
|
+
- [angleWith](Point.md#anglewith)
|
|
28
|
+
- [angleWithSep](Point.md#anglewithsep)
|
|
29
|
+
- [clone](Point.md#clone)
|
|
30
|
+
- [dist](Point.md#dist)
|
|
31
|
+
- [distSqr](Point.md#distsqr)
|
|
32
|
+
- [div](Point.md#div)
|
|
33
|
+
- [divByPoint](Point.md#divbypoint)
|
|
34
|
+
- [equals](Point.md#equals)
|
|
35
|
+
- [mag](Point.md#mag)
|
|
36
|
+
- [matMult](Point.md#matmult)
|
|
37
|
+
- [mult](Point.md#mult)
|
|
38
|
+
- [multByPoint](Point.md#multbypoint)
|
|
39
|
+
- [perp](Point.md#perp)
|
|
40
|
+
- [rotate](Point.md#rotate)
|
|
41
|
+
- [rotateAround](Point.md#rotatearound)
|
|
42
|
+
- [round](Point.md#round)
|
|
43
|
+
- [sub](Point.md#sub)
|
|
44
|
+
- [unit](Point.md#unit)
|
|
45
|
+
- [convert](Point.md#convert)
|
|
46
|
+
|
|
47
|
+
## Constructors
|
|
48
|
+
|
|
49
|
+
### constructor
|
|
50
|
+
|
|
51
|
+
• **new Point**(`x`, `y`)
|
|
52
|
+
|
|
53
|
+
#### Parameters
|
|
54
|
+
|
|
55
|
+
| Name | Type |
|
|
56
|
+
| :------ | :------ |
|
|
57
|
+
| `x` | `number` |
|
|
58
|
+
| `y` | `number` |
|
|
59
|
+
|
|
60
|
+
#### Defined in
|
|
61
|
+
|
|
62
|
+
[src/Point.ts:20](https://github.com/maptiler/maptiler-sdk-js/blob/638970c/src/Point.ts#L20)
|
|
63
|
+
|
|
64
|
+
## Properties
|
|
65
|
+
|
|
66
|
+
### x
|
|
67
|
+
|
|
68
|
+
• **x**: `number`
|
|
69
|
+
|
|
70
|
+
#### Defined in
|
|
71
|
+
|
|
72
|
+
[src/Point.ts:17](https://github.com/maptiler/maptiler-sdk-js/blob/638970c/src/Point.ts#L17)
|
|
73
|
+
|
|
74
|
+
___
|
|
75
|
+
|
|
76
|
+
### y
|
|
77
|
+
|
|
78
|
+
• **y**: `number`
|
|
79
|
+
|
|
80
|
+
#### Defined in
|
|
81
|
+
|
|
82
|
+
[src/Point.ts:18](https://github.com/maptiler/maptiler-sdk-js/blob/638970c/src/Point.ts#L18)
|
|
83
|
+
|
|
84
|
+
## Methods
|
|
85
|
+
|
|
86
|
+
### add
|
|
87
|
+
|
|
88
|
+
▸ **add**(`p`): [`Point`](Point.md)
|
|
89
|
+
|
|
90
|
+
Add this point's x & y coordinates to another point,
|
|
91
|
+
yielding a new point.
|
|
92
|
+
|
|
93
|
+
#### Parameters
|
|
94
|
+
|
|
95
|
+
| Name | Type | Description |
|
|
96
|
+
| :------ | :------ | :------ |
|
|
97
|
+
| `p` | [`Point`](Point.md) | the other point |
|
|
98
|
+
|
|
99
|
+
#### Returns
|
|
100
|
+
|
|
101
|
+
[`Point`](Point.md)
|
|
102
|
+
|
|
103
|
+
output point
|
|
104
|
+
|
|
105
|
+
#### Defined in
|
|
106
|
+
|
|
107
|
+
[src/Point.ts:122](https://github.com/maptiler/maptiler-sdk-js/blob/638970c/src/Point.ts#L122)
|
|
108
|
+
|
|
109
|
+
___
|
|
110
|
+
|
|
111
|
+
### angle
|
|
112
|
+
|
|
113
|
+
▸ **angle**(): `number`
|
|
114
|
+
|
|
115
|
+
Get the angle from the 0, 0 coordinate to this point, in radians
|
|
116
|
+
coordinates.
|
|
117
|
+
|
|
118
|
+
#### Returns
|
|
119
|
+
|
|
120
|
+
`number`
|
|
121
|
+
|
|
122
|
+
angle
|
|
123
|
+
|
|
124
|
+
#### Defined in
|
|
125
|
+
|
|
126
|
+
[src/Point.ts:283](https://github.com/maptiler/maptiler-sdk-js/blob/638970c/src/Point.ts#L283)
|
|
127
|
+
|
|
128
|
+
___
|
|
129
|
+
|
|
130
|
+
### angleTo
|
|
131
|
+
|
|
132
|
+
▸ **angleTo**(`b`): `number`
|
|
133
|
+
|
|
134
|
+
Get the angle from this point to another point, in radians
|
|
135
|
+
|
|
136
|
+
#### Parameters
|
|
137
|
+
|
|
138
|
+
| Name | Type | Description |
|
|
139
|
+
| :------ | :------ | :------ |
|
|
140
|
+
| `b` | [`Point`](Point.md) | the other point |
|
|
141
|
+
|
|
142
|
+
#### Returns
|
|
143
|
+
|
|
144
|
+
`number`
|
|
145
|
+
|
|
146
|
+
angle
|
|
147
|
+
|
|
148
|
+
#### Defined in
|
|
149
|
+
|
|
150
|
+
[src/Point.ts:292](https://github.com/maptiler/maptiler-sdk-js/blob/638970c/src/Point.ts#L292)
|
|
151
|
+
|
|
152
|
+
___
|
|
153
|
+
|
|
154
|
+
### angleWith
|
|
155
|
+
|
|
156
|
+
▸ **angleWith**(`b`): `number`
|
|
157
|
+
|
|
158
|
+
Get the angle between this point and another point, in radians
|
|
159
|
+
|
|
160
|
+
#### Parameters
|
|
161
|
+
|
|
162
|
+
| Name | Type | Description |
|
|
163
|
+
| :------ | :------ | :------ |
|
|
164
|
+
| `b` | [`Point`](Point.md) | the other point |
|
|
165
|
+
|
|
166
|
+
#### Returns
|
|
167
|
+
|
|
168
|
+
`number`
|
|
169
|
+
|
|
170
|
+
angle
|
|
171
|
+
|
|
172
|
+
#### Defined in
|
|
173
|
+
|
|
174
|
+
[src/Point.ts:301](https://github.com/maptiler/maptiler-sdk-js/blob/638970c/src/Point.ts#L301)
|
|
175
|
+
|
|
176
|
+
___
|
|
177
|
+
|
|
178
|
+
### angleWithSep
|
|
179
|
+
|
|
180
|
+
▸ **angleWithSep**(`x`, `y`): `number`
|
|
181
|
+
|
|
182
|
+
#### Parameters
|
|
183
|
+
|
|
184
|
+
| Name | Type |
|
|
185
|
+
| :------ | :------ |
|
|
186
|
+
| `x` | `number` |
|
|
187
|
+
| `y` | `number` |
|
|
188
|
+
|
|
189
|
+
#### Returns
|
|
190
|
+
|
|
191
|
+
`number`
|
|
192
|
+
|
|
193
|
+
#### Defined in
|
|
194
|
+
|
|
195
|
+
[src/Point.ts:312](https://github.com/maptiler/maptiler-sdk-js/blob/638970c/src/Point.ts#L312)
|
|
196
|
+
|
|
197
|
+
___
|
|
198
|
+
|
|
199
|
+
### clone
|
|
200
|
+
|
|
201
|
+
▸ **clone**(): [`Point`](Point.md)
|
|
202
|
+
|
|
203
|
+
Clone this point, returning a new point that can be modified
|
|
204
|
+
without affecting the old one.
|
|
205
|
+
|
|
206
|
+
#### Returns
|
|
207
|
+
|
|
208
|
+
[`Point`](Point.md)
|
|
209
|
+
|
|
210
|
+
the clone
|
|
211
|
+
|
|
212
|
+
#### Defined in
|
|
213
|
+
|
|
214
|
+
[src/Point.ts:112](https://github.com/maptiler/maptiler-sdk-js/blob/638970c/src/Point.ts#L112)
|
|
215
|
+
|
|
216
|
+
___
|
|
217
|
+
|
|
218
|
+
### dist
|
|
219
|
+
|
|
220
|
+
▸ **dist**(`p`): `number`
|
|
221
|
+
|
|
222
|
+
Calculate the distance from this point to another point
|
|
223
|
+
|
|
224
|
+
#### Parameters
|
|
225
|
+
|
|
226
|
+
| Name | Type | Description |
|
|
227
|
+
| :------ | :------ | :------ |
|
|
228
|
+
| `p` | `any` | the other point |
|
|
229
|
+
|
|
230
|
+
#### Returns
|
|
231
|
+
|
|
232
|
+
`number`
|
|
233
|
+
|
|
234
|
+
distance
|
|
235
|
+
|
|
236
|
+
#### Defined in
|
|
237
|
+
|
|
238
|
+
[src/Point.ts:261](https://github.com/maptiler/maptiler-sdk-js/blob/638970c/src/Point.ts#L261)
|
|
239
|
+
|
|
240
|
+
___
|
|
241
|
+
|
|
242
|
+
### distSqr
|
|
243
|
+
|
|
244
|
+
▸ **distSqr**(`p`): `number`
|
|
245
|
+
|
|
246
|
+
Calculate the distance from this point to another point,
|
|
247
|
+
without the square root step. Useful if you're comparing
|
|
248
|
+
relative distances.
|
|
249
|
+
|
|
250
|
+
#### Parameters
|
|
251
|
+
|
|
252
|
+
| Name | Type | Description |
|
|
253
|
+
| :------ | :------ | :------ |
|
|
254
|
+
| `p` | `any` | the other point |
|
|
255
|
+
|
|
256
|
+
#### Returns
|
|
257
|
+
|
|
258
|
+
`number`
|
|
259
|
+
|
|
260
|
+
distance
|
|
261
|
+
|
|
262
|
+
#### Defined in
|
|
263
|
+
|
|
264
|
+
[src/Point.ts:272](https://github.com/maptiler/maptiler-sdk-js/blob/638970c/src/Point.ts#L272)
|
|
265
|
+
|
|
266
|
+
___
|
|
267
|
+
|
|
268
|
+
### div
|
|
269
|
+
|
|
270
|
+
▸ **div**(`k`): [`Point`](Point.md)
|
|
271
|
+
|
|
272
|
+
Divide this point's x & y coordinates by a factor,
|
|
273
|
+
yielding a new point.
|
|
274
|
+
|
|
275
|
+
#### Parameters
|
|
276
|
+
|
|
277
|
+
| Name | Type | Description |
|
|
278
|
+
| :------ | :------ | :------ |
|
|
279
|
+
| `k` | `number` | factor |
|
|
280
|
+
|
|
281
|
+
#### Returns
|
|
282
|
+
|
|
283
|
+
[`Point`](Point.md)
|
|
284
|
+
|
|
285
|
+
output point
|
|
286
|
+
|
|
287
|
+
#### Defined in
|
|
288
|
+
|
|
289
|
+
[src/Point.ts:172](https://github.com/maptiler/maptiler-sdk-js/blob/638970c/src/Point.ts#L172)
|
|
290
|
+
|
|
291
|
+
___
|
|
292
|
+
|
|
293
|
+
### divByPoint
|
|
294
|
+
|
|
295
|
+
▸ **divByPoint**(`p`): [`Point`](Point.md)
|
|
296
|
+
|
|
297
|
+
Divide this point's x & y coordinates by point,
|
|
298
|
+
yielding a new point.
|
|
299
|
+
|
|
300
|
+
#### Parameters
|
|
301
|
+
|
|
302
|
+
| Name | Type | Description |
|
|
303
|
+
| :------ | :------ | :------ |
|
|
304
|
+
| `p` | [`Point`](Point.md) | the other point |
|
|
305
|
+
|
|
306
|
+
#### Returns
|
|
307
|
+
|
|
308
|
+
[`Point`](Point.md)
|
|
309
|
+
|
|
310
|
+
output point
|
|
311
|
+
|
|
312
|
+
#### Defined in
|
|
313
|
+
|
|
314
|
+
[src/Point.ts:152](https://github.com/maptiler/maptiler-sdk-js/blob/638970c/src/Point.ts#L152)
|
|
315
|
+
|
|
316
|
+
___
|
|
317
|
+
|
|
318
|
+
### equals
|
|
319
|
+
|
|
320
|
+
▸ **equals**(`other`): `boolean`
|
|
321
|
+
|
|
322
|
+
Judge whether this point is equal to another point, returning
|
|
323
|
+
true or false.
|
|
324
|
+
|
|
325
|
+
#### Parameters
|
|
326
|
+
|
|
327
|
+
| Name | Type | Description |
|
|
328
|
+
| :------ | :------ | :------ |
|
|
329
|
+
| `other` | `any` | the other point |
|
|
330
|
+
|
|
331
|
+
#### Returns
|
|
332
|
+
|
|
333
|
+
`boolean`
|
|
334
|
+
|
|
335
|
+
whether the points are equal
|
|
336
|
+
|
|
337
|
+
#### Defined in
|
|
338
|
+
|
|
339
|
+
[src/Point.ts:252](https://github.com/maptiler/maptiler-sdk-js/blob/638970c/src/Point.ts#L252)
|
|
340
|
+
|
|
341
|
+
___
|
|
342
|
+
|
|
343
|
+
### mag
|
|
344
|
+
|
|
345
|
+
▸ **mag**(): `number`
|
|
346
|
+
|
|
347
|
+
Return the magnitude of this point: this is the Euclidean
|
|
348
|
+
distance from the 0, 0 coordinate to this point's x and y
|
|
349
|
+
coordinates.
|
|
350
|
+
|
|
351
|
+
#### Returns
|
|
352
|
+
|
|
353
|
+
`number`
|
|
354
|
+
|
|
355
|
+
magnitude
|
|
356
|
+
|
|
357
|
+
#### Defined in
|
|
358
|
+
|
|
359
|
+
[src/Point.ts:242](https://github.com/maptiler/maptiler-sdk-js/blob/638970c/src/Point.ts#L242)
|
|
360
|
+
|
|
361
|
+
___
|
|
362
|
+
|
|
363
|
+
### matMult
|
|
364
|
+
|
|
365
|
+
▸ **matMult**(`m`): [`Point`](Point.md)
|
|
366
|
+
|
|
367
|
+
Multiply this point by a 4x1 transformation matrix
|
|
368
|
+
|
|
369
|
+
#### Parameters
|
|
370
|
+
|
|
371
|
+
| Name | Type | Description |
|
|
372
|
+
| :------ | :------ | :------ |
|
|
373
|
+
| `m` | [`Matrix2`](../README.md#matrix2) | transformation matrix |
|
|
374
|
+
|
|
375
|
+
#### Returns
|
|
376
|
+
|
|
377
|
+
[`Point`](Point.md)
|
|
378
|
+
|
|
379
|
+
output point
|
|
380
|
+
|
|
381
|
+
#### Defined in
|
|
382
|
+
|
|
383
|
+
[src/Point.ts:202](https://github.com/maptiler/maptiler-sdk-js/blob/638970c/src/Point.ts#L202)
|
|
384
|
+
|
|
385
|
+
___
|
|
386
|
+
|
|
387
|
+
### mult
|
|
388
|
+
|
|
389
|
+
▸ **mult**(`k`): [`Point`](Point.md)
|
|
390
|
+
|
|
391
|
+
Multiply this point's x & y coordinates by a factor,
|
|
392
|
+
yielding a new point.
|
|
393
|
+
|
|
394
|
+
#### Parameters
|
|
395
|
+
|
|
396
|
+
| Name | Type | Description |
|
|
397
|
+
| :------ | :------ | :------ |
|
|
398
|
+
| `k` | `number` | factor |
|
|
399
|
+
|
|
400
|
+
#### Returns
|
|
401
|
+
|
|
402
|
+
[`Point`](Point.md)
|
|
403
|
+
|
|
404
|
+
output point
|
|
405
|
+
|
|
406
|
+
#### Defined in
|
|
407
|
+
|
|
408
|
+
[src/Point.ts:162](https://github.com/maptiler/maptiler-sdk-js/blob/638970c/src/Point.ts#L162)
|
|
409
|
+
|
|
410
|
+
___
|
|
411
|
+
|
|
412
|
+
### multByPoint
|
|
413
|
+
|
|
414
|
+
▸ **multByPoint**(`p`): [`Point`](Point.md)
|
|
415
|
+
|
|
416
|
+
Multiply this point's x & y coordinates by point,
|
|
417
|
+
yielding a new point.
|
|
418
|
+
|
|
419
|
+
#### Parameters
|
|
420
|
+
|
|
421
|
+
| Name | Type | Description |
|
|
422
|
+
| :------ | :------ | :------ |
|
|
423
|
+
| `p` | [`Point`](Point.md) | the other point |
|
|
424
|
+
|
|
425
|
+
#### Returns
|
|
426
|
+
|
|
427
|
+
[`Point`](Point.md)
|
|
428
|
+
|
|
429
|
+
output point
|
|
430
|
+
|
|
431
|
+
#### Defined in
|
|
432
|
+
|
|
433
|
+
[src/Point.ts:142](https://github.com/maptiler/maptiler-sdk-js/blob/638970c/src/Point.ts#L142)
|
|
434
|
+
|
|
435
|
+
___
|
|
436
|
+
|
|
437
|
+
### perp
|
|
438
|
+
|
|
439
|
+
▸ **perp**(): [`Point`](Point.md)
|
|
440
|
+
|
|
441
|
+
Compute a perpendicular point, where the new y coordinate
|
|
442
|
+
is the old x coordinate and the new x coordinate is the old y
|
|
443
|
+
coordinate multiplied by -1
|
|
444
|
+
|
|
445
|
+
#### Returns
|
|
446
|
+
|
|
447
|
+
[`Point`](Point.md)
|
|
448
|
+
|
|
449
|
+
perpendicular point
|
|
450
|
+
|
|
451
|
+
#### Defined in
|
|
452
|
+
|
|
453
|
+
[src/Point.ts:223](https://github.com/maptiler/maptiler-sdk-js/blob/638970c/src/Point.ts#L223)
|
|
454
|
+
|
|
455
|
+
___
|
|
456
|
+
|
|
457
|
+
### rotate
|
|
458
|
+
|
|
459
|
+
▸ **rotate**(`a`): [`Point`](Point.md)
|
|
460
|
+
|
|
461
|
+
Rotate this point around the 0, 0 origin by an angle a,
|
|
462
|
+
given in radians
|
|
463
|
+
|
|
464
|
+
#### Parameters
|
|
465
|
+
|
|
466
|
+
| Name | Type | Description |
|
|
467
|
+
| :------ | :------ | :------ |
|
|
468
|
+
| `a` | `number` | angle to rotate around, in radians |
|
|
469
|
+
|
|
470
|
+
#### Returns
|
|
471
|
+
|
|
472
|
+
[`Point`](Point.md)
|
|
473
|
+
|
|
474
|
+
output point
|
|
475
|
+
|
|
476
|
+
#### Defined in
|
|
477
|
+
|
|
478
|
+
[src/Point.ts:182](https://github.com/maptiler/maptiler-sdk-js/blob/638970c/src/Point.ts#L182)
|
|
479
|
+
|
|
480
|
+
___
|
|
481
|
+
|
|
482
|
+
### rotateAround
|
|
483
|
+
|
|
484
|
+
▸ **rotateAround**(`a`, `p`): [`Point`](Point.md)
|
|
485
|
+
|
|
486
|
+
Rotate this point around p point by an angle a,
|
|
487
|
+
given in radians
|
|
488
|
+
|
|
489
|
+
#### Parameters
|
|
490
|
+
|
|
491
|
+
| Name | Type | Description |
|
|
492
|
+
| :------ | :------ | :------ |
|
|
493
|
+
| `a` | `number` | angle to rotate around, in radians |
|
|
494
|
+
| `p` | [`Point`](Point.md) | Point to rotate around |
|
|
495
|
+
|
|
496
|
+
#### Returns
|
|
497
|
+
|
|
498
|
+
[`Point`](Point.md)
|
|
499
|
+
|
|
500
|
+
output point
|
|
501
|
+
|
|
502
|
+
#### Defined in
|
|
503
|
+
|
|
504
|
+
[src/Point.ts:193](https://github.com/maptiler/maptiler-sdk-js/blob/638970c/src/Point.ts#L193)
|
|
505
|
+
|
|
506
|
+
___
|
|
507
|
+
|
|
508
|
+
### round
|
|
509
|
+
|
|
510
|
+
▸ **round**(): [`Point`](Point.md)
|
|
511
|
+
|
|
512
|
+
Return a version of this point with the x & y coordinates
|
|
513
|
+
rounded to integers.
|
|
514
|
+
|
|
515
|
+
#### Returns
|
|
516
|
+
|
|
517
|
+
[`Point`](Point.md)
|
|
518
|
+
|
|
519
|
+
rounded point
|
|
520
|
+
|
|
521
|
+
#### Defined in
|
|
522
|
+
|
|
523
|
+
[src/Point.ts:232](https://github.com/maptiler/maptiler-sdk-js/blob/638970c/src/Point.ts#L232)
|
|
524
|
+
|
|
525
|
+
___
|
|
526
|
+
|
|
527
|
+
### sub
|
|
528
|
+
|
|
529
|
+
▸ **sub**(`p`): [`Point`](Point.md)
|
|
530
|
+
|
|
531
|
+
Subtract this point's x & y coordinates to from point,
|
|
532
|
+
yielding a new point.
|
|
533
|
+
|
|
534
|
+
#### Parameters
|
|
535
|
+
|
|
536
|
+
| Name | Type | Description |
|
|
537
|
+
| :------ | :------ | :------ |
|
|
538
|
+
| `p` | [`Point`](Point.md) | the other point |
|
|
539
|
+
|
|
540
|
+
#### Returns
|
|
541
|
+
|
|
542
|
+
[`Point`](Point.md)
|
|
543
|
+
|
|
544
|
+
output point
|
|
545
|
+
|
|
546
|
+
#### Defined in
|
|
547
|
+
|
|
548
|
+
[src/Point.ts:132](https://github.com/maptiler/maptiler-sdk-js/blob/638970c/src/Point.ts#L132)
|
|
549
|
+
|
|
550
|
+
___
|
|
551
|
+
|
|
552
|
+
### unit
|
|
553
|
+
|
|
554
|
+
▸ **unit**(): [`Point`](Point.md)
|
|
555
|
+
|
|
556
|
+
Calculate this point but as a unit vector from 0, 0, meaning
|
|
557
|
+
that the distance from the resulting point to the 0, 0
|
|
558
|
+
coordinate will be equal to 1 and the angle from the resulting
|
|
559
|
+
point to the 0, 0 coordinate will be the same as before.
|
|
560
|
+
|
|
561
|
+
#### Returns
|
|
562
|
+
|
|
563
|
+
[`Point`](Point.md)
|
|
564
|
+
|
|
565
|
+
unit vector point
|
|
566
|
+
|
|
567
|
+
#### Defined in
|
|
568
|
+
|
|
569
|
+
[src/Point.ts:213](https://github.com/maptiler/maptiler-sdk-js/blob/638970c/src/Point.ts#L213)
|
|
570
|
+
|
|
571
|
+
___
|
|
572
|
+
|
|
573
|
+
### convert
|
|
574
|
+
|
|
575
|
+
▸ `Static` **convert**(`a`): [`Point`](Point.md)
|
|
576
|
+
|
|
577
|
+
Construct a point from an array if necessary, otherwise if the input
|
|
578
|
+
is already a Point, or an unknown type, return it unchanged
|
|
579
|
+
|
|
580
|
+
**`Example`**
|
|
581
|
+
|
|
582
|
+
```ts
|
|
583
|
+
// this
|
|
584
|
+
var point = Point.convert([0, 1]);
|
|
585
|
+
// is equivalent to
|
|
586
|
+
var point = new Point(0, 1);
|
|
587
|
+
```
|
|
588
|
+
|
|
589
|
+
#### Parameters
|
|
590
|
+
|
|
591
|
+
| Name | Type | Description |
|
|
592
|
+
| :------ | :------ | :------ |
|
|
593
|
+
| `a` | `number`[] \| [`Point`](Point.md) | any kind of input value |
|
|
594
|
+
|
|
595
|
+
#### Returns
|
|
596
|
+
|
|
597
|
+
[`Point`](Point.md)
|
|
598
|
+
|
|
599
|
+
constructed point, or passed-through value.
|
|
600
|
+
|
|
601
|
+
#### Defined in
|
|
602
|
+
|
|
603
|
+
[src/Point.ts:327](https://github.com/maptiler/maptiler-sdk-js/blob/638970c/src/Point.ts#L327)
|