Introduce ol.render.Feature

This commit is contained in:
Andreas Hocevar
2015-09-13 22:14:46 +09:00
parent 63629e1ee2
commit 6e2f82c397
27 changed files with 380 additions and 108 deletions
+11 -1
View File
@@ -17,6 +17,12 @@ describe('ol.format.MVT', function() {
describe('#readFeatures', function() {
it('uses ol.render.Feature as feature class by default', function() {
var format = new ol.format.MVT({layers: ['water']});
var features = format.readFeatures(data);
expect(features[0]).to.be.a(ol.render.Feature);
});
it('parses only specified layers', function() {
var format = new ol.format.MVT({layers: ['water']});
var features = format.readFeatures(data);
@@ -24,7 +30,10 @@ describe('ol.format.MVT', function() {
});
it('parses geometries correctly', function() {
var format = new ol.format.MVT({layers: ['poi_label']});
var format = new ol.format.MVT({
featureClass: ol.Feature,
layers: ['poi_label']
});
var pbf = new ol.ext.pbf(data);
var tile = new ol.ext.vectortile.VectorTile(pbf);
var geometry, rawGeometry;
@@ -66,3 +75,4 @@ goog.require('ol.Feature');
goog.require('ol.ext.pbf');
goog.require('ol.ext.vectortile');
goog.require('ol.format.MVT');
goog.require('ol.render.Feature');