diff --git a/src/leaf/map/fullscreen/control/control-added-listener.ts b/src/leaf/map/fullscreen/control/control-added-listener.ts index 82c666e..c816dec 100644 --- a/src/leaf/map/fullscreen/control/control-added-listener.ts +++ b/src/leaf/map/fullscreen/control/control-added-listener.ts @@ -1,8 +1,8 @@ import { DomEvent, type Map } from 'leaflet' -import { type UseAnchor } from '../state/use-anchor' import { type UseBooleanGet } from '../state/use-boolean' +import { type ControlAnchor } from './anchor/anchor' import { type AnchorAssignTitleOptions, setControlAnchorTitle, @@ -11,7 +11,7 @@ import { export type ControlAddedListenerOptions = { map: { control: { - anchor: AnchorAssignTitleOptions & UseAnchor + anchor: AnchorAssignTitleOptions & ControlAnchor container: { element: HTMLElement } } fullscreen: { state: { get: UseBooleanGet } } diff --git a/src/leaf/map/fullscreen/control/set-control-anchor-title.ts b/src/leaf/map/fullscreen/control/set-control-anchor-title.ts index adf0855..5cd4e3d 100644 --- a/src/leaf/map/fullscreen/control/set-control-anchor-title.ts +++ b/src/leaf/map/fullscreen/control/set-control-anchor-title.ts @@ -1,9 +1,10 @@ -import { type AnchorAssign } from '../state/use-anchor' import { type UseBooleanGet } from '../state/use-boolean' +import { type ControlAnchorAssign } from './anchor/anchor' + export type ControlAnchorTitleStates = Record<'false' | 'true', string> export type AnchorAssignTitleOptions = { - assign: AnchorAssign + assign: ControlAnchorAssign titleStates: ControlAnchorTitleStates } diff --git a/src/leaf/map/fullscreen/fullscreen.ts b/src/leaf/map/fullscreen/fullscreen.ts index 90bb1c2..e373c1b 100644 --- a/src/leaf/map/fullscreen/fullscreen.ts +++ b/src/leaf/map/fullscreen/fullscreen.ts @@ -17,10 +17,10 @@ import { mapLifecycleListener, } from './map/map-lifecycle-listener' import { - type AnchorAttributes, - type UseAnchor, - useAnchor, -} from './state/use-anchor' + type ControlAnchor, + type ControlAnchorAttributes, + controlAnchor, +} from './control/anchor/anchor' import { useBoolean } from './state/use-boolean' const leafletControl = <(options: ControlOptions) => Control>( @@ -36,7 +36,7 @@ export type FullscreenMapOptions = MapOptions & { } control: { anchor: { - attributes: AnchorAttributes + attributes: ControlAnchorAttributes tag: string titleStates: ControlAnchorTitleStates } @@ -98,14 +98,15 @@ export function fullscreenMap({ containerTag, joinClassNames(containerClassNames), ), - { assign: anchorAssign, onClick: anchorOnClick }: UseAnchor = useAnchor({ - attributes: anchorAttributes, - element: DomUtil.create( - anchorTag, - joinClassNames(anchorClassNames), - containerElement, - ), - }), + { assign: anchorAssign, onClick: anchorOnClick }: ControlAnchor = + controlAnchor({ + attributes: anchorAttributes, + element: DomUtil.create( + anchorTag, + joinClassNames(anchorClassNames), + containerElement, + ), + }), control: Control = leafletControl({ position }), map: Map = leafletMap(id, mapOptions), handleMapLifecycleChange: ( diff --git a/src/leaf/map/fullscreen/map/map-lifecycle-listener.ts b/src/leaf/map/fullscreen/map/map-lifecycle-listener.ts index ab45721..ac1da36 100644 --- a/src/leaf/map/fullscreen/map/map-lifecycle-listener.ts +++ b/src/leaf/map/fullscreen/map/map-lifecycle-listener.ts @@ -1,6 +1,6 @@ import { DomEvent, DomUtil, type Map } from 'leaflet' -import { type AnchorAssign } from '../state/use-anchor' +import { type ControlAnchorAssign } from '../control/anchor/anchor' import { type UseBoolean } from '../state/use-boolean' import { setControlAnchorTitle, @@ -13,7 +13,7 @@ export type MapLifecycleListenerOptions = { map: { control: { anchor: { - assign: AnchorAssign + assign: ControlAnchorAssign titleStates: ControlAnchorTitleStates } }