-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fd926ca
commit 941e8ac
Showing
5 changed files
with
31 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,25 @@ | ||
import { toLngLat } from '../utils/toLngLat'; | ||
|
||
import type { EventMapping, PropKeys } from './types'; | ||
|
||
export const mapEventMap: EventMapping = { | ||
onDragStart: 'dragstart', | ||
onDrag: 'drag', | ||
onDragEnd: 'dragend', | ||
}; | ||
import type { PropKey } from './types'; | ||
|
||
/** 静态属性 */ | ||
export const StaticProps: PropKeys[] = ['anchor', 'clickTolerance', 'color', 'onClick']; | ||
export const StaticProps: PropKey[] = ['anchor', 'clickTolerance', 'color', 'onClick']; | ||
|
||
/** 动态属性 */ | ||
export const NativeDynamicProps: PropKeys[] = [ | ||
export const NativeDynamicProps: PropKey[] = [ | ||
'draggable', | ||
'offset', | ||
'rotation', | ||
'rotationAlignment', | ||
'pitchAlignment', | ||
'scale', | ||
'lnglat', | ||
'lngLat', | ||
]; | ||
|
||
export const allProps = NativeDynamicProps.concat(StaticProps); | ||
|
||
export const setterMap = {}; | ||
|
||
export const converterMap: Partial<Record<PropKeys, (...value: any[]) => any>> = { | ||
lnglat: toLngLat, | ||
export const converterMap: Partial<Record<PropKey, (...value: any[]) => any>> = { | ||
lngLat: toLngLat, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import type { EventMapping, KeysOfUnion } from './types'; | ||
|
||
export const MarkerEventMap: EventMapping = { | ||
onDragStart: 'dragstart', | ||
onDrag: 'drag', | ||
onDragEnd: 'dragend', | ||
}; | ||
|
||
export const MarkerEventList = Object.keys(MarkerEventMap) as KeysOfUnion<EventMapping>[]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters