Rename _ol_format_GeoJSON_ to GeoJSON

This commit is contained in:
Tim Schaub
2017-12-17 01:42:56 -07:00
parent 96a05fa0ed
commit 8656e794ff
31 changed files with 135 additions and 135 deletions

View File

@@ -1,7 +1,7 @@
import _ol_Feature_ from '../../../../src/ol/Feature.js';
import _ol_Map_ from '../../../../src/ol/Map.js';
import _ol_View_ from '../../../../src/ol/View.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 LineString from '../../../../src/ol/geom/LineString.js';
import Point from '../../../../src/ol/geom/Point.js';
@@ -463,7 +463,7 @@ describe('ol.rendering.layer.Vector', function() {
properties: {}
};
var format = new _ol_format_GeoJSON_({featureProjection: 'EPSG:3857'});
var format = new GeoJSON({featureProjection: 'EPSG:3857'});
var feature = format.readFeature(json);
var layer = new _ol_layer_Vector_({

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_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_array_ from '../../../../src/ol/array.js';
import _ol_format_GeoJSON_ from '../../../../src/ol/format/GeoJSON.js';
import GeoJSON from '../../../../src/ol/format/GeoJSON.js';
import _ol_format_KML_ from '../../../../src/ol/format/KML.js';
import GeometryCollection from '../../../../src/ol/geom/GeometryCollection.js';
import LineString from '../../../../src/ol/geom/LineString.js';
@@ -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

@@ -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

@@ -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() {