Skip to content

Commit 130bf7d

Browse files
authored
allow multiple plugin installation (#247)
1 parent 3756fbb commit 130bf7d

File tree

8 files changed

+0
-40
lines changed

8 files changed

+0
-40
lines changed

src/components/animations/index.ts

-5
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,7 @@ import OlAnimationSlide from "./OlAnimationSlide.vue";
88
import OlAnimationTeleport from "./OlAnimationTeleport.vue";
99
import OlAnimationZoom from "./OlAnimationZoom.vue";
1010

11-
let installed = false;
12-
1311
function install(app: App) {
14-
if (installed) return;
15-
installed = true;
16-
1712
app.component("ol-animation-drop", OLAnimationDrop);
1813
app.component("ol-animation-fade", OlAnimationFade);
1914
app.component("ol-animation-feature", OlAnimationFeature);

src/components/geometries/index.ts

-5
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,7 @@ import OlGeomMultiPolygon from "./OlGeomMultiPolygon.vue";
77
import OlGeomPoint from "./OlGeomPoint.vue";
88
import OlGeomPolygon from "./OlGeomPolygon.vue";
99

10-
let installed = false;
11-
1210
function install(app: App) {
13-
if (installed) return;
14-
installed = true;
15-
1611
app.component("ol-geom-circle", OlGeomCircle);
1712
app.component("ol-geom-line-string", OlGeomLineString);
1813
app.component("ol-geom-multi-line-string", OlGeomMultiLineString);

src/components/interaction/index.ts

-5
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,7 @@ import OlModifyInteraction from "./OlModifyInteraction.vue";
88
import OlSnapInteraction from "./OlSnapInteraction.vue";
99
import OlTransformInteraction from "./OlTransformInteraction.vue";
1010

11-
let installed = false;
12-
1311
function install(app: App) {
14-
if (installed) return;
15-
installed = true;
16-
1712
app.component("ol-interaction-clusterselect", OlClusterSelectInteraction);
1813
app.component("ol-interaction-dragrotate", OlDragRotateInteraction);
1914
app.component("ol-interaction-dragrotatezoom", OlDragRotateZoomInteraction);

src/components/layers/index.ts

-5
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,7 @@ import OlVectorImageLayer from "./OlVectorImageLayer.vue";
1010
import OlWebglPointsLayer from "./OlWebglPointsLayer.vue";
1111
import OlWebglTileLayer from "./OlWebglTileLayer.vue";
1212

13-
let installed = false;
14-
1513
function install(app: App) {
16-
if (installed) return;
17-
installed = true;
18-
1914
app.component("ol-animated-clusterlayer", OlAnimatedClusterLayer);
2015
app.component("ol-heatmap-layer", OlHeatmapLayer);
2116
app.component("ol-image-layer", OlImageLayer);

src/components/map/index.ts

-5
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,7 @@ import OlOverlay from "./OlOverlay.vue";
66
import OlProjectionRegister from "./OlProjectionRegister.vue";
77
import OlView from "./OlView.vue";
88

9-
let installed = false;
10-
119
function install(app: App) {
12-
if (installed) return;
13-
installed = true;
14-
1510
app.component("ol-feature", OlFeature);
1611
app.component("ol-geolocation", OlGeoLocation);
1712
app.component("ol-map", OlMap);

src/components/mapControls/index.ts

-5
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,7 @@ import OlZoomControl from "./OlZoomControl.vue";
1919
import OlZoomSliderControl from "./OlZoomSliderControl.vue";
2020
import OlZoomToExtentControl from "./OlZoomToExtentControl.vue";
2121

22-
let installed = false;
23-
2422
function install(app: App) {
25-
if (installed) return;
26-
installed = true;
27-
2823
app.component("ol-attribution-control", OlAttributionControl);
2924
app.component("ol-fullscreen-control", OlFullScreenControl);
3025
app.component("ol-mouseposition-control", OlMousePositionControl);

src/components/sources/index.ts

-5
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,7 @@ import OlSourceWebglPoints from "./OlSourceWebglPoints.vue";
1515
import OlSourceXYZ from "./OlSourceXYZ.vue";
1616
import OlSourceWMTS from "./OlSourceWMTS.vue";
1717

18-
let installed = false;
19-
2018
function install(app: App) {
21-
if (installed) return;
22-
installed = true;
23-
2419
app.component("ol-source-bingmaps", OlSourceBingMaps);
2520
app.component("ol-source-cluster", OlSourceCluster);
2621
app.component("ol-source-image-static", OlSourceImageStatic);

src/components/styles/index.ts

-5
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,13 @@ import OlStyleFlowline from "./OlStyleFlowline.vue";
99
import type { FeatureLike } from "ol/Feature";
1010
import type { Style } from "ol/style";
1111

12-
let installed = false;
13-
1412
type OverrideStyleFunction = (
1513
feature: FeatureLike,
1614
currentStyle: Style,
1715
resolution: number
1816
) => Style | Style[] | void;
1917

2018
function install(app: App) {
21-
if (installed) return;
22-
installed = true;
23-
2419
app.component("ol-style", OlStyle);
2520
app.component("ol-style-circle", OlStyleCircle);
2621
app.component("ol-style-stroke", OlStyleStroke);

0 commit comments

Comments
 (0)