From 8ee39b63c3687257a992773a0d42559a678e0618 Mon Sep 17 00:00:00 2001 From: lvisei Date: Wed, 22 Jun 2022 10:59:15 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E9=80=8F=E5=87=BA=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B=E5=AE=9A=E4=B9=89=20(#1156)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/component/src/css/l7.css | 2 +- packages/component/src/index.ts | 23 ++++++++++++++++++----- packages/component/src/markerlayer.ts | 6 ++++-- 3 files changed, 23 insertions(+), 8 deletions(-) diff --git a/packages/component/src/css/l7.css b/packages/component/src/css/l7.css index b7e09ea077..79ef9405b2 100644 --- a/packages/component/src/css/l7.css +++ b/packages/component/src/css/l7.css @@ -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, diff --git a/packages/component/src/index.ts b/packages/component/src/index.ts index 8e991a7e6f..33e70454ef 100644 --- a/packages/component/src/index.ts +++ b/packages/component/src/index.ts @@ -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, +}; diff --git a/packages/component/src/markerlayer.ts b/packages/component/src/markerlayer.ts index ed9901a92f..ca7b81b2dd 100644 --- a/packages/component/src/markerlayer.ts +++ b/packages/component/src/markerlayer.ts @@ -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; } @@ -39,6 +40,7 @@ interface IPointFeature { }; properties: any; } + export default class MarkerLayer extends EventEmitter { private markers: IMarker[] = []; private markerLayerOption: IMarkerLayerOption;