Commit f21dd1d5 authored by Michael Underwood's avatar Michael Underwood
Browse files

Temp fixes for final ts errors in initial conversion!

parent b05c57aa
Loading
Loading
Loading
Loading
+16 −12
Original line number Diff line number Diff line
@@ -245,8 +245,15 @@ export default defineComponent({
      if (props.useGlobalLeaflet) {
        WINDOW_OR_GLOBAL.L = WINDOW_OR_GLOBAL.L || (await import("leaflet"));
      }
      const { map, CRS, Icon, latLngBounds, latLng, DomEvent }: typeof L =
        props.useGlobalLeaflet
      const {
        map,
        CRS,
        Icon,
        latLngBounds,
        latLng,
        DomEvent,
        stamp,
      }: typeof L = props.useGlobalLeaflet
        ? WINDOW_OR_GLOBAL.L
        : await import("leaflet/dist/leaflet-src.esm");

@@ -272,9 +279,7 @@ export default defineComponent({
              blueprint.layersToAdd.push(layer);
            } else {
              const exist = blueprint.layersInControl.find(
                (l) =>
                  l.leafletObject._leaflet_id ===
                  layer.leafletObject._leaflet_id
                (l) => stamp(l.leafletObject) === stamp(layer.leafletObject)
              );
              if (!exist) {
                blueprint.layerControl.addLayer(layer);
@@ -286,7 +291,7 @@ export default defineComponent({
            blueprint.leafletRef!.addLayer(layer.leafletObject);
          }
        },
        removeLayer(layer: ILayerDefinition<any>) {
        removeLayer(layer: ILayerDefinition) {
          if (layer.layerType !== undefined) {
            if (blueprint.layerControl === undefined) {
              blueprint.layersToAdd = blueprint.layersToAdd.filter(
@@ -295,9 +300,7 @@ export default defineComponent({
            } else {
              blueprint.layerControl.removeLayer(layer.leafletObject);
              blueprint.layersInControl = blueprint.layersInControl.filter(
                (l) =>
                  l.leafletObject._leaflet_id !==
                  layer.leafletObject._leaflet_id
                (l) => stamp(l.leafletObject) !== stamp(layer.leafletObject)
              );
            }
          }
@@ -348,7 +351,8 @@ export default defineComponent({
          }
          const oldBounds =
            blueprint.lastSetBounds || blueprint.leafletRef!.getBounds();
          const boundsChanged = !oldBounds.equals(newBounds, 0); // set maxMargin to 0 - check exact equals
          // TODO: Remove `as any` if @types/leaflet adds the second argument to the method signature
          const boundsChanged = !(oldBounds as any).equals(newBounds, 0); // set maxMargin to 0 - check exact equals
          if (boundsChanged) {
            blueprint.lastSetBounds = newBounds;
            blueprint.leafletRef!.fitBounds(newBounds);
+1 −1
Original line number Diff line number Diff line
@@ -90,4 +90,4 @@ export const CreateVueGridLayer = (
        this.tileComponents[key] = undefined;
      }
    },
  });
  }) as (new (options: L.GridLayerOptions) => L.GridLayer) & typeof L.Class;
+2 −1
Original line number Diff line number Diff line
@@ -37,7 +37,8 @@ export const layerProps = {
  },
} as const;

export const setupLayer = <T extends L.Layer>(
// TODO: Remove extra {options} definition if @types/leaflet updates to include it on Layer
export const setupLayer = <T extends L.Layer & { options: L.LayerOptions }>(
  props,
  leafletRef: Ref<T>,
  context
+1 −0
Original line number Diff line number Diff line
import { h } from "vue";

import { componentProps, setupComponent } from "./component";

export const popperProps = {
+3 −1
Original line number Diff line number Diff line
import { onBeforeUnmount } from "vue";

import { UnbindTooltipInjection } from "@src/types/injectionKeys";
import { assertInject } from "@src/utils";
import { onBeforeUnmount } from "vue";

import { popperProps, setupPopper } from "./popper";

export const tooltipProps = {
Loading