Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update ControlPosition #71

Merged
merged 4 commits into from
Nov 9, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 29 additions & 28 deletions src/components/map-control.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,35 +8,36 @@ type MapControlProps = PropsWithChildren<{
position: ControlPosition;
}>;

/**
* Copy of the `google.maps.ControlPosition` constants.
* They have to be duplicated here since we can't wait for the maps API to load to be able to use them.
*/
export enum ControlPosition {
usefulthink marked this conversation as resolved.
Show resolved Hide resolved
BLOCK_END_INLINE_CENTER = 0,
BLOCK_END_INLINE_END = 1,
BLOCK_END_INLINE_START = 2,
BLOCK_START_INLINE_CENTER = 3,
BLOCK_START_INLINE_END = 4,
BLOCK_START_INLINE_START = 5,
BOTTOM_CENTER = 6,
BOTTOM_LEFT = 7,
BOTTOM_RIGHT = 8,
INLINE_END_BLOCK_CENTER = 9,
INLINE_END_BLOCK_END = 10,
INLINE_END_BLOCK_START = 11,
INLINE_START_BLOCK_CENTER = 12,
INLINE_START_BLOCK_END = 13,
INLINE_START_BLOCK_START = 14,
LEFT_BOTTOM = 15,
LEFT_CENTER = 16,
LEFT_TOP = 17,
RIGHT_BOTTOM = 18,
RIGHT_CENTER = 19,
RIGHT_TOP = 20,
TOP_CENTER = 21,
TOP_LEFT = 22,
TOP_RIGHT = 23
TOP_LEFT = 1,
TOP_CENTER = 2,
TOP = 2,
TOP_RIGHT = 3,
LEFT_CENTER = 4,
LEFT_TOP = 5,
LEFT = 5,
LEFT_BOTTOM = 6,
RIGHT_TOP = 7,
RIGHT = 7,
RIGHT_CENTER = 8,
RIGHT_BOTTOM = 9,
BOTTOM_LEFT = 10,
BOTTOM_CENTER = 11,
BOTTOM = 11,
BOTTOM_RIGHT = 12,
CENTER = 13,
BLOCK_START_INLINE_START = 14,
BLOCK_START_INLINE_CENTER = 15,
BLOCK_START_INLINE_END = 16,
INLINE_START_BLOCK_CENTER = 17,
INLINE_START_BLOCK_START = 18,
INLINE_START_BLOCK_END = 19,
INLINE_END_BLOCK_START = 20,
INLINE_END_BLOCK_CENTER = 21,
INLINE_END_BLOCK_END = 22,
BLOCK_END_INLINE_START = 23,
BLOCK_END_INLINE_CENTER = 24,
BLOCK_END_INLINE_END = 25
}

export const MapControl = ({children, position}: MapControlProps) => {
Expand Down