@maptiler/client 1.5.0 → 1.6.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/dist/maptiler-client.cjs.map +1 -1
- package/dist/maptiler-client.d.ts +64 -9
- package/dist/maptiler-client.mjs.map +1 -1
- package/dist/maptiler-client.umd.js.map +1 -1
- package/docs/assets/search.js +1 -1
- package/docs/classes/config.ClientConfig.html +9 -9
- package/docs/classes/services_ServiceError.ServiceError.html +7 -7
- package/docs/functions/language.getAutoLanguageGeocoding.html +5 -5
- package/docs/functions/services_simplify.default.html +5 -5
- package/docs/index.html +4 -4
- package/docs/modules/config.html +5 -5
- package/docs/modules/language.html +5 -5
- package/docs/modules/services_ServiceError.html +5 -5
- package/docs/modules/services_coordinates.html +5 -5
- package/docs/modules/services_data.html +5 -5
- package/docs/modules/services_geocoding.html +5 -5
- package/docs/modules/services_geolocation.html +5 -5
- package/docs/modules/services_simplify.html +5 -5
- package/docs/modules/services_staticMaps.html +5 -5
- package/docs/modules.html +4 -4
- package/docs/types/config.FetchFunction.html +5 -5
- package/docs/types/language.LanguageGeocodingString.html +5 -5
- package/docs/types/services_coordinates.CoordinateExport.html +5 -5
- package/docs/types/services_coordinates.CoordinateGrid.html +5 -5
- package/docs/types/services_coordinates.CoordinateId.html +5 -5
- package/docs/types/services_coordinates.CoordinateSearch.html +5 -5
- package/docs/types/services_coordinates.CoordinateSearchResult.html +5 -5
- package/docs/types/services_coordinates.CoordinateTransformResult.html +5 -5
- package/docs/types/services_coordinates.CoordinateTransformation.html +5 -5
- package/docs/types/services_coordinates.CoordinatesSearchOptions.html +5 -5
- package/docs/types/services_coordinates.CoordinatesTransformOptions.html +5 -5
- package/docs/types/services_coordinates.XYZ.html +5 -5
- package/docs/types/services_data.GetDataOptions.html +5 -5
- package/docs/types/services_geocoding.ByIdGeocodingOptions.html +5 -5
- package/docs/types/services_geocoding.CommonForwardAndReverseGeocodingOptions.html +6 -6
- package/docs/types/services_geocoding.Coordinates.html +5 -5
- package/docs/types/services_geocoding.FeatureHierarchy.html +6 -17
- package/docs/types/services_geocoding.GeocodingFeature.html +6 -6
- package/docs/types/services_geocoding.GeocodingOptions.html +5 -5
- package/docs/types/services_geocoding.GeocodingSearchResult.html +5 -5
- package/docs/types/services_geocoding.LanguageGeocodingOptions.html +5 -5
- package/docs/types/services_geocoding.ReverseGeocodingOptions.html +5 -5
- package/docs/types/services_geolocation.GeolocationInfoOptions.html +5 -5
- package/docs/types/services_geolocation.GeolocationResult.html +5 -5
- package/docs/types/services_staticMaps.AutomaticStaticMapOptions.html +5 -5
- package/docs/types/services_staticMaps.BoundedStaticMapOptions.html +5 -5
- package/docs/types/services_staticMaps.CenteredStaticMapOptions.html +5 -5
- package/docs/types/services_staticMaps.StaticMapBaseOptions.html +5 -5
- package/docs/types/services_staticMaps.StaticMapMarker.html +5 -5
- package/docs/variables/config.config.html +5 -5
- package/docs/variables/language.LanguageGeocoding.html +5 -5
- package/docs/variables/services_coordinates.coordinates.html +5 -5
- package/docs/variables/services_data.data.html +5 -5
- package/docs/variables/services_geocoding.geocoding.html +5 -5
- package/docs/variables/services_geolocation.geolocation.html +5 -5
- package/docs/variables/services_staticMaps.staticMaps.html +5 -5
- package/docsmd/README.md +45 -52
- package/docsmd/classes/ClientConfig.md +5 -5
- package/docsmd/classes/MapStyleVariant.md +13 -13
- package/docsmd/classes/ReferenceMapStyle.md +9 -9
- package/docsmd/classes/ServiceError.md +3 -3
- package/examples/test-node.js +9 -9
- package/package.json +1 -1
- package/src/services/geocoding.ts +96 -18
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BBox, Position, Feature, FeatureCollection } from 'geojson';
|
|
1
|
+
import { BBox, Position, Feature, Geometry, FeatureCollection } from 'geojson';
|
|
2
2
|
export { BBox, Position } from 'geojson';
|
|
3
3
|
|
|
4
4
|
type FetchFunction = (url: string, options: object) => Promise<any>;
|
|
@@ -121,7 +121,7 @@ type CommonForwardAndReverseGeocodingOptions = LanguageGeocodingOptions & {
|
|
|
121
121
|
/**
|
|
122
122
|
* Filter of feature types to return. If not specified, all available feature types are returned.
|
|
123
123
|
*/
|
|
124
|
-
types?: ("country" | "region" | "subregion" | "county" | "joint_municipality" | "joint_submunicipality" | "municipality" | "municipal_district" | "locality" | "neighbourhood" | "place" | "postal_code" | "address")[];
|
|
124
|
+
types?: ("country" | "region" | "subregion" | "county" | "joint_municipality" | "joint_submunicipality" | "municipality" | "municipal_district" | "locality" | "neighbourhood" | "place" | "postal_code" | "address" | "poi")[];
|
|
125
125
|
};
|
|
126
126
|
type GeocodingOptions = CommonForwardAndReverseGeocodingOptions & {
|
|
127
127
|
/**
|
|
@@ -149,7 +149,33 @@ type GeocodingOptions = CommonForwardAndReverseGeocodingOptions & {
|
|
|
149
149
|
type ReverseGeocodingOptions = CommonForwardAndReverseGeocodingOptions;
|
|
150
150
|
type ByIdGeocodingOptions = LanguageGeocodingOptions;
|
|
151
151
|
type Coordinates = Position;
|
|
152
|
-
type
|
|
152
|
+
type FeatureProperties = {
|
|
153
|
+
/**
|
|
154
|
+
* External reference of the feature used for debugging purposes
|
|
155
|
+
*/
|
|
156
|
+
ref: string;
|
|
157
|
+
/**
|
|
158
|
+
* ISO 3166-1 alpha-2 country code of the feature
|
|
159
|
+
*/
|
|
160
|
+
country_code: string;
|
|
161
|
+
/**
|
|
162
|
+
* (experimental) Kind of the feature
|
|
163
|
+
*/
|
|
164
|
+
kind?: "road" | "road_relation" | "admin_area" | "place" | "street" | "virtual_street";
|
|
165
|
+
/**
|
|
166
|
+
* (experimental) Value of place=* tag from OpenStreetMap feature if kind=place
|
|
167
|
+
*/
|
|
168
|
+
"osm:place_type"?: string;
|
|
169
|
+
/**
|
|
170
|
+
* (experimental) Feature tags from OpenStreetMap. Only available for `poi` type.
|
|
171
|
+
*/
|
|
172
|
+
"osm:tags"?: Record<string, string>;
|
|
173
|
+
/**
|
|
174
|
+
* Array of POI categories. Only available for `poi` type.
|
|
175
|
+
*/
|
|
176
|
+
categories?: string[];
|
|
177
|
+
};
|
|
178
|
+
type FeatureBase = {
|
|
153
179
|
/**
|
|
154
180
|
* Unique feature ID
|
|
155
181
|
*/
|
|
@@ -158,8 +184,23 @@ type FeatureHierarchy = {
|
|
|
158
184
|
* Localized feature name
|
|
159
185
|
*/
|
|
160
186
|
text: string;
|
|
187
|
+
/**
|
|
188
|
+
* Query's primary ISO 639-1 language code
|
|
189
|
+
*/
|
|
190
|
+
language?: string;
|
|
191
|
+
/**
|
|
192
|
+
* A string analogous to the `text` field that matches the query in the requested language.
|
|
193
|
+
* This field is only returned when multiple languages are requested using the `language` parameter, and will be present for each requested language.
|
|
194
|
+
*/
|
|
195
|
+
[text: `text_${string}`]: string;
|
|
196
|
+
/**
|
|
197
|
+
* A ISO 639-1 query's fallback language code.
|
|
198
|
+
* This field is only returned when multiple languages are requested using the `language` parameter, and will be present for each requested language.
|
|
199
|
+
*/
|
|
200
|
+
[language: `language_${string}`]: string;
|
|
161
201
|
};
|
|
162
|
-
type
|
|
202
|
+
type FeatureHierarchy = FeatureProperties & FeatureBase;
|
|
203
|
+
type GeocodingFeature = Feature<Geometry, FeatureProperties> & FeatureBase & {
|
|
163
204
|
/**
|
|
164
205
|
* Bounding box of the original feature as [w, s, e, n] array
|
|
165
206
|
*/
|
|
@@ -173,9 +214,19 @@ type GeocodingFeature = Feature & {
|
|
|
173
214
|
*/
|
|
174
215
|
place_name: string;
|
|
175
216
|
/**
|
|
176
|
-
*
|
|
217
|
+
* A string analogous to the `place_name` field that matches the query in the requested language.
|
|
218
|
+
* This field is only returned when multiple languages are requested using the `language` parameter, and will be present for each requested language.
|
|
177
219
|
*/
|
|
178
|
-
|
|
220
|
+
[key: `place_name_${string}`]: string;
|
|
221
|
+
/**
|
|
222
|
+
* An array of feature types describing the feature.
|
|
223
|
+
* Currently each feature has only single type but this may change in the future.
|
|
224
|
+
*/
|
|
225
|
+
place_type: string[];
|
|
226
|
+
/**
|
|
227
|
+
* Localized type of the place name, matches `place_type` property
|
|
228
|
+
*/
|
|
229
|
+
place_type_name: string[];
|
|
179
230
|
/**
|
|
180
231
|
* Feature hierarchy
|
|
181
232
|
*/
|
|
@@ -184,6 +235,12 @@ type GeocodingFeature = Feature & {
|
|
|
184
235
|
* Address number, if applicable
|
|
185
236
|
*/
|
|
186
237
|
address?: string;
|
|
238
|
+
/**
|
|
239
|
+
* Indicates how well the returned feature matches the user's query on a scale from 0 to 1.
|
|
240
|
+
* 0 means the result does not match the query text at all, while 1 means the result fully matches the query text.
|
|
241
|
+
* You can use the relevance property to remove results that don't fully match the query.
|
|
242
|
+
*/
|
|
243
|
+
relevance: number;
|
|
187
244
|
};
|
|
188
245
|
type GeocodingSearchResult = {
|
|
189
246
|
type: "FeatureCollection";
|
|
@@ -288,9 +345,7 @@ declare const geocoding: {
|
|
|
288
345
|
LUXEMBOURGISH: string;
|
|
289
346
|
MACEDONIAN: string;
|
|
290
347
|
MALTESE: string;
|
|
291
|
-
NORWEGIAN: string;
|
|
292
|
-
* Maximum number of results to show. Must be between 1 and 10. Default is 5 for forward and 1 for reverse geocoding.
|
|
293
|
-
*/
|
|
348
|
+
NORWEGIAN: string;
|
|
294
349
|
POLISH: string;
|
|
295
350
|
PORTUGUESE: string;
|
|
296
351
|
ROMANIAN: string;
|