Skip to content

Commit

Permalink
feat: support PascalCase component usage for global plugin installations
Browse files Browse the repository at this point in the history
e. g. `<ol-map>` can now be used as `<OlMap>` as well.
  • Loading branch information
d-koppenhagen committed Apr 17, 2024
1 parent 5d367b9 commit 861f3ea
Show file tree
Hide file tree
Showing 8 changed files with 84 additions and 84 deletions.
14 changes: 7 additions & 7 deletions src/components/animations/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ import OlAnimationZoom from "./OlAnimationZoom.vue";
import type { Vue3OpenlayersGlobalOptions } from "@/types";

function install(app: App, options?: Vue3OpenlayersGlobalOptions) {
app.component("ol-animation-drop", OLAnimationDrop);
app.component("ol-animation-fade", OlAnimationFade);
app.component("ol-animation-path", OlAnimationPath);
app.component("ol-animation-shake", OlAnimationShake);
app.component("ol-animation-slide", OlAnimationSlide);
app.component("ol-animation-teleport", OlAnimationTeleport);
app.component("ol-animation-zoom", OlAnimationZoom);
app.component("OlAnimationDrop", OLAnimationDrop);
app.component("OlAnimationFade", OlAnimationFade);
app.component("OlAnimationPath", OlAnimationPath);
app.component("OlAnimationShake", OlAnimationShake);
app.component("OlAnimationSlide", OlAnimationSlide);
app.component("OlAnimationTeleport", OlAnimationTeleport);
app.component("OlAnimationZoom", OlAnimationZoom);

app.provide("ol-options", options);
}
Expand Down
14 changes: 7 additions & 7 deletions src/components/geometries/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ import OlGeomPolygon from "./OlGeomPolygon.vue";
import type { Vue3OpenlayersGlobalOptions } from "@/types";

function install(app: App, options?: Vue3OpenlayersGlobalOptions) {
app.component("ol-geom-circle", OlGeomCircle);
app.component("ol-geom-line-string", OlGeomLineString);
app.component("ol-geom-multi-line-string", OlGeomMultiLineString);
app.component("ol-geom-multi-point", OlGeomMultiPoint);
app.component("ol-geom-multi-polygon", OlGeomMultiPolygon);
app.component("ol-geom-point", OlGeomPoint);
app.component("ol-geom-polygon", OlGeomPolygon);
app.component("OlGeomCircle", OlGeomCircle);
app.component("OlGeomLineString", OlGeomLineString);
app.component("OlGeomMultiLineString", OlGeomMultiLineString);
app.component("OlGeomMultiPoint", OlGeomMultiPoint);
app.component("OlGeomMultiPolygon", OlGeomMultiPolygon);
app.component("OlGeomPoint", OlGeomPoint);
app.component("OlGeomPolygon", OlGeomPolygon);

app.provide("ol-options", options);
}
Expand Down
20 changes: 10 additions & 10 deletions src/components/interaction/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@ import OlTransformInteraction from "./OlTransformInteraction.vue";
import type { Vue3OpenlayersGlobalOptions } from "@/types";

function install(app: App, options?: Vue3OpenlayersGlobalOptions) {
app.component("ol-interaction-clusterselect", OlClusterSelectInteraction);
app.component("ol-interaction-dragbox", OlDragBoxInteraction);
app.component("ol-interaction-dragrotate", OlDragRotateInteraction);
app.component("ol-interaction-dragrotatezoom", OlDragRotateZoomInteraction);
app.component("ol-interaction-link", OlLinktInteraction);
app.component("ol-interaction-select", OlSelectInteraction);
app.component("ol-interaction-draw", OlDrawInteraction);
app.component("ol-interaction-modify", OlModifyInteraction);
app.component("ol-interaction-snap", OlSnapInteraction);
app.component("ol-interaction-transform", OlTransformInteraction);
app.component("OlInteractionClusterselect", OlClusterSelectInteraction);
app.component("OlInteractionDragbox", OlDragBoxInteraction);
app.component("OlInteractionDragrotate", OlDragRotateInteraction);
app.component("OlInteractionDragrotatezoom", OlDragRotateZoomInteraction);
app.component("OlInteractionLink", OlLinktInteraction);
app.component("OlInteractionSelect", OlSelectInteraction);
app.component("OlInteractionDraw", OlDrawInteraction);
app.component("OlInteractionModify", OlModifyInteraction);
app.component("OlInteractionSnap", OlSnapInteraction);
app.component("OlInteractionTransform", OlTransformInteraction);

app.provide("ol-options", options);
}
Expand Down
20 changes: 10 additions & 10 deletions src/components/layers/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@ import OlWebglVectorLayer from "./OlWebglVectorLayer.vue";
import type { Vue3OpenlayersGlobalOptions } from "@/types";

