I am trying to use OpenLayers 3 to display tiles from a TMS repository. I don't know why I only have some parts of may base layer displayed, north-west part as you can see:
Here is my code :
var NESource = new ol.source.XYZ({
projection: 'EPSG:4326'
, url: 'datatest/tms/NaturalEarthII/{z}/{x}/{-y}.jpg'
, crossOrigin: 'null'
});
var NETileLayer = new ol.layer.Tile({
source: NESource
, isBaseLayer: true
, wrapDateLine: false
, extent: [-180.0, -90.0, 180.0, 90.0]
});
var map = new ol.Map({
target: 'map',
renderer: 'canvas',
layers: [
NETileLayer
],
view: new ol.View({
projection: 'EPSG:4326'
, center: [0,0]
, zoom: 1
, extent: [-180.0, -90.0, 180.0, 90.0]
})
});
//Create the graticule component
var graticule = new ol.Graticule({
map: map
, strokeStyle: new ol.style.Stroke({
color: 'rgba(255,120,0,0.9)',
width: 2,
lineDash: [0.5, 4]
})
});
var extent = [-180.0, -90.0, 180.0, 90.0];
map.getView().fitExtent(extent, map.getSize());
Looking at Firefox console, I can see only those tiles (as said at the beginning) are requested, not all the extent.