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

Add 'position' option to control

parent dd0ac34e
Loading
Loading
Loading
Loading
+15 −1
Original line number Diff line number Diff line
@@ -6,10 +6,24 @@ export const props = {
    default: "topright",
  },
};
export const setup = (leafletRef) => {
export const setup = (props, leafletRef) => {
  const options = {
    position: props.position,
  };

  const methods = {
    setPosition(position) {
      if (leafletRef.value) {
        leafletRef.value.setPosition(position);
      }
    },
  };

  onUnmounted(() => {
    if (leafletRef.value) {
      leafletRef.value.remove();
    }
  });

  return { options, methods };
};
+2 −1
Original line number Diff line number Diff line
@@ -25,8 +25,9 @@ export const props = {
};

export const setup = (props, leafletRef) => {
  controlSetup(leafletRef);
  const { options: controlOptions } = controlSetup(props, leafletRef);
  const options = {
    ...controlOptions,
    collapsed: props.collapsed,
    autoZIndex: props.autoZIndex,
    hideSingleBase: props.hideSingleBase,