@tomtom-org/maps-sdk-plugin-viewport-places 0.3.0 → 0.4.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/index.d.ts CHANGED
@@ -78,6 +78,7 @@ export declare class ViewportPlaces {
78
78
  * @param map - The TomTom map instance to attach place modules to.
79
79
  */
80
80
  constructor(map: TomTomMap);
81
+ private getRegisteredModule;
81
82
  /**
82
83
  * Performs the update logic for a registered PlacesModule, cancelling whatever search that
83
84
  * module still has in flight.
@@ -112,10 +113,9 @@ export declare class ViewportPlaces {
112
113
  }): Promise<PlacesModule>;
113
114
  /**
114
115
  * Removes a specific place module by its ID, stopping its updates and clearing the displayed places.
115
- * @remarks
116
- * If the id does not exist, an error is logged into console.
117
116
  *
118
117
  * @param id - The unique identifier of the PlacesModule to remove.
118
+ * @throws Error if the place module with the given ID does not exist.
119
119
  */
120
120
  remove(id: string): void;
121
121
  /**
package/dist/index.es.js CHANGED
@@ -1,2 +1,2 @@
1
- import{generateId as o}from"@tomtom-org/maps-sdk/core";import{PlacesModule as e}from"@tomtom-org/maps-sdk/map";import{SDKAbortError as s,search as t}from"@tomtom-org/maps-sdk/services";var i=class{map;registeredModules={};mapLibreMap;constructor(o){this.map=o,this.mapLibreMap=o.mapLibreMap}async searchAndDisplay(o){const e=this.registeredModules[o];if(!e)return;const{placesModule:i,options:r}=e;e.controller?.abort();const a=this.mapLibreMap.getZoom();if(r.minZoom&&a<r.minZoom||r.maxZoom&&a>r.maxZoom)return void(await i.clear());const n=new AbortController;e.controller=n;try{const o=await t({geoBias:{boundingBox:this.map.getBBox()},limit:100,...r.searchOptions,signal:n.signal});if(n.signal.aborted)return;await i.show(o)}catch(l){if(l instanceof s)return;throw l}}async add(s){const t=s.id??o(),i={...s,placesModuleConfig:{theme:"base-map",...s.placesModuleConfig}},r=await e.create(this.map,i.placesModuleConfig),a=()=>this.searchAndDisplay(t),n=this.mapLibreMap.on("moveend",a);return this.registeredModules[t]={placesModule:r,subscription:n,options:i},await a(),r}async addPOICategories(o){return this.add({...o,searchOptions:{poiCategories:o.categories}})}remove(o){const e=this.registeredModules[o];e?(e.controller?.abort(),e.placesModule.clear(),e.subscription.unsubscribe(),delete this.registeredModules[o]):console.error(`Viewport places module ${o} not found`)}removeAll(){Object.keys(this.registeredModules).forEach(o=>this.remove(o))}async update(o){const e=this.registeredModules[o.id];if(!e)throw new Error(`Place module with id ${o.id} not found`);const s=e.options;e.options={...s,...o,searchOptions:{...s.searchOptions,...o.searchOptions},placesModuleConfig:{...s.placesModuleConfig,...o.placesModuleConfig}},e.placesModule.applyConfig(e.options.placesModuleConfig),await this.searchAndDisplay(o.id)}};export{i as ViewportPlaces};
1
+ import{generateId as e}from"@tomtom-org/maps-sdk/core";import{PlacesModule as o}from"@tomtom-org/maps-sdk/map";import{SDKAbortError as s,discoverPlaces as t}from"@tomtom-org/maps-sdk/services";var i=class{map;registeredModules={};mapLibreMap;constructor(e){this.map=e,this.mapLibreMap=e.mapLibreMap}getRegisteredModule(e){const o=this.registeredModules[e];if(!o)throw new Error(`Place module with id ${e} not found`);return o}async searchAndDisplay(e){const o=this.registeredModules[e];if(!o)return;const{placesModule:i,options:r}=o;o.controller?.abort();const a=this.mapLibreMap.getZoom();if(r.minZoom&&a<r.minZoom||r.maxZoom&&a>r.maxZoom)return void(await i.clear());const n=new AbortController;o.controller=n;try{const e=await t({geoBias:{boundingBox:this.map.getBBox()},limit:100,...r.searchOptions,signal:n.signal});if(n.signal.aborted)return;await i.show(e)}catch(l){if(l instanceof s)return;throw l}}async add(s){const t=s.id??e(),i={...s,placesModuleConfig:{theme:"base-map",...s.placesModuleConfig}},r=await o.create(this.map,i.placesModuleConfig),a=()=>this.searchAndDisplay(t),n=this.mapLibreMap.on("moveend",a);return this.registeredModules[t]={placesModule:r,subscription:n,options:i},await a(),r}async addPOICategories(e){return this.add({...e,searchOptions:{poiCategories:e.categories}})}remove(e){const o=this.getRegisteredModule(e);o.controller?.abort(),o.placesModule.clear(),o.subscription.unsubscribe(),delete this.registeredModules[e]}removeAll(){Object.keys(this.registeredModules).forEach(e=>this.remove(e))}async update(e){const o=this.getRegisteredModule(e.id),s=o.options;o.options={...s,...e,searchOptions:{...s.searchOptions,...e.searchOptions},placesModuleConfig:{...s.placesModuleConfig,...e.placesModuleConfig}},o.placesModule.applyConfig(o.options.placesModuleConfig),await this.searchAndDisplay(e.id)}};export{i as ViewportPlaces};
2
2
  //# sourceMappingURL=index.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.es.js","names":[],"sources":["../src/viewportPlaces.ts"],"sourcesContent":["import { generateId, POICategory } from '@tomtom-org/maps-sdk/core';\nimport { PlacesModule, type PlacesModuleConfig, TomTomMap } from '@tomtom-org/maps-sdk/map';\nimport { type FuzzySearchParams, SDKAbortError, search } from '@tomtom-org/maps-sdk/services';\nimport type { Subscription } from 'maplibre-gl';\n\n/**\n * Common Options when adding a viewport places module.\n *\n * @group Viewport Places\n */\nexport type ViewportPlacesAddCommonOptions = {\n /**\n * Optional unique identifier for the viewport places module.\n *\n * @remarks\n * * If not provided, a random ID will be generated.\n * * If you need to keep updating or removing this place module later, provide a fixed ID.\n */\n id?: string;\n /**\n * Minimum zoom level at which the place module is visible.\n */\n minZoom?: number;\n /**\n * Maximum zoom level at which the place module is visible.\n */\n maxZoom?: number;\n};\n\n/**\n * Full Options when adding a viewport places module.\n *\n * @group Viewport Places\n */\nexport type ViewportPlacesAddOptions = ViewportPlacesAddCommonOptions & {\n /**\n * The search parameters to query places for this place module.\n *\n * @remarks\n * `geoBias` and `signal` are not accepted here: each module always searches the current\n * viewport and owns an `AbortSignal` so that a new search cancels the one it supersedes.\n */\n searchOptions: Omit<FuzzySearchParams, 'geoBias' | 'signal'>;\n /**\n * Optional configuration for the places module, such as styling.\n */\n placesModuleConfig?: PlacesModuleConfig;\n};\n\n/**\n * Options when updating a viewport places module.\n *\n * @group Viewport Places\n */\nexport type ViewportPlacesOptions = Omit<ViewportPlacesAddOptions, 'id'> & {\n /**\n * The unique identifier of the place module to update.\n * @remarks\n * * This ID must correspond to an existing place module added via an \"add\" method.\n */\n id: string;\n};\n\n/**\n * A class for managing dynamic searched place modules on a TomTom map.\n *\n * It leverages the SDK search service to maintain place modules that automatically\n * update and stay current as the map viewport changes.\n *\n * @group Viewport Places\n */\nexport class ViewportPlaces {\n /**\n * Internal map of registered place modules, keyed by their `id`.\n * @private\n */\n private registeredModules: Record<\n string,\n {\n options: ViewportPlacesAddOptions;\n placesModule: PlacesModule;\n subscription: Subscription;\n /** Cancels this module's in-flight search when a newer viewport supersedes it. */\n controller?: AbortController;\n }\n > = {};\n private readonly mapLibreMap;\n\n /**\n * Creates an instance of ViewportPlaces bound to a TomTom map.\n * @param map - The TomTom map instance to attach place modules to.\n */\n constructor(private readonly map: TomTomMap) {\n this.mapLibreMap = map.mapLibreMap;\n }\n\n /**\n * Performs the update logic for a registered PlacesModule, cancelling whatever search that\n * module still has in flight.\n * @param id - The unique identifier of the registered place module to refresh.\n */\n private async searchAndDisplay(id: string): Promise<void> {\n const entry = this.registeredModules[id];\n if (!entry) return;\n\n const { placesModule, options } = entry;\n\n // The previous viewport's search is stale. Must precede the zoom guard below: that path\n // clears and returns early, and a search left running would repopulate what it cleared.\n entry.controller?.abort();\n\n const zoom = this.mapLibreMap.getZoom();\n if ((options.minZoom && zoom < options.minZoom) || (options.maxZoom && zoom > options.maxZoom)) {\n await placesModule.clear();\n return;\n }\n\n const controller = new AbortController();\n entry.controller = controller;\n\n try {\n const places = await search({\n geoBias: { boundingBox: this.map.getBBox() },\n limit: 100,\n ...options.searchOptions,\n signal: controller.signal,\n });\n // Superseded between the response arriving and rendering it\n if (controller.signal.aborted) return;\n\n await placesModule.show(places);\n } catch (error) {\n if (error instanceof SDKAbortError) return;\n\n throw error;\n }\n }\n\n /**\n * Adds a PlacesModule that displays places based on fuzzy search parameters and automatically updates as the map moves.\n *\n * @remarks\n * * Each call to \"add\" creates a new place module and places it above previously added modules.\n * * Place modules are rendered bottom-up in the order they are added: the first added module is displayed at the bottom, and later modules are stacked on top of earlier ones.\n * * The default places module theme is 'base-map' unless overridden in the options.\n *\n * @param options - The options for the place module.\n * @returns A promise that resolves to the PlacesModule instance managing the module.\n */\n async add(options: ViewportPlacesAddOptions): Promise<PlacesModule> {\n const id = options.id ?? generateId();\n const effectiveOptions = {\n ...options,\n placesModuleConfig: { theme: 'base-map', ...options.placesModuleConfig } as PlacesModuleConfig,\n };\n\n const placesModule = await PlacesModule.create(this.map, effectiveOptions.placesModuleConfig);\n const searchAndDisplay = () => this.searchAndDisplay(id);\n\n const subscription = this.mapLibreMap.on('moveend', searchAndDisplay);\n this.registeredModules[id] = { placesModule, subscription, options: effectiveOptions };\n await searchAndDisplay();\n return placesModule;\n }\n\n /**\n * Adds a PlacesModule for specific POI categories that updates automatically as the map moves.\n * The POIs are shown in the same style as the base map.\n *\n * @remarks\n * * This is a convenience wrapper over `add` that configures a category-based search for a PlacesModule.\n * * Each call creates a new place module that will be stacked on top of previously added modules.\n *\n * @param options - The options for the category-based place module.\n * @returns A promise that resolves to the PlacesModule instance managing the module.\n */\n async addPOICategories(\n options: ViewportPlacesAddCommonOptions & { categories: POICategory[] },\n ): Promise<PlacesModule> {\n return this.add({\n ...options,\n searchOptions: { poiCategories: options.categories },\n });\n }\n\n /**\n * Removes a specific place module by its ID, stopping its updates and clearing the displayed places.\n * @remarks\n * If the id does not exist, an error is logged into console.\n *\n * @param id - The unique identifier of the PlacesModule to remove.\n */\n remove(id: string): void {\n const entry = this.registeredModules[id];\n if (entry) {\n entry.controller?.abort();\n entry.placesModule.clear();\n entry.subscription.unsubscribe();\n delete this.registeredModules[id];\n } else {\n console.error(`Viewport places module ${id} not found`);\n }\n }\n\n /**\n * Removes all registered place modules, stopping their updates and clearing all displayed places.\n */\n removeAll(): void {\n Object.keys(this.registeredModules).forEach((key) => this.remove(key));\n }\n\n /**\n * Updates the search and display options for an existing place module identified by its ID.\n * This will immediately apply the new options and refresh the place module accordingly.\n * @param newOptions - The new options to apply.\n * @throws Error if the place module with the given ID does not exist.\n */\n async update(newOptions: ViewportPlacesOptions): Promise<void> {\n const entry = this.registeredModules[newOptions.id];\n if (!entry) {\n throw new Error(`Place module with id ${newOptions.id} not found`);\n }\n const currentOptions = entry.options;\n\n // Update the options by merging current and new options:\n entry.options = {\n ...currentOptions,\n ...newOptions,\n // search and places display options are merged incrementally:\n searchOptions: { ...currentOptions.searchOptions, ...newOptions.searchOptions },\n placesModuleConfig: { ...currentOptions.placesModuleConfig, ...newOptions.placesModuleConfig },\n };\n // Update the places module configuration and refresh the display:\n entry.placesModule.applyConfig(entry.options.placesModuleConfig);\n await this.searchAndDisplay(newOptions.id);\n }\n}\n"],"mappings":"yLAuEA,IAAa,EAAb,MAqBiC,IAhB7B,kBASI,CAAC,EACL,YAMA,WAAA,CAAY,GAAiB,KAAA,IAAA,EACzB,KAAK,YAAc,EAAI,WAC3B,CAOA,sBAAc,CAAiB,GAC3B,MAAM,EAAQ,KAAK,kBAAkB,GACrC,IAAK,EAAO,OAEZ,MAAM,aAAE,EAAA,QAAc,GAAY,EAIlC,EAAM,YAAY,QAElB,MAAM,EAAO,KAAK,YAAY,UAC9B,GAAK,EAAQ,SAAW,EAAO,EAAQ,SAAa,EAAQ,SAAW,EAAO,EAAQ,QAElF,kBADM,EAAa,SAIvB,MAAM,EAAa,IAAI,gBACvB,EAAM,WAAa,EAEnB,IACI,MAAM,QAAe,EAAO,CACxB,QAAS,CAAE,YAAa,KAAK,IAAI,WACjC,MAAO,OACJ,EAAQ,cACX,OAAQ,EAAW,SAGvB,GAAI,EAAW,OAAO,QAAS,aAEzB,EAAa,KAAK,EAC5B,CAAA,MAAS,GACL,GAAI,aAAiB,EAAe,OAEpC,MAAM,CACV,CACJ,CAaA,SAAM,CAAI,GACN,MAAM,EAAK,EAAQ,IAAM,IACnB,EAAmB,IAClB,EACH,mBAAoB,CAAE,MAAO,cAAe,EAAQ,qBAGlD,QAAqB,EAAa,OAAO,KAAK,IAAK,EAAiB,oBACpE,EAAA,IAAyB,KAAK,iBAAiB,GAE/C,EAAe,KAAK,YAAY,GAAG,UAAW,GAGpD,OAFA,KAAK,kBAAkB,GAAM,CAAE,eAAc,eAAc,QAAS,SAC9D,IACC,CACX,CAaA,sBAAM,CACF,GAEA,OAAO,KAAK,IAAI,IACT,EACH,cAAe,CAAE,cAAe,EAAQ,aAEhD,CASA,MAAA,CAAO,GACH,MAAM,EAAQ,KAAK,kBAAkB,GACjC,GACA,EAAM,YAAY,QAClB,EAAM,aAAa,QACnB,EAAM,aAAa,qBACZ,KAAK,kBAAkB,IAE9B,QAAQ,MAAM,0BAA0B,cAEhD,CAKA,SAAA,GACI,OAAO,KAAK,KAAK,mBAAmB,QAAS,GAAQ,KAAK,OAAO,GACrE,CAQA,YAAM,CAAO,GACT,MAAM,EAAQ,KAAK,kBAAkB,EAAW,IAChD,IAAK,EACD,MAAM,IAAI,MAAM,wBAAwB,EAAW,gBAEvD,MAAM,EAAiB,EAAM,QAG7B,EAAM,QAAU,IACT,KACA,EAEH,cAAe,IAAK,EAAe,iBAAkB,EAAW,eAChE,mBAAoB,IAAK,EAAe,sBAAuB,EAAW,qBAG9E,EAAM,aAAa,YAAY,EAAM,QAAQ,0BACvC,KAAK,iBAAiB,EAAW,GAC3C"}
1
+ {"version":3,"file":"index.es.js","names":["generateId","PlacesModule","SDKAbortError","discoverPlaces","ViewportPlaces","map","registeredModules","mapLibreMap","constructor","this","getRegisteredModule","id","entry","Error","searchAndDisplay","placesModule","options","controller","abort","zoom","getZoom","minZoom","maxZoom","clear","AbortController","places","geoBias","boundingBox","getBBox","limit","searchOptions","signal","aborted","show","error","add","effectiveOptions","placesModuleConfig","theme","create","subscription","on","addPOICategories","poiCategories","categories","remove","unsubscribe","removeAll","Object","keys","forEach","key","update","newOptions","currentOptions","applyConfig"],"sources":["../src/viewportPlaces.ts"],"sourcesContent":["import { generateId, POICategory } from '@tomtom-org/maps-sdk/core';\nimport { PlacesModule, type PlacesModuleConfig, TomTomMap } from '@tomtom-org/maps-sdk/map';\nimport { discoverPlaces, type FuzzySearchParams, SDKAbortError } from '@tomtom-org/maps-sdk/services';\nimport type { Subscription } from 'maplibre-gl';\n\n/**\n * Common Options when adding a viewport places module.\n *\n * @group Viewport Places\n */\nexport type ViewportPlacesAddCommonOptions = {\n /**\n * Optional unique identifier for the viewport places module.\n *\n * @remarks\n * * If not provided, a random ID will be generated.\n * * If you need to keep updating or removing this place module later, provide a fixed ID.\n */\n id?: string;\n /**\n * Minimum zoom level at which the place module is visible.\n */\n minZoom?: number;\n /**\n * Maximum zoom level at which the place module is visible.\n */\n maxZoom?: number;\n};\n\n/**\n * Full Options when adding a viewport places module.\n *\n * @group Viewport Places\n */\nexport type ViewportPlacesAddOptions = ViewportPlacesAddCommonOptions & {\n /**\n * The search parameters to query places for this place module.\n *\n * @remarks\n * `geoBias` and `signal` are not accepted here: each module always searches the current\n * viewport and owns an `AbortSignal` so that a new search cancels the one it supersedes.\n */\n searchOptions: Omit<FuzzySearchParams, 'geoBias' | 'signal'>;\n /**\n * Optional configuration for the places module, such as styling.\n */\n placesModuleConfig?: PlacesModuleConfig;\n};\n\n/**\n * Options when updating a viewport places module.\n *\n * @group Viewport Places\n */\nexport type ViewportPlacesOptions = Omit<ViewportPlacesAddOptions, 'id'> & {\n /**\n * The unique identifier of the place module to update.\n * @remarks\n * * This ID must correspond to an existing place module added via an \"add\" method.\n */\n id: string;\n};\n\n/**\n * A class for managing dynamic searched place modules on a TomTom map.\n *\n * It leverages the SDK search service to maintain place modules that automatically\n * update and stay current as the map viewport changes.\n *\n * @group Viewport Places\n */\nexport class ViewportPlaces {\n /**\n * Internal map of registered place modules, keyed by their `id`.\n * @private\n */\n private registeredModules: Record<\n string,\n {\n options: ViewportPlacesAddOptions;\n placesModule: PlacesModule;\n subscription: Subscription;\n /** Cancels this module's in-flight search when a newer viewport supersedes it. */\n controller?: AbortController;\n }\n > = {};\n private readonly mapLibreMap;\n\n /**\n * Creates an instance of ViewportPlaces bound to a TomTom map.\n * @param map - The TomTom map instance to attach place modules to.\n */\n constructor(private readonly map: TomTomMap) {\n this.mapLibreMap = map.mapLibreMap;\n }\n\n private getRegisteredModule(id: string) {\n const entry = this.registeredModules[id];\n if (!entry) {\n throw new Error(`Place module with id ${id} not found`);\n }\n\n return entry;\n }\n\n /**\n * Performs the update logic for a registered PlacesModule, cancelling whatever search that\n * module still has in flight.\n * @param id - The unique identifier of the registered place module to refresh.\n */\n private async searchAndDisplay(id: string): Promise<void> {\n const entry = this.registeredModules[id];\n if (!entry) return;\n\n const { placesModule, options } = entry;\n\n // The previous viewport's search is stale. Must precede the zoom guard below: that path\n // clears and returns early, and a search left running would repopulate what it cleared.\n entry.controller?.abort();\n\n const zoom = this.mapLibreMap.getZoom();\n if ((options.minZoom && zoom < options.minZoom) || (options.maxZoom && zoom > options.maxZoom)) {\n await placesModule.clear();\n return;\n }\n\n const controller = new AbortController();\n entry.controller = controller;\n\n try {\n const places = await discoverPlaces({\n geoBias: { boundingBox: this.map.getBBox() },\n limit: 100,\n ...options.searchOptions,\n signal: controller.signal,\n });\n // Superseded between the response arriving and rendering it\n if (controller.signal.aborted) return;\n\n await placesModule.show(places);\n } catch (error) {\n if (error instanceof SDKAbortError) return;\n\n throw error;\n }\n }\n\n /**\n * Adds a PlacesModule that displays places based on fuzzy search parameters and automatically updates as the map moves.\n *\n * @remarks\n * * Each call to \"add\" creates a new place module and places it above previously added modules.\n * * Place modules are rendered bottom-up in the order they are added: the first added module is displayed at the bottom, and later modules are stacked on top of earlier ones.\n * * The default places module theme is 'base-map' unless overridden in the options.\n *\n * @param options - The options for the place module.\n * @returns A promise that resolves to the PlacesModule instance managing the module.\n */\n async add(options: ViewportPlacesAddOptions): Promise<PlacesModule> {\n const id = options.id ?? generateId();\n const effectiveOptions = {\n ...options,\n placesModuleConfig: { theme: 'base-map', ...options.placesModuleConfig } as PlacesModuleConfig,\n };\n\n const placesModule = await PlacesModule.create(this.map, effectiveOptions.placesModuleConfig);\n const searchAndDisplay = () => this.searchAndDisplay(id);\n\n const subscription = this.mapLibreMap.on('moveend', searchAndDisplay);\n this.registeredModules[id] = { placesModule, subscription, options: effectiveOptions };\n await searchAndDisplay();\n return placesModule;\n }\n\n /**\n * Adds a PlacesModule for specific POI categories that updates automatically as the map moves.\n * The POIs are shown in the same style as the base map.\n *\n * @remarks\n * * This is a convenience wrapper over `add` that configures a category-based search for a PlacesModule.\n * * Each call creates a new place module that will be stacked on top of previously added modules.\n *\n * @param options - The options for the category-based place module.\n * @returns A promise that resolves to the PlacesModule instance managing the module.\n */\n async addPOICategories(\n options: ViewportPlacesAddCommonOptions & { categories: POICategory[] },\n ): Promise<PlacesModule> {\n return this.add({\n ...options,\n searchOptions: { poiCategories: options.categories },\n });\n }\n\n /**\n * Removes a specific place module by its ID, stopping its updates and clearing the displayed places.\n *\n * @param id - The unique identifier of the PlacesModule to remove.\n * @throws Error if the place module with the given ID does not exist.\n */\n remove(id: string): void {\n const entry = this.getRegisteredModule(id);\n entry.controller?.abort();\n entry.placesModule.clear();\n entry.subscription.unsubscribe();\n delete this.registeredModules[id];\n }\n\n /**\n * Removes all registered place modules, stopping their updates and clearing all displayed places.\n */\n removeAll(): void {\n Object.keys(this.registeredModules).forEach((key) => this.remove(key));\n }\n\n /**\n * Updates the search and display options for an existing place module identified by its ID.\n * This will immediately apply the new options and refresh the place module accordingly.\n * @param newOptions - The new options to apply.\n * @throws Error if the place module with the given ID does not exist.\n */\n async update(newOptions: ViewportPlacesOptions): Promise<void> {\n const entry = this.getRegisteredModule(newOptions.id);\n const currentOptions = entry.options;\n\n // Update the options by merging current and new options:\n entry.options = {\n ...currentOptions,\n ...newOptions,\n // search and places display options are merged incrementally:\n searchOptions: { ...currentOptions.searchOptions, ...newOptions.searchOptions },\n placesModuleConfig: { ...currentOptions.placesModuleConfig, ...newOptions.placesModuleConfig },\n };\n // Update the places module configuration and refresh the display:\n entry.placesModule.applyConfig(entry.options.placesModuleConfig);\n await this.searchAndDisplay(newOptions.id);\n }\n}\n"],"mappings":"iMAuEA,IAAaI,EAAb,MAqBiCC,IAhB7BC,kBASI,CAAC,EACLC,YAMA,WAAAC,CAAYH,GAAiBI,KAAAJ,IAAAA,EACzBI,KAAKF,YAAcF,EAAIE,WAC3B,CAEA,mBAAAG,CAA4BC,GACxB,MAAMC,EAAQH,KAAKH,kBAAkBK,GACrC,IAAKC,EACD,MAAM,IAAIC,MAAM,wBAAwBF,eAG5C,OAAOC,CACX,CAOA,sBAAcE,CAAiBH,GAC3B,MAAMC,EAAQH,KAAKH,kBAAkBK,GACrC,IAAKC,EAAO,OAEZ,MAAMG,aAAEA,EAAAC,QAAcA,GAAYJ,EAIlCA,EAAMK,YAAYC,QAElB,MAAMC,EAAOV,KAAKF,YAAYa,UAC9B,GAAKJ,EAAQK,SAAWF,EAAOH,EAAQK,SAAaL,EAAQM,SAAWH,EAAOH,EAAQM,QAElF,kBADMP,EAAaQ,SAIvB,MAAMN,EAAa,IAAIO,gBACvBZ,EAAMK,WAAaA,EAEnB,IACI,MAAMQ,QAAetB,EAAe,CAChCuB,QAAS,CAAEC,YAAalB,KAAKJ,IAAIuB,WACjCC,MAAO,OACJb,EAAQc,cACXC,OAAQd,EAAWc,SAGvB,GAAId,EAAWc,OAAOC,QAAS,aAEzBjB,EAAakB,KAAKR,EAC5B,CAAA,MAASS,GACL,GAAIA,aAAiBhC,EAAe,OAEpC,MAAMgC,CACV,CACJ,CAaA,SAAMC,CAAInB,GACN,MAAML,EAAKK,EAAQL,IAAMX,IACnBoC,EAAmB,IAClBpB,EACHqB,mBAAoB,CAAEC,MAAO,cAAetB,EAAQqB,qBAGlDtB,QAAqBd,EAAasC,OAAO9B,KAAKJ,IAAK+B,EAAiBC,oBACpEvB,EAAA,IAAyBL,KAAKK,iBAAiBH,GAE/C6B,EAAe/B,KAAKF,YAAYkC,GAAG,UAAW3B,GAGpD,OAFAL,KAAKH,kBAAkBK,GAAM,CAAEI,eAAcyB,eAAcxB,QAASoB,SAC9DtB,IACCC,CACX,CAaA,sBAAM2B,CACF1B,GAEA,OAAOP,KAAK0B,IAAI,IACTnB,EACHc,cAAe,CAAEa,cAAe3B,EAAQ4B,aAEhD,CAQA,MAAAC,CAAOlC,GACH,MAAMC,EAAQH,KAAKC,oBAAoBC,GACvCC,EAAMK,YAAYC,QAClBN,EAAMG,aAAaQ,QACnBX,EAAM4B,aAAaM,qBACZrC,KAAKH,kBAAkBK,EAClC,CAKA,SAAAoC,GACIC,OAAOC,KAAKxC,KAAKH,mBAAmB4C,QAASC,GAAQ1C,KAAKoC,OAAOM,GACrE,CAQA,YAAMC,CAAOC,GACT,MAAMzC,EAAQH,KAAKC,oBAAoB2C,EAAW1C,IAC5C2C,EAAiB1C,EAAMI,QAG7BJ,EAAMI,QAAU,IACTsC,KACAD,EAEHvB,cAAe,IAAKwB,EAAexB,iBAAkBuB,EAAWvB,eAChEO,mBAAoB,IAAKiB,EAAejB,sBAAuBgB,EAAWhB,qBAG9EzB,EAAMG,aAAawC,YAAY3C,EAAMI,QAAQqB,0BACvC5B,KAAKK,iBAAiBuC,EAAW1C,GAC3C"}
package/package.json CHANGED
@@ -2,23 +2,23 @@
2
2
  "name": "@tomtom-org/maps-sdk-plugin-viewport-places",
3
3
  "author": "TomTom International B.V.",
4
4
  "license": "See in LICENSE.txt",
5
- "version": "0.3.0",
5
+ "version": "0.4.0",
6
6
  "type": "module",
7
7
  "description": "Plugin to leverage search to show places on the current viewport that refresh as the map moves",
8
8
  "types": "dist/index.d.ts",
9
9
  "peerDependencies": {
10
- "@tomtom-org/maps-sdk": ">=0.56.0 <1.0.0"
10
+ "@tomtom-org/maps-sdk": ">=0.58.0 <1.0.0"
11
11
  },
12
12
  "devDependencies": {
13
13
  "@tsconfig/recommended": "^1.0.13",
14
- "@types/node": "^26.3.0",
14
+ "@types/node": "^26.6.2",
15
15
  "@vitest/coverage-v8": "^4.1.11",
16
- "rolldown": "^1.2.5",
16
+ "rolldown": "^1.2.11",
17
17
  "ts-node": "^10.9.2",
18
18
  "typescript": "^6.0.3",
19
- "vite": "^8.2.2",
19
+ "vite": "^8.3.1",
20
20
  "vitest": "^4.1.11",
21
- "@tomtom-org/maps-sdk": "0.56.0"
21
+ "@tomtom-org/maps-sdk": "0.58.0"
22
22
  },
23
23
  "files": [
24
24
  "dist",