UNPKG

nuxt-mapbox

Version:

Elegant Mapbox GL JS integration with Nuxt

28 lines (27 loc) 1.49 kB
import { type Ref } from '#imports'; import { type MarkerOptions, Marker } from 'mapbox-gl'; /** * Create a new Marker instance for a component. Will be automatically added to map if it is nested in MapboxMap * * This overload adds the passed template ref to the marker. It has to pass a Ref since the Marker instance has to be created after html is mounted * * You should set the marker properties through the callback, since you cannot normally access it before it is attached to map. * * @param markerHTML Optionally pass a template ref to automatically put html inside marker * @param mapID Optionally pass the mapID manually. Will be auto injected if component is nested in MapboxMap */ export declare function defineMapboxMarker(markerID: string, options: MarkerOptions & { lnglat: mapboxgl.LngLatLike; } | Ref<MarkerOptions & { lnglat: mapboxgl.LngLatLike; }>, markerHTML: Ref<HTMLElement | null>, callback?: (marker: Marker) => void, mapID?: string): Ref<Marker | undefined>; /** * Create a new Marker instance for a component. Will be automatically added to map if it is nested in MapboxMap * * @param mapID Optionally pass the mapID manually. Will be auto injected if component is nested in MapboxMap */ export declare function defineMapboxMarker(markerID: string, options: MarkerOptions & { lnglat: mapboxgl.LngLatLike; } | Ref<MarkerOptions & { lnglat: mapboxgl.LngLatLike; }>, markerHTML?: undefined, callback?: undefined, mapID?: string): Marker;