function install(app: App, options?: Vue3OpenlayersGlobalOptions) {
app.component("ol-animated-clusterlayer", OlAnimatedClusterLayer);
app.component("ol-heatmap-layer", OlHeatmapLayer);
app.component("ol-image-layer", OlImageLayer);
app.component("ol-layer-group", OlLayerGroup);
app.component("ol-tile-layer", OlTileLayer);
app.component("ol-vector-image-layer", OlVectorImageLayer);
app.component("ol-vector-layer", OlVectorLayer);
app.component("ol-vector-tile-layer", OlVectorTileLayer);
app.component("ol-webgl-tile-layer", OlWebglTileLayer);
app.component("ol-webgl-vector-layer", OlWebglVectorLayer);
app.component("OlAnimatedClusterlayer", OlAnimatedClusterLayer);
app.component("OlHeatmapLayer", OlHeatmapLayer);
app.component("OlImageLayer", OlImageLayer);
app.component("OlLayerGroup", OlLayerGroup);
app.component("OlTileLayer", OlTileLayer);
app.component("OlVectorImageLayer", OlVectorImageLayer);
app.component("OlVectorLayer", OlVectorLayer);
app.component("OlVectorTileLayer", OlVectorTileLayer);
app.component("OlWebglTileLayer", OlWebglTileLayer);
app.component("OlWebglVectorLayer", OlWebglVectorLayer);

app.provide("ol-options", options);
}
Expand Down
12 changes: 6 additions & 6 deletions src/components/map/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ import OlView from "./OlView.vue";
import type { Vue3OpenlayersGlobalOptions } from "@/types";

function install(app: App, options?: Vue3OpenlayersGlobalOptions) {
app.component("ol-feature", OlFeature);
app.component("ol-geolocation", OlGeoLocation);
app.component("ol-map", OlMap);
app.component("ol-overlay", OlOverlay);
app.component("ol-projection-register", OlProjectionRegister);
app.component("ol-view", OlView);
app.component("OlFeature", OlFeature);
app.component("OlGeolocation", OlGeoLocation);
app.component("OlMap", OlMap);
app.component("OlOverlay", OlOverlay);
app.component("OlProjectionRegister", OlProjectionRegister);
app.component("OlView", OlView);

app.provide("ol-options", options);
}
Expand Down
42 changes: 21 additions & 21 deletions src/components/mapControls/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,27 +23,27 @@ import OlZoomToExtentControl from "./OlZoomToExtentControl.vue";
import type { Vue3OpenlayersGlobalOptions } from "@/types";

function install(app: App, options?: Vue3OpenlayersGlobalOptions) {
app.component("ol-attribution-control", OlAttributionControl);
app.component("ol-fullscreen-control", OlFullScreenControl);
app.component("ol-mouseposition-control", OlMousePositionControl);
app.component("ol-overviewmap-control", OlOverviewMapControl);
app.component("ol-scaleline-control", OlScaleLineControl);
app.component("ol-zoom-control", OlZoomControl);
app.component("ol-zoomslider-control", OlZoomSliderControl);
app.component("ol-zoomtoextent-control", OlZoomToExtentControl);
app.component("ol-rotate-control", OlRotateControl);
app.component("ol-context-menu-control", OlContextMenuControl);
app.component("ol-search-control", OlSearchControl);
app.component("ol-swipe-control", OlSwipeControl);
app.component("ol-control-bar", OlControlBar);
app.component("ol-toggle-control", OlToggleControl);
app.component("ol-button-control", OlButtonControl);
app.component("ol-printdialog-control", OlPrintDialogControl);
app.component("ol-profile-control", OlProfileControl);
app.component("ol-videorecorder-control", OlVideoRecorderControl);
app.component("ol-layerswitcher-control", OlLayerSwitcherControl);
app.component("ol-layerswitcherimage-control", OlLayerSwitcherImageControl);
app.component("ol-zone-control", OlZoneControl);
app.component("OlAttributionControl", OlAttributionControl);
app.component("OlFullscreenControl", OlFullScreenControl);
app.component("OlMousepositionControl", OlMousePositionControl);
app.component("OlOverviewmapControl", OlOverviewMapControl);
app.component("OlScalelineControl", OlScaleLineControl);
app.component("OlZoomControl", OlZoomControl);
app.component("OlZoomsliderControl", OlZoomSliderControl);
app.component("OlZoomtoextentControl", OlZoomToExtentControl);
app.component("OlRotateControl", OlRotateControl);
app.component("OlContextMenuControl", OlContextMenuControl);
app.component("OlSearchControl", OlSearchControl);
app.component("OlSwipeControl", OlSwipeControl);
app.component("OlControlBar", OlControlBar);
app.component("OlToggleControl", OlToggleControl);
app.component("OlButtonControl", OlButtonControl);
app.component("OlPrintdialogControl", OlPrintDialogControl);
app.component("OlProfileControl", OlProfileControl);
app.component("OlVideorecorderControl", OlVideoRecorderControl);
app.component("OlLayerswitcherControl", OlLayerSwitcherControl);
app.component("OlLayerswitcherimageControl", OlLayerSwitcherImageControl);
app.component("OlZoneControl", OlZoneControl);

app.provide("ol-options", options);
}
Expand Down
32 changes: 16 additions & 16 deletions src/components/sources/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,22 @@ import OlSourceWMTS from "./OlSourceWMTS.vue";
import type { Vue3OpenlayersGlobalOptions } from "@/types";

