简体   繁体   中英

Openlayers3 with custom tile server

I've got a problem with the latest openlayers3 beta. I'm trying to use custom tile server using xyz layer. 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.

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?

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....

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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