@maplibre/maplibre-gl-native 5.2.0-pre.0 → 5.2.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/package.json +2 -2
- package/platform/node/README.md +3 -0
- package/platform/node/index.d.ts +102 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@maplibre/maplibre-gl-native",
|
|
3
|
-
"version": "5.2.0
|
|
3
|
+
"version": "5.2.0",
|
|
4
4
|
"description": "Renders map tiles with Maplibre GL",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"maplibre",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"@acalcutt/node-pre-gyp": "^1.0.11",
|
|
25
25
|
"@acalcutt/node-pre-gyp-github": "1.4.8",
|
|
26
|
-
"minimatch": "^7.
|
|
26
|
+
"minimatch": "^7.2.0",
|
|
27
27
|
"npm-run-all": "^4.0.2"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
package/platform/node/README.md
CHANGED
|
@@ -10,6 +10,7 @@ Binaries are available and downloaded during install for the following platforms
|
|
|
10
10
|
- Operating systems:
|
|
11
11
|
- Ubuntu 20.04 (amd64/arm64)
|
|
12
12
|
- macOS 12 (amd64/arm64)
|
|
13
|
+
- Windows (amd64)
|
|
13
14
|
- Node.js 14, 16, 18
|
|
14
15
|
|
|
15
16
|
Run:
|
|
@@ -172,6 +173,8 @@ var map = new mbgl.Map({
|
|
|
172
173
|
response.data = body;
|
|
173
174
|
|
|
174
175
|
callback(null, response);
|
|
176
|
+
} else if (res.statusCode == 204) {
|
|
177
|
+
callback();
|
|
175
178
|
} else {
|
|
176
179
|
callback(new Error(JSON.parse(body).message));
|
|
177
180
|
}
|
package/platform/node/index.d.ts
CHANGED
|
@@ -60,6 +60,8 @@ declare module '@maplibre/maplibre-gl-native' {
|
|
|
60
60
|
*/
|
|
61
61
|
type RenderOptions = {
|
|
62
62
|
/**
|
|
63
|
+
* Zoom level
|
|
64
|
+
*
|
|
63
65
|
* @default 0
|
|
64
66
|
*/
|
|
65
67
|
zoom?: number;
|
|
@@ -111,19 +113,114 @@ declare module '@maplibre/maplibre-gl-native' {
|
|
|
111
113
|
class Map {
|
|
112
114
|
constructor(mapOptions: MapOptions);
|
|
113
115
|
|
|
116
|
+
/**
|
|
117
|
+
* Load a style into a map
|
|
118
|
+
*/
|
|
114
119
|
load: (style: any) => void;
|
|
115
120
|
|
|
116
121
|
/**
|
|
117
|
-
* Render a specific map view to an image with previously loaded map styles
|
|
122
|
+
* Render a specific map view to an image with previously loaded map styles with render options.
|
|
118
123
|
*/
|
|
119
|
-
render: (
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
124
|
+
render(renderOptions: RenderOptions, callback: (...args: [error: Error, buffer: undefined] | [error: undefined, buffer: Uint8Array]) => void): void;
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Render a specific map view to an image with previously loaded map styles without render options.
|
|
128
|
+
*/
|
|
129
|
+
render(callback: (...args: [error: Error, buffer: undefined] | [error: undefined, buffer: Uint8Array]) => void): void;
|
|
123
130
|
|
|
124
131
|
/**
|
|
125
132
|
* Call to permanently dispose the internal map resources, instance can't be used for further render calls
|
|
126
133
|
*/
|
|
127
134
|
release: () => void;
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* Add source to map's style
|
|
138
|
+
*/
|
|
139
|
+
addSource: (sourceId: string, source: object) => void;
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* Remove source from map's style
|
|
143
|
+
*/
|
|
144
|
+
removeSource: (sourceId: string) => void;
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* Add layer to map's style
|
|
148
|
+
*/
|
|
149
|
+
addLayer: (layer: object, beforeId?: string) => void;
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* Remove layer from map's style
|
|
153
|
+
*/
|
|
154
|
+
removeLayer: (layerId: string) => void;
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* Add image to map's style
|
|
158
|
+
*/
|
|
159
|
+
addImage: (imageId: string, image: any) => void;
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* Remove image from map's style
|
|
163
|
+
*/
|
|
164
|
+
removeImage: (imageId: string) => void;
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* Set the extent of the zoom for a specified layer
|
|
168
|
+
*/
|
|
169
|
+
setLayerZoomRange: (layerId: string, minZoom: number, maxZoom: number) => void;
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* Set the value for a layer's property
|
|
173
|
+
*/
|
|
174
|
+
setLayoutProperty: (layerId: string, name: string, value: string) => void;
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
* Set filter for specified style layer
|
|
178
|
+
*/
|
|
179
|
+
setFilter: (layerId: string, filter: [] | null | undefined) => void;
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* Set size of the tile
|
|
183
|
+
*/
|
|
184
|
+
setSize: (size: [number, number]) => void;
|
|
185
|
+
|
|
186
|
+
/**
|
|
187
|
+
* Set the center of the map
|
|
188
|
+
*/
|
|
189
|
+
setCenter: (center: [number, number]) => void;
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
* Set zoom of the map
|
|
193
|
+
*/
|
|
194
|
+
setZoom: (zoom: number) => void;
|
|
195
|
+
|
|
196
|
+
/**
|
|
197
|
+
* Set bearing (rotation) of map
|
|
198
|
+
*/
|
|
199
|
+
setBearing: (bearing: number) => void;
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* Set pitch (tilt angle) of map
|
|
203
|
+
*/
|
|
204
|
+
setPitch: (pitch: number) => void;
|
|
205
|
+
|
|
206
|
+
/**
|
|
207
|
+
* Set light value of map
|
|
208
|
+
*/
|
|
209
|
+
setLight: (light: any) => void;
|
|
210
|
+
|
|
211
|
+
/**
|
|
212
|
+
* Set axonometric view of map
|
|
213
|
+
*/
|
|
214
|
+
setAxonometric: (state: boolean) => void;
|
|
215
|
+
|
|
216
|
+
/**
|
|
217
|
+
* Set X skew of map
|
|
218
|
+
*/
|
|
219
|
+
setXSkew: (x: number) => void;
|
|
220
|
+
|
|
221
|
+
/**
|
|
222
|
+
* Set Y skew of map
|
|
223
|
+
*/
|
|
224
|
+
setYSkew: (y: number) => void;
|
|
128
225
|
}
|
|
129
226
|
}
|