Skip to content

Commit

Permalink
Merge 133b924 into adcab25
Browse files Browse the repository at this point in the history
  • Loading branch information
atd-schubert committed Jul 18, 2018
2 parents adcab25 + 133b924 commit 8837a62
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 1 deletion.
22 changes: 22 additions & 0 deletions ts/map.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,28 @@ describe("Map Component", () => {
map.fire("move", testEvent);
});
});
describe("(boxzoomstart)", () => {
it("should fire event in Angular when firing event in Leaflet", (done: Mocha.Done) => {
const testHandle: any = {};
const testEvent: any = { testHandle };
map.boxzoomstartEvent.subscribe((event: any) => {
expect(event.testHandle).to.equal(testEvent.testHandle);
return done();
});
map.fire("boxzoomstart", testEvent);
});
});
describe("(boxzoomend)", () => {
it("should fire event in Angular when firing event in Leaflet", (done: Mocha.Done) => {
const testHandle: any = {};
const testEvent: any = { testHandle };
map.boxzoomendEvent.subscribe((event: any) => {
expect(event.testHandle).to.equal(testEvent.testHandle);
return done();
});
map.fire("boxzoomend", testEvent);
});
});
describe("(zoomend)", () => {
it("should fire event in Angular when firing event in Leaflet", (done: MochaDone) => {
const testHandle: any = {};
Expand Down
19 changes: 18 additions & 1 deletion ts/map.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,18 @@ export class MapComponent extends Map implements AfterViewInit {
* @link http://leafletjs.com/reference-1.2.0.html#map-moveend Original Leaflet documentation
*/
@Output("moveend") public moveendEvent: EventEmitter<LeafletEvent> = new EventEmitter();
/**
* From leaflet fired (undocumented) boxzoomstart event.
* Use it with `<yaga-tile-layer (boxzoomstart)="processEvent($event)">`
* @link https://github.com/Leaflet/Leaflet/blob/master/src/map/handler/Map.BoxZoom.js SourceCode
*/
@Output("boxzoomstart") public boxzoomstartEvent: EventEmitter<LeafletEvent> = new EventEmitter();
/**
* From leaflet fired (undocumented) boxzoomend event.
* Use it with `<yaga-tile-layer (boxzoomend)="processEvent($event)">`
* @link https://github.com/Leaflet/Leaflet/blob/master/src/map/handler/Map.BoxZoom.js SourceCode
*/
@Output("boxzoomend") public boxzoomendEvent: EventEmitter<LeafletEvent> = new EventEmitter();
/**
* From leaflet fired popupopen event.
* Use it with `<yaga-tile-layer (popupopen)="processEvent($event)">`
Expand Down Expand Up @@ -462,6 +474,12 @@ export class MapComponent extends Map implements AfterViewInit {
this.on("moveend", (event: LeafletEvent) => {
this.moveendEvent.emit(event);
});
this.on("boxzoomstart", (event: LeafletEvent) => {
this.boxzoomstartEvent.emit(event);
});
this.on("boxzoomend", (event: LeafletEvent) => {
this.boxzoomendEvent.emit(event);
});
this.on("popupopen", (event: LeafletEvent) => {
this.popupopenEvent.emit(event as PopupEvent);
});
Expand Down Expand Up @@ -510,7 +528,6 @@ export class MapComponent extends Map implements AfterViewInit {
this.on("zoomanim", (event: LeafletEvent) => {
this.zoomanimEvent.emit(event as ZoomAnimEvent);
});

}

/**
Expand Down

0 comments on commit 8837a62

Please sign in to comment.