Hi again, here is some more information in addition to my previous mail:
The problem occurs for VectorTiles in GeoJSON format as well. So there must be a more general problem with extending the ol.source.VectorTile (or the way I do it). The change / problem seems to be introduced with Version 4.2.0. With version 4.1.1 everything works as expected. Cheers Chris On 12.10.2017 13:45, Christian Mayer wrote: > > Hi all, > > I extended the class ol.source.VectorTile in order to load VectorTiles > in different formats (GeoJSON and MVT) from a local GWC cache. While > upgrading from OpenLayers v3.20 to OpenLayers v4.x it seems that for > MVT the scope in the "tileUrlFunction" gets lost. It seems to be > "window". For GeoJSON-based VectorTiles everything is still running fine. > > Below you find the crutial parts of my class: > > ol.inherits(ol.source.GWCVT, ol.source.VectorTile); > > ol.source.GWCVT.prototype.tileUrlFunction = > function(tileCoord, pixelRatio, projection) { > > // here 'this' becomes 'window' in the second call > > // assembling the URL > // ... > > } > > ol.source.GWCVT.prototype.setTileUrlFunction = function(tileUrlFunction) { > > ol.source.VectorTile.prototype.setTileUrlFunction.call(this, > tileUrlFunction); > }; > > Thanks for any hint! > > Cheers > Chris > > > _______________________________________________ > Dev mailing list > d...@lists.osgeo.org > https://lists.osgeo.org/mailman/listinfo/openlayers-dev
_______________________________________________ Dev mailing list d...@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/openlayers-dev