简体   繁体   English

带有自定义图块服务器的Openlayers3

[英]Openlayers3 with custom tile server

I've got a problem with the latest openlayers3 beta. 我在使用最新的openlayers3 beta时遇到问题。 I'm trying to use custom tile server using xyz layer. 我正在尝试通过xyz图层使用自定义切片服务器。 The thing is the tiles are re not rendered for some reason. 问题是,由于某种原因无法重新渲染图块。 Using firebug I can see that the tile requests are send and the images are fetched succesfuly, though they do not show up... Everything works in chrome however. 使用firebug,我可以看到虽然已显示并成功发送了图块请求,但图像却未成功显示。

var baseLayer = new ol.layer.Tile({
    source: new ol.source.XYZ({
        url: 'http://xx.xx.xx.xx:33333/osm/{z}/{x}/{y}.png'
    })
});

var map = new ol.Map({
controls: ol.control.defaults().extend([
]),
    target: 'map',
    layers: [baseLayer],
    view: new ol.View2D({
    center: ol.proj.transform([21.999529, 50.041682], 'EPSG:4326', 'EPSG:3857'),
            zoom: 13
    })
});

Can you try putting a minus before your tile url's y value? 您可以尝试在图块网址的y值前加上减号吗?

var baseLayer = new ol.layer.Tile({
    source: new ol.source.XYZ({
        url: 'http://xx.xx.xx.xx:33333/osm/{z}/{x}/{-y}.png'
    })
});

EDIT: Wow... Super old question... My bad, but maybe someone can use this answer anyway.... 编辑:哇...超级老问题...我不好,但是也许有人仍然可以使用此答案....

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM