-
Notifications
You must be signed in to change notification settings - Fork 633
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(layer): add setSelect setActive 方法 & refactor color util
- Loading branch information
Showing
24 changed files
with
234 additions
and
88 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
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
16 changes: 14 additions & 2 deletions
16
packages/core/src/services/interaction/IInteractionService.ts
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,14 +1,26 @@ | ||
import { ILngLat } from '../map/IMapService'; | ||
export enum InteractionEvent { | ||
Hover = 'hover', | ||
Click = 'click', | ||
Select = 'select', | ||
Active = 'active', | ||
} | ||
export interface IInteractionTarget { | ||
x: number; | ||
y: number; | ||
lngLat: ILngLat; | ||
type: string; | ||
featureId?: number; | ||
} | ||
|
||
export interface IInteractionService { | ||
init(): void; | ||
destroy(): void; | ||
on( | ||
eventName: InteractionEvent, | ||
callback: (params: { x: number; y: number; type: string }) => void, | ||
callback: (params: IInteractionTarget) => void, | ||
): void; | ||
triggerHover({ x, y, type }: { x: number; y: number; type?: string }): void; | ||
triggerHover({ x, y, type }: Partial<IInteractionTarget>): void; | ||
triggerSelect(id: number): void; | ||
triggerActive(id: number): void; | ||
} |
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
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
Oops, something went wrong.