Skip to content

Commit

Permalink
fix collectResourceTiming assignment mapbox#3709
Browse files Browse the repository at this point in the history
  • Loading branch information
stepankuzmin committed Jan 12, 2020
1 parent 9e6faf3 commit da23634
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/source/vector_tile_source.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ import type {Callback} from '../types/callback';
import type {Cancelable} from '../types/cancelable';
import type {VectorSourceSpecification, PromoteIdSpecification} from '../style-spec/types';

export type VectorTileSourceOptions = {...VectorSourceSpecification, collectResourceTiming?: boolean};

class VectorTileSource extends Evented implements Source {
type: 'vector';
id: string;
Expand All @@ -43,7 +41,7 @@ class VectorTileSource extends Evented implements Source {
_tileJSONRequest: ?Cancelable;
_loaded: boolean;

constructor(id: string, options: VectorTileSourceOptions, dispatcher: Dispatcher, eventedParent: Evented) {
constructor(id: string, options: {...VectorSourceSpecification, collectResourceTiming?: boolean}, dispatcher: Dispatcher, eventedParent: Evented) {
super();
this.id = id;
this.dispatcher = dispatcher;
Expand All @@ -60,7 +58,7 @@ class VectorTileSource extends Evented implements Source {
extend(this, pick(options, ['url', 'scheme', 'tileSize', 'promoteId']));
this._options = extend({type: 'vector'}, options);

this._collectResourceTiming = options.collectResourceTiming;
this._collectResourceTiming = !!options.collectResourceTiming;

if (this.tileSize !== 512) {
throw new Error('vector tile sources must have a tileSize of 512');
Expand Down

0 comments on commit da23634

Please sign in to comment.