Does OpenLayers 3 support LineString and Polygon rendering on WebGL? I have set renderer to 'webgl' and tried to render a TopoJSON format Vector Tile but got the following error: "Uncaught TypeError: vectorSource.loadFeatures is not a function".
The following example from the OL3 web site only works if i remove the 'renderer' attribute from the map properties so the map is rendered using an HTML5 canvas:
var map = new ol.Map({
renderer: 'webgl',
layers: [
new ol.layer.VectorTile({
source: new ol.source.VectorTile({
attributions: [new ol.Attribution({
html: '© Mapbox ' +
'© ' +
'OpenStreetMap contributors'
})],
format: new ol.format.MVT(),
tileGrid: ol.tilegrid.createXYZ({maxZoom: 22}),
tilePixelRatio: 16,
url: 'http://{a-d}.tiles.mapbox.com/v4/mapbox.mapbox-streets-v6/' +
'{z}/{x}/{y}.vector.pbf?access_token=' + key
})
})
],
target: 'map',
view: new ol.View({
center: [0, 0],
zoom: 2
})
});
ol-debug.js(instead of the minifiedol.js), which gives you more readable error messages - Sidney Gijzen