@tomtom-org/maps-sdk 0.31.0 → 0.32.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/CHANGELOG.md +8 -0
- package/core/dist/core.es.js +1 -1
- package/core/package.json +7 -4
- package/map/dist/THIRD_PARTY.txt +1 -1
- package/map/dist/index.d.ts +50 -104
- package/map/dist/map.es.js +1 -1
- package/map/dist/map.es.js.map +1 -1
- package/map/package.json +7 -4
- package/package.json +1 -4
- package/services/dist/index.d.ts +14 -18
- package/services/dist/services.es.js +1 -1
- package/services/dist/services.es.js.map +1 -1
- package/services/package.json +7 -4
- package/core/dist/core.cjs.js +0 -530
- package/core/dist/core.cjs.js.map +0 -1
- package/core/dist/core.cjs.min.js +0 -2
- package/core/dist/core.cjs.min.js.map +0 -1
- package/core/main.js +0 -6
- package/map/dist/map.cjs.js +0 -7510
- package/map/dist/map.cjs.js.map +0 -1
- package/map/dist/map.cjs.min.js +0 -2
- package/map/dist/map.cjs.min.js.map +0 -1
- package/map/main.js +0 -6
- package/services/dist/services.cjs.js +0 -5059
- package/services/dist/services.cjs.js.map +0 -1
- package/services/dist/services.cjs.min.js +0 -2
- package/services/dist/services.cjs.min.js.map +0 -1
- package/services/main.js +0 -6
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
## [0.32.0](https://github.com/tomtom-internal/maps-sdk-js/compare/v0.31.1...v0.32.0) (2025-11-13)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* export sdk as es modules only ([1e7d0d9](https://github.com/tomtom-internal/maps-sdk-js/commit/1e7d0d99d96320f910529d912b455ce36251560d))
|
|
11
|
+
* simplify map style initialization ([6dde7c9](https://github.com/tomtom-internal/maps-sdk-js/commit/6dde7c9cea644e5046df19294d94da04a18cd49e))
|
|
12
|
+
|
|
5
13
|
## [0.31.0](https://github.com/tomtom-internal/maps-sdk-js/compare/v0.30.2...v0.31.0) (2025-11-11)
|
|
6
14
|
|
|
7
15
|
|
package/core/dist/core.es.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const e={commonBaseURL:"https://api.tomtom.com",apiKey:"",apiVersion:1},t=class{constructor(){this.config={...e}}put(e){this.config={...this.config,...e}}reset(){this.config={...e}}get(){return this.config}};t.instance=new t;let r=t;const n=(e={})=>({...r.instance.get(),...e}),a=["Public","Authorized","Restricted","Private","Unknown"],o=["Available","Reserved","Occupied","OutOfService","Unknown"],i=["ChargingProfileCapable","ChargingPreferencesCapable","ChipCardSupport","ContactlessCardSupport","CreditCardPayable","DebitCardPayable","PedTerminal","RemoteStartStopCapable","Reservable","RfidReader","StartSessionConnectorRequired","TokenGroupCapable","UnlockCapable","PlugAndCharge","Unknown"],s=["EvOnly","Plugged","Disabled","Customers","Motorcycles"],c=["StandardHouseholdCountrySpecific","IEC62196Type1","IEC62196Type1CCS","IEC62196Type2CableAttached","IEC62196Type2Outlet","IEC62196Type2CCS","IEC62196Type3","Chademo","GBT20234Part2","GBT20234Part3","IEC60309AC3PhaseRed","IEC60309AC1PhaseBlue","IEC60309DCWhite","Tesla"],u=["AC1","AC3","DC"],d=["Country","CountrySubdivision","CountrySecondarySubdivision","CountryTertiarySubdivision","Municipality","MunicipalitySubdivision","Neighbourhood","PostalCodeArea"],l=["POI","Street","Geography","Point Address","Address Range","Cross Street"],_=["Small_Paddle_Inductive","Large_Paddle_Inductive","IEC_60309_1_Phase","IEC_60309_3_Phase","IEC_62196_Type_1_Outlet","IEC_62196_Type_2_Outlet","IEC_62196_Type_3_Outlet","IEC_62196_Type_1_Connector_Cable_Attached","IEC_62196_Type_2_Connector_Cable_Attached","IEC_62196_Type_3_Connector_Cable_Attached","Combo_to_IEC_62196_Type_1_Base","Combo_to_IEC_62196_Type_2_Base","Type_E_French_Standard_CEE_7_5","Type_F_Schuko_CEE_7_4","Type_G_British_Standard_BS_1363","Type_J_Swiss_Standard_SEV_1011","China_GB_Part_2","China_GB_Part_3","IEC_309_DC_Plug","AVCON_Connector","Tesla_Connector","NEMA_5_20","CHAdeMO","SAE_J1772","TEPCO","Better_Place_Socket","Marechal_Socket","Standard_Household_Country_Specific"],p=["No_Payment","Subscription","Direct"],y=["tollRoads","motorways","ferries","unpavedRoads","carpools","alreadyUsedRoads","borderCrossings","tunnels","carTrains","lowEmissionZones"],C=["jam","accident","roadworks","road-closed","narrow-lanes","danger","animals-on-road","broken-down-vehicle","lane-closed","wind","fog","rain","frost","flooding","other"],h=["carTrain","ferry","tunnel","motorway","pedestrian","toll","tollVignette","country","vehicleRestricted","traffic","carpool","urban","unpaved","lowEmissionZone","speedLimit","roadShields","importantRoadStretch"],g=[...h,"lanes"],$=[...g,"leg"],m=["Unified","AR","IN","PK","IL","MA","RU","TR","CN"],f=e=>!!e&&(e.length>=4&&e[3]!==e[1]&&e[2]!==e[0]),S=e=>f(e)?e:void 0,b=(e,t)=>{if(e&&!(e.length<2))return t?[t[0]>e[0]?e[0]:t[0],t[1]>e[1]?e[1]:t[1],t[2]<e[0]?e[0]:t[2],t[3]<e[1]?e[1]:t[3]]:[e[0],e[1],e[0],e[1]]},E=(e,t)=>t&&e?[t[0]>e[0]?e[0]:t[0],t[1]>e[1]?e[1]:t[1],t[2]<e[2]?e[2]:t[2],t[3]<e[3]?e[3]:t[3]]:e||t,M=e=>e?.length?e.reduce((e,t)=>E(t,e)):void 0,P=e=>{const t=e?.length;if(!t)return;let r;const n=Math.ceil(t/1e3);for(let a=0;a<t;a+=n)r=b(e[a],r);return 1===n?r:b(e[t-1],r)},T=e=>{if(e){if(Array.isArray(e))return"number"==typeof e[0]?e.length>=4?e:void 0:M(e.map(e=>T(e)));if(e.bbox)return e.bbox;switch(e.type){case"Feature":return T(e.geometry);case"FeatureCollection":return M(e.features.map(T));case"GeometryCollection":return M(e.geometries.map(T));case"Point":return b(e.coordinates);case"LineString":case"MultiPoint":return P(e.coordinates);case"MultiLineString":case"Polygon":return M(e.coordinates.map(P));case"MultiPolygon":return M(e.coordinates.flatMap(e=>e.map(P)));default:return}}},A=(e,t)=>E(T(e),t),I=e=>[(e[0]+e[2])/2,(e[1]+e[3])/2],v=()=>Date.now().toString(36)+Math.random().toString(36).substring(2),w="MapsSDKJS",R=e=>{if(!/^[a-zA-Z0-9-]{1,100}$/.test(e))throw new TypeError(`a string matching regular expression ^[a-zA-Z0-9-]{1,100}$ is expected, but ${e} ['${typeof e}'] given`);return e},k=e=>({"TomTom-User-Agent":`${w}/0.
|
|
1
|
+
const e={commonBaseURL:"https://api.tomtom.com",apiKey:"",apiVersion:1},t=class{constructor(){this.config={...e}}put(e){this.config={...this.config,...e}}reset(){this.config={...e}}get(){return this.config}};t.instance=new t;let r=t;const n=(e={})=>({...r.instance.get(),...e}),a=["Public","Authorized","Restricted","Private","Unknown"],o=["Available","Reserved","Occupied","OutOfService","Unknown"],i=["ChargingProfileCapable","ChargingPreferencesCapable","ChipCardSupport","ContactlessCardSupport","CreditCardPayable","DebitCardPayable","PedTerminal","RemoteStartStopCapable","Reservable","RfidReader","StartSessionConnectorRequired","TokenGroupCapable","UnlockCapable","PlugAndCharge","Unknown"],s=["EvOnly","Plugged","Disabled","Customers","Motorcycles"],c=["StandardHouseholdCountrySpecific","IEC62196Type1","IEC62196Type1CCS","IEC62196Type2CableAttached","IEC62196Type2Outlet","IEC62196Type2CCS","IEC62196Type3","Chademo","GBT20234Part2","GBT20234Part3","IEC60309AC3PhaseRed","IEC60309AC1PhaseBlue","IEC60309DCWhite","Tesla"],u=["AC1","AC3","DC"],d=["Country","CountrySubdivision","CountrySecondarySubdivision","CountryTertiarySubdivision","Municipality","MunicipalitySubdivision","Neighbourhood","PostalCodeArea"],l=["POI","Street","Geography","Point Address","Address Range","Cross Street"],_=["Small_Paddle_Inductive","Large_Paddle_Inductive","IEC_60309_1_Phase","IEC_60309_3_Phase","IEC_62196_Type_1_Outlet","IEC_62196_Type_2_Outlet","IEC_62196_Type_3_Outlet","IEC_62196_Type_1_Connector_Cable_Attached","IEC_62196_Type_2_Connector_Cable_Attached","IEC_62196_Type_3_Connector_Cable_Attached","Combo_to_IEC_62196_Type_1_Base","Combo_to_IEC_62196_Type_2_Base","Type_E_French_Standard_CEE_7_5","Type_F_Schuko_CEE_7_4","Type_G_British_Standard_BS_1363","Type_J_Swiss_Standard_SEV_1011","China_GB_Part_2","China_GB_Part_3","IEC_309_DC_Plug","AVCON_Connector","Tesla_Connector","NEMA_5_20","CHAdeMO","SAE_J1772","TEPCO","Better_Place_Socket","Marechal_Socket","Standard_Household_Country_Specific"],p=["No_Payment","Subscription","Direct"],y=["tollRoads","motorways","ferries","unpavedRoads","carpools","alreadyUsedRoads","borderCrossings","tunnels","carTrains","lowEmissionZones"],C=["jam","accident","roadworks","road-closed","narrow-lanes","danger","animals-on-road","broken-down-vehicle","lane-closed","wind","fog","rain","frost","flooding","other"],h=["carTrain","ferry","tunnel","motorway","pedestrian","toll","tollVignette","country","vehicleRestricted","traffic","carpool","urban","unpaved","lowEmissionZone","speedLimit","roadShields","importantRoadStretch"],g=[...h,"lanes"],$=[...g,"leg"],m=["Unified","AR","IN","PK","IL","MA","RU","TR","CN"],f=e=>!!e&&(e.length>=4&&e[3]!==e[1]&&e[2]!==e[0]),S=e=>f(e)?e:void 0,b=(e,t)=>{if(e&&!(e.length<2))return t?[t[0]>e[0]?e[0]:t[0],t[1]>e[1]?e[1]:t[1],t[2]<e[0]?e[0]:t[2],t[3]<e[1]?e[1]:t[3]]:[e[0],e[1],e[0],e[1]]},E=(e,t)=>t&&e?[t[0]>e[0]?e[0]:t[0],t[1]>e[1]?e[1]:t[1],t[2]<e[2]?e[2]:t[2],t[3]<e[3]?e[3]:t[3]]:e||t,M=e=>e?.length?e.reduce((e,t)=>E(t,e)):void 0,P=e=>{const t=e?.length;if(!t)return;let r;const n=Math.ceil(t/1e3);for(let a=0;a<t;a+=n)r=b(e[a],r);return 1===n?r:b(e[t-1],r)},T=e=>{if(e){if(Array.isArray(e))return"number"==typeof e[0]?e.length>=4?e:void 0:M(e.map(e=>T(e)));if(e.bbox)return e.bbox;switch(e.type){case"Feature":return T(e.geometry);case"FeatureCollection":return M(e.features.map(T));case"GeometryCollection":return M(e.geometries.map(T));case"Point":return b(e.coordinates);case"LineString":case"MultiPoint":return P(e.coordinates);case"MultiLineString":case"Polygon":return M(e.coordinates.map(P));case"MultiPolygon":return M(e.coordinates.flatMap(e=>e.map(P)));default:return}}},A=(e,t)=>E(T(e),t),I=e=>[(e[0]+e[2])/2,(e[1]+e[3])/2],v=()=>Date.now().toString(36)+Math.random().toString(36).substring(2),w="MapsSDKJS",R=e=>{if(!/^[a-zA-Z0-9-]{1,100}$/.test(e))throw new TypeError(`a string matching regular expression ^[a-zA-Z0-9-]{1,100}$ is expected, but ${e} ['${typeof e}'] given`);return e},k=e=>({"TomTom-User-Agent":`${w}/0.32.0`,...e.trackingId&&{"Tracking-ID":R(e.trackingId)}}),O=(e,t)=>{if(e){if(Array.isArray(e))return e;if(e.coordinates)return e.coordinates;if(e.geometry){if("main-when-available"===t?.useEntryPoint){const t=(r=e,r?.properties?.entryPoints?.find(e=>"main"===e.type));return t?.position??e.geometry.coordinates}return e.geometry.coordinates}}var r;return null},B=(e,t)=>{const r=O(e,t);if(!r)throw new Error(`The received object does not have lng-lat coordinates: ${JSON.stringify(e)}`);return r},U=e=>({type:"Feature",geometry:{type:"Point",coordinates:e},properties:{}}),D=(e,t)=>{let r;return r=Array.isArray(e)||"Feature"!==e.type?U(B(e)):e,{...r,properties:{...r.properties,radiusMeters:t}}},N=e=>Array.isArray(e)?Array.isArray(e[0])?"path":"waypoint":"Feature"===e.type&&"LineString"===e.geometry.type?"path":"waypoint",G=["unknown","minor","moderate","major","indefinite"];const F=e=>e?.minutes??"min",L=(e,t)=>{if(e){const a=Math.abs(e)/3600;let o=Math.floor(a),i=Math.round(a%1*60);60===i&&(i=0,o++);const s={...r.instance.get().displayUnits?.time,...t};if(o)return`${o} ${n=s,n?.hours??"hr"} ${i.toString().padStart(2,"0")} ${F(s)}`;if(i)return`${i.toString()} ${F(s)}`}var n},x=1609.344,J=e=>e?.meters??"m",V=e=>e?.kilometers??"km",Z=(e,t,r)=>t<3?((e,t,r)=>{const n=Number.parseInt(t.toString()),a=t-n,o=e<0?"-":"";if(a<.125)return`${o}${n} ${r}`;const i=n>0?n:"";return a<.375?`${o}${i}¼ ${r}`:a<.625?`${o}${i}½ ${r}`:a<.875?`${o}${i}¾ ${r}`:`${o}${n+1} ${r}`})(e,t,r):t<10?((e,t,r)=>{const n=Number.parseInt(t.toString()),a=t-n,o=e<0?"-":"";return a<.25?`${o}${n} ${r}`:a<.75?`${o}${n}½ ${r}`:`${o}${n+1} ${r}`})(e,t,r):`${Math.round(e)} ${r}`,j=e=>e.miles??"mi",z=(e,t)=>{const r=e/x,n=Math.abs(r);return n<.125?((e,t)=>{const r=Math.round(e/.3048),n=Math.abs(r);return n<30?`${r} ${t}`:n<500?`${10*Math.round(r/10)} ${t}`:`${100*Math.round(r/100)} ${t}`})(e,t.feet??"ft"):Z(r,n,j(t))},H=(e,t)=>{const r=e/x,n=Math.abs(r);return n<.125?((e,t)=>{const r=Math.round(e/.9144);return Math.abs(r)<10?`${Math.round(r)} ${t}`:`${10*Math.round(r/10)} ${t}`})(e,t.yards??"yd"):Z(r,n,j(t))},K=(e,t)=>{if(null==e)return"";const n={...r.instance.get().displayUnits?.distance,...t};switch(n?.type??"metric"){case"metric":return((e,t)=>{const r=Math.abs(e);if(r<10)return`${e} ${J(t)}`;if(r<500)return`${10*Math.round(e/10)} ${J(t)}`;if(r<1e3){const r=100*Math.round(e/100);return 1e3===r||-1e3===r?`${e<0?"-":""}1 ${V(t)}`:`${r} ${J(t)}`}return r<1e4?`${100*Math.round(e/100)/1e3} ${V(t)}`:`${Math.round(e/1e3)} ${V(t)}`})(e,n);case"imperial_us":return z(e,n);case"imperial_uk":return H(e,n)}};export{w as TOMTOM_USER_AGENT_SDK_NAME,r as TomTomConfig,D as asSoftWaypoint,y as avoidableTypes,I as bboxCenter,E as bboxExpandedWithBBox,A as bboxExpandedWithGeoJSON,b as bboxExpandedWithPosition,M as bboxFromBBoxes,P as bboxFromCoordsArray,T as bboxFromGeoJSON,S as bboxOnlyIfWithArea,i as chargingPointCapabilities,s as chargingPointRestrictions,o as chargingPointStatus,a as chargingStationAccessTypes,c as connectorTypes,u as currentTypes,e as defaultConfig,K as formatDistance,L as formatDuration,v as generateId,k as generateTomTomHeaders,d as geographyTypes,O as getPosition,B as getPositionStrict,N as getRoutePlanningLocationType,G as indexedMagnitudes,h as inputSectionTypes,g as inputSectionTypesWithGuidance,f as isBBoxWithArea,n as mergeFromGlobal,p as paymentMethods,l as placeTypes,_ as plugTypes,$ as sectionTypes,U as toPointFeature,C as trafficCategories,m as views};
|
|
2
2
|
//# sourceMappingURL=core.es.js.map
|
package/core/package.json
CHANGED
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "core",
|
|
3
3
|
"description": "TomTom Maps SDK JS - bundle for shared core functionalities between map and services",
|
|
4
|
-
"
|
|
5
|
-
"
|
|
4
|
+
"type": "module",
|
|
5
|
+
"exports": {
|
|
6
|
+
".": {
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"default": "./dist/core.es.js"
|
|
9
|
+
}
|
|
10
|
+
},
|
|
6
11
|
"sideEffects": false,
|
|
7
12
|
"scripts": {
|
|
8
13
|
"test": "vitest run",
|
|
@@ -12,7 +17,6 @@
|
|
|
12
17
|
"type-check": "tsc --noEmit",
|
|
13
18
|
"clean:dist": "rimraf ./dist"
|
|
14
19
|
},
|
|
15
|
-
"types": "./dist/index.d.ts",
|
|
16
20
|
"dependencies": {
|
|
17
21
|
"geojson": "^0.5.0"
|
|
18
22
|
},
|
|
@@ -21,7 +25,6 @@
|
|
|
21
25
|
},
|
|
22
26
|
"devDependencies": {
|
|
23
27
|
"@microsoft/api-extractor": "catalog:",
|
|
24
|
-
"@rollup/plugin-terser": "catalog:",
|
|
25
28
|
"@types/geojson": "catalog:",
|
|
26
29
|
"@types/lodash-es": "catalog:",
|
|
27
30
|
"@vitest/coverage-v8": "catalog:",
|
package/map/dist/THIRD_PARTY.txt
CHANGED
package/map/dist/index.d.ts
CHANGED
|
@@ -824,7 +824,13 @@ export declare class BaseMapModule extends AbstractMapModule<BaseSourceAndLayers
|
|
|
824
824
|
*
|
|
825
825
|
* @group Base Map
|
|
826
826
|
*/
|
|
827
|
-
export declare type BaseMapModuleConfig =
|
|
827
|
+
export declare type BaseMapModuleConfig = {
|
|
828
|
+
/**
|
|
829
|
+
* Controls the visibility of all layers associated with this module.
|
|
830
|
+
*
|
|
831
|
+
* @default true
|
|
832
|
+
*/
|
|
833
|
+
visible?: boolean;
|
|
828
834
|
/**
|
|
829
835
|
* Optional visibility configuration for specific layer groups.
|
|
830
836
|
*
|
|
@@ -2325,7 +2331,13 @@ export declare const FINISH_INDEX = "finish";
|
|
|
2325
2331
|
*
|
|
2326
2332
|
* @group Traffic Flow
|
|
2327
2333
|
*/
|
|
2328
|
-
export declare type FlowConfig =
|
|
2334
|
+
export declare type FlowConfig = {
|
|
2335
|
+
/**
|
|
2336
|
+
* Controls the visibility of the traffic flow layers.
|
|
2337
|
+
*
|
|
2338
|
+
* @default false
|
|
2339
|
+
*/
|
|
2340
|
+
visible?: boolean;
|
|
2329
2341
|
/**
|
|
2330
2342
|
* Filter configuration for traffic flow data.
|
|
2331
2343
|
*
|
|
@@ -3183,7 +3195,6 @@ export declare class HillshadeModule extends AbstractMapModule<HillshadeSourcesW
|
|
|
3183
3195
|
* Auto-add to style if missing:
|
|
3184
3196
|
* ```typescript
|
|
3185
3197
|
* const hillshade = await HillshadeModule.get(map, {
|
|
3186
|
-
* ensureAddedToStyle: true,
|
|
3187
3198
|
* visible: true
|
|
3188
3199
|
* });
|
|
3189
3200
|
* ```
|
|
@@ -3196,7 +3207,7 @@ export declare class HillshadeModule extends AbstractMapModule<HillshadeSourcesW
|
|
|
3196
3207
|
* });
|
|
3197
3208
|
* ```
|
|
3198
3209
|
*/
|
|
3199
|
-
static get(map: TomTomMap, config?:
|
|
3210
|
+
static get(map: TomTomMap, config?: HillshadeModuleConfig): Promise<HillshadeModule>;
|
|
3200
3211
|
private constructor();
|
|
3201
3212
|
/**
|
|
3202
3213
|
* @ignore
|
|
@@ -3207,7 +3218,7 @@ export declare class HillshadeModule extends AbstractMapModule<HillshadeSourcesW
|
|
|
3207
3218
|
/**
|
|
3208
3219
|
* @ignore
|
|
3209
3220
|
*/
|
|
3210
|
-
protected _applyConfig(config: HillshadeModuleConfig | undefined):
|
|
3221
|
+
protected _applyConfig(config: HillshadeModuleConfig | undefined): HillshadeModuleConfig | undefined;
|
|
3211
3222
|
/**
|
|
3212
3223
|
* Sets the visibility of the hillshade layer.
|
|
3213
3224
|
*
|
|
@@ -3262,14 +3273,12 @@ export declare class HillshadeModule extends AbstractMapModule<HillshadeSourcesW
|
|
|
3262
3273
|
* Configuration options for the HillshadeModule.
|
|
3263
3274
|
*
|
|
3264
3275
|
* Controls the appearance and visibility of terrain shading on the map.
|
|
3265
|
-
* Extends {@link StyleModuleConfig} with hillshade-specific settings.
|
|
3266
3276
|
*
|
|
3267
3277
|
* @remarks
|
|
3268
3278
|
* The HillshadeModule uses vector tile elevation data to create shadow/highlight
|
|
3269
3279
|
* effects that enhance the 3D perception of terrain features like mountains and valleys.
|
|
3270
3280
|
*
|
|
3271
3281
|
* **Configuration Options:**
|
|
3272
|
-
* All options are inherited from StyleModuleConfig:
|
|
3273
3282
|
* - `visible`: Whether the hillshade layer is shown or hidden
|
|
3274
3283
|
*
|
|
3275
3284
|
* **Visual Effect:**
|
|
@@ -3292,7 +3301,14 @@ export declare class HillshadeModule extends AbstractMapModule<HillshadeSourcesW
|
|
|
3292
3301
|
*
|
|
3293
3302
|
* @group Hillshade
|
|
3294
3303
|
*/
|
|
3295
|
-
export declare type HillshadeModuleConfig =
|
|
3304
|
+
export declare type HillshadeModuleConfig = {
|
|
3305
|
+
/**
|
|
3306
|
+
* Controls the visibility of the hillshade layers.
|
|
3307
|
+
*
|
|
3308
|
+
* @default false
|
|
3309
|
+
*/
|
|
3310
|
+
visible?: boolean;
|
|
3311
|
+
};
|
|
3296
3312
|
|
|
3297
3313
|
/**
|
|
3298
3314
|
* IDs of sources and layers for hillshade module.
|
|
@@ -3371,7 +3387,13 @@ export declare type IncidentCategory = (typeof incidentCategories)[number];
|
|
|
3371
3387
|
*
|
|
3372
3388
|
* @group Traffic Incidents
|
|
3373
3389
|
*/
|
|
3374
|
-
export declare type IncidentsCommonConfig =
|
|
3390
|
+
export declare type IncidentsCommonConfig = {
|
|
3391
|
+
/**
|
|
3392
|
+
* Controls the visibility of the traffic incident layers.
|
|
3393
|
+
*
|
|
3394
|
+
* @default false
|
|
3395
|
+
*/
|
|
3396
|
+
visible?: boolean;
|
|
3375
3397
|
/**
|
|
3376
3398
|
* Filter configuration for traffic incidents.
|
|
3377
3399
|
*
|
|
@@ -5194,7 +5216,13 @@ export declare class POIsModule extends AbstractMapModule<PoIsSourcesAndLayers,
|
|
|
5194
5216
|
*
|
|
5195
5217
|
* @group POIs
|
|
5196
5218
|
*/
|
|
5197
|
-
export declare type POIsModuleConfig =
|
|
5219
|
+
export declare type POIsModuleConfig = {
|
|
5220
|
+
/**
|
|
5221
|
+
* Controls the visibility of the POI layers.
|
|
5222
|
+
*
|
|
5223
|
+
* @default true
|
|
5224
|
+
*/
|
|
5225
|
+
visible?: boolean;
|
|
5198
5226
|
/**
|
|
5199
5227
|
* Optional filters for controlling which POI categories are displayed.
|
|
5200
5228
|
*
|
|
@@ -6388,9 +6416,12 @@ export declare type StandardStyle = {
|
|
|
6388
6416
|
id?: StandardStyleID;
|
|
6389
6417
|
/**
|
|
6390
6418
|
* Modules to include when loading the style.
|
|
6419
|
+
* * Use this to selectively enable only needed modules for better performance.
|
|
6391
6420
|
*
|
|
6392
6421
|
* If not specified, all available modules are included by default.
|
|
6393
|
-
*
|
|
6422
|
+
* If an empty array is provided, no optional modules will be included.
|
|
6423
|
+
*
|
|
6424
|
+
* @default All available modules
|
|
6394
6425
|
*
|
|
6395
6426
|
* @remarks
|
|
6396
6427
|
* Available modules:
|
|
@@ -6405,6 +6436,9 @@ export declare type StandardStyle = {
|
|
|
6405
6436
|
*
|
|
6406
6437
|
* // Include only hillshade
|
|
6407
6438
|
* include: ['hillshade']
|
|
6439
|
+
*
|
|
6440
|
+
* // Include no optional modules
|
|
6441
|
+
* include: []
|
|
6408
6442
|
* ```
|
|
6409
6443
|
*/
|
|
6410
6444
|
include?: StyleModule[];
|
|
@@ -6639,98 +6673,14 @@ export declare type StyleInput = StandardStyleID | (StandardStyle & {
|
|
|
6639
6673
|
*
|
|
6640
6674
|
* @group Map Style
|
|
6641
6675
|
*/
|
|
6642
|
-
export declare type StyleModule =
|
|
6676
|
+
export declare type StyleModule = (typeof styleModules)[number];
|
|
6643
6677
|
|
|
6644
6678
|
/**
|
|
6645
|
-
*
|
|
6646
|
-
*
|
|
6647
|
-
* @remarks
|
|
6648
|
-
* This is the base type extended by all Maps SDK modules that rely on vector tile
|
|
6649
|
-
* sources and layers in the loaded map style (e.g., BaseMapModule, TrafficModule,
|
|
6650
|
-
* POIsModule).
|
|
6651
|
-
*
|
|
6652
|
-
* Runtime configuration properties defined here can be updated after module
|
|
6653
|
-
* initialization using the module's `updateConfig()` method.
|
|
6679
|
+
* Array of all available style modules.
|
|
6654
6680
|
*
|
|
6655
6681
|
* @group Map Style
|
|
6656
6682
|
*/
|
|
6657
|
-
export declare
|
|
6658
|
-
/**
|
|
6659
|
-
* Controls the visibility of all layers associated with this module.
|
|
6660
|
-
*
|
|
6661
|
-
* @remarks
|
|
6662
|
-
* This property can be updated at runtime using the module's `updateConfig()` method.
|
|
6663
|
-
* All layers belonging to the module will be shown or hidden accordingly.
|
|
6664
|
-
*
|
|
6665
|
-
* @default true
|
|
6666
|
-
*
|
|
6667
|
-
* @example
|
|
6668
|
-
* ```typescript
|
|
6669
|
-
* // Hide traffic layers
|
|
6670
|
-
* trafficModule.updateConfig({ visible: false });
|
|
6671
|
-
*
|
|
6672
|
-
* // Show traffic layers
|
|
6673
|
-
* trafficModule.updateConfig({ visible: true });
|
|
6674
|
-
* ```
|
|
6675
|
-
*/
|
|
6676
|
-
visible?: boolean;
|
|
6677
|
-
};
|
|
6678
|
-
|
|
6679
|
-
/**
|
|
6680
|
-
* Initialization configuration for style-based map modules.
|
|
6681
|
-
*
|
|
6682
|
-
* @remarks
|
|
6683
|
-
* This type controls how modules handle missing style components during initialization.
|
|
6684
|
-
* Use `ensureAddedToStyle` to dynamically load missing sources and layers, or leave it
|
|
6685
|
-
* false to fail fast if required style components are missing.
|
|
6686
|
-
*
|
|
6687
|
-
* @group Map Style
|
|
6688
|
-
*/
|
|
6689
|
-
export declare type StyleModuleInitConfig = {
|
|
6690
|
-
/**
|
|
6691
|
-
* Controls whether the module will automatically add missing sources and layers to the style.
|
|
6692
|
-
*
|
|
6693
|
-
* @remarks
|
|
6694
|
-
* **When `true`:**
|
|
6695
|
-
* - The module ensures all required sources and layers are present in the style
|
|
6696
|
-
* - If any are missing, the style will be **reloaded** with the missing components
|
|
6697
|
-
* - Useful for lazy-loading modules to optimize initial map load time
|
|
6698
|
-
*
|
|
6699
|
-
* **When `false`:**
|
|
6700
|
-
* - The module expects all required sources and layers to already be in the style
|
|
6701
|
-
* - Throws an error if any required components are missing
|
|
6702
|
-
* - Provides faster initialization with clear error messages
|
|
6703
|
-
*
|
|
6704
|
-
* **Warning:** If you set this to `true` and have added custom sources or layers
|
|
6705
|
-
* to the style, you must listen to the style change event and re-add them, as the
|
|
6706
|
-
* style reload will remove your custom additions.
|
|
6707
|
-
*
|
|
6708
|
-
* @default false
|
|
6709
|
-
*
|
|
6710
|
-
* @example
|
|
6711
|
-
* ```typescript
|
|
6712
|
-
* // Lazy-load traffic module after map initialization
|
|
6713
|
-
* const trafficModule = await map.addModule(tt.TrafficModule, {
|
|
6714
|
-
* ensureAddedToStyle: true,
|
|
6715
|
-
* visible: true
|
|
6716
|
-
* });
|
|
6717
|
-
*
|
|
6718
|
-
* // Require traffic to be in initial style (fail fast if missing)
|
|
6719
|
-
* const trafficModule = await map.addModule(tt.TrafficModule, {
|
|
6720
|
-
* ensureAddedToStyle: false,
|
|
6721
|
-
* visible: true
|
|
6722
|
-
* });
|
|
6723
|
-
*
|
|
6724
|
-
* // Handle custom layers when using ensureAddedToStyle
|
|
6725
|
-
* map.on('style.load', () => {
|
|
6726
|
-
* // Re-add your custom sources and layers here
|
|
6727
|
-
* map.addSource('my-custom-source', { ... });
|
|
6728
|
-
* map.addLayer({ id: 'my-custom-layer', ... });
|
|
6729
|
-
* });
|
|
6730
|
-
* ```
|
|
6731
|
-
*/
|
|
6732
|
-
ensureAddedToStyle?: boolean;
|
|
6733
|
-
};
|
|
6683
|
+
export declare const styleModules: readonly ["trafficIncidents", "trafficFlow", "hillshade"];
|
|
6734
6684
|
|
|
6735
6685
|
/**
|
|
6736
6686
|
* Source with layers which are coming from the downloaded TT map style.
|
|
@@ -7664,7 +7614,6 @@ export declare type TrafficFlowFilters = {
|
|
|
7664
7614
|
*
|
|
7665
7615
|
* // Get module (auto-add to style if needed)
|
|
7666
7616
|
* const trafficFlow = await TrafficFlowModule.get(map, {
|
|
7667
|
-
* ensureAddedToStyle: true,
|
|
7668
7617
|
* visible: true
|
|
7669
7618
|
* });
|
|
7670
7619
|
*
|
|
@@ -7743,7 +7692,6 @@ export declare class TrafficFlowModule extends AbstractMapModule<TrafficFlowSour
|
|
|
7743
7692
|
* Auto-add to style:
|
|
7744
7693
|
* ```typescript
|
|
7745
7694
|
* const trafficFlow = await TrafficFlowModule.get(map, {
|
|
7746
|
-
* ensureAddedToStyle: true,
|
|
7747
7695
|
* visible: true,
|
|
7748
7696
|
* filters: {
|
|
7749
7697
|
* any: [{
|
|
@@ -7756,7 +7704,7 @@ export declare class TrafficFlowModule extends AbstractMapModule<TrafficFlowSour
|
|
|
7756
7704
|
* });
|
|
7757
7705
|
* ```
|
|
7758
7706
|
*/
|
|
7759
|
-
static get(map: TomTomMap, config?:
|
|
7707
|
+
static get(map: TomTomMap, config?: FlowConfig): Promise<TrafficFlowModule>;
|
|
7760
7708
|
private constructor();
|
|
7761
7709
|
/**
|
|
7762
7710
|
* @ignore
|
|
@@ -7993,7 +7941,6 @@ export declare type TrafficIncidentsFilters = {
|
|
|
7993
7941
|
*
|
|
7994
7942
|
* // Get module (auto-add to style if needed)
|
|
7995
7943
|
* const incidents = await TrafficIncidentsModule.get(map, {
|
|
7996
|
-
* ensureAddedToStyle: true,
|
|
7997
7944
|
* visible: true
|
|
7998
7945
|
* });
|
|
7999
7946
|
*
|
|
@@ -8104,7 +8051,6 @@ export declare class TrafficIncidentsModule extends AbstractMapModule<TrafficInc
|
|
|
8104
8051
|
* With configuration:
|
|
8105
8052
|
* ```typescript
|
|
8106
8053
|
* const incidents = await TrafficIncidentsModule.get(map, {
|
|
8107
|
-
* ensureAddedToStyle: true,
|
|
8108
8054
|
* visible: true,
|
|
8109
8055
|
* icons: { visible: true },
|
|
8110
8056
|
* filters: {
|
|
@@ -8118,7 +8064,7 @@ export declare class TrafficIncidentsModule extends AbstractMapModule<TrafficInc
|
|
|
8118
8064
|
* });
|
|
8119
8065
|
* ```
|
|
8120
8066
|
*/
|
|
8121
|
-
static get(map: TomTomMap, config?:
|
|
8067
|
+
static get(map: TomTomMap, config?: IncidentsConfig): Promise<TrafficIncidentsModule>;
|
|
8122
8068
|
private constructor();
|
|
8123
8069
|
/**
|
|
8124
8070
|
* @ignore
|