iTowns / itowns

A Three.js-based framework written in Javascript/WebGL for visualizing 3D geospatial data
http://www.itowns-project.org
Other
1.09k stars 293 forks source link

Bing Satellite layer #2184

Open vladimir-rybalko opened 1 year ago

vladimir-rybalko commented 1 year ago

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?

jailln commented 12 months 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:

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.