Introduce new overlaps option for Vector and VectorTile sources

Instead of deciding whether to batch fills and strokes by looking at the
opacity of the style, we now rely on user input.
This commit is contained in:
Andreas Hocevar
2016-04-18 10:41:00 +02:00
parent 091dc9fbf4
commit 3c37ce3990
17 changed files with 132 additions and 62 deletions

View File

@@ -50,6 +50,7 @@ var map = new ol.Map({
'© <a href="http://www.openstreetmap.org/copyright">' +
'OpenStreetMap contributors</a>',
format: new ol.format.MVT(),
overlaps: false,
tileGrid: new ol.tilegrid.TileGrid({
extent: ol.proj.get('EPSG:3857').getExtent(),
resolutions: resolutions

View File

@@ -21,6 +21,7 @@ var map = new ol.Map({
'© <a href="http://www.openstreetmap.org/copyright">' +
'OpenStreetMap contributors</a>',
format: new ol.format.MVT(),
overlaps: false,
tileGrid: ol.tilegrid.createXYZ({maxZoom: 22}),
tilePixelRatio: 16,
url: 'http://{a-d}.tiles.mapbox.com/v4/mapbox.mapbox-streets-v6/' +

View File

@@ -92,6 +92,7 @@ var map = new ol.Map({
new ol.layer.VectorTile({
source: new ol.source.VectorTile({
format: format,
overlaps: false,
tileGrid: tileGrid,
url: 'http://{a-c}.tile.openstreetmap.us/' +
'vectiles-land-usages/{z}/{x}/{y}.topojson'

View File

@@ -29,7 +29,8 @@ var style = new ol.style.Style({
var vector = new ol.layer.Vector({
source: new ol.source.Vector({
url: 'data/topojson/world-110m.json',
format: new ol.format.TopoJSON()
format: new ol.format.TopoJSON(),
overlaps: false
}),
style: function(feature) {
// don't want to render the full world polygon, which repeats all countries