Skip to content

Commit

Permalink
fix(map): fitScreenCoordinates: handle fitScreenCoordinates at init
Browse files Browse the repository at this point in the history
  • Loading branch information
Wykks committed Dec 17, 2018
1 parent d10ff55 commit 1126410
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion projects/ngx-mapbox-gl/src/lib/map/map.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,10 @@ export class MapComponent implements OnChanges, OnDestroy, AfterViewInit, MapEve
}
this.MapService.fitBounds(changes.fitBounds.currentValue, this.fitBoundsOptions);
}
if (changes.fitScreenCoordinates && !changes.fitBounds.isFirstChange()) {
if (changes.fitScreenCoordinates) {
if (this.center || this.zoom || this.pitch || this.fitBounds) {
console.warn('[ngx-mapbox-gl] center / zoom / pitch / fitBounds inputs are being overridden by fitScreenCoordinates input');
}
this.MapService.fitScreenCoordinates(
changes.fitScreenCoordinates.currentValue,
this.bearing ? this.bearing[0] : 0,
Expand Down

0 comments on commit 1126410

Please sign in to comment.