Merge pull request #7620 from tschaub/rename

Rename variables in format modules
This commit is contained in:
Tim Schaub
2017-12-17 02:40:29 -07:00
committed by GitHub
96 changed files with 2379 additions and 2384 deletions

View File

@@ -1,5 +1,5 @@
import _ol_featureloader_ from '../../../src/ol/featureloader.js';
import _ol_format_GeoJSON_ from '../../../src/ol/format/GeoJSON.js';
import GeoJSON from '../../../src/ol/format/GeoJSON.js';
import _ol_source_Vector_ from '../../../src/ol/source/Vector.js';
@@ -13,7 +13,7 @@ describe('ol.featureloader', function() {
beforeEach(function() {
url = 'spec/ol/data/point.json';
format = new _ol_format_GeoJSON_();
format = new GeoJSON();
source = new _ol_source_Vector_();
});

View File

@@ -1,6 +1,6 @@
import _ol_Feature_ from '../../../../src/ol/Feature.js';
import * as _ol_extent_ from '../../../../src/ol/extent.js';
import _ol_format_EsriJSON_ from '../../../../src/ol/format/EsriJSON.js';
import EsriJSON from '../../../../src/ol/format/EsriJSON.js';
import LineString from '../../../../src/ol/geom/LineString.js';
import LinearRing from '../../../../src/ol/geom/LinearRing.js';
import MultiLineString from '../../../../src/ol/geom/MultiLineString.js';
@@ -15,7 +15,7 @@ describe('ol.format.EsriJSON', function() {
var format;
beforeEach(function() {
format = new _ol_format_EsriJSON_();
format = new EsriJSON();
});
var pointEsriJSON = {
@@ -265,7 +265,7 @@ describe('ol.format.EsriJSON', function() {
});
it('can create a feature with a specific geometryName', function() {
var feature = new _ol_format_EsriJSON_({geometryName: 'the_geom'}).
var feature = new EsriJSON({geometryName: 'the_geom'}).
readFeature(pointEsriJSON);
expect(feature.getGeometryName()).to.be('the_geom');
expect(feature.getGeometry()).to.be.an(Point);

View File

@@ -1,6 +1,6 @@
import _ol_Feature_ from '../../../../src/ol/Feature.js';
import * as _ol_extent_ from '../../../../src/ol/extent.js';
import _ol_format_GeoJSON_ from '../../../../src/ol/format/GeoJSON.js';
import GeoJSON from '../../../../src/ol/format/GeoJSON.js';
import Circle from '../../../../src/ol/geom/Circle.js';
import GeometryCollection from '../../../../src/ol/geom/GeometryCollection.js';
import LineString from '../../../../src/ol/geom/LineString.js';
@@ -15,7 +15,7 @@ describe('ol.format.GeoJSON', function() {
var format;
beforeEach(function() {
format = new _ol_format_GeoJSON_();
format = new GeoJSON();
});
var pointGeoJSON = {
@@ -215,7 +215,7 @@ describe('ol.format.GeoJSON', function() {
});
it('uses featureProjection passed to the constructor', function() {
var format = new _ol_format_GeoJSON_({featureProjection: 'EPSG:3857'});
var format = new GeoJSON({featureProjection: 'EPSG:3857'});
var feature = format.readFeatures(pointGeoJSON);
expect(feature[0].getGeometry()).to.be.an(Point);
expect(feature[0].getGeometry().getCoordinates()).to.eql(
@@ -223,7 +223,7 @@ describe('ol.format.GeoJSON', function() {
});
it('gives precedence to options passed to the read method', function() {
var format = new _ol_format_GeoJSON_({featureProjection: 'EPSG:1234'});
var format = new GeoJSON({featureProjection: 'EPSG:1234'});
var feature = format.readFeatures(pointGeoJSON, {
featureProjection: 'EPSG:3857'
});
@@ -254,7 +254,7 @@ describe('ol.format.GeoJSON', function() {
});
it('can create a feature with a specific geometryName', function() {
var feature = new _ol_format_GeoJSON_({geometryName: 'the_geom'}).
var feature = new GeoJSON({geometryName: 'the_geom'}).
readFeature(pointGeoJSON);
expect(feature.getGeometryName()).to.be('the_geom');
expect(feature.getGeometry()).to.be.an(Point);
@@ -322,7 +322,7 @@ describe('ol.format.GeoJSON', function() {
it('generates an array of features for Feature', function() {
var format = new _ol_format_GeoJSON_();
var format = new GeoJSON();
var json = {
type: 'Feature',
properties: {
@@ -604,7 +604,7 @@ describe('ol.format.GeoJSON', function() {
});
it('respects featureProjection passed to constructor', function() {
var format = new _ol_format_GeoJSON_({featureProjection: 'EPSG:3857'});
var format = new GeoJSON({featureProjection: 'EPSG:3857'});
var point = new Point(fromLonLat([10, 20]));
var geojson = format.writeGeometry(point);
var obj = JSON.parse(geojson);

View File

@@ -1,6 +1,6 @@
import _ol_Feature_ from '../../../../src/ol/Feature.js';
import _ol_format_GML_ from '../../../../src/ol/format/GML.js';
import _ol_format_GML2_ from '../../../../src/ol/format/GML2.js';
import GML2 from '../../../../src/ol/format/GML2.js';
import LineString from '../../../../src/ol/geom/LineString.js';
import LinearRing from '../../../../src/ol/geom/LinearRing.js';
import MultiLineString from '../../../../src/ol/geom/MultiLineString.js';
@@ -23,7 +23,7 @@ describe('ol.format.GML2', function() {
var format;
beforeEach(function() {
format = new _ol_format_GML2_({srsName: 'CRS:84'});
format = new GML2({srsName: 'CRS:84'});
});
describe('#readFeatures', function() {
@@ -32,7 +32,7 @@ describe('ol.format.GML2', function() {
var url = 'spec/ol/format/gml/osm-wfs-10.xml';
afterLoadText(url, function(xml) {
try {
features = new _ol_format_GML2_().readFeatures(xml);
features = new GML2().readFeatures(xml);
} catch (e) {
done(e);
}

View File

@@ -1,5 +1,5 @@
import _ol_Feature_ from '../../../../src/ol/Feature.js';
import _ol_format_GPX_ from '../../../../src/ol/format/GPX.js';
import GPX from '../../../../src/ol/format/GPX.js';
import LineString from '../../../../src/ol/geom/LineString.js';
import MultiLineString from '../../../../src/ol/geom/MultiLineString.js';
import Point from '../../../../src/ol/geom/Point.js';
@@ -11,7 +11,7 @@ describe('ol.format.GPX', function() {
var format;
beforeEach(function() {
format = new _ol_format_GPX_();
format = new GPX();
});
describe('#readProjection', function() {
@@ -550,7 +550,7 @@ describe('ol.format.GPX', function() {
describe('XML namespace support', function() {
beforeEach(function() {
format = new _ol_format_GPX_();
format = new GPX();
});
it('can read features with a version 1.0 namespace', function() {
@@ -591,7 +591,7 @@ describe('ol.format.GPX', function() {
describe('extensions support', function() {
beforeEach(function() {
format = new _ol_format_GPX_({
format = new GPX({
readExtensions: function(feature, extensionsNode) {
var nodes = extensionsNode.getElementsByTagName('id');
var id = nodes.item(0).textContent;
@@ -657,7 +657,7 @@ describe('ol.format.GPX', function() {
describe('write unsupported geometries', function() {
beforeEach(function() {
format = new _ol_format_GPX_();
format = new GPX();
});
it('does not fail', function() {

View File

@@ -1,4 +1,4 @@
import _ol_format_IGC_ from '../../../../src/ol/format/IGC.js';
import IGC from '../../../../src/ol/format/IGC.js';
import _ol_Feature_ from '../../../../src/ol/Feature.js';
import {get as getProjection, transform} from '../../../../src/ol/proj.js';
@@ -29,7 +29,7 @@ describe('ol.format.IGC', function() {
'G60189641B00B00800019000000000000';
beforeEach(function() {
format = new _ol_format_IGC_();
format = new IGC();
});
describe('#readProjectionFromText', function() {

View File

@@ -1,7 +1,7 @@
import _ol_Feature_ from '../../../../src/ol/Feature.js';
import _ol_array_ from '../../../../src/ol/array.js';
import _ol_format_GeoJSON_ from '../../../../src/ol/format/GeoJSON.js';
import _ol_format_KML_ from '../../../../src/ol/format/KML.js';
import GeoJSON from '../../../../src/ol/format/GeoJSON.js';
import KML from '../../../../src/ol/format/KML.js';
import GeometryCollection from '../../../../src/ol/geom/GeometryCollection.js';
import LineString from '../../../../src/ol/geom/LineString.js';
import LinearRing from '../../../../src/ol/geom/LinearRing.js';
@@ -33,13 +33,13 @@ describe('ol.format.KML', function() {
var dfltStyle = new _ol_style_Style_();
beforeEach(function() {
format = new _ol_format_KML_({
format = new KML({
defaultStyle: [dfltStyle]
});
});
it('set constant variables', function() {
expect(_ol_format_KML_.DEFAULT_STYLE_ARRAY_).to.be.an(Array);
expect(KML.DEFAULT_STYLE_ARRAY_).to.be.an(Array);
});
describe('#readFeatures', function() {
@@ -70,11 +70,11 @@ describe('ol.format.KML', function() {
describe('without parameters', function() {
beforeEach(function() {
format = new _ol_format_KML_();
format = new KML();
});
it('set constant variables', function() {
expect(_ol_format_KML_.DEFAULT_STYLE_ARRAY_).to.be.an(Array);
expect(KML.DEFAULT_STYLE_ARRAY_).to.be.an(Array);
});
describe('#readProjection', function() {
@@ -1720,11 +1720,11 @@ describe('ol.format.KML', function() {
expect(styleArray).to.have.length(1);
var style = styleArray[0];
expect(style).to.be.an(_ol_style_Style_);
expect(style.getFill()).to.be(_ol_format_KML_.DEFAULT_FILL_STYLE_);
expect(style.getFill()).to.be(KML.DEFAULT_FILL_STYLE_);
expect(style.getFill().getColor()).to.eql([255, 255, 255, 1]);
expect(style.getImage()).to.be(_ol_format_KML_.DEFAULT_IMAGE_STYLE_);
expect(style.getImage()).to.be(KML.DEFAULT_IMAGE_STYLE_);
// FIXME check image style
expect(style.getStroke()).to.be(_ol_format_KML_.DEFAULT_STROKE_STYLE_);
expect(style.getStroke()).to.be(KML.DEFAULT_STROKE_STYLE_);
expect(style.getStroke().getColor()).to.eql([255, 255, 255, 1]);
expect(style.getStroke().getWidth()).to.be(1);
});
@@ -1753,8 +1753,8 @@ describe('ol.format.KML', function() {
expect(styleArray).to.have.length(1);
var style = styleArray[0];
expect(style).to.be.an(_ol_style_Style_);
expect(style.getFill()).to.be(_ol_format_KML_.DEFAULT_FILL_STYLE_);
expect(style.getStroke()).to.be(_ol_format_KML_.DEFAULT_STROKE_STYLE_);
expect(style.getFill()).to.be(KML.DEFAULT_FILL_STYLE_);
expect(style.getStroke()).to.be(KML.DEFAULT_STROKE_STYLE_);
var imageStyle = style.getImage();
expect(imageStyle).to.be.an(_ol_style_Icon_);
expect(new URL(imageStyle.getSrc()).href).to.eql(new URL('http://foo.png').href);
@@ -1763,7 +1763,7 @@ describe('ol.format.KML', function() {
expect(imageStyle.getRotation()).to.eql(0);
expect(imageStyle.getSize()).to.be(null);
expect(imageStyle.getScale()).to.be(1);
expect(style.getText()).to.be(_ol_format_KML_.DEFAULT_TEXT_STYLE_);
expect(style.getText()).to.be(KML.DEFAULT_TEXT_STYLE_);
expect(style.getZIndex()).to.be(undefined);
});
@@ -1833,8 +1833,8 @@ describe('ol.format.KML', function() {
expect(styleArray).to.have.length(1);
var style = styleArray[0];
expect(style).to.be.an(_ol_style_Style_);
expect(style.getFill()).to.be(_ol_format_KML_.DEFAULT_FILL_STYLE_);
expect(style.getStroke()).to.be(_ol_format_KML_.DEFAULT_STROKE_STYLE_);
expect(style.getFill()).to.be(KML.DEFAULT_FILL_STYLE_);
expect(style.getStroke()).to.be(KML.DEFAULT_STROKE_STYLE_);
var imageStyle = style.getImage();
expect(imageStyle).to.be.an(_ol_style_Icon_);
expect(new URL(imageStyle.getSrc()).href).to.eql(new URL('http://foo.png').href);
@@ -1867,7 +1867,7 @@ describe('ol.format.KML', function() {
expect(imageStyle.getRotation()).to.eql(0);
expect(imageStyle.getSize()).to.be(null);
expect(imageStyle.getScale()).to.be(1);
expect(style.getText()).to.be(_ol_format_KML_.DEFAULT_TEXT_STYLE_);
expect(style.getText()).to.be(KML.DEFAULT_TEXT_STYLE_);
expect(style.getZIndex()).to.be(undefined);
});
});
@@ -1904,8 +1904,8 @@ describe('ol.format.KML', function() {
expect(styleArray).to.have.length(1);
var style = styleArray[0];
expect(style).to.be.an(_ol_style_Style_);
expect(style.getFill()).to.be(_ol_format_KML_.DEFAULT_FILL_STYLE_);
expect(style.getStroke()).to.be(_ol_format_KML_.DEFAULT_STROKE_STYLE_);
expect(style.getFill()).to.be(KML.DEFAULT_FILL_STYLE_);
expect(style.getStroke()).to.be(KML.DEFAULT_STROKE_STYLE_);
var imageStyle = style.getImage();
imageStyle.iconImage_.size_ = [144, 192];
expect(imageStyle.getSize()).to.eql([48, 48]);
@@ -1913,7 +1913,7 @@ describe('ol.format.KML', function() {
expect(imageStyle.getOrigin()).to.eql([24, 108]);
expect(imageStyle.getRotation()).to.eql(0);
expect(imageStyle.getScale()).to.eql(3.0);
expect(style.getText()).to.be(_ol_format_KML_.DEFAULT_TEXT_STYLE_);
expect(style.getText()).to.be(KML.DEFAULT_TEXT_STYLE_);
expect(style.getZIndex()).to.be(undefined);
});
@@ -1940,9 +1940,9 @@ describe('ol.format.KML', function() {
expect(styleArray).to.have.length(1);
var style = styleArray[0];
expect(style).to.be.an(_ol_style_Style_);
expect(style.getFill()).to.be(_ol_format_KML_.DEFAULT_FILL_STYLE_);
expect(style.getImage()).to.be(_ol_format_KML_.DEFAULT_IMAGE_STYLE_);
expect(style.getStroke()).to.be(_ol_format_KML_.DEFAULT_STROKE_STYLE_);
expect(style.getFill()).to.be(KML.DEFAULT_FILL_STYLE_);
expect(style.getImage()).to.be(KML.DEFAULT_IMAGE_STYLE_);
expect(style.getStroke()).to.be(KML.DEFAULT_STROKE_STYLE_);
var textStyle = style.getText();
expect(textStyle).to.be.an(_ol_style_Text_);
expect(textStyle.getScale()).to.be(0.25);
@@ -1975,13 +1975,13 @@ describe('ol.format.KML', function() {
expect(styleArray).to.have.length(1);
var style = styleArray[0];
expect(style).to.be.an(_ol_style_Style_);
expect(style.getFill()).to.be(_ol_format_KML_.DEFAULT_FILL_STYLE_);
expect(style.getImage()).to.be(_ol_format_KML_.DEFAULT_IMAGE_STYLE_);
expect(style.getFill()).to.be(KML.DEFAULT_FILL_STYLE_);
expect(style.getImage()).to.be(KML.DEFAULT_IMAGE_STYLE_);
var strokeStyle = style.getStroke();
expect(strokeStyle).to.be.an(_ol_style_Stroke_);
expect(strokeStyle.getColor()).to.eql([0x78, 0x56, 0x34, 0x12 / 255]);
expect(strokeStyle.getWidth()).to.be(9);
expect(style.getText()).to.be(_ol_format_KML_.DEFAULT_TEXT_STYLE_);
expect(style.getText()).to.be(KML.DEFAULT_TEXT_STYLE_);
expect(style.getZIndex()).to.be(undefined);
});
@@ -2010,9 +2010,9 @@ describe('ol.format.KML', function() {
var fillStyle = style.getFill();
expect(fillStyle).to.be.an(_ol_style_Fill_);
expect(fillStyle.getColor()).to.eql([0x78, 0x56, 0x34, 0x12 / 255]);
expect(style.getImage()).to.be(_ol_format_KML_.DEFAULT_IMAGE_STYLE_);
expect(style.getStroke()).to.be(_ol_format_KML_.DEFAULT_STROKE_STYLE_);
expect(style.getText()).to.be(_ol_format_KML_.DEFAULT_TEXT_STYLE_);
expect(style.getImage()).to.be(KML.DEFAULT_IMAGE_STYLE_);
expect(style.getStroke()).to.be(KML.DEFAULT_STROKE_STYLE_);
expect(style.getText()).to.be(KML.DEFAULT_TEXT_STYLE_);
expect(style.getZIndex()).to.be(undefined);
});
@@ -2047,12 +2047,12 @@ describe('ol.format.KML', function() {
var fillStyle = style.getFill();
expect(fillStyle).to.be.an(_ol_style_Fill_);
expect(fillStyle.getColor()).to.eql([0x78, 0x56, 0x34, 0x12 / 255]);
expect(style.getImage()).to.be(_ol_format_KML_.DEFAULT_IMAGE_STYLE_);
expect(style.getImage()).to.be(KML.DEFAULT_IMAGE_STYLE_);
var strokeStyle = style.getStroke();
expect(strokeStyle).to.be.an(_ol_style_Stroke_);
expect(strokeStyle.getColor()).to.eql([0x78, 0x56, 0x34, 0x12 / 255]);
expect(strokeStyle.getWidth()).to.be(9);
expect(style.getText()).to.be(_ol_format_KML_.DEFAULT_TEXT_STYLE_);
expect(style.getText()).to.be(KML.DEFAULT_TEXT_STYLE_);
expect(style.getZIndex()).to.be(undefined);
});
@@ -2084,12 +2084,12 @@ describe('ol.format.KML', function() {
var style = styleArray[0];
expect(style).to.be.an(_ol_style_Style_);
expect(style.getFill()).to.be(null);
expect(style.getImage()).to.be(_ol_format_KML_.DEFAULT_IMAGE_STYLE_);
expect(style.getImage()).to.be(KML.DEFAULT_IMAGE_STYLE_);
var strokeStyle = style.getStroke();
expect(strokeStyle).to.be.an(_ol_style_Stroke_);
expect(strokeStyle.getColor()).to.eql([0x78, 0x56, 0x34, 0x12 / 255]);
expect(strokeStyle.getWidth()).to.be(9);
expect(style.getText()).to.be(_ol_format_KML_.DEFAULT_TEXT_STYLE_);
expect(style.getText()).to.be(KML.DEFAULT_TEXT_STYLE_);
expect(style.getZIndex()).to.be(undefined);
});
@@ -2123,9 +2123,9 @@ describe('ol.format.KML', function() {
var fillStyle = style.getFill();
expect(fillStyle).to.be.an(_ol_style_Fill_);
expect(fillStyle.getColor()).to.eql([0x78, 0x56, 0x34, 0x12 / 255]);
expect(style.getImage()).to.be(_ol_format_KML_.DEFAULT_IMAGE_STYLE_);
expect(style.getImage()).to.be(KML.DEFAULT_IMAGE_STYLE_);
expect(style.getStroke()).to.be(null);
expect(style.getText()).to.be(_ol_format_KML_.DEFAULT_TEXT_STYLE_);
expect(style.getText()).to.be(KML.DEFAULT_TEXT_STYLE_);
expect(style.getZIndex()).to.be(undefined);
});
@@ -2159,9 +2159,9 @@ describe('ol.format.KML', function() {
var style = styleArray[0];
expect(style).to.be.an(_ol_style_Style_);
expect(style.getFill()).to.be(null);
expect(style.getImage()).to.be(_ol_format_KML_.DEFAULT_IMAGE_STYLE_);
expect(style.getImage()).to.be(KML.DEFAULT_IMAGE_STYLE_);
expect(style.getStroke()).to.be(null);
expect(style.getText()).to.be(_ol_format_KML_.DEFAULT_TEXT_STYLE_);
expect(style.getText()).to.be(KML.DEFAULT_TEXT_STYLE_);
expect(style.getZIndex()).to.be(undefined);
});
@@ -2312,7 +2312,7 @@ describe('ol.format.KML', function() {
});
it('does not write styles when writeStyles option is false', function() {
format = new _ol_format_KML_({writeStyles: false});
format = new KML({writeStyles: false});
var style = new _ol_style_Style_({
image: new _ol_style_Icon_({
src: 'http://foo.png'
@@ -2547,7 +2547,7 @@ describe('ol.format.KML', function() {
expect(styleArray).to.have.length(1);
var s = styleArray[0];
expect(s).to.be.an(_ol_style_Style_);
expect(s).to.be(_ol_format_KML_.DEFAULT_STYLE_);
expect(s).to.be(KML.DEFAULT_STYLE_);
});
@@ -2656,7 +2656,7 @@ describe('ol.format.KML', function() {
expect(styleArray).to.have.length(1);
var s = styleArray[0];
expect(s).to.be.an(_ol_style_Style_);
expect(s).to.be(_ol_format_KML_.DEFAULT_STYLE_);
expect(s).to.be(KML.DEFAULT_STYLE_);
});
it('can use Styles in StyleMaps before they are defined', function() {
@@ -3018,7 +3018,7 @@ describe('ol.format.KML', function() {
it('should ignore invalid coordinates', function() {
var doc = new DOMParser().parseFromString('<coordinates>INVALID</coordinates>', 'application/xml');
var node = doc.firstChild;
expect(_ol_format_KML_.readFlatCoordinates_(node)).to.be(undefined);
expect(KML.readFlatCoordinates_(node)).to.be(undefined);
});
it('should ignore Points with invalid coordinates', function() {
@@ -3230,7 +3230,7 @@ describe('ol.format.KML', function() {
});
it('feature must not have a properties property', function() {
var geojsonFormat = new _ol_format_GeoJSON_();
var geojsonFormat = new GeoJSON();
features.forEach(function(feature) {
var geojsonFeature = geojsonFormat.writeFeatureObject(feature);
expect(geojsonFeature.properties).to.be(null);

View File

@@ -1,6 +1,6 @@
import _ol_Feature_ from '../../../../src/ol/Feature.js';
import * as _ol_extent_ from '../../../../src/ol/extent.js';
import _ol_format_MVT_ from '../../../../src/ol/format/MVT.js';
import MVT from '../../../../src/ol/format/MVT.js';
import Point from '../../../../src/ol/geom/Point.js';
import Polygon from '../../../../src/ol/geom/Polygon.js';
import MultiPolygon from '../../../../src/ol/geom/MultiPolygon.js';
@@ -23,19 +23,19 @@ where('ArrayBuffer.isView').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 format = new 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 format = new MVT({layers: ['water']});
var features = format.readFeatures(data);
expect(features.length).to.be(10);
});
it('parses geometries correctly', function() {
var format = new _ol_format_MVT_({
var format = new MVT({
featureClass: _ol_Feature_,
layers: ['poi_label']
});
@@ -60,14 +60,14 @@ where('ArrayBuffer.isView').describe('ol.format.MVT', function() {
it('parses id property', function() {
// ol.Feature
var format = new _ol_format_MVT_({
var format = new MVT({
featureClass: _ol_Feature_,
layers: ['building']
});
var features = format.readFeatures(data);
expect(features[0].getId()).to.be(2);
// ol.render.Feature
format = new _ol_format_MVT_({
format = new MVT({
layers: ['building']
});
features = format.readFeatures(data);
@@ -75,7 +75,7 @@ where('ArrayBuffer.isView').describe('ol.format.MVT', function() {
});
it('sets the extent of the last readFeatures call', function() {
var format = new _ol_format_MVT_();
var format = new MVT();
format.readFeatures(data);
var extent = format.getLastExtent();
expect(_ol_extent_.getWidth(extent)).to.be(4096);
@@ -89,7 +89,7 @@ describe('ol.format.MVT', function() {
describe('#createFeature_', function() {
it('accepts a geometryName', function() {
var format = new _ol_format_MVT_({
var format = new MVT({
featureClass: _ol_Feature_,
geometryName: 'myGeom'
});
@@ -103,13 +103,13 @@ describe('ol.format.MVT', function() {
name: 'layer1'
}
};
var readRawGeometry_ = _ol_format_MVT_.readRawGeometry_;
_ol_format_MVT_.readRawGeometry_ = function({}, rawFeature, flatCoordinates, ends) {
var readRawGeometry_ = MVT.readRawGeometry_;
MVT.readRawGeometry_ = function({}, rawFeature, flatCoordinates, ends) {
flatCoordinates.push(0, 0);
ends.push(2);
};
var feature = format.createFeature_({}, rawFeature);
_ol_format_MVT_.readRawGeometry_ = readRawGeometry_;
MVT.readRawGeometry_ = readRawGeometry_;
var geometry = feature.getGeometry();
expect(geometry).to.be.a(Point);
expect(feature.get('myGeom')).to.equal(geometry);
@@ -117,7 +117,7 @@ describe('ol.format.MVT', function() {
});
it('detects a Polygon', function() {
var format = new _ol_format_MVT_({
var format = new MVT({
featureClass: _ol_Feature_
});
var rawFeature = {
@@ -127,20 +127,20 @@ describe('ol.format.MVT', function() {
name: 'layer1'
}
};
var readRawGeometry_ = _ol_format_MVT_.readRawGeometry_;
_ol_format_MVT_.readRawGeometry_ = function({}, rawFeature, flatCoordinates, ends) {
var readRawGeometry_ = MVT.readRawGeometry_;
MVT.readRawGeometry_ = function({}, rawFeature, flatCoordinates, ends) {
flatCoordinates.push(0, 0, 3, 0, 3, 3, 3, 0, 0, 0);
flatCoordinates.push(1, 1, 1, 2, 2, 2, 2, 1, 1, 1);
ends.push(10, 20);
};
var feature = format.createFeature_({}, rawFeature);
_ol_format_MVT_.readRawGeometry_ = readRawGeometry_;
MVT.readRawGeometry_ = readRawGeometry_;
var geometry = feature.getGeometry();
expect(geometry).to.be.a(Polygon);
});
it('detects a MultiPolygon', function() {
var format = new _ol_format_MVT_({
var format = new MVT({
featureClass: _ol_Feature_
});
var rawFeature = {
@@ -150,20 +150,20 @@ describe('ol.format.MVT', function() {
name: 'layer1'
}
};
var readRawGeometry_ = _ol_format_MVT_.readRawGeometry_;
_ol_format_MVT_.readRawGeometry_ = function({}, rawFeature, flatCoordinates, ends) {
var readRawGeometry_ = MVT.readRawGeometry_;
MVT.readRawGeometry_ = function({}, rawFeature, flatCoordinates, ends) {
flatCoordinates.push(0, 0, 1, 0, 1, 1, 1, 0, 0, 0);
flatCoordinates.push(1, 1, 2, 1, 2, 2, 2, 1, 1, 1);
ends.push(10, 20);
};
var feature = format.createFeature_({}, rawFeature);
_ol_format_MVT_.readRawGeometry_ = readRawGeometry_;
MVT.readRawGeometry_ = readRawGeometry_;
var geometry = feature.getGeometry();
expect(geometry).to.be.a(MultiPolygon);
});
it('creates ol.render.Feature instances', function() {
var format = new _ol_format_MVT_();
var format = new MVT();
var rawFeature = {
type: 3,
properties: {
@@ -173,10 +173,10 @@ describe('ol.format.MVT', function() {
name: 'layer1'
}
};
var readRawGeometry_ = _ol_format_MVT_.readRawGeometry_;
var readRawGeometry_ = MVT.readRawGeometry_;
var createdFlatCoordinates;
var createdEnds;
_ol_format_MVT_.readRawGeometry_ = function({}, rawFeature, flatCoordinates, ends) {
MVT.readRawGeometry_ = function({}, rawFeature, flatCoordinates, ends) {
flatCoordinates.push(0, 0, 1, 0, 1, 1, 1, 0, 0, 0);
flatCoordinates.push(1, 1, 2, 1, 2, 2, 2, 1, 1, 1);
createdFlatCoordinates = flatCoordinates;
@@ -184,7 +184,7 @@ describe('ol.format.MVT', function() {
createdEnds = ends;
};
var feature = format.createFeature_({}, rawFeature);
_ol_format_MVT_.readRawGeometry_ = readRawGeometry_;
MVT.readRawGeometry_ = readRawGeometry_;
expect(feature).to.be.a(_ol_render_Feature_);
expect(feature.getType()).to.be('Polygon');
expect(feature.getFlatCoordinates()).to.equal(createdFlatCoordinates);

View File

@@ -1,5 +1,5 @@
import _ol_Feature_ from '../../../../src/ol/Feature.js';
import _ol_format_OSMXML_ from '../../../../src/ol/format/OSMXML.js';
import OSMXML from '../../../../src/ol/format/OSMXML.js';
import Point from '../../../../src/ol/geom/Point.js';
import LineString from '../../../../src/ol/geom/LineString.js';
import {get as getProjection, transform} from '../../../../src/ol/proj.js';
@@ -9,7 +9,7 @@ describe('ol.format.OSMXML', function() {
var format;
beforeEach(function() {
format = new _ol_format_OSMXML_();
format = new OSMXML();
});
describe('#readProjection', function() {

View File

@@ -1,10 +1,10 @@
import _ol_format_OWS_ from '../../../../src/ol/format/OWS.js';
import OWS from '../../../../src/ol/format/OWS.js';
import _ol_xml_ from '../../../../src/ol/xml.js';
describe('ol.format.OWS 1.1', function() {
var parser = new _ol_format_OWS_();
var parser = new OWS();
it('should read ServiceProvider tag properly', function() {
var doc = _ol_xml_.parse(

View File

@@ -1,5 +1,5 @@
import _ol_Feature_ from '../../../../src/ol/Feature.js';
import _ol_format_Polyline_ from '../../../../src/ol/format/Polyline.js';
import Polyline from '../../../../src/ol/format/Polyline.js';
import LineString from '../../../../src/ol/geom/LineString.js';
import {get as getProjection, transform} from '../../../../src/ol/proj.js';
@@ -14,7 +14,7 @@ describe('ol.format.Polyline', function() {
var points3857;
function resetTestingData() {
format = new _ol_format_Polyline_();
format = new Polyline();
points = [
[-120.20000, 38.50000],
[-120.95000, 40.70000],
@@ -60,7 +60,7 @@ describe('ol.format.Polyline', function() {
describe('encodeDeltas', function() {
it('returns expected value', function() {
var encodeDeltas = _ol_format_Polyline_.encodeDeltas;
var encodeDeltas = Polyline.encodeDeltas;
expect(encodeDeltas(flippedFlatPoints, 2)).to.eql(encodedFlatPoints);
});
@@ -68,7 +68,7 @@ describe('ol.format.Polyline', function() {
describe('decodeDeltas', function() {
it('returns expected value', function() {
var decodeDeltas = _ol_format_Polyline_.decodeDeltas;
var decodeDeltas = Polyline.decodeDeltas;
expect(decodeDeltas(encodedFlatPoints, 2)).to.eql(flippedFlatPoints);
});
@@ -77,7 +77,7 @@ describe('ol.format.Polyline', function() {
describe('encodeFloats', function() {
it('returns expected value', function() {
var encodeFloats = _ol_format_Polyline_.encodeFloats;
var encodeFloats = Polyline.encodeFloats;
expect(encodeFloats(smallFloats)).to.eql(encodedFloats);
@@ -90,7 +90,7 @@ describe('ol.format.Polyline', function() {
describe('decodeFloats', function() {
it('returns expected value', function() {
var decodeFloats = _ol_format_Polyline_.decodeFloats;
var decodeFloats = Polyline.decodeFloats;
expect(decodeFloats(encodedFloats)).to.eql(smallFloats);
expect(decodeFloats(encodedFloats, 1e5)).to.eql(smallFloats);
@@ -101,7 +101,7 @@ describe('ol.format.Polyline', function() {
describe('encodeSignedIntegers', function() {
it('returns expected value', function() {
var encodeSignedIntegers = _ol_format_Polyline_.encodeSignedIntegers;
var encodeSignedIntegers = Polyline.encodeSignedIntegers;
expect(encodeSignedIntegers(
signedIntegers)).to.eql(encodedSignedIntegers);
@@ -110,7 +110,7 @@ describe('ol.format.Polyline', function() {
describe('decodeSignedIntegers', function() {
it('returns expected value', function() {
var decodeSignedIntegers = _ol_format_Polyline_.decodeSignedIntegers;
var decodeSignedIntegers = Polyline.decodeSignedIntegers;
expect(decodeSignedIntegers(
encodedSignedIntegers)).to.eql(signedIntegers);
@@ -120,7 +120,7 @@ describe('ol.format.Polyline', function() {
describe('encodeUnsignedIntegers', function() {
it('returns expected value', function() {
var encodeUnsignedIntegers = _ol_format_Polyline_.encodeUnsignedIntegers;
var encodeUnsignedIntegers = Polyline.encodeUnsignedIntegers;
expect(encodeUnsignedIntegers(
unsignedIntegers)).to.eql(encodedUnsignedIntegers);
@@ -129,7 +129,7 @@ describe('ol.format.Polyline', function() {
describe('decodeUnsignedIntegers', function() {
it('returns expected value', function() {
var decodeUnsignedIntegers = _ol_format_Polyline_.decodeUnsignedIntegers;
var decodeUnsignedIntegers = Polyline.decodeUnsignedIntegers;
expect(decodeUnsignedIntegers(
encodedUnsignedIntegers)).to.eql(unsignedIntegers);
@@ -139,7 +139,7 @@ describe('ol.format.Polyline', function() {
describe('encodeFloat', function() {
it('returns expected value', function() {
var encodeFloats = _ol_format_Polyline_.encodeFloats;
var encodeFloats = Polyline.encodeFloats;
expect(encodeFloats([0.00000])).to.eql('?');
expect(encodeFloats([-0.00001])).to.eql('@');
@@ -162,7 +162,7 @@ describe('ol.format.Polyline', function() {
describe('decodeFloat', function() {
it('returns expected value', function() {
var decodeFloats = _ol_format_Polyline_.decodeFloats;
var decodeFloats = Polyline.decodeFloats;
expect(decodeFloats('?')).to.eql([0.00000]);
expect(decodeFloats('@')).to.eql([-0.00001]);
@@ -186,7 +186,7 @@ describe('ol.format.Polyline', function() {
describe('encodeSignedInteger', function() {
it('returns expected value', function() {
var encodeSignedIntegers = _ol_format_Polyline_.encodeSignedIntegers;
var encodeSignedIntegers = Polyline.encodeSignedIntegers;
expect(encodeSignedIntegers([0])).to.eql('?');
expect(encodeSignedIntegers([-1])).to.eql('@');
@@ -204,7 +204,7 @@ describe('ol.format.Polyline', function() {
describe('decodeSignedInteger', function() {
it('returns expected value', function() {
var decodeSignedIntegers = _ol_format_Polyline_.decodeSignedIntegers;
var decodeSignedIntegers = Polyline.decodeSignedIntegers;
expect(decodeSignedIntegers('?')).to.eql([0]);
expect(decodeSignedIntegers('@')).to.eql([-1]);
@@ -223,7 +223,7 @@ describe('ol.format.Polyline', function() {
describe('encodeUnsignedInteger', function() {
it('returns expected value', function() {
var encodeUnsignedInteger = _ol_format_Polyline_.encodeUnsignedInteger;
var encodeUnsignedInteger = Polyline.encodeUnsignedInteger;
expect(encodeUnsignedInteger(0)).to.eql('?');
expect(encodeUnsignedInteger(1)).to.eql('@');
@@ -243,7 +243,7 @@ describe('ol.format.Polyline', function() {
describe('decodeUnsignedInteger', function() {
it('returns expected value', function() {
var decodeUnsignedIntegers = _ol_format_Polyline_.decodeUnsignedIntegers;
var decodeUnsignedIntegers = Polyline.decodeUnsignedIntegers;
expect(decodeUnsignedIntegers('?')).to.eql([0]);
expect(decodeUnsignedIntegers('@')).to.eql([1]);
@@ -320,12 +320,12 @@ describe('ol.format.Polyline', function() {
});
it('parses XYZ linestring', function() {
var xyz = _ol_format_Polyline_.encodeDeltas([
var xyz = Polyline.encodeDeltas([
38.500, -120.200, 100,
40.700, -120.950, 200,
43.252, -126.453, 20
], 3);
var format = new _ol_format_Polyline_({
var format = new Polyline({
geometryLayout: 'XYZ'
});

View File

@@ -1,9 +1,9 @@
import _ol_Feature_ from '../../../../src/ol/Feature.js';
import MultiPolygon from '../../../../src/ol/geom/MultiPolygon.js';
import Polygon from '../../../../src/ol/geom/Polygon.js';
import _ol_format_Feature_ from '../../../../src/ol/format/Feature.js';
import FeatureFormat from '../../../../src/ol/format/Feature.js';
import {transform} from '../../../../src/ol/proj.js';
import _ol_format_TopoJSON_ from '../../../../src/ol/format/TopoJSON.js';
import TopoJSON from '../../../../src/ol/format/TopoJSON.js';
var aruba = {
type: 'Topology',
@@ -42,13 +42,13 @@ describe('ol.format.TopoJSON', function() {
var format;
before(function() {
format = new _ol_format_TopoJSON_();
format = new TopoJSON();
});
describe('constructor', function() {
it('creates a new format', function() {
expect(format).to.be.a(_ol_format_Feature_);
expect(format).to.be.a(_ol_format_TopoJSON_);
expect(format).to.be.a(FeatureFormat);
expect(format).to.be.a(TopoJSON);
});
});
@@ -176,7 +176,7 @@ describe('ol.format.TopoJSON', function() {
it('sets the topology\'s child names as feature property', function(done) {
afterLoadText('spec/ol/format/topojson/world-110m.json', function(text) {
var format = new _ol_format_TopoJSON_({
var format = new TopoJSON({
layerName: 'layer'
});
var features = format.readFeatures(text);
@@ -188,7 +188,7 @@ describe('ol.format.TopoJSON', function() {
it('only parses features from specified topology\'s children', function(done) {
afterLoadText('spec/ol/format/topojson/world-110m.json', function(text) {
var format = new _ol_format_TopoJSON_({
var format = new TopoJSON({
layers: ['land']
});
var features = format.readFeatures(text);

View File

@@ -1,6 +1,6 @@
import _ol_Feature_ from '../../../../src/ol/Feature.js';
import _ol_format_GML2_ from '../../../../src/ol/format/GML2.js';
import _ol_format_WFS_ from '../../../../src/ol/format/WFS.js';
import GML2 from '../../../../src/ol/format/GML2.js';
import WFS from '../../../../src/ol/format/WFS.js';
import _ol_format_filter_ from '../../../../src/ol/format/filter.js';
import LineString from '../../../../src/ol/geom/LineString.js';
import MultiLineString from '../../../../src/ol/geom/MultiLineString.js';
@@ -16,7 +16,7 @@ describe('ol.format.WFS', function() {
describe('featureType', function() {
it('#getFeatureType #setFeatureType', function() {
var format = new _ol_format_WFS_({
var format = new WFS({
featureNS: 'http://www.openplans.org/topp',
featureType: ['foo', 'bar']
});
@@ -41,7 +41,7 @@ describe('ol.format.WFS', function() {
afterLoadText('spec/ol/format/wfs/topp-states-wfs.xml', function(data) {
try {
xml = data;
features = new _ol_format_WFS_(config).readFeatures(xml);
features = new WFS(config).readFeatures(xml);
} catch (e) {
done(e);
}
@@ -67,7 +67,7 @@ describe('ol.format.WFS', function() {
});
it('transforms and creates a polygon for Illinois', function() {
features = new _ol_format_WFS_(config).readFeatures(xml, {
features = new WFS(config).readFeatures(xml, {
featureProjection: 'EPSG:3857'
});
feature = features[0];
@@ -88,7 +88,7 @@ describe('ol.format.WFS', function() {
var config = {
'featureNS': 'http://mapserver.gis.umn.edu/mapserver',
'featureType': 'polygon',
'gmlFormat': new _ol_format_GML2_()
'gmlFormat': new GML2()
};
before(function(done) {
@@ -97,7 +97,7 @@ describe('ol.format.WFS', function() {
afterLoadText('spec/ol/format/wfs/polygonv2.xml', function(data) {
try {
xml = data;
features = new _ol_format_WFS_(config).readFeatures(xml);
features = new WFS(config).readFeatures(xml);
} catch (e) {
done(e);
}
@@ -138,7 +138,7 @@ describe('ol.format.WFS', function() {
});
});
it('returns an empty array of features when none exist', function() {
var result = new _ol_format_WFS_().readFeatures(xml);
var result = new WFS().readFeatures(xml);
expect(result).to.have.length(0);
});
});
@@ -149,7 +149,7 @@ describe('ol.format.WFS', function() {
afterLoadText('spec/ol/format/wfs/NumberOfFeatures.xml',
function(xml) {
try {
response = new _ol_format_WFS_().readFeatureCollectionMetadata(xml);
response = new WFS().readFeatureCollectionMetadata(xml);
} catch (e) {
done(e);
}
@@ -172,7 +172,7 @@ describe('ol.format.WFS', function() {
afterLoadText('spec/ol/format/wfs/boundedBy.xml',
function(xml) {
try {
response = new _ol_format_WFS_().readFeatureCollectionMetadata(xml);
response = new WFS().readFeatureCollectionMetadata(xml);
} catch (e) {
done(e);
}
@@ -191,7 +191,7 @@ describe('ol.format.WFS', function() {
afterLoadText('spec/ol/format/wfs/TransactionResponse.xml',
function(xml) {
try {
response = new _ol_format_WFS_().readTransactionResponse(xml);
response = new WFS().readTransactionResponse(xml);
} catch (e) {
done(e);
}
@@ -226,7 +226,7 @@ describe('ol.format.WFS', function() {
' <wfs:PropertyName>STATE_ABBR</wfs:PropertyName>' +
' </wfs:Query>' +
'</wfs:GetFeature>';
var serialized = new _ol_format_WFS_().writeGetFeature({
var serialized = new WFS().writeGetFeature({
resultType: 'hits',
featureTypes: ['states'],
featureNS: 'http://www.openplans.org/topp',
@@ -251,7 +251,7 @@ describe('ol.format.WFS', function() {
' xmlns:topp="http://www.openplans.org/topp">' +
' </wfs:Query>' +
'</wfs:GetFeature>';
var serialized = new _ol_format_WFS_().writeGetFeature({
var serialized = new WFS().writeGetFeature({
count: 10,
startIndex: 20,
srsName: 'urn:ogc:def:crs:EPSG::4326',
@@ -278,7 +278,7 @@ describe('ol.format.WFS', function() {
' </ogc:BBOX>' +
' </ogc:Filter>' +
'</wfs:Query>';
var serialized = new _ol_format_WFS_().writeGetFeature({
var serialized = new WFS().writeGetFeature({
srsName: 'urn:ogc:def:crs:EPSG::4326',
featureNS: 'http://www.openplans.org/topp',
featurePrefix: 'topp',
@@ -301,7 +301,7 @@ describe('ol.format.WFS', function() {
' </ogc:PropertyIsEqualTo>' +
' </ogc:Filter>' +
'</wfs:Query>';
var serialized = new _ol_format_WFS_().writeGetFeature({
var serialized = new WFS().writeGetFeature({
srsName: 'urn:ogc:def:crs:EPSG::4326',
featureNS: 'http://www.openplans.org/topp',
featurePrefix: 'topp',
@@ -329,7 +329,7 @@ describe('ol.format.WFS', function() {
' </ogc:Or>' +
' </ogc:Filter>' +
'</wfs:Query>';
var serialized = new _ol_format_WFS_().writeGetFeature({
var serialized = new WFS().writeGetFeature({
srsName: 'urn:ogc:def:crs:EPSG::4326',
featureNS: 'http://www.openplans.org/topp',
featurePrefix: 'topp',
@@ -371,7 +371,7 @@ describe('ol.format.WFS', function() {
' </ogc:Or>' +
' </ogc:Filter>' +
'</wfs:Query>';
var serialized = new _ol_format_WFS_().writeGetFeature({
var serialized = new WFS().writeGetFeature({
srsName: 'urn:ogc:def:crs:EPSG::4326',
featureNS: 'http://www.openplans.org/topp',
featurePrefix: 'topp',
@@ -403,7 +403,7 @@ describe('ol.format.WFS', function() {
' </ogc:PropertyIsBetween>' +
' </ogc:Filter>' +
'</wfs:Query>';
var serialized = new _ol_format_WFS_().writeGetFeature({
var serialized = new WFS().writeGetFeature({
srsName: 'urn:ogc:def:crs:EPSG::4326',
featureNS: 'http://www.openplans.org/topp',
featurePrefix: 'topp',
@@ -424,7 +424,7 @@ describe('ol.format.WFS', function() {
' </ogc:PropertyIsNull>' +
' </ogc:Filter>' +
'</wfs:Query>';
var serialized = new _ol_format_WFS_().writeGetFeature({
var serialized = new WFS().writeGetFeature({
srsName: 'urn:ogc:def:crs:EPSG::4326',
featureNS: 'http://www.openplans.org/topp',
featurePrefix: 'topp',
@@ -446,7 +446,7 @@ describe('ol.format.WFS', function() {
' </ogc:PropertyIsLike>' +
' </ogc:Filter>' +
'</wfs:Query>';
var serialized = new _ol_format_WFS_().writeGetFeature({
var serialized = new WFS().writeGetFeature({
srsName: 'urn:ogc:def:crs:EPSG::4326',
featureNS: 'http://www.openplans.org/topp',
featurePrefix: 'topp',
@@ -468,7 +468,7 @@ describe('ol.format.WFS', function() {
' </ogc:PropertyIsLike>' +
' </ogc:Filter>' +
'</wfs:Query>';
var serialized = new _ol_format_WFS_().writeGetFeature({
var serialized = new WFS().writeGetFeature({
srsName: 'urn:ogc:def:crs:EPSG::4326',
featureNS: 'http://www.openplans.org/topp',
featurePrefix: 'topp',
@@ -492,7 +492,7 @@ describe('ol.format.WFS', function() {
' </ogc:Not>' +
' </ogc:Filter>' +
'</wfs:Query>';
var serialized = new _ol_format_WFS_().writeGetFeature({
var serialized = new WFS().writeGetFeature({
srsName: 'urn:ogc:def:crs:EPSG::4326',
featureNS: 'http://www.openplans.org/topp',
featurePrefix: 'topp',
@@ -528,7 +528,7 @@ describe('ol.format.WFS', function() {
' </ogc:And>' +
' </ogc:Filter>' +
'</wfs:Query>';
var serialized = new _ol_format_WFS_().writeGetFeature({
var serialized = new WFS().writeGetFeature({
srsName: 'urn:ogc:def:crs:EPSG::4326',
featureNS: 'http://www.openplans.org/topp',
featurePrefix: 'topp',
@@ -562,7 +562,7 @@ describe('ol.format.WFS', function() {
' </ogc:Contains>' +
' </ogc:Filter>' +
'</wfs:Query>';
var serialized = new _ol_format_WFS_().writeGetFeature({
var serialized = new WFS().writeGetFeature({
srsName: 'EPSG:4326',
featureTypes: ['area'],
filter: _ol_format_filter_.contains(
@@ -599,7 +599,7 @@ describe('ol.format.WFS', function() {
' </ogc:Intersects>' +
' </ogc:Filter>' +
'</wfs:Query>';
var serialized = new _ol_format_WFS_().writeGetFeature({
var serialized = new WFS().writeGetFeature({
srsName: 'EPSG:4326',
featureTypes: ['area'],
filter: _ol_format_filter_.intersects(
@@ -636,7 +636,7 @@ describe('ol.format.WFS', function() {
' </ogc:Within>' +
' </ogc:Filter>' +
'</wfs:Query>';
var serialized = new _ol_format_WFS_().writeGetFeature({
var serialized = new WFS().writeGetFeature({
srsName: 'EPSG:4326',
featureTypes: ['area'],
filter: _ol_format_filter_.within(
@@ -676,7 +676,7 @@ describe('ol.format.WFS', function() {
' </ogc:Filter>' +
'</wfs:Query>';
var serialized = new _ol_format_WFS_().writeGetFeature({
var serialized = new WFS().writeGetFeature({
srsName: 'EPSG:4326',
featureTypes: ['states'],
filter: _ol_format_filter_.during('date_prop', '2010-01-20T00:00:00Z', '2012-12-31T00:00:00Z')
@@ -695,7 +695,7 @@ describe('ol.format.WFS', function() {
'service="WFS" version="1.1.0" handle="handle_t" ' +
'xsi:schemaLocation="http://www.opengis.net/wfs ' +
'http://schemas.opengis.net/wfs/1.1.0/wfs.xsd"/>';
var serialized = new _ol_format_WFS_().writeTransaction(null, null, null,
var serialized = new WFS().writeTransaction(null, null, null,
{handle: 'handle_t'});
expect(serialized).to.xmleql(_ol_xml_.parse(text));
});
@@ -711,7 +711,7 @@ describe('ol.format.WFS', function() {
});
});
it('creates the correct srsName', function() {
var format = new _ol_format_WFS_();
var format = new WFS();
var insertFeature = new _ol_Feature_({
the_geom: new MultiLineString([[
[-5178372.1885436, 1992365.7775042],
@@ -742,7 +742,7 @@ describe('ol.format.WFS', function() {
});
it('creates the correct update', function() {
var format = new _ol_format_WFS_();
var format = new WFS();
var updateFeature = new _ol_Feature_();
updateFeature.setGeometryName('the_geom');
updateFeature.setGeometry(new MultiLineString([[
@@ -763,7 +763,7 @@ describe('ol.format.WFS', function() {
});
it('creates the correct update if geometry name is alias', function() {
var format = new _ol_format_WFS_();
var format = new WFS();
var updateFeature = new _ol_Feature_(new MultiLineString([[
[-12279454, 6741885],
[-12064207, 6732101],
@@ -787,7 +787,7 @@ describe('ol.format.WFS', function() {
describe('when writing out a Transaction request', function() {
it('creates the correct update with default featurePrefix', function() {
var format = new _ol_format_WFS_();
var format = new WFS();
var updateFeature = new _ol_Feature_();
updateFeature.setGeometryName('the_geom');
updateFeature.setGeometry(new MultiLineString([[
@@ -810,7 +810,7 @@ describe('ol.format.WFS', function() {
describe('when writing out a Transaction request', function() {
it('does not create an update if no fid', function() {
var format = new _ol_format_WFS_();
var format = new WFS();
var updateFeature = new _ol_Feature_();
updateFeature.setGeometryName('the_geom');
updateFeature.setGeometry(new MultiLineString([[
@@ -843,7 +843,7 @@ describe('ol.format.WFS', function() {
});
it('handles multiple geometries', function() {
var format = new _ol_format_WFS_();
var format = new WFS();
var updateFeature = new _ol_Feature_();
updateFeature.setGeometryName('the_geom');
updateFeature.setGeometry(new MultiLineString([[
@@ -878,7 +878,7 @@ describe('ol.format.WFS', function() {
});
it('creates the correct transaction body', function() {
var format = new _ol_format_WFS_();
var format = new WFS();
var insertFeature = new _ol_Feature_({
the_geom: new MultiPoint([[1, 2]]),
foo: 'bar',
@@ -921,7 +921,7 @@ describe('ol.format.WFS', function() {
});
it('handles writing out Native', function() {
var format = new _ol_format_WFS_();
var format = new WFS();
var serialized = format.writeTransaction(null, null, null, {
nativeElements: [{
vendorId: 'ORACLE',
@@ -948,7 +948,7 @@ describe('ol.format.WFS', function() {
});
it('handles the WFS version', function() {
var format = new _ol_format_WFS_();
var format = new WFS();
var insertFeature = new _ol_Feature_({
the_geom: new LineString([[1.1, 2], [3, 4.2]]),
foo: 'bar',
@@ -992,7 +992,7 @@ describe('ol.format.WFS', function() {
});
it('do not add feature prefix twice', function() {
var format = new _ol_format_WFS_();
var format = new WFS();
var insertFeature = new _ol_Feature_({
the_geom: new MultiPoint([[1, 2]]),
foo: 'bar',
@@ -1035,7 +1035,7 @@ describe('ol.format.WFS', function() {
});
it('handles 3D in WFS 1.0.0', function() {
var format = new _ol_format_WFS_();
var format = new WFS();
var insertFeature = new _ol_Feature_({
the_geom: new LineString([[1.1, 2, 4], [3, 4.2, 5]]),
foo: 'bar',
@@ -1077,7 +1077,7 @@ describe('ol.format.WFS', function() {
});
it('handles 3D in WFS 1.1.0', function() {
var format = new _ol_format_WFS_();
var format = new WFS();
var insertFeature = new _ol_Feature_({
the_geom: new MultiPoint([[1, 2, 3]]),
foo: 'bar',
@@ -1117,7 +1117,7 @@ describe('ol.format.WFS', function() {
});
it('handles writing multiple Query elements', function() {
var format = new _ol_format_WFS_();
var format = new WFS();
var serialized = format.writeGetFeature({
featureNS: 'http://www.openplans.org/topp',
featureTypes: ['states', 'cities'],
@@ -1137,7 +1137,7 @@ describe('ol.format.WFS', function() {
'featureNS': 'http://mapserver.gis.umn.edu/mapserver',
'featureType': 'Historische_Messtischblaetter_WFS'
};
features = new _ol_format_WFS_(config).readFeatures(xml);
features = new WFS(config).readFeatures(xml);
} catch (e) {
done(e);
}
@@ -1165,7 +1165,7 @@ describe('ol.format.WFS', function() {
before(function(done) {
afterLoadText('spec/ol/format/gml/multiple-typenames.xml', function(xml) {
try {
features = new _ol_format_WFS_({
features = new WFS({
featureNS: 'http://localhost:8080/official',
featureType: ['planet_osm_polygon', 'planet_osm_line']
}).readFeatures(xml);
@@ -1188,11 +1188,11 @@ describe('ol.format.WFS', function() {
before(function(done) {
afterLoadText('spec/ol/format/gml/multiple-typenames.xml', function(xml) {
try {
lineFeatures = new _ol_format_WFS_({
lineFeatures = new WFS({
featureNS: 'http://localhost:8080/official',
featureType: ['planet_osm_line']
}).readFeatures(xml);
polygonFeatures = new _ol_format_WFS_({
polygonFeatures = new WFS({
featureNS: 'http://localhost:8080/official',
featureType: ['planet_osm_polygon']
}).readFeatures(xml);
@@ -1216,7 +1216,7 @@ describe('ol.format.WFS', function() {
before(function(done) {
afterLoadText('spec/ol/format/gml/multiple-typenames.xml', function(xml) {
try {
features = new _ol_format_WFS_().readFeatures(xml);
features = new WFS().readFeatures(xml);
} catch (e) {
done(e);
}
@@ -1236,7 +1236,7 @@ describe('ol.format.WFS', function() {
before(function(done) {
afterLoadText('spec/ol/format/gml/multiple-typenames-mapserver.xml', function(xml) {
try {
features = new _ol_format_WFS_().readFeatures(xml);
features = new WFS().readFeatures(xml);
} catch (e) {
done(e);
}
@@ -1259,11 +1259,11 @@ describe('ol.format.WFS', function() {
before(function(done) {
afterLoadText('spec/ol/format/gml/multiple-typenames-mapserver.xml', function(xml) {
try {
busFeatures = new _ol_format_WFS_({
busFeatures = new WFS({
featureNS: 'http://mapserver.gis.umn.edu/mapserver',
featureType: ['bus_stop']
}).readFeatures(xml);
infoFeatures = new _ol_format_WFS_({
infoFeatures = new WFS({
featureNS: 'http://mapserver.gis.umn.edu/mapserver',
featureType: ['information']
}).readFeatures(xml);
@@ -1296,7 +1296,7 @@ describe('ol.format.WFS', function() {
' </PropertyIsEqualTo>' +
' </And>' +
'</Filter>';
var serialized = _ol_format_WFS_.writeFilter(
var serialized = WFS.writeFilter(
_ol_format_filter_.and(
_ol_format_filter_.like('name', 'Mississippi*'),
_ol_format_filter_.equalTo('waterway', 'riverbank')

View File

@@ -1,12 +1,12 @@
import _ol_Feature_ from '../../../../src/ol/Feature.js';
import Point from '../../../../src/ol/geom/Point.js';
import _ol_format_WKT_ from '../../../../src/ol/format/WKT.js';
import WKT from '../../../../src/ol/format/WKT.js';
import {transform} from '../../../../src/ol/proj.js';
describe('ol.format.WKT', function() {
var format = new _ol_format_WKT_();
var format = new WKT();
describe('#readProjectionFromText', function() {
it('returns the default projection', function() {
@@ -779,7 +779,7 @@ describe('ol.format.WKT', function() {
});
it('GeometryCollection split / merged correctly', function() {
format = new _ol_format_WKT_({splitCollection: true});
format = new WKT({splitCollection: true});
var wkt = 'GEOMETRYCOLLECTION(POINT(4 6),LINESTRING(4 6,7 10))';
var features = format.readFeatures(wkt);
expect(features.length).to.eql(2);

View File

@@ -1,10 +1,10 @@
import _ol_format_WMSCapabilities_ from '../../../../src/ol/format/WMSCapabilities.js';
import WMSCapabilities from '../../../../src/ol/format/WMSCapabilities.js';
describe('ol.format.WMSCapabilities', function() {
describe('when parsing ogcsample.xml', function() {
var parser = new _ol_format_WMSCapabilities_();
var parser = new WMSCapabilities();
var capabilities;
before(function(done) {
afterLoadText('spec/ol/format/wms/ogcsample.xml', function(xml) {

View File

@@ -1,4 +1,4 @@
import _ol_format_WMSGetFeatureInfo_ from '../../../../src/ol/format/WMSGetFeatureInfo.js';
import WMSGetFeatureInfo from '../../../../src/ol/format/WMSGetFeatureInfo.js';
import {addCommon, clearAllProjections} from '../../../../src/ol/proj.js';
import {register} from '../../../../src/ol/proj/proj4.js';
@@ -8,12 +8,12 @@ describe('ol.format.WMSGetFeatureInfo', function() {
describe('#getLayers', function() {
it('returns null if layers is undefined', function() {
var format = new _ol_format_WMSGetFeatureInfo_();
var format = new WMSGetFeatureInfo();
expect(format.getLayers()).to.be(null);
});
it('returns the value provided in the layers option', function() {
var format = new _ol_format_WMSGetFeatureInfo_({
var format = new WMSGetFeatureInfo({
layers: ['a', 'z']
});
expect(format.getLayers()).to.eql(['a', 'z']);
@@ -32,7 +32,7 @@ describe('ol.format.WMSGetFeatureInfo', function() {
register(proj4);
afterLoadText('spec/ol/format/wms/getfeatureinfo.xml', function(data) {
try {
features = new _ol_format_WMSGetFeatureInfo_().readFeatures(data);
features = new WMSGetFeatureInfo().readFeatures(data);
} catch (e) {
done(e);
}
@@ -73,7 +73,7 @@ describe('ol.format.WMSGetFeatureInfo', function() {
' <AAA64_layer>' +
' </AAA64_layer>' +
'</msGMLOutput>';
var features = new _ol_format_WMSGetFeatureInfo_().readFeatures(text);
var features = new WMSGetFeatureInfo().readFeatures(text);
expect(features.length).to.be(0);
});
@@ -98,7 +98,7 @@ describe('ol.format.WMSGetFeatureInfo', function() {
' </AAA64_feature>' +
' </AAA64_layer>' +
'</msGMLOutput>';
var features = new _ol_format_WMSGetFeatureInfo_().readFeatures(text);
var features = new WMSGetFeatureInfo().readFeatures(text);
expect(features.length).to.be(1);
expect(features[0].get('FOO')).to.be('bar');
// FIXME is that really wanted ?
@@ -158,7 +158,7 @@ describe('ol.format.WMSGetFeatureInfo', function() {
' </AAA62_feature>' +
' </AAA62_layer>' +
'</msGMLOutput>';
var format = new _ol_format_WMSGetFeatureInfo_();
var format = new WMSGetFeatureInfo();
var features = format.readFeatures(text);
expect(features.length).to.be(2);
expect(features[0].get('OBJECTID')).to.be('287');
@@ -224,7 +224,7 @@ describe('ol.format.WMSGetFeatureInfo', function() {
' </opengeo:roads>' +
' </gml:featureMember>' +
'</wfs:FeatureCollection>';
var features = new _ol_format_WMSGetFeatureInfo_().readFeatures(text);
var features = new WMSGetFeatureInfo().readFeatures(text);
expect(features.length).to.be(1);
expect(features[0].get('cat')).to.be('3');
expect(features[0].getGeometry().getType()).to.be('MultiLineString');

View File

@@ -1,4 +1,4 @@
import _ol_format_XSD_ from '../../../../src/ol/format/XSD.js';
import XSD from '../../../../src/ol/format/XSD.js';
describe('ol.format.XSD', function() {
@@ -7,7 +7,7 @@ describe('ol.format.XSD', function() {
it('can handle non-Zulu time zones', function() {
var node = document.createElement('time');
node.textContent = '2016-07-12T15:00:00+03:00';
expect(new Date(_ol_format_XSD_.readDateTime(node) * 1000).toISOString()).to.eql('2016-07-12T12:00:00.000Z');
expect(new Date(XSD.readDateTime(node) * 1000).toISOString()).to.eql('2016-07-12T12:00:00.000Z');
});
});

View File

@@ -2,7 +2,7 @@ import {inherits} from '../../../../src/ol/index.js';
import _ol_View_ from '../../../../src/ol/View.js';
import Event from '../../../../src/ol/events/Event.js';
import EventTarget from '../../../../src/ol/events/EventTarget.js';
import _ol_format_GeoJSON_ from '../../../../src/ol/format/GeoJSON.js';
import GeoJSON from '../../../../src/ol/format/GeoJSON.js';
import DragAndDrop from '../../../../src/ol/interaction/DragAndDrop.js';
import _ol_source_Vector_ from '../../../../src/ol/source/Vector.js';
@@ -20,7 +20,7 @@ where('FileReader').describe('ol.interaction.DragAndDrop', function() {
}
};
interaction = new DragAndDrop({
formatConstructors: [_ol_format_GeoJSON_]
formatConstructors: [GeoJSON]
});
});
@@ -38,7 +38,7 @@ where('FileReader').describe('ol.interaction.DragAndDrop', function() {
it('accepts a source option', function() {
var source = new _ol_source_Vector_();
var drop = new DragAndDrop({
formatConstructors: [_ol_format_GeoJSON_],
formatConstructors: [GeoJSON],
source: source
});
expect(drop.source_).to.equal(source);
@@ -74,7 +74,7 @@ where('FileReader').describe('ol.interaction.DragAndDrop', function() {
it('registers and unregisters listeners on a custom target', function() {
var customTarget = new EventTarget();
interaction = new DragAndDrop({
formatConstructors: [_ol_format_GeoJSON_],
formatConstructors: [GeoJSON],
target: customTarget
});
interaction.setMap(map);
@@ -138,7 +138,7 @@ where('FileReader').describe('ol.interaction.DragAndDrop', function() {
it('adds dropped features to a source', function(done) {
var source = new _ol_source_Vector_();
var drop = new DragAndDrop({
formatConstructors: [_ol_format_GeoJSON_],
formatConstructors: [GeoJSON],
source: source
});
drop.setMap(map);

View File

@@ -7,7 +7,7 @@ import _ol_VectorImageTile_ from '../../../../../src/ol/VectorImageTile.js';
import _ol_VectorTile_ from '../../../../../src/ol/VectorTile.js';
import _ol_View_ from '../../../../../src/ol/View.js';
import * as _ol_extent_ from '../../../../../src/ol/extent.js';
import _ol_format_MVT_ from '../../../../../src/ol/format/MVT.js';
import MVT from '../../../../../src/ol/format/MVT.js';
import Point from '../../../../../src/ol/geom/Point.js';
import _ol_layer_VectorTile_ from '../../../../../src/ol/layer/VectorTile.js';
import {get as getProjection, fromLonLat} from '../../../../../src/ol/proj.js';
@@ -68,7 +68,7 @@ describe('ol.renderer.canvas.VectorTileLayer', function() {
};
inherits(TileClass, _ol_VectorTile_);
source = new _ol_source_VectorTile_({
format: new _ol_format_MVT_(),
format: new MVT(),
tileClass: TileClass,
tileGrid: _ol_tilegrid_.createXYZ()
});
@@ -350,7 +350,7 @@ describe('ol.renderer.canvas.VectorTileLayer', function() {
document.body.appendChild(target);
var extent = [1824704.739223726, 6141868.096770482, 1827150.7241288517, 6144314.081675608];
var source = new _ol_source_VectorTile_({
format: new _ol_format_MVT_(),
format: new MVT(),
url: 'spec/ol/data/14-8938-5680.vector.pbf',
minZoom: 14,
maxZoom: 14

View File

@@ -2,7 +2,7 @@ import _ol_Map_ from '../../../../src/ol/Map.js';
import _ol_View_ from '../../../../src/ol/View.js';
import _ol_VectorImageTile_ from '../../../../src/ol/VectorImageTile.js';
import _ol_VectorTile_ from '../../../../src/ol/VectorTile.js';
import _ol_format_MVT_ from '../../../../src/ol/format/MVT.js';
import MVT from '../../../../src/ol/format/MVT.js';
import _ol_layer_VectorTile_ from '../../../../src/ol/layer/VectorTile.js';
import {get as getProjection} from '../../../../src/ol/proj.js';
import _ol_source_VectorTile_ from '../../../../src/ol/source/VectorTile.js';
@@ -11,7 +11,7 @@ import _ol_tilegrid_TileGrid_ from '../../../../src/ol/tilegrid/TileGrid.js';
describe('ol.source.VectorTile', function() {
var format = new _ol_format_MVT_();
var format = new MVT();
var source = new _ol_source_VectorTile_({
format: format,
tilePixelRatio: 8,

View File

@@ -3,7 +3,7 @@
import _ol_Sphere_ from '../../../src/ol/Sphere.js';
import _ol_format_WKT_ from '../../../src/ol/format/WKT.js';
import WKT from '../../../src/ol/format/WKT.js';
import GeometryCollection from '../../../src/ol/geom/GeometryCollection.js';
import LineString from '../../../src/ol/geom/LineString.js';
import MultiLineString from '../../../src/ol/geom/MultiLineString.js';
@@ -95,7 +95,7 @@ describe('ol.Sphere', function() {
before(function(done) {
afterLoadText('spec/ol/format/wkt/illinois.wkt', function(wkt) {
try {
var format = new _ol_format_WKT_();
var format = new WKT();
geometry = format.readGeometry(wkt);
} catch (e) {
done(e);
@@ -187,7 +187,7 @@ describe('ol.Sphere.getArea()', function() {
before(function(done) {
afterLoadText('spec/ol/format/wkt/illinois.wkt', function(wkt) {
try {
var format = new _ol_format_WKT_();
var format = new WKT();
geometry = format.readGeometry(wkt);
} catch (e) {
done(e);

View File

@@ -2,7 +2,7 @@ import _ol_TileState_ from '../../../src/ol/TileState.js';
import _ol_VectorImageTile_ from '../../../src/ol/VectorImageTile.js';
import _ol_VectorTile_ from '../../../src/ol/VectorTile.js';
import _ol_events_ from '../../../src/ol/events.js';
import _ol_format_GeoJSON_ from '../../../src/ol/format/GeoJSON.js';
import GeoJSON from '../../../src/ol/format/GeoJSON.js';
import {get as getProjection} from '../../../src/ol/proj.js';
import _ol_tilegrid_ from '../../../src/ol/tilegrid.js';
import _ol_tilegrid_TileGrid_ from '../../../src/ol/tilegrid/TileGrid.js';
@@ -11,7 +11,7 @@ import _ol_tilegrid_TileGrid_ from '../../../src/ol/tilegrid/TileGrid.js';
describe('ol.VectorImageTile', function() {
it('configures loader that sets features on the source tile', function(done) {
var format = new _ol_format_GeoJSON_();
var format = new GeoJSON();
var url = 'spec/ol/data/point.json';
var tile = new _ol_VectorImageTile_([0, 0, -1], 0, url, format,
_ol_VectorImageTile_.defaultLoadFunction, [0, 0, -1], function() {
@@ -31,7 +31,7 @@ describe('ol.VectorImageTile', function() {
});
it('sets LOADED state when previously failed source tiles are loaded', function(done) {
var format = new _ol_format_GeoJSON_();
var format = new GeoJSON();
var url = 'spec/ol/data/unavailable.json';
var sourceTile;
var tile = new _ol_VectorImageTile_([0, 0, 0] /* one world away */, 0, url, format,
@@ -59,7 +59,7 @@ describe('ol.VectorImageTile', function() {
});
it('sets ERROR state when source tiles fail to load', function(done) {
var format = new _ol_format_GeoJSON_();
var format = new GeoJSON();
var url = 'spec/ol/data/unavailable.json';
var tile = new _ol_VectorImageTile_([0, 0, -1], 0, url, format,
_ol_VectorImageTile_.defaultLoadFunction, [0, 0, -1], function() {
@@ -76,7 +76,7 @@ describe('ol.VectorImageTile', function() {
});
it('sets EMPTY state when tile has only empty source tiles', function(done) {
var format = new _ol_format_GeoJSON_();
var format = new GeoJSON();
var url = '';
var tile = new _ol_VectorImageTile_([0, 0, -1], 0, url, format,
_ol_VectorImageTile_.defaultLoadFunction, [0, 0, -1], function() {},
@@ -92,7 +92,7 @@ describe('ol.VectorImageTile', function() {
});
it('only loads tiles within the source tileGrid\'s extent', function() {
var format = new _ol_format_GeoJSON_();
var format = new GeoJSON();
var url = 'spec/ol/data/point.json';
var tileGrid = new _ol_tilegrid_TileGrid_({
resolutions: [0.02197265625, 0.010986328125, 0.0054931640625],
@@ -112,7 +112,7 @@ describe('ol.VectorImageTile', function() {
});
it('#dispose() while loading', function() {
var format = new _ol_format_GeoJSON_();
var format = new GeoJSON();
var url = 'spec/ol/data/point.json';
var tile = new _ol_VectorImageTile_([0, 0, 0] /* one world away */, 0, url, format,
_ol_VectorImageTile_.defaultLoadFunction, [0, 0, -1], function() {
@@ -132,7 +132,7 @@ describe('ol.VectorImageTile', function() {
});
it('#dispose() when loaded', function(done) {
var format = new _ol_format_GeoJSON_();
var format = new GeoJSON();
var url = 'spec/ol/data/point.json';
var tile = new _ol_VectorImageTile_([0, 0, -1], 0, url, format,
_ol_VectorImageTile_.defaultLoadFunction, [0, 0, -1], function() {

View File

@@ -2,7 +2,7 @@ import _ol_Feature_ from '../../../src/ol/Feature.js';
import _ol_VectorImageTile_ from '../../../src/ol/VectorImageTile.js';
import _ol_VectorTile_ from '../../../src/ol/VectorTile.js';
import _ol_events_ from '../../../src/ol/events.js';
import _ol_format_TextFeature_ from '../../../src/ol/format/TextFeature.js';
import TextFeature from '../../../src/ol/format/TextFeature.js';
import {get as getProjection} from '../../../src/ol/proj.js';
import _ol_proj_Projection_ from '../../../src/ol/proj/Projection.js';
@@ -11,7 +11,7 @@ describe('ol.VectorTile', function() {
it('loader sets features on the tile and updates proj units', function(done) {
// mock format that return a tile-pixels feature
var format = new _ol_format_TextFeature_();
var format = new TextFeature();
format.readProjection = function(source) {
return new _ol_proj_Projection_({
code: '',