Force reload of Tiles in Layer

المشرف العام

Administrator
طاقم الإدارة
I want to display an indoor map. My problem is that when I change to another floor (the URL changes) the tiles are not refetched. The following code is used:

var indoorSource = new ol.source.XYZ({ crossOrigin: null, tileUrlFunction: parseUrl, maxZoom: 45});var indoorLayer = new ol.layer.Tile({ source: indoorSource});The parseUrl function is the following:

var parseUrl = function (tileCoords, pixelRatio, projection) { var url = 'http://127.0.0.1/tiles/{z}/{level}/{x}/{y}'; var innerMap = LocalUserData.currentInnerMap(); url = url.replace('{level}', innerMap.level || 0); url = url.replace('{z}', tileCoords.z || 0); url = url.replace('{x}', tileCoords.x || 0); url = url.replace('{y}', tileCoords.y || 0); return url;};Is there a way to force a reload of the tiles?



أكثر...
 
أعلى