Open vladimir-rybalko opened 1 year ago
The equivalent to openlayers' tileUrlFunction
in itowns is urlFromExtent
. It is however not configurable as in openLayers.
I think that one quick solution would be to override the tileUrlFunction
of the TMSSource
to use determine the url based on quadtree key.
I think that one better solution would be to:
useQuadkeyUrl
)xyzQuadKey
) in UrlBuilder.js
that returns builds an url based on quadtree keyTMSSource.urlFromExtent
, when useQuadkeyUrl
is true, call UrlBuilder.xyzQuadKey
instead of URLBuilder.xyz
That will make quadtree key url templates available to all users to itowns. It would be very valuable if you could make this contribution to itowns.
To go further and make it more configurable, we could also implement a similar mechanism than openLayers
and add a tileUrlFunction
(or equivalent) parameter to TMSSource
and use it in urlFromExtent
if it's provided in the source declaration.
I'm trying to add a Bing Satellite layer to the itowns map project. The tile request template uses the quadtree key. Its calculation is based on values ZXY. https://ecn.t0.tiles.virtualearth.net/tiles/a{quadkey}.jpeg?g=587&mkt=en-gb&n=z
As an example, openlayers has a method tileUrlFunction to get the URL of a tile given its coordinates and projection.
How can I define a url template in iTowns for Bing Satellite layer?