Skip to content

Commit

Permalink
fix(googlemaps): fix GoogleMapsLaLngBounds
Browse files Browse the repository at this point in the history
closes #972
  • Loading branch information
ihadeed committed Jan 24, 2017
1 parent 1322c1b commit c3127d3
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/plugins/googlemap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1696,9 +1696,9 @@ export class GoogleMapsKmlOverlay {
export class GoogleMapsLatLngBounds {
private _objectInstance: any;

@InstanceProperty get northeast(): GoogleMapsLatLng { return; }
@InstanceProperty get southwest(): GoogleMapsLatLng { return; }
@InstanceProperty get type(): string { return; }
@InstanceProperty northeast: GoogleMapsLatLng;
@InstanceProperty southwest: GoogleMapsLatLng;
@InstanceProperty type: string;

constructor(southwestOrArrayOfLatLng: GoogleMapsLatLng | GoogleMapsLatLng[], northeast?: GoogleMapsLatLng) {
let args = !!northeast ? [southwestOrArrayOfLatLng, northeast] : southwestOrArrayOfLatLng;
Expand Down
40 changes: 40 additions & 0 deletions test/plugins/googlemap.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import { GoogleMapsLatLngBounds, GoogleMapsLatLng } from '../../src/plugins/googlemap';

declare var window: any;

class LatLngBounds {
public southwest: GoogleMapsLatLng;
public northeast: GoogleMapsLatLng;

constructor(latLngArray: GoogleMapsLatLng[]) {
this.southwest = latLngArray[0];
this.northeast = latLngArray[1];
}
}

window.plugin = {
google: {
maps: {
LatLngBounds
}
}
};

describe('GoogleMapsLatLngBounds', () => {

const southwest = new GoogleMapsLatLng(1,1);
const northeast = new GoogleMapsLatLng(4,4);
let object;

it('should create an object', () => {
object = new GoogleMapsLatLngBounds([southwest, northeast]);
expect(object).toBeDefined();
});

it('northwest property should be defined', () => expect(object.northeast).toBeDefined());

it('southwest property should be defined', () => expect(object.southwest).toBeDefined());



});

0 comments on commit c3127d3

Please sign in to comment.