Skip to content

Commit

Permalink
fix(map): rename zoomChange and pitchChange events
Browse files Browse the repository at this point in the history
BREAKING CHANGES:
Rename zoomChange and pitchChange events to zoomEvt and pitchEvt, because the "Change" suffix allow incorrecty two-way binding.
  • Loading branch information
Wykks committed Nov 20, 2017
1 parent 28f58cd commit 0142f88
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/app/lib/map/map.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,13 +127,13 @@ export class MapComponent implements OnChanges, OnDestroy, AfterViewInit, Mapbox
@Output() drag = new EventEmitter<MapTouchEvent | MapMouseEvent>();
@Output() dragEnd = new EventEmitter<DragEvent>();
@Output() zoomStart = new EventEmitter<MapTouchEvent | MapMouseEvent>();
@Output() zoomChange = new EventEmitter<MapTouchEvent | MapMouseEvent>();
@Output() zoomEvt = new EventEmitter<MapTouchEvent | MapMouseEvent>();
@Output() zoomEnd = new EventEmitter<MapTouchEvent | MapMouseEvent>();
@Output() rotateStart = new EventEmitter<MapTouchEvent | MapMouseEvent>();
@Output() rotate = new EventEmitter<MapTouchEvent | MapMouseEvent>();
@Output() rotateEnd = new EventEmitter<MapTouchEvent | MapMouseEvent>();
@Output() pitchStart = new EventEmitter<EventData>();
@Output() pitchChange = new EventEmitter<EventData>();
@Output() pitchEvt = new EventEmitter<EventData>();
@Output() pitchEnd = new EventEmitter<EventData>();
@Output() boxZoomStart = new EventEmitter<MapBoxZoomEvent>();
@Output() boxZoomEnd = new EventEmitter<MapBoxZoomEvent>();
Expand Down
4 changes: 2 additions & 2 deletions src/app/lib/map/map.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,13 @@ describe('MapService', () => {
drag: new EventEmitter<MapTouchEvent | MapMouseEvent>(),
dragEnd: new EventEmitter<DragEvent>(),
zoomStart: new EventEmitter<MapTouchEvent | MapMouseEvent>(),
zoomChange: new EventEmitter<MapTouchEvent | MapMouseEvent>(),
zoomEvt: new EventEmitter<MapTouchEvent | MapMouseEvent>(),
zoomEnd: new EventEmitter<MapTouchEvent | MapMouseEvent>(),
rotateStart: new EventEmitter<MapTouchEvent | MapMouseEvent>(),
rotate: new EventEmitter<MapTouchEvent | MapMouseEvent>(),
rotateEnd: new EventEmitter<MapTouchEvent | MapMouseEvent>(),
pitchStart: new EventEmitter<EventData>(),
pitchChange: new EventEmitter<EventData>(),
pitchEvt: new EventEmitter<EventData>(),
pitchEnd: new EventEmitter<EventData>(),
boxZoomStart: new EventEmitter<MapBoxZoomEvent>(),
boxZoomEnd: new EventEmitter<MapBoxZoomEvent>(),
Expand Down
4 changes: 2 additions & 2 deletions src/app/lib/map/map.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -382,13 +382,13 @@ export class MapService {
this.mapInstance.on('drag', (evt: MapboxGl.MapTouchEvent | MapboxGl.MapMouseEvent) => this.zone.run(() => events.drag.emit(evt)));
this.mapInstance.on('dragend', (evt: DragEvent) => this.zone.run(() => events.dragEnd.emit(evt)));
this.mapInstance.on('zoomstart', (evt: MapboxGl.MapTouchEvent | MapboxGl.MapMouseEvent) => this.zone.run(() => events.zoomStart.emit(evt)));
this.mapInstance.on('zoom', (evt: MapboxGl.MapTouchEvent | MapboxGl.MapMouseEvent) => this.zone.run(() => events.zoomChange.emit(evt)));
this.mapInstance.on('zoom', (evt: MapboxGl.MapTouchEvent | MapboxGl.MapMouseEvent) => this.zone.run(() => events.zoomEvt.emit(evt)));
this.mapInstance.on('zoomend', (evt: MapboxGl.MapTouchEvent | MapboxGl.MapMouseEvent) => this.zone.run(() => events.zoomEnd.emit(evt)));
this.mapInstance.on('rotatestart', (evt: MapboxGl.MapTouchEvent | MapboxGl.MapMouseEvent) => this.zone.run(() => events.rotateStart.emit(evt)));
this.mapInstance.on('rotate', (evt: MapboxGl.MapTouchEvent | MapboxGl.MapMouseEvent) => this.zone.run(() => events.rotate.emit(evt)));
this.mapInstance.on('rotateend', (evt: MapboxGl.MapTouchEvent | MapboxGl.MapMouseEvent) => this.zone.run(() => events.rotateEnd.emit(evt)));
this.mapInstance.on('pitchstart', (evt: MapboxGl.EventData) => this.zone.run(() => events.pitchStart.emit(evt)));
this.mapInstance.on('pitch', (evt: MapboxGl.EventData) => this.zone.run(() => events.pitchChange.emit(evt)));
this.mapInstance.on('pitch', (evt: MapboxGl.EventData) => this.zone.run(() => events.pitchEvt.emit(evt)));
this.mapInstance.on('pitchend', (evt: MapboxGl.EventData) => this.zone.run(() => events.pitchEnd.emit(evt)));
this.mapInstance.on('boxzoomstart', (evt: MapboxGl.MapBoxZoomEvent) => this.zone.run(() => events.boxZoomStart.emit(evt)));
this.mapInstance.on('boxzoomend', (evt: MapboxGl.MapBoxZoomEvent) => this.zone.run(() => events.boxZoomEnd.emit(evt)));
Expand Down
4 changes: 2 additions & 2 deletions src/app/lib/map/map.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ export interface MapEvent {
drag: EventEmitter<MapTouchEvent | MapMouseEvent>;
dragEnd: EventEmitter<DragEvent>;
zoomStart: EventEmitter<MapTouchEvent | MapMouseEvent>;
zoomChange: EventEmitter<MapTouchEvent | MapMouseEvent>;
zoomEvt: EventEmitter<MapTouchEvent | MapMouseEvent>;
zoomEnd: EventEmitter<MapTouchEvent | MapMouseEvent>;
rotateStart: EventEmitter<MapTouchEvent | MapMouseEvent>;
rotate: EventEmitter<MapTouchEvent | MapMouseEvent>;
rotateEnd: EventEmitter<MapTouchEvent | MapMouseEvent>;
pitchStart: EventEmitter<EventData>;
pitchChange: EventEmitter<EventData>;
pitchEvt: EventEmitter<EventData>;
pitchEnd: EventEmitter<EventData>;
boxZoomStart: EventEmitter<MapBoxZoomEvent>;
boxZoomEnd: EventEmitter<MapBoxZoomEvent>;
Expand Down

0 comments on commit 0142f88

Please sign in to comment.