Skip to content

Commit 1ac3aeb

Browse files
committed
callbacks were not running
also, there's a bug resizing on load, i don't quite get it. probably this thing? mapbox/mapbox-gl-js#8982
1 parent 5878517 commit 1ac3aeb

File tree

2 files changed

+5
-836
lines changed

2 files changed

+5
-836
lines changed

dist/cyclemaps.js

Lines changed: 2 additions & 834 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/main.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ export class MainControl implements IControl {
5252
this.map.addControl(new RainControl(layerControl));
5353
this.map.addControl(new RouteControl(layerControl));
5454
this.map.scrollZoom.setWheelZoomRate(4 / 450); //default is 1 / 450
55+
this.map.on('load', (event: Event) => this.map.resize()); // https://github.com/mapbox/mapbox-gl-js/issues/8982
5556
}
5657

5758
onAdd(map: Map) {
@@ -66,10 +67,10 @@ export class MainControl implements IControl {
6667
}
6768

6869
addMoveListener() {
69-
this.map.on('moveend', () => this.checkMove);
70+
this.map.on('moveend', () => this.checkMove());
7071
this.checkMove();
7172

72-
this.map.on('zoom', () => this.checkZoom);
73+
this.map.on('zoom', () => this.checkZoom());
7374
this.checkZoom();
7475
}
7576

0 commit comments

Comments
 (0)