function install(app: App, options?: Vue3OpenlayersGlobalOptions) {
app.component("ol-source-bingmaps", OlSourceBingMaps);
app.component("ol-source-cluster", OlSourceCluster);
app.component("ol-source-image-static", OlSourceImageStatic);
app.component("ol-source-image-wms", OlSourceImageWMS);
app.component("ol-source-osm", OlSourceOSM);
app.component("ol-source-stadia-maps", OlSourceStadiaMaps);
app.component("ol-source-tianditu", OlSourceTianditu);
app.component("ol-source-tile-arcgis-rest", OlSourceTileArcGISRest);
app.component("ol-source-tile-debug", OlSourceTileDebug);
app.component("ol-source-geo-tiff", OlSourceGeoTIFF);
app.component("ol-source-tile-json", OlSourceTileJSON);
app.component("ol-source-tile-wms", OlSourceTileWMS);
app.component("ol-source-vector", OlSourceVector);
app.component("ol-source-vector-tile", OlSourceVectorTile);
app.component("ol-source-xyz", OlSourceXYZ);
app.component("ol-source-wmts", OlSourceWMTS);
app.component("OlSourceBingmaps", OlSourceBingMaps);
app.component("OlSourceCluster", OlSourceCluster);
app.component("OlSourceImageStatic", OlSourceImageStatic);
app.component("OlSourceImageWms", OlSourceImageWMS);
app.component("OlSourceOsm", OlSourceOSM);
app.component("OlSourceStadiaMaps", OlSourceStadiaMaps);
app.component("OlSourceTianditu", OlSourceTianditu);
app.component("OlSourceTileArcgisRest", OlSourceTileArcGISRest);
app.component("OlSourceTileDebug", OlSourceTileDebug);
app.component("OlSourceGeoTiff", OlSourceGeoTIFF);
app.component("OlSourceTileJson", OlSourceTileJSON);
app.component("OlSourceTileWms", OlSourceTileWMS);
app.component("OlSourceVector", OlSourceVector);
app.component("OlSourceVectorTile", OlSourceVectorTile);
app.component("OlSourceXyz", OlSourceXYZ);
app.component("OlSourceWmts", OlSourceWMTS);

app.provide("ol-options", options);
}
Expand Down
14 changes: 7 additions & 7 deletions src/components/styles/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ type OverrideStyleFunction = (
) => Style | Style[] | void;

function install(app: App, options?: Vue3OpenlayersGlobalOptions) {
app.component("ol-style", OlStyle);
app.component("ol-style-circle", OlStyleCircle);
app.component("ol-style-stroke", OlStyleStroke);
app.component("ol-style-fill", OlStyleFill);
app.component("ol-style-icon", OlStyleIcon);
app.component("ol-style-text", OlStyleText);
app.component("ol-style-flowline", OlStyleFlowline);
app.component("OlStyle", OlStyle);
app.component("OlStyleCircle", OlStyleCircle);
app.component("OlStyleStroke", OlStyleStroke);
app.component("OlStyleFill", OlStyleFill);
app.component("OlStyleIcon", OlStyleIcon);
app.component("OlStyleText", OlStyleText);
app.component("OlStyleFlowline", OlStyleFlowline);

app.provide("ol-options", options);
}
Expand Down

0 comments on commit 861f3ea

Please sign in to comment.