@bdh-gis/mapbox-gl-back
v1.5.0
Published
Back for mapbox controls
Downloads
24
Readme
🏷️ @bdh-gis/mapbox-gl-back
返回
npm i @bdh-gis/mapbox-gl-back
import Back from '@bdh-gis/mapbox-gl-back';
import '@bdh-gis/mapbox-gl-back/src/index.css';
map.addControl(new Back({
location: [number, number, number, number]
}));
或者
map.addControl(new Back(
location: {
center: [number, number],
zoom: number,
bearing: number,
pitch: number,
duration: number
}
));
Options
export type AnyEvent = 'CONTROL_BUTTON_CLICK' | 'CREATE_BUTTONS';
export type Location = {
center?: [number, number];
zoom?: number;
bearing?: number;
pitch?: number;
bounds?: [number, number, number, number];
duration?: number;
};
export type Options = {
location?: Location;
isCreateButtons?: boolean;
buttons?: Utils.ButtonOptions[];
onEvents?: (event: AnyEvent, data?: any) => void;
};