extending ol.Tile in OpenLayers 6?

Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

extending ol.Tile in OpenLayers 6?

mortac8

I am upgrading my app from OpenLayers 4.6.4 to 6.1.1 and I can't figure out how to extend Tile in OL6. My code is as follows which works in OL 4.6.4.  What would I do to achieve the same thing in OpenLayers 6?

My error is: Uncaught TypeError: Class extends value undefined is not a constructor or null

index.html that includes OL6.1.1 is:

<link rel="stylesheet" href="ol.css">
<script src="ol.js"></script>
 
<div tabindex="700" id="map" class="map"></div>
 
<script type="module">
    import MapView from './mapview.js';
 
    var mv = new MapView();
</script>

 

My map view class contains the following (which works in OpenLayers 4):

class CanvasTile extends ol.Tile {
  constructor(tileCoord, state, src, crossOrigin, tileLoadFunction, options) {
    super(tileCoord, state, options);
    this.canvas = document.createElement('canvas');
    this.tileLoadFunction = tileLoadFunction;
    this.src = src;
  }
 
  getCanvas() {
    return this.canvas;
  }
}

 

 

Ashley Mort

Sr. Software Engineer

972-638-6317 office

814-571-3039 cell

 


_______________________________________________
Users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/openlayers-users