import Component from '@glimmer/component'; import MapboxGlControl from '@prysmex-engineering/ember-mapbox-gl/helpers/mapbox-gl-control'; import MapboxGlOn from '@prysmex-engineering/ember-mapbox-gl/helpers/mapbox-gl-on'; import MapboxGlTerrain from '@prysmex-engineering/ember-mapbox-gl/helpers/mapbox-gl-terrain'; import MapboxLoader from '../../-private/mapbox-loader'; import MapboxGlLayer from './layer'; import MapboxGlMarker from './marker'; import MapboxGlPopup from './popup'; import MapboxGlSource from './source'; import type { WithBoundArgs } from '@glint/template'; import type MapCacheService from '@prysmex-engineering/ember-mapbox-gl/services/map-cache'; import type { Map as MapboxMap, MapOptions } from 'mapbox-gl'; /** * Component that creates a new [mapbox-gl-js instance](https://www.mapbox.com/mapbox-gl-js/api/#map): * * ```hbs * * * * ``` * * @class MapboxGL * * An options hash to pass on to the [mapbox-gl-js instance](https://www.mapbox.com/mapbox-gl-js/api/). * This is only used during map construction, and updates will have no effect. * @argument {Object} initOptions * * An action function to call when the map has finished loading. Note that the component does not yield until the map has loaded, * so this is the only way to listen for the mapbox load event. * @argument {function} mapLoaded * * Key use to identify the map on the map cache * Only when specified, the map instance and its HTML element is cached on the map-cache service * When map is cached, the next time the same map is rendered it will load instantly the exact way it was left * Useful when rerending a map with large amounts of data, like layers with big geojsons * Note: Not recommended when rendering multiple times the same map at the same time * @argument {string} cacheKey * * @yield {Hash} map * @yield {Component} map.control * @yield {Component} map.layer * @yield {Component} map.marker * @yield {Component} map.on * @yield {Component} map.popup * @yield {Component} map.source */ export interface MapboxGlArgs { initOptions?: Partial; mapLoaded?: (map: MapboxMap) => void; mapReloaded?: (map: MapboxMap, metadata: object) => void; cacheKey?: string | false; cacheMetadata?: object; } export interface MapboxGlYield { instance: MapboxMap | undefined; cache: boolean; on: WithBoundArgs; terrain: WithBoundArgs; control: WithBoundArgs; source: WithBoundArgs; layer: WithBoundArgs; marker: WithBoundArgs; popup: WithBoundArgs; } export interface MapboxGlSignature { Args: MapboxGlArgs; Element: HTMLDivElement; Blocks: { default: [MapboxGlYield]; else: [Error]; }; } export default class MapboxGlComponent extends Component { mapCache: MapCacheService; _loader: MapboxLoader | undefined; _cacheKey: string | false; _wrapperElement: HTMLDivElement | undefined; get shouldCache(): boolean; get cacheKey(): string; loadMap: (element: HTMLDivElement) => void; mapLoaded: (map: MapboxMap) => void; willDestroy(): void; } //# sourceMappingURL=index.d.ts.map