<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <p><font face="Helvetica, Arial, sans-serif">Hi again,<br>
      </font></p>
    <p><font face="Helvetica, Arial, sans-serif">here is some more
        information in addition to my previous mail:</font></p>
    <p><font face="Helvetica, Arial, sans-serif">The problem occurs for
        VectorTiles in GeoJSON format as well. So there must be a more
        general problem with extending the </font><br>
      <font face="Helvetica, Arial, sans-serif">ol.source.VectorTile (or
        the way I do it).<br>
        The change / problem seems to be introduced with Version 4.2.0.
        With version 4.1.1 everything works as expected.</font></p>
    <p><font face="Helvetica, Arial, sans-serif">Cheers<br>
        Chris<br>
      </font></p>
    <p><font face="Helvetica, Arial, sans-serif"></font><br>
    </p>
    <div class="moz-cite-prefix">On 12.10.2017 13:45, Christian Mayer
      wrote:<br>
    </div>
    <blockquote type="cite"
      cite="mid:860f0d80-51a2-9f6b-aa43-a96dd0c9ba5e@meggsimum.de">
      <meta http-equiv="content-type" content="text/html; charset=utf-8">
      <p><font face="Helvetica, Arial, sans-serif">Hi all,</font></p>
      <p>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.</p>
      <p>Below you find the crutial parts of my class:</p>
      <p><tt>ol.inherits(ol.source.GWCVT, ol.source.VectorTile);</tt><tt><br>
        </tt><tt><br>
        </tt><tt>ol.source.GWCVT.prototype.tileUrlFunction =</tt><tt><br>
        </tt><tt>    function(tileCoord, pixelRatio, projection) {</tt></p>
      <p><tt>// here 'this' becomes 'window' in the second call<br>
        </tt></p>
      <p><tt>// assembling the URL</tt><tt><br>
        </tt><tt>// ...</tt><tt><br>
        </tt></p>
      <p><tt>}</tt></p>
      <p><tt>ol.source.GWCVT.prototype.setTileUrlFunction =
          function(tileUrlFunction) {</tt><tt><br>
        </tt><tt><br>
        </tt><tt> 
          ol.source.VectorTile.prototype.setTileUrlFunction.call(this,
          tileUrlFunction);</tt><tt><br>
        </tt><tt>};</tt></p>
      <p>Thanks for any hint!</p>
      Cheers<br>
      Chris <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
Dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Dev@lists.osgeo.org">Dev@lists.osgeo.org</a>
<a class="moz-txt-link-freetext" href="https://lists.osgeo.org/mailman/listinfo/openlayers-dev">https://lists.osgeo.org/mailman/listinfo/openlayers-dev</a></pre>
    </blockquote>
    <br>
  </body>
</html>