Skip to content

Commit

Permalink
fix(map): change event-type of projectionChanged event to MapEvent (#346
Browse files Browse the repository at this point in the history
)

Fixes #342.

BREAKING CHANGE: The type passed to the `onProjectionChange` is changed from `MapCameraChangedEvent` to `MapEvent`, so there are no longer camera-props available for this event
  • Loading branch information
usefulthink authored May 6, 2024
1 parent aba43ac commit 83f9309
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docs/api-reference/components/map.md
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,6 @@ Based on the specific event, there is also additional information in the
| `zoom_changed` | `onZoomChanged` | `MapCameraChangedEvent` |
| `heading_changed` | `onHeadingChanged` | `MapCameraChangedEvent` |
| `tilt_changed` | `onTiltChanged` | `MapCameraChangedEvent` |
| `projection_changed` | `onProjectionChanged` | `MapCameraChangedEvent` |
| `click` | `onClick` | `MapMouseEvent` |
| `contextmenu` | `onContextmenu` | `MapMouseEvent` |
| `dblclick` | `onDblclick` | `MapMouseEvent` |
Expand All @@ -236,6 +235,7 @@ Based on the specific event, there is also additional information in the
| `dragend` | `onDragend` | `MapEvent` |
| `dragstart` | `onDragstart` | `MapEvent` |
| `idle` | `onIdle` | `MapEvent` |
| `projection_changed` | `onProjectionChanged` | `MapEvent` |
| `isfractionalzoomenabled_changed` | `onIsFractionalZoomEnabledChanged` | `MapEvent` |
| `mapcapabilities_changed` | `onMapCapabilitiesChanged` | `MapEvent` |
| `maptypeid_changed` | `onMapTypeIdChanged` | `MapEvent` |
Expand Down
3 changes: 1 addition & 2 deletions src/components/map/use-map-events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ export type MapEventProps = Partial<{
onHeadingChanged: (event: MapCameraChangedEvent) => void;
onTiltChanged: (event: MapCameraChangedEvent) => void;
onZoomChanged: (event: MapCameraChangedEvent) => void;
onProjectionChanged: (event: MapCameraChangedEvent) => void;
onCameraChanged: (event: MapCameraChangedEvent) => void;

// mouse / touch / pointer events
Expand All @@ -29,6 +28,7 @@ export type MapEventProps = Partial<{
onIdle: (event: MapEvent) => void;

// configuration events
onProjectionChanged: (event: MapEvent) => void;
onIsFractionalZoomEnabledChanged: (event: MapEvent) => void;
onMapCapabilitiesChanged: (event: MapEvent) => void;
onMapTypeIdChanged: (event: MapEvent) => void;
Expand Down Expand Up @@ -179,7 +179,6 @@ const cameraEventTypes = [
'bounds_changed',
'center_changed',
'heading_changed',
'projection_changed',
'tilt_changed',
'zoom_changed'
];
Expand Down

0 comments on commit 83f9309

Please sign in to comment.