brendankenny / CanvasLayer

A <canvas> map layer for the Google Maps JavaScript API v3 for 2d and WebGL data visualization
Apache License 2.0
147 stars 52 forks source link

setMap: not an instance of Map #9

Open Messier82 opened 7 years ago

Messier82 commented 7 years ago

Hello! I'm trying to use this library but cannot even initialize it. It's dropping me InvalidValueError: setMap: not an instance of Map; and not an instance of StreetViewPanorama error.

var canvasLayerOptions = {
  map: this.map,
  animate: false
};

var canvasLayer = new CanvasLayer(canvasLayerOptions);

return canvasLayer.canvas.getContext('2d');

That's the code, that I'm using to initialize it. this.map is not undefined and instanceof google.maps.Map on it returns true

Messier82 commented 7 years ago

Okay. I assume I fixed it by initializing only after map is loaded. But there's another problem: updateHandler and resizeHandler is not calling. At all