diff --git a/examples/box-selection.js b/examples/box-selection.js index 80140cc52a..958c565db2 100644 --- a/examples/box-selection.js +++ b/examples/box-selection.js @@ -1,7 +1,7 @@ import _ol_Map_ from '../src/ol/Map.js'; import _ol_View_ from '../src/ol/View.js'; import _ol_events_condition_ from '../src/ol/events/condition.js'; -import _ol_format_GeoJSON_ from '../src/ol/format/GeoJSON.js'; +import GeoJSON from '../src/ol/format/GeoJSON.js'; import DragBox from '../src/ol/interaction/DragBox.js'; import _ol_interaction_Select_ from '../src/ol/interaction/Select.js'; import _ol_layer_Tile_ from '../src/ol/layer/Tile.js'; @@ -12,7 +12,7 @@ import _ol_source_Vector_ from '../src/ol/source/Vector.js'; var vectorSource = new _ol_source_Vector_({ url: 'data/geojson/countries.geojson', - format: new _ol_format_GeoJSON_() + format: new GeoJSON() }); diff --git a/examples/canvas-gradient-pattern.js b/examples/canvas-gradient-pattern.js index 4cdfec729f..76f22d58a7 100644 --- a/examples/canvas-gradient-pattern.js +++ b/examples/canvas-gradient-pattern.js @@ -1,7 +1,7 @@ import _ol_Map_ from '../src/ol/Map.js'; import _ol_View_ from '../src/ol/View.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 _ol_has_ from '../src/ol/has.js'; import _ol_layer_Vector_ from '../src/ol/layer/Vector.js'; import {fromLonLat} from '../src/ol/proj.js'; @@ -84,7 +84,7 @@ var getStackedStyle = function(feature, resolution) { var vectorLayer = new _ol_layer_Vector_({ source: new _ol_source_Vector_({ url: 'data/geojson/countries.geojson', - format: new _ol_format_GeoJSON_() + format: new GeoJSON() }), style: getStackedStyle }); diff --git a/examples/center.js b/examples/center.js index 36a5b1c3df..7c1c32d509 100644 --- a/examples/center.js +++ b/examples/center.js @@ -1,7 +1,7 @@ import _ol_Map_ from '../src/ol/Map.js'; import _ol_View_ from '../src/ol/View.js'; import _ol_control_ from '../src/ol/control.js'; -import _ol_format_GeoJSON_ from '../src/ol/format/GeoJSON.js'; +import GeoJSON from '../src/ol/format/GeoJSON.js'; import _ol_layer_Tile_ from '../src/ol/layer/Tile.js'; import _ol_layer_Vector_ from '../src/ol/layer/Vector.js'; import _ol_source_OSM_ from '../src/ol/source/OSM.js'; @@ -13,7 +13,7 @@ import _ol_style_Style_ from '../src/ol/style/Style.js'; var source = new _ol_source_Vector_({ url: 'data/geojson/switzerland.geojson', - format: new _ol_format_GeoJSON_() + format: new GeoJSON() }); var style = new _ol_style_Style_({ fill: new _ol_style_Fill_({ diff --git a/examples/drag-and-drop-image-vector.js b/examples/drag-and-drop-image-vector.js index 44fdd05d59..7a8f8f81f7 100644 --- a/examples/drag-and-drop-image-vector.js +++ b/examples/drag-and-drop-image-vector.js @@ -1,7 +1,7 @@ import _ol_Map_ from '../src/ol/Map.js'; import _ol_View_ from '../src/ol/View.js'; import _ol_format_GPX_ from '../src/ol/format/GPX.js'; -import _ol_format_GeoJSON_ from '../src/ol/format/GeoJSON.js'; +import GeoJSON from '../src/ol/format/GeoJSON.js'; import _ol_format_IGC_ from '../src/ol/format/IGC.js'; import _ol_format_KML_ from '../src/ol/format/KML.js'; import _ol_format_TopoJSON_ from '../src/ol/format/TopoJSON.js'; @@ -86,7 +86,7 @@ var styleFunction = function(feature, resolution) { var dragAndDropInteraction = new DragAndDrop({ formatConstructors: [ _ol_format_GPX_, - _ol_format_GeoJSON_, + GeoJSON, _ol_format_IGC_, _ol_format_KML_, _ol_format_TopoJSON_ diff --git a/examples/drag-and-drop.js b/examples/drag-and-drop.js index 222efea03b..45d353a7d0 100644 --- a/examples/drag-and-drop.js +++ b/examples/drag-and-drop.js @@ -1,7 +1,7 @@ import _ol_Map_ from '../src/ol/Map.js'; import _ol_View_ from '../src/ol/View.js'; import _ol_format_GPX_ from '../src/ol/format/GPX.js'; -import _ol_format_GeoJSON_ from '../src/ol/format/GeoJSON.js'; +import GeoJSON from '../src/ol/format/GeoJSON.js'; import _ol_format_IGC_ from '../src/ol/format/IGC.js'; import _ol_format_KML_ from '../src/ol/format/KML.js'; import _ol_format_TopoJSON_ from '../src/ol/format/TopoJSON.js'; @@ -86,7 +86,7 @@ var styleFunction = function(feature, resolution) { var dragAndDropInteraction = new DragAndDrop({ formatConstructors: [ _ol_format_GPX_, - _ol_format_GeoJSON_, + GeoJSON, _ol_format_IGC_, _ol_format_KML_, _ol_format_TopoJSON_ diff --git a/examples/export-map.js b/examples/export-map.js index d0d9323f1e..df03f94c81 100644 --- a/examples/export-map.js +++ b/examples/export-map.js @@ -3,7 +3,7 @@ import _ol_Map_ from '../src/ol/Map.js'; import _ol_View_ from '../src/ol/View.js'; import _ol_control_ from '../src/ol/control.js'; -import _ol_format_GeoJSON_ from '../src/ol/format/GeoJSON.js'; +import GeoJSON from '../src/ol/format/GeoJSON.js'; import _ol_layer_Tile_ from '../src/ol/layer/Tile.js'; import _ol_layer_Vector_ from '../src/ol/layer/Vector.js'; import _ol_source_OSM_ from '../src/ol/source/OSM.js'; @@ -17,7 +17,7 @@ var map = new _ol_Map_({ new _ol_layer_Vector_({ source: new _ol_source_Vector_({ url: 'data/geojson/countries.geojson', - format: new _ol_format_GeoJSON_() + format: new GeoJSON() }) }) ], diff --git a/examples/extent-interaction.js b/examples/extent-interaction.js index b2bb3f2457..655bb9e138 100644 --- a/examples/extent-interaction.js +++ b/examples/extent-interaction.js @@ -1,7 +1,7 @@ import _ol_Map_ from '../src/ol/Map.js'; import _ol_View_ from '../src/ol/View.js'; import _ol_events_condition_ from '../src/ol/events/condition.js'; -import _ol_format_GeoJSON_ from '../src/ol/format/GeoJSON.js'; +import GeoJSON from '../src/ol/format/GeoJSON.js'; import _ol_interaction_Extent_ from '../src/ol/interaction/Extent.js'; import _ol_layer_Tile_ from '../src/ol/layer/Tile.js'; import _ol_layer_Vector_ from '../src/ol/layer/Vector.js'; @@ -10,7 +10,7 @@ import _ol_source_Vector_ from '../src/ol/source/Vector.js'; var vectorSource = new _ol_source_Vector_({ url: 'data/geojson/countries.geojson', - format: new _ol_format_GeoJSON_() + format: new GeoJSON() }); var map = new _ol_Map_({ diff --git a/examples/geojson-vt.js b/examples/geojson-vt.js index 57a5f7d959..fad9a58d3c 100644 --- a/examples/geojson-vt.js +++ b/examples/geojson-vt.js @@ -1,7 +1,7 @@ // NOCOMPILE 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 _ol_source_OSM_ from '../src/ol/source/OSM.js'; import _ol_source_VectorTile_ from '../src/ol/source/VectorTile.js'; import _ol_layer_Tile_ from '../src/ol/layer/Tile.js'; @@ -75,7 +75,7 @@ fetch(url).then(function(response) { debug: 1 }); var vectorSource = new _ol_source_VectorTile_({ - format: new _ol_format_GeoJSON_(), + format: new GeoJSON(), tileLoadFunction: function(tile) { var format = tile.getFormat(); var tileCoord = tile.getTileCoord(); diff --git a/examples/geojson.js b/examples/geojson.js index e8c9db2d8f..a3d548526a 100644 --- a/examples/geojson.js +++ b/examples/geojson.js @@ -2,7 +2,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_control_ from '../src/ol/control.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 _ol_layer_Tile_ from '../src/ol/layer/Tile.js'; import _ol_layer_Vector_ from '../src/ol/layer/Vector.js'; @@ -161,7 +161,7 @@ var geojsonObject = { }; var vectorSource = new _ol_source_Vector_({ - features: (new _ol_format_GeoJSON_()).readFeatures(geojsonObject) + features: (new GeoJSON()).readFeatures(geojsonObject) }); vectorSource.addFeature(new _ol_Feature_(new Circle([5e6, 7e6], 1e6))); diff --git a/examples/image-vector-layer.js b/examples/image-vector-layer.js index 199c0fe46d..5af586662b 100644 --- a/examples/image-vector-layer.js +++ b/examples/image-vector-layer.js @@ -1,6 +1,6 @@ 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 _ol_layer_Vector_ from '../src/ol/layer/Vector.js'; import _ol_source_Vector_ from '../src/ol/source/Vector.js'; import _ol_style_Fill_ from '../src/ol/style/Fill.js'; @@ -26,7 +26,7 @@ var map = new _ol_Map_({ renderMode: 'image', source: new _ol_source_Vector_({ url: 'data/geojson/countries.geojson', - format: new _ol_format_GeoJSON_() + format: new GeoJSON() }), style: function(feature) { style.getText().setText(feature.get('name')); diff --git a/examples/jsts.js b/examples/jsts.js index 99a430373b..038f2e6294 100644 --- a/examples/jsts.js +++ b/examples/jsts.js @@ -2,7 +2,7 @@ // this example uses JSTS for which we don't have an externs file. 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 _ol_layer_Tile_ from '../src/ol/layer/Tile.js'; import _ol_layer_Vector_ from '../src/ol/layer/Vector.js'; import {fromLonLat} from '../src/ol/proj.js'; @@ -14,7 +14,7 @@ var source = new _ol_source_Vector_(); fetch('data/geojson/roads-seoul.geojson').then(function(response) { return response.json(); }).then(function(json) { - var format = new _ol_format_GeoJSON_(); + var format = new GeoJSON(); var features = format.readFeatures(json, {featureProjection: 'EPSG:3857'}); var parser = new jsts.io.OL3Parser(); diff --git a/examples/modify-features.js b/examples/modify-features.js index e8db4f57cd..d03a795b1d 100644 --- a/examples/modify-features.js +++ b/examples/modify-features.js @@ -1,6 +1,6 @@ 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 _ol_interaction_ from '../src/ol/interaction.js'; import _ol_interaction_Modify_ from '../src/ol/interaction/Modify.js'; import _ol_interaction_Select_ from '../src/ol/interaction/Select.js'; @@ -17,7 +17,7 @@ var raster = new _ol_layer_Tile_({ var vector = new _ol_layer_Vector_({ source: new _ol_source_Vector_({ url: 'data/geojson/countries.geojson', - format: new _ol_format_GeoJSON_(), + format: new GeoJSON(), wrapX: false }) }); diff --git a/examples/modify-test.js b/examples/modify-test.js index 8553ac8fa9..a9002fa77b 100644 --- a/examples/modify-test.js +++ b/examples/modify-test.js @@ -1,6 +1,6 @@ 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 _ol_interaction_ from '../src/ol/interaction.js'; import _ol_interaction_Modify_ from '../src/ol/interaction/Modify.js'; import _ol_interaction_Select_ from '../src/ol/interaction/Select.js'; @@ -145,7 +145,7 @@ var geojsonObject = { }; var source = new _ol_source_Vector_({ - features: (new _ol_format_GeoJSON_()).readFeatures(geojsonObject) + features: (new GeoJSON()).readFeatures(geojsonObject) }); var layer = new _ol_layer_Vector_({ diff --git a/examples/polygon-styles.js b/examples/polygon-styles.js index 80629d2423..32c1b0442f 100644 --- a/examples/polygon-styles.js +++ b/examples/polygon-styles.js @@ -1,6 +1,6 @@ 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 MultiPoint from '../src/ol/geom/MultiPoint.js'; import _ol_layer_Vector_ from '../src/ol/layer/Vector.js'; import _ol_source_Vector_ from '../src/ol/source/Vector.js'; @@ -81,7 +81,7 @@ var geojsonObject = { }; var source = new _ol_source_Vector_({ - features: (new _ol_format_GeoJSON_()).readFeatures(geojsonObject) + features: (new GeoJSON()).readFeatures(geojsonObject) }); var layer = new _ol_layer_Vector_({ diff --git a/examples/select-features.js b/examples/select-features.js index c2a8a4a934..6d1a0d8039 100644 --- a/examples/select-features.js +++ b/examples/select-features.js @@ -1,7 +1,7 @@ import _ol_Map_ from '../src/ol/Map.js'; import _ol_View_ from '../src/ol/View.js'; import _ol_events_condition_ from '../src/ol/events/condition.js'; -import _ol_format_GeoJSON_ from '../src/ol/format/GeoJSON.js'; +import GeoJSON from '../src/ol/format/GeoJSON.js'; import _ol_interaction_Select_ from '../src/ol/interaction/Select.js'; import _ol_layer_Tile_ from '../src/ol/layer/Tile.js'; import _ol_layer_Vector_ from '../src/ol/layer/Vector.js'; @@ -15,7 +15,7 @@ var raster = new _ol_layer_Tile_({ var vector = new _ol_layer_Vector_({ source: new _ol_source_Vector_({ url: 'data/geojson/countries.geojson', - format: new _ol_format_GeoJSON_() + format: new GeoJSON() }) }); diff --git a/examples/sphere-mollweide.js b/examples/sphere-mollweide.js index 13cb008b6c..c317e1f479 100644 --- a/examples/sphere-mollweide.js +++ b/examples/sphere-mollweide.js @@ -1,7 +1,7 @@ import Graticule from '../src/ol/Graticule.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 _ol_layer_Vector_ from '../src/ol/layer/Vector.js'; import _ol_proj_Projection_ from '../src/ol/proj/Projection.js'; import _ol_source_Vector_ from '../src/ol/source/Vector.js'; @@ -28,7 +28,7 @@ var map = new _ol_Map_({ new _ol_layer_Vector_({ source: new _ol_source_Vector_({ url: 'data/geojson/countries-110m.geojson', - format: new _ol_format_GeoJSON_() + format: new GeoJSON() }) }) ], diff --git a/examples/street-labels.js b/examples/street-labels.js index aee202b175..acc7330bbf 100644 --- a/examples/street-labels.js +++ b/examples/street-labels.js @@ -1,7 +1,7 @@ import _ol_Map_ from '../src/ol/Map.js'; import _ol_View_ from '../src/ol/View.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 _ol_layer_Tile_ from '../src/ol/layer/Tile.js'; import _ol_layer_Vector_ from '../src/ol/layer/Vector.js'; import _ol_source_BingMaps_ from '../src/ol/source/BingMaps.js'; @@ -30,7 +30,7 @@ var map = new _ol_Map_({ }), new _ol_layer_Vector_({ declutter: true, source: new _ol_source_Vector_({ - format: new _ol_format_GeoJSON_(), + format: new GeoJSON(), url: 'data/geojson/vienna-streets.geojson' }), style: function(feature) { diff --git a/examples/translate-features.js b/examples/translate-features.js index 54cecc4e4c..23d8d50ec9 100644 --- a/examples/translate-features.js +++ b/examples/translate-features.js @@ -1,6 +1,6 @@ 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 _ol_interaction_ from '../src/ol/interaction.js'; import _ol_interaction_Select_ from '../src/ol/interaction/Select.js'; import _ol_interaction_Translate_ from '../src/ol/interaction/Translate.js'; @@ -17,7 +17,7 @@ var raster = new _ol_layer_Tile_({ var vector = new _ol_layer_Vector_({ source: new _ol_source_Vector_({ url: 'data/geojson/countries.geojson', - format: new _ol_format_GeoJSON_() + format: new GeoJSON() }) }); diff --git a/examples/turf.js b/examples/turf.js index a4a8f59c7d..d53aa6a293 100644 --- a/examples/turf.js +++ b/examples/turf.js @@ -2,7 +2,7 @@ // this example uses turf.js for which we don't have an externs file. 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 _ol_layer_Tile_ from '../src/ol/layer/Tile.js'; import _ol_layer_Vector_ from '../src/ol/layer/Vector.js'; import {fromLonLat} from '../src/ol/proj.js'; @@ -14,7 +14,7 @@ var source = new _ol_source_Vector_(); fetch('data/geojson/roads-seoul.geojson').then(function(response) { return response.json(); }).then(function(json) { - var format = new _ol_format_GeoJSON_(); + var format = new GeoJSON(); var features = format.readFeatures(json); var street = features[0]; diff --git a/examples/vector-label-decluttering.js b/examples/vector-label-decluttering.js index d7b95b515f..dc1a1c92ca 100644 --- a/examples/vector-label-decluttering.js +++ b/examples/vector-label-decluttering.js @@ -1,7 +1,7 @@ import _ol_Map_ from '../src/ol/Map.js'; import _ol_View_ from '../src/ol/View.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 _ol_layer_Vector_ from '../src/ol/layer/Vector.js'; import _ol_source_Vector_ from '../src/ol/source/Vector.js'; import _ol_style_Fill_ from '../src/ol/style/Fill.js'; @@ -61,7 +61,7 @@ var style = [countryStyle, labelStyle]; var vectorLayer = new _ol_layer_Vector_({ source: new _ol_source_Vector_({ url: 'data/geojson/countries.geojson', - format: new _ol_format_GeoJSON_() + format: new GeoJSON() }), style: function(feature) { labelStyle.getText().setText(feature.get('name')); diff --git a/examples/vector-labels.js b/examples/vector-labels.js index e39e1d8630..ffe12c6d68 100644 --- a/examples/vector-labels.js +++ b/examples/vector-labels.js @@ -1,6 +1,6 @@ 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 _ol_layer_Tile_ from '../src/ol/layer/Tile.js'; import _ol_layer_Vector_ from '../src/ol/layer/Vector.js'; import _ol_source_OSM_ from '../src/ol/source/OSM.js'; @@ -143,7 +143,7 @@ function polygonStyleFunction(feature, resolution) { var vectorPolygons = new _ol_layer_Vector_({ source: new _ol_source_Vector_({ url: 'data/geojson/polygon-samples.geojson', - format: new _ol_format_GeoJSON_() + format: new GeoJSON() }), style: polygonStyleFunction }); @@ -163,7 +163,7 @@ function lineStyleFunction(feature, resolution) { var vectorLines = new _ol_layer_Vector_({ source: new _ol_source_Vector_({ url: 'data/geojson/line-samples.geojson', - format: new _ol_format_GeoJSON_() + format: new GeoJSON() }), style: lineStyleFunction }); @@ -184,7 +184,7 @@ function pointStyleFunction(feature, resolution) { var vectorPoints = new _ol_layer_Vector_({ source: new _ol_source_Vector_({ url: 'data/geojson/point-samples.geojson', - format: new _ol_format_GeoJSON_() + format: new GeoJSON() }), style: pointStyleFunction }); diff --git a/examples/vector-layer.js b/examples/vector-layer.js index 14d340e96a..53b340a584 100644 --- a/examples/vector-layer.js +++ b/examples/vector-layer.js @@ -1,6 +1,6 @@ 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 _ol_layer_Vector_ from '../src/ol/layer/Vector.js'; import _ol_source_Vector_ from '../src/ol/source/Vector.js'; import _ol_style_Fill_ from '../src/ol/style/Fill.js'; @@ -32,7 +32,7 @@ var style = new _ol_style_Style_({ var vectorLayer = new _ol_layer_Vector_({ source: new _ol_source_Vector_({ url: 'data/geojson/countries.geojson', - format: new _ol_format_GeoJSON_() + format: new GeoJSON() }), style: function(feature) { style.getText().setText(feature.get('name')); diff --git a/examples/vector-wfs-getfeature.js b/examples/vector-wfs-getfeature.js index 3473a2fb08..cc83d821da 100644 --- a/examples/vector-wfs-getfeature.js +++ b/examples/vector-wfs-getfeature.js @@ -2,7 +2,7 @@ import _ol_Map_ from '../src/ol/Map.js'; import _ol_View_ from '../src/ol/View.js'; import _ol_format_filter_ from '../src/ol/format/filter.js'; import _ol_format_WFS_ from '../src/ol/format/WFS.js'; -import _ol_format_GeoJSON_ from '../src/ol/format/GeoJSON.js'; +import GeoJSON from '../src/ol/format/GeoJSON.js'; import _ol_layer_Tile_ from '../src/ol/layer/Tile.js'; import _ol_layer_Vector_ from '../src/ol/layer/Vector.js'; import _ol_source_BingMaps_ from '../src/ol/source/BingMaps.js'; @@ -59,7 +59,7 @@ fetch('https://ahocevar.com/geoserver/wfs', { }).then(function(response) { return response.json(); }).then(function(json) { - var features = new _ol_format_GeoJSON_().readFeatures(json); + var features = new GeoJSON().readFeatures(json); vectorSource.addFeatures(features); map.getView().fit(vectorSource.getExtent()); }); diff --git a/examples/vector-wfs.js b/examples/vector-wfs.js index 64114664b8..8e242b28f9 100644 --- a/examples/vector-wfs.js +++ b/examples/vector-wfs.js @@ -1,6 +1,6 @@ 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 _ol_layer_Tile_ from '../src/ol/layer/Tile.js'; import _ol_layer_Vector_ from '../src/ol/layer/Vector.js'; import _ol_loadingstrategy_ from '../src/ol/loadingstrategy.js'; @@ -11,7 +11,7 @@ import _ol_style_Style_ from '../src/ol/style/Style.js'; var vectorSource = new _ol_source_Vector_({ - format: new _ol_format_GeoJSON_(), + format: new GeoJSON(), url: function(extent) { return 'https://ahocevar.com/geoserver/wfs?service=WFS&' + 'version=1.1.0&request=GetFeature&typename=osm:water_areas&' + diff --git a/src/ol/format/GeoJSON.js b/src/ol/format/GeoJSON.js index 173c115953..e44df4dda3 100644 --- a/src/ol/format/GeoJSON.js +++ b/src/ol/format/GeoJSON.js @@ -28,7 +28,7 @@ import {get as getProjection} from '../proj.js'; * @param {olx.format.GeoJSONOptions=} opt_options Options. * @api */ -var _ol_format_GeoJSON_ = function(opt_options) { +var GeoJSON = function(opt_options) { var options = opt_options ? opt_options : {}; @@ -62,7 +62,7 @@ var _ol_format_GeoJSON_ = function(opt_options) { }; -inherits(_ol_format_GeoJSON_, _ol_format_JSONFeature_); +inherits(GeoJSON, _ol_format_JSONFeature_); /** @@ -71,11 +71,11 @@ inherits(_ol_format_GeoJSON_, _ol_format_JSONFeature_); * @private * @return {ol.geom.Geometry} Geometry. */ -_ol_format_GeoJSON_.readGeometry_ = function(object, opt_options) { +GeoJSON.readGeometry_ = function(object, opt_options) { if (!object) { return null; } - var geometryReader = _ol_format_GeoJSON_.GEOMETRY_READERS_[object.type]; + var geometryReader = GeoJSON.GEOMETRY_READERS_[object.type]; return ( /** @type {ol.geom.Geometry} */ FeatureFormat.transformWithOptions( geometryReader(object), false, opt_options) @@ -89,7 +89,7 @@ _ol_format_GeoJSON_.readGeometry_ = function(object, opt_options) { * @private * @return {ol.geom.GeometryCollection} Geometry collection. */ -_ol_format_GeoJSON_.readGeometryCollectionGeometry_ = function( +GeoJSON.readGeometryCollectionGeometry_ = function( object, opt_options) { var geometries = object.geometries.map( /** @@ -97,7 +97,7 @@ _ol_format_GeoJSON_.readGeometryCollectionGeometry_ = function( * @return {ol.geom.Geometry} geometry Geometry. */ function(geometry) { - return _ol_format_GeoJSON_.readGeometry_(geometry, opt_options); + return GeoJSON.readGeometry_(geometry, opt_options); }); return new GeometryCollection(geometries); }; @@ -108,7 +108,7 @@ _ol_format_GeoJSON_.readGeometryCollectionGeometry_ = function( * @private * @return {ol.geom.Point} Point. */ -_ol_format_GeoJSON_.readPointGeometry_ = function(object) { +GeoJSON.readPointGeometry_ = function(object) { return new Point(object.coordinates); }; @@ -118,7 +118,7 @@ _ol_format_GeoJSON_.readPointGeometry_ = function(object) { * @private * @return {ol.geom.LineString} LineString. */ -_ol_format_GeoJSON_.readLineStringGeometry_ = function(object) { +GeoJSON.readLineStringGeometry_ = function(object) { return new LineString(object.coordinates); }; @@ -128,7 +128,7 @@ _ol_format_GeoJSON_.readLineStringGeometry_ = function(object) { * @private * @return {ol.geom.MultiLineString} MultiLineString. */ -_ol_format_GeoJSON_.readMultiLineStringGeometry_ = function(object) { +GeoJSON.readMultiLineStringGeometry_ = function(object) { return new MultiLineString(object.coordinates); }; @@ -138,7 +138,7 @@ _ol_format_GeoJSON_.readMultiLineStringGeometry_ = function(object) { * @private * @return {ol.geom.MultiPoint} MultiPoint. */ -_ol_format_GeoJSON_.readMultiPointGeometry_ = function(object) { +GeoJSON.readMultiPointGeometry_ = function(object) { return new MultiPoint(object.coordinates); }; @@ -148,7 +148,7 @@ _ol_format_GeoJSON_.readMultiPointGeometry_ = function(object) { * @private * @return {ol.geom.MultiPolygon} MultiPolygon. */ -_ol_format_GeoJSON_.readMultiPolygonGeometry_ = function(object) { +GeoJSON.readMultiPolygonGeometry_ = function(object) { return new MultiPolygon(object.coordinates); }; @@ -158,7 +158,7 @@ _ol_format_GeoJSON_.readMultiPolygonGeometry_ = function(object) { * @private * @return {ol.geom.Polygon} Polygon. */ -_ol_format_GeoJSON_.readPolygonGeometry_ = function(object) { +GeoJSON.readPolygonGeometry_ = function(object) { return new Polygon(object.coordinates); }; @@ -169,8 +169,8 @@ _ol_format_GeoJSON_.readPolygonGeometry_ = function(object) { * @private * @return {GeoJSONGeometry|GeoJSONGeometryCollection} GeoJSON geometry. */ -_ol_format_GeoJSON_.writeGeometry_ = function(geometry, opt_options) { - var geometryWriter = _ol_format_GeoJSON_.GEOMETRY_WRITERS_[geometry.getType()]; +GeoJSON.writeGeometry_ = function(geometry, opt_options) { + var geometryWriter = GeoJSON.GEOMETRY_WRITERS_[geometry.getType()]; return geometryWriter(/** @type {ol.geom.Geometry} */ ( FeatureFormat.transformWithOptions(geometry, true, opt_options)), opt_options); @@ -182,7 +182,7 @@ _ol_format_GeoJSON_.writeGeometry_ = function(geometry, opt_options) { * @private * @return {GeoJSONGeometryCollection} Empty GeoJSON geometry collection. */ -_ol_format_GeoJSON_.writeEmptyGeometryCollectionGeometry_ = function(geometry) { +GeoJSON.writeEmptyGeometryCollectionGeometry_ = function(geometry) { return /** @type {GeoJSONGeometryCollection} */ ({ type: 'GeometryCollection', geometries: [] @@ -196,12 +196,12 @@ _ol_format_GeoJSON_.writeEmptyGeometryCollectionGeometry_ = function(geometry) { * @private * @return {GeoJSONGeometryCollection} GeoJSON geometry collection. */ -_ol_format_GeoJSON_.writeGeometryCollectionGeometry_ = function( +GeoJSON.writeGeometryCollectionGeometry_ = function( geometry, opt_options) { var geometries = geometry.getGeometriesArray().map(function(geometry) { var options = _ol_obj_.assign({}, opt_options); delete options.featureProjection; - return _ol_format_GeoJSON_.writeGeometry_(geometry, options); + return GeoJSON.writeGeometry_(geometry, options); }); return /** @type {GeoJSONGeometryCollection} */ ({ type: 'GeometryCollection', @@ -216,7 +216,7 @@ _ol_format_GeoJSON_.writeGeometryCollectionGeometry_ = function( * @private * @return {GeoJSONGeometry} GeoJSON geometry. */ -_ol_format_GeoJSON_.writeLineStringGeometry_ = function(geometry, opt_options) { +GeoJSON.writeLineStringGeometry_ = function(geometry, opt_options) { return /** @type {GeoJSONGeometry} */ ({ type: 'LineString', coordinates: geometry.getCoordinates() @@ -230,7 +230,7 @@ _ol_format_GeoJSON_.writeLineStringGeometry_ = function(geometry, opt_options) { * @private * @return {GeoJSONGeometry} GeoJSON geometry. */ -_ol_format_GeoJSON_.writeMultiLineStringGeometry_ = function(geometry, opt_options) { +GeoJSON.writeMultiLineStringGeometry_ = function(geometry, opt_options) { return /** @type {GeoJSONGeometry} */ ({ type: 'MultiLineString', coordinates: geometry.getCoordinates() @@ -244,7 +244,7 @@ _ol_format_GeoJSON_.writeMultiLineStringGeometry_ = function(geometry, opt_optio * @private * @return {GeoJSONGeometry} GeoJSON geometry. */ -_ol_format_GeoJSON_.writeMultiPointGeometry_ = function(geometry, opt_options) { +GeoJSON.writeMultiPointGeometry_ = function(geometry, opt_options) { return /** @type {GeoJSONGeometry} */ ({ type: 'MultiPoint', coordinates: geometry.getCoordinates() @@ -258,7 +258,7 @@ _ol_format_GeoJSON_.writeMultiPointGeometry_ = function(geometry, opt_options) { * @private * @return {GeoJSONGeometry} GeoJSON geometry. */ -_ol_format_GeoJSON_.writeMultiPolygonGeometry_ = function(geometry, opt_options) { +GeoJSON.writeMultiPolygonGeometry_ = function(geometry, opt_options) { var right; if (opt_options) { right = opt_options.rightHanded; @@ -276,7 +276,7 @@ _ol_format_GeoJSON_.writeMultiPolygonGeometry_ = function(geometry, opt_options) * @private * @return {GeoJSONGeometry} GeoJSON geometry. */ -_ol_format_GeoJSON_.writePointGeometry_ = function(geometry, opt_options) { +GeoJSON.writePointGeometry_ = function(geometry, opt_options) { return /** @type {GeoJSONGeometry} */ ({ type: 'Point', coordinates: geometry.getCoordinates() @@ -290,7 +290,7 @@ _ol_format_GeoJSON_.writePointGeometry_ = function(geometry, opt_options) { * @private * @return {GeoJSONGeometry} GeoJSON geometry. */ -_ol_format_GeoJSON_.writePolygonGeometry_ = function(geometry, opt_options) { +GeoJSON.writePolygonGeometry_ = function(geometry, opt_options) { var right; if (opt_options) { right = opt_options.rightHanded; @@ -307,14 +307,14 @@ _ol_format_GeoJSON_.writePolygonGeometry_ = function(geometry, opt_options) { * @private * @type {Object.} */ -_ol_format_GeoJSON_.GEOMETRY_READERS_ = { - 'Point': _ol_format_GeoJSON_.readPointGeometry_, - 'LineString': _ol_format_GeoJSON_.readLineStringGeometry_, - 'Polygon': _ol_format_GeoJSON_.readPolygonGeometry_, - 'MultiPoint': _ol_format_GeoJSON_.readMultiPointGeometry_, - 'MultiLineString': _ol_format_GeoJSON_.readMultiLineStringGeometry_, - 'MultiPolygon': _ol_format_GeoJSON_.readMultiPolygonGeometry_, - 'GeometryCollection': _ol_format_GeoJSON_.readGeometryCollectionGeometry_ +GeoJSON.GEOMETRY_READERS_ = { + 'Point': GeoJSON.readPointGeometry_, + 'LineString': GeoJSON.readLineStringGeometry_, + 'Polygon': GeoJSON.readPolygonGeometry_, + 'MultiPoint': GeoJSON.readMultiPointGeometry_, + 'MultiLineString': GeoJSON.readMultiLineStringGeometry_, + 'MultiPolygon': GeoJSON.readMultiPolygonGeometry_, + 'GeometryCollection': GeoJSON.readGeometryCollectionGeometry_ }; @@ -323,15 +323,15 @@ _ol_format_GeoJSON_.GEOMETRY_READERS_ = { * @private * @type {Object.} */ -_ol_format_GeoJSON_.GEOMETRY_WRITERS_ = { - 'Point': _ol_format_GeoJSON_.writePointGeometry_, - 'LineString': _ol_format_GeoJSON_.writeLineStringGeometry_, - 'Polygon': _ol_format_GeoJSON_.writePolygonGeometry_, - 'MultiPoint': _ol_format_GeoJSON_.writeMultiPointGeometry_, - 'MultiLineString': _ol_format_GeoJSON_.writeMultiLineStringGeometry_, - 'MultiPolygon': _ol_format_GeoJSON_.writeMultiPolygonGeometry_, - 'GeometryCollection': _ol_format_GeoJSON_.writeGeometryCollectionGeometry_, - 'Circle': _ol_format_GeoJSON_.writeEmptyGeometryCollectionGeometry_ +GeoJSON.GEOMETRY_WRITERS_ = { + 'Point': GeoJSON.writePointGeometry_, + 'LineString': GeoJSON.writeLineStringGeometry_, + 'Polygon': GeoJSON.writePolygonGeometry_, + 'MultiPoint': GeoJSON.writeMultiPointGeometry_, + 'MultiLineString': GeoJSON.writeMultiLineStringGeometry_, + 'MultiPolygon': GeoJSON.writeMultiPolygonGeometry_, + 'GeometryCollection': GeoJSON.writeGeometryCollectionGeometry_, + 'Circle': GeoJSON.writeEmptyGeometryCollectionGeometry_ }; @@ -347,7 +347,7 @@ _ol_format_GeoJSON_.GEOMETRY_WRITERS_ = { * @return {ol.Feature} Feature. * @api */ -_ol_format_GeoJSON_.prototype.readFeature; +GeoJSON.prototype.readFeature; /** @@ -361,13 +361,13 @@ _ol_format_GeoJSON_.prototype.readFeature; * @return {Array.} Features. * @api */ -_ol_format_GeoJSON_.prototype.readFeatures; +GeoJSON.prototype.readFeatures; /** * @inheritDoc */ -_ol_format_GeoJSON_.prototype.readFeatureFromObject = function( +GeoJSON.prototype.readFeatureFromObject = function( object, opt_options) { /** * @type {GeoJSONFeature} @@ -382,7 +382,7 @@ _ol_format_GeoJSON_.prototype.readFeatureFromObject = function( }); } - var geometry = _ol_format_GeoJSON_.readGeometry_(geoJSONFeature.geometry, opt_options); + var geometry = GeoJSON.readGeometry_(geoJSONFeature.geometry, opt_options); var feature = new _ol_Feature_(); if (this.geometryName_) { feature.setGeometryName(this.geometryName_); @@ -403,7 +403,7 @@ _ol_format_GeoJSON_.prototype.readFeatureFromObject = function( /** * @inheritDoc */ -_ol_format_GeoJSON_.prototype.readFeaturesFromObject = function( +GeoJSON.prototype.readFeaturesFromObject = function( object, opt_options) { var geoJSONObject = /** @type {GeoJSONObject} */ (object); /** @type {Array.} */ @@ -434,15 +434,15 @@ _ol_format_GeoJSON_.prototype.readFeaturesFromObject = function( * @return {ol.geom.Geometry} Geometry. * @api */ -_ol_format_GeoJSON_.prototype.readGeometry; +GeoJSON.prototype.readGeometry; /** * @inheritDoc */ -_ol_format_GeoJSON_.prototype.readGeometryFromObject = function( +GeoJSON.prototype.readGeometryFromObject = function( object, opt_options) { - return _ol_format_GeoJSON_.readGeometry_( + return GeoJSON.readGeometry_( /** @type {GeoJSONGeometry} */ (object), opt_options); }; @@ -455,13 +455,13 @@ _ol_format_GeoJSON_.prototype.readGeometryFromObject = function( * @return {ol.proj.Projection} Projection. * @api */ -_ol_format_GeoJSON_.prototype.readProjection; +GeoJSON.prototype.readProjection; /** * @inheritDoc */ -_ol_format_GeoJSON_.prototype.readProjectionFromObject = function(object) { +GeoJSON.prototype.readProjectionFromObject = function(object) { var geoJSONObject = /** @type {GeoJSONObject} */ (object); var crs = geoJSONObject.crs; var projection; @@ -488,7 +488,7 @@ _ol_format_GeoJSON_.prototype.readProjectionFromObject = function(object) { * @override * @api */ -_ol_format_GeoJSON_.prototype.writeFeature; +GeoJSON.prototype.writeFeature; /** @@ -500,7 +500,7 @@ _ol_format_GeoJSON_.prototype.writeFeature; * @override * @api */ -_ol_format_GeoJSON_.prototype.writeFeatureObject = function(feature, opt_options) { +GeoJSON.prototype.writeFeatureObject = function(feature, opt_options) { opt_options = this.adaptOptions(opt_options); var object = /** @type {GeoJSONFeature} */ ({ @@ -513,7 +513,7 @@ _ol_format_GeoJSON_.prototype.writeFeatureObject = function(feature, opt_options var geometry = feature.getGeometry(); if (geometry) { object.geometry = - _ol_format_GeoJSON_.writeGeometry_(geometry, opt_options); + GeoJSON.writeGeometry_(geometry, opt_options); } else { object.geometry = null; } @@ -537,7 +537,7 @@ _ol_format_GeoJSON_.prototype.writeFeatureObject = function(feature, opt_options * @return {string} GeoJSON. * @api */ -_ol_format_GeoJSON_.prototype.writeFeatures; +GeoJSON.prototype.writeFeatures; /** @@ -549,7 +549,7 @@ _ol_format_GeoJSON_.prototype.writeFeatures; * @override * @api */ -_ol_format_GeoJSON_.prototype.writeFeaturesObject = function(features, opt_options) { +GeoJSON.prototype.writeFeaturesObject = function(features, opt_options) { opt_options = this.adaptOptions(opt_options); var objects = []; var i, ii; @@ -572,7 +572,7 @@ _ol_format_GeoJSON_.prototype.writeFeaturesObject = function(features, opt_optio * @return {string} GeoJSON. * @api */ -_ol_format_GeoJSON_.prototype.writeGeometry; +GeoJSON.prototype.writeGeometry; /** @@ -584,9 +584,9 @@ _ol_format_GeoJSON_.prototype.writeGeometry; * @override * @api */ -_ol_format_GeoJSON_.prototype.writeGeometryObject = function(geometry, +GeoJSON.prototype.writeGeometryObject = function(geometry, opt_options) { - return _ol_format_GeoJSON_.writeGeometry_(geometry, + return GeoJSON.writeGeometry_(geometry, this.adaptOptions(opt_options)); }; -export default _ol_format_GeoJSON_; +export default GeoJSON; diff --git a/test/rendering/ol/layer/vector.test.js b/test/rendering/ol/layer/vector.test.js index 6153fd4864..2d594d97b6 100644 --- a/test/rendering/ol/layer/vector.test.js +++ b/test/rendering/ol/layer/vector.test.js @@ -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_({ diff --git a/test/spec/ol/featureloader.test.js b/test/spec/ol/featureloader.test.js index 103e8ec0cd..6165a735d6 100644 --- a/test/spec/ol/featureloader.test.js +++ b/test/spec/ol/featureloader.test.js @@ -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_(); }); diff --git a/test/spec/ol/format/geojson.test.js b/test/spec/ol/format/geojson.test.js index cffafb4869..5c1d1b86d5 100644 --- a/test/spec/ol/format/geojson.test.js +++ b/test/spec/ol/format/geojson.test.js @@ -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); diff --git a/test/spec/ol/format/kml.test.js b/test/spec/ol/format/kml.test.js index 79c3c42504..90d871112c 100644 --- a/test/spec/ol/format/kml.test.js +++ b/test/spec/ol/format/kml.test.js @@ -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); diff --git a/test/spec/ol/interaction/draganddrop.test.js b/test/spec/ol/interaction/draganddrop.test.js index 99a3665b44..ffd6d51be6 100644 --- a/test/spec/ol/interaction/draganddrop.test.js +++ b/test/spec/ol/interaction/draganddrop.test.js @@ -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); diff --git a/test/spec/ol/vectorimagetile.test.js b/test/spec/ol/vectorimagetile.test.js index 922ea6b1d9..4e88bb3e1e 100644 --- a/test/spec/ol/vectorimagetile.test.js +++ b/test/spec/ol/vectorimagetile.test.js @@ -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() {