Help: TileImage's tileUrlFunction not work when I change V5 to V6.
See original GitHub issueDescribe the bug when I update V5 to V6, it’s not show view , and no bugs report. when I follow code , found the tileUrlFunction dosen’t work, my map is Baidu Map. To Reproduce `// 百度坐标系 proj4.defs( ‘BD09’, ‘+proj=merc +a=6378206 +b=6356584.314245179 +lat_ts=0.0 +lon_0=0.0 +x_0=0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs’); register(proj4); let projection = projGet(‘BD09’);
// 分辨率
let resolutions = [];
for (let i = 0; i < 19; i++) {
resolutions[i] = Math.pow(2, 18 - i);
}
// 中心点坐标
let center = null;
if (options.center) {
center = BaiduMap.transformCoord(options.center);
}
// 地图边界
let extent = null;
if (options.extent) {
extent = BaiduMap.transformExtent(options.extent);
}
let mapkeys = [];
let maplayers = [];
let Creatlayer = (TitUrl, filter = options.tileImageFilter) =>{
let source = new TileImage({
crossOrigin: 'anonymous',
projection: projection,
tilePixelRatio: 2,
tileGrid: new TileGrid({
origin: [0, 0],
resolutions: resolutions,
extent: extent
}),
tileUrlFunction: function(tileCoord) {
if (!tileCoord) {
return '';
}
let z = tileCoord[0];
let x = tileCoord[1];
let y = tileCoord[2];
let tileUrl = TitUrl.replace('{z}', z).replace('{x}', x).replace('{y}', y);
return tileUrl;
}
});
// 图片变色效果
if (filter) {
source.setTileLoadFunction(function(imageTile, src) {
Map.tileImageFilterFunction(imageTile, src, filter);
});
}
// 地图图层
let mapLayer = new Tile({
source: source
});
`
I want to know how to put it right, thanks!~
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (1 by maintainers)
Top Results From Across the Web
Falcon Sandbox v8.30 © Hybrid Analysis
Submit malware for free analysis with Falcon Sandbox and Hybrid Analysis technology. Hybrid Analysis develops and licenses analysis tools to fight malware.
Read more >ol-mapbox-style - UNPKG
... 3.6.1, 3.6.2, 3.6.3, 3.6.4, 3.7.0, 3.7.1, 3.7.2, 3.8.0, 3.9.0, 4.0.0, 4.1.0, 4.2.1, 4.3.0, 4.3.1, 5.0.0-beta.1, 5.0.0-beta.2, 5.0.0-beta.3, 5.0.1, 5.0.2 ...
Read more >openlayers: Versions | Openbase
Full version history for openlayers including change logs.
Read more >Layer Styles - OSCHINA - 中文开源技术交流社区
TileImage ({ tileUrlFunction: function (tileCoord) { var z = tileCoord[0] + 1; var x = tileCoord[1]; var y = -tileCoord[2] - 1; var...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The internal tile coordinates have changed. You have to update your code according to the release notes. In particular, you will have to change the value of the
{y}
placeholder of your tile url:This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.