vue3-openlayers
Version:
OpenLayers Wrapper for Vue3
36 lines (34 loc) • 2.76 kB
TypeScript
import { default as Map } from 'ol/Map';
import { Attribution, FullScreen, MousePosition, OverviewMap, ScaleLine } from 'ol/control';
import { Options as AttributionOptions } from 'ol/control/Attribution';
import { default as Control } from 'ol/control/Control';
import { default as ContextMenu } from 'ol-contextmenu';
import { Options as OlContextmenuOptions } from 'ol-contextmenu/dist/types';
import { default as Bar, Options as BarOptions } from 'ol-ext/control/Bar';
import { default as Button, Options as ButtonOptions } from 'ol-ext/control/Button';
import { default as PrintDialog, Options as PrintDialogOptions } from 'ol-ext/control/PrintDialog';
import { default as Profile, Options as ProfileOptions } from 'ol-ext/control/Profile';
import { default as Toggle, Options as ToggleOptions } from 'ol-ext/control/Toggle';
import { default as VideoRecorder, Options as VideoRecorderOptions } from 'ol-ext/control/VideoRecorder';
import { default as LayerSwitcher, Options as LayerSwitcherOptions } from 'ol-ext/control/LayerSwitcher';
import { default as LayerSwitcherImage } from 'ol-ext/control/LayerSwitcherImage';
import { default as Rotate, Options as RotateOptions } from 'ol/control/Rotate';
import { default as Search, Options as SearchOptions } from 'ol-ext/control/Search';
import { default as Swipe, Options as SwipeOptions } from 'ol-ext/control/Swipe';
import { default as Zone, Options as MapZoneOptions } from 'ol-ext/control/MapZone';
import { default as Zoom, Options as ZoomOptions } from 'ol/control/Zoom';
import { default as ZoomSlider, Options as ZoomSliderOptions } from 'ol/control/ZoomSlider';
import { default as ZoomToExtent, Options as ZoomToExtentOptions } from 'ol/control/ZoomToExtent';
import { ComputedRef } from 'vue';
type ExtentedMap = Map & {
controls_?: Control[];
};
type InnerControlType = (Attribution | ContextMenu | Bar | Button | PrintDialog | Profile | Toggle | VideoRecorder | FullScreen | LayerSwitcher | LayerSwitcherImage | MousePosition | OverviewMap | Rotate | Search | ScaleLine | Swipe | Zone | Zoom | ZoomSlider | ZoomToExtent) & {
controls_?: Control[];
};
type InnerControlProperties = AttributionOptions | Partial<OlContextmenuOptions> | BarOptions | ButtonOptions | PrintDialogOptions | ProfileOptions | ToggleOptions | VideoRecorderOptions | LayerSwitcherOptions | SearchOptions | RotateOptions | SwipeOptions | MapZoneOptions | ZoomOptions | ZoomSliderOptions | ZoomToExtentOptions;
export default function useControl<T extends InnerControlType>(ControlType: new (options?: Record<string, unknown>) => T, properties: InnerControlProperties, attrs: Record<string, unknown>, eventsToHandle?: string[]): {
map: ExtentedMap | undefined;
control: ComputedRef<T>;
};
export {};