Move functionality for filtering tiles by the layer's tileMatrixLimits
Description
WMTS is using the same functionality as OSM and Bing for finding tiles for a given extent. There are one difference between WMTS and the two others. Whereas the others have a global perspective, WMTS can be restricted for each layer, and this should be taken into consideration when finding tiles for a given extent.
At the moment this is done within AbstractGetTileRequest.getTiles(). I think this functionality should be moved into WMTSService.findTilesInExtent. After all the getTiles function call this function first and then removes tiles that are outside tileMatrixLimits. I think it will be fruitful to avoid adding those tiles.
And AbstractGetTileRequest should primarily be used to fetch a single image from a WMTS server by calling that server's GetTile Url.
WMTS is using the same functionality as OSM and Bing for finding tiles for a given extent. There are one difference between WMTS and the two others. Whereas the others have a global perspective, WMTS can be restricted for each layer, and this should be taken into consideration when finding tiles for a given extent.
At the moment this is done within AbstractGetTileRequest.getTiles(). I think this functionality should be moved into WMTSService.findTilesInExtent. After all the getTiles function call this function first and then removes tiles that are outside tileMatrixLimits. I think it will be fruitful to avoid adding those tiles.
And AbstractGetTileRequest should primarily be used to fetch a single image from a WMTS server by calling that server's GetTile Url.