@bdh-gis/mapbox-gl-location
v1.5.0
Published
Location for mapbox controls
Downloads
23
Readme
🏷️ @bdh-gis/mapbox-gl-location
位置栏
npm i @bdh-gis/mapbox-gl-location
import Location from '@bdh-gis/mapbox-gl-location';
import '@bdh-gis/mapbox-gl-location/src/index.css';
map.addControl(new Location({
isCreateButtons: true,
template: '经度:{lon} 纬度:{lat} 层级:{zoom}',
}));
Options
export type AnyEvent =
| 'CONTROL_BUTTON_CLICK'
| 'CREATE_BUTTONS'
| 'CREATE_PANEL'
| 'PANEL_CLOSE'
| 'MAP_ON_MOVE'
| 'MAP_OFF_MOVE'
| 'MAP_ON_MOVE_CALLBACK';
export type Panel = {
text?: string;
};
export type Options = {
isShowPanel?: boolean;
template?: string;
isCreateButtons?: boolean;
isCreatePanel?: boolean;
buttons?: Utils.ButtonOptions[];
panelContainer?: HTMLDivElement;
panel?: {
template: string;
location: {
[key: string]: string | number;
};
};
onEvents?: (event: AnyEvent, data?: any) => void;
};