chore: 透出组件类型定义 (#1156)

This commit is contained in:
lvisei 2022-06-22 10:59:15 +08:00 committed by GitHub
parent 4a86642405
commit 8ee39b63c3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 23 additions and 8 deletions

View File

@ -238,7 +238,7 @@
/* general toolbar styles */
.l7-bar {
box-shadow: 0 1px 5px rgba(0, 0, 0, 0.65);
box-shadow: 0 0 1px rgba(0, 0, 0, 0.3);
border-radius: 4px;
}
.l7-bar a,

View File

@ -1,14 +1,27 @@
import Control from './control/BaseControl';
import Layers from './control/layer';
import Layers, { ILayerControlOption } from './control/layer';
import Logo from './control/logo';
import Scale from './control/scale';
import Zoom from './control/zoom';
import Scale, { IScaleControlOption } from './control/scale';
import Zoom, { IZoomControlOption } from './control/zoom';
import Marker from './marker';
import MarkerLayer from './markerlayer';
import MarkerLayer, { IMarkerLayerOption } from './markerlayer';
import Popup from './popup';
// 引入样式
// TODO: 使用 Less 或者 Sass每个组件单独引用自身样式
import './css/l7.css';
export { Control, Logo, Scale, Zoom, Layers, Marker, Popup, MarkerLayer };
export {
Control,
Logo,
Scale,
IScaleControlOption,
Zoom,
IZoomControlOption,
Layers,
ILayerControlOption,
Marker,
Popup,
MarkerLayer,
IMarkerLayerOption,
};

View File

@ -14,8 +14,9 @@ import { merge } from 'lodash';
// tslint:disable-next-line:no-submodule-imports
import Supercluster from 'supercluster/dist/supercluster';
import Marker from './marker';
type CallBack = (...args: any[]) => any;
interface IMarkerStyleOption {
export interface IMarkerStyleOption {
element?: CallBack;
style: { [key: string]: any } | CallBack;
className: string;
@ -27,7 +28,7 @@ interface IMarkerStyleOption {
zoom: number;
}
interface IMarkerLayerOption {
export interface IMarkerLayerOption {
cluster: boolean;
clusterOption: Partial<IMarkerStyleOption>;
}
@ -39,6 +40,7 @@ interface IPointFeature {
};
properties: any;
}
export default class MarkerLayer extends EventEmitter {
private markers: IMarker[] = [];
private markerLayerOption: IMarkerLayerOption;