From ca6ea355e6d645a84f682bc65922d104f44c2fbd Mon Sep 17 00:00:00 2001 From: Tim Schaub Date: Mon, 8 Jan 2018 10:06:23 -0700 Subject: [PATCH] Rename _ol_source_Vector_ to VectorSource --- examples/blend-modes.js | 8 +- examples/box-selection.js | 4 +- examples/canvas-gradient-pattern.js | 4 +- examples/center.js | 4 +- examples/cluster.js | 4 +- examples/custom-interactions.js | 4 +- examples/drag-and-drop-image-vector.js | 4 +- examples/drag-and-drop.js | 4 +- examples/draw-and-modify-features.js | 4 +- examples/draw-features.js | 4 +- examples/draw-freehand.js | 4 +- examples/draw-shapes.js | 4 +- examples/earthquake-clusters.js | 4 +- examples/earthquake-custom-symbol.js | 4 +- examples/export-map.js | 4 +- examples/export-pdf.js | 4 +- examples/extent-interaction.js | 4 +- examples/feature-animation.js | 4 +- examples/feature-move-animation.js | 4 +- examples/flight-animation.js | 4 +- examples/fractal.js | 4 +- examples/geojson.js | 4 +- examples/geolocation.js | 4 +- examples/gpx.js | 4 +- examples/heatmap-earthquakes.js | 4 +- examples/hit-tolerance.js | 4 +- examples/icon-color.js | 4 +- examples/icon-negative.js | 4 +- examples/icon-sprite-webgl.js | 6 +- examples/icon.js | 4 +- examples/igc.js | 6 +- examples/image-vector-layer.js | 6 +- examples/jsts.js | 4 +- examples/kml-earthquakes.js | 4 +- examples/kml-timezones.js | 4 +- examples/kml.js | 4 +- examples/layer-z-index.js | 4 +- examples/line-arrows.js | 4 +- examples/measure.js | 4 +- examples/modify-features.js | 4 +- examples/modify-test.js | 4 +- examples/polygon-styles.js | 4 +- examples/regularshape.js | 4 +- examples/select-features.js | 4 +- examples/snap.js | 4 +- examples/sphere-mollweide.js | 4 +- examples/street-labels.js | 4 +- examples/symbol-atlas-webgl.js | 4 +- examples/synthetic-lines.js | 4 +- examples/synthetic-points.js | 4 +- examples/tissot.js | 6 +- examples/topojson.js | 4 +- examples/topolis.js | 8 +- examples/translate-features.js | 4 +- examples/turf.js | 4 +- examples/vector-esri-edit.js | 4 +- examples/vector-esri.js | 4 +- examples/vector-label-decluttering.js | 4 +- examples/vector-labels.js | 8 +- examples/vector-layer.js | 6 +- examples/vector-osm.js | 4 +- examples/vector-wfs-getfeature.js | 4 +- examples/vector-wfs.js | 4 +- examples/wkt.js | 4 +- src/ol/interaction/Draw.js | 4 +- src/ol/interaction/Extent.js | 6 +- src/ol/interaction/Modify.js | 4 +- src/ol/interaction/Select.js | 4 +- src/ol/interaction/Snap.js | 6 +- src/ol/source/Cluster.js | 8 +- src/ol/source/Vector.js | 82 +++++++++---------- test/rendering/ol/layer/vector.test.js | 18 ++-- test/rendering/ol/layer/vectortile.test.js | 4 +- test/rendering/ol/map.test.js | 4 +- test/rendering/ol/style/circle.test.js | 4 +- test/rendering/ol/style/icon.test.js | 4 +- test/rendering/ol/style/linestring.test.js | 4 +- test/rendering/ol/style/polygon.test.js | 4 +- test/rendering/ol/style/regularshape.test.js | 4 +- test/rendering/ol/style/text.test.js | 4 +- test/spec/ol/featureloader.test.js | 4 +- test/spec/ol/interaction/draganddrop.test.js | 6 +- .../ol/interaction/dragrotateandzoom.test.js | 4 +- test/spec/ol/interaction/dragzoom.test.js | 4 +- test/spec/ol/interaction/draw.test.js | 4 +- test/spec/ol/interaction/modify.test.js | 6 +- test/spec/ol/interaction/select.test.js | 4 +- test/spec/ol/interaction/translate.test.js | 4 +- test/spec/ol/layer/vector.test.js | 8 +- test/spec/ol/map.test.js | 6 +- test/spec/ol/renderer/canvas/map.test.js | 8 +- .../ol/renderer/canvas/vectorlayer.test.js | 16 ++-- test/spec/ol/source/cluster.test.js | 10 +-- test/spec/ol/source/vector.test.js | 32 ++++---- 94 files changed, 279 insertions(+), 279 deletions(-) diff --git a/examples/blend-modes.js b/examples/blend-modes.js index d6fbc7909c..819f4c4798 100644 --- a/examples/blend-modes.js +++ b/examples/blend-modes.js @@ -3,7 +3,7 @@ import Map from '../src/ol/Map.js'; import View from '../src/ol/View.js'; import Point from '../src/ol/geom/Point.js'; import VectorLayer from '../src/ol/layer/Vector.js'; -import _ol_source_Vector_ from '../src/ol/source/Vector.js'; +import VectorSource from '../src/ol/source/Vector.js'; import _ol_style_Circle_ from '../src/ol/style/Circle.js'; import _ol_style_Fill_ from '../src/ol/style/Fill.js'; import _ol_style_Stroke_ from '../src/ol/style/Stroke.js'; @@ -15,7 +15,7 @@ import _ol_style_Style_ from '../src/ol/style/Style.js'; // Every layer has one feature that is styled with a circle, together the // features form the corners of an equilateral triangle and their styles overlap var redLayer = new VectorLayer({ - source: new _ol_source_Vector_({ + source: new VectorSource({ features: [new Feature(new Point([0, 0]))] }), style: new _ol_style_Style_({ @@ -32,7 +32,7 @@ var redLayer = new VectorLayer({ }) }); var greenLayer = new VectorLayer({ - source: new _ol_source_Vector_({ + source: new VectorSource({ // 433.013 is roughly 250 * Math.sqrt(3) features: [new Feature(new Point([250, 433.013]))] }), @@ -50,7 +50,7 @@ var greenLayer = new VectorLayer({ }) }); var blueLayer = new VectorLayer({ - source: new _ol_source_Vector_({ + source: new VectorSource({ features: [new Feature(new Point([500, 0]))] }), style: new _ol_style_Style_({ diff --git a/examples/box-selection.js b/examples/box-selection.js index 4d5d08b962..1364931411 100644 --- a/examples/box-selection.js +++ b/examples/box-selection.js @@ -7,10 +7,10 @@ import _ol_interaction_Select_ from '../src/ol/interaction/Select.js'; import TileLayer from '../src/ol/layer/Tile.js'; import VectorLayer from '../src/ol/layer/Vector.js'; import _ol_source_OSM_ from '../src/ol/source/OSM.js'; -import _ol_source_Vector_ from '../src/ol/source/Vector.js'; +import VectorSource from '../src/ol/source/Vector.js'; -var vectorSource = new _ol_source_Vector_({ +var vectorSource = new VectorSource({ url: 'data/geojson/countries.geojson', format: new GeoJSON() }); diff --git a/examples/canvas-gradient-pattern.js b/examples/canvas-gradient-pattern.js index f4299b64aa..f4810a1430 100644 --- a/examples/canvas-gradient-pattern.js +++ b/examples/canvas-gradient-pattern.js @@ -5,7 +5,7 @@ import GeoJSON from '../src/ol/format/GeoJSON.js'; import _ol_has_ from '../src/ol/has.js'; import VectorLayer from '../src/ol/layer/Vector.js'; import {fromLonLat} from '../src/ol/proj.js'; -import _ol_source_Vector_ from '../src/ol/source/Vector.js'; +import VectorSource from '../src/ol/source/Vector.js'; import _ol_style_Fill_ from '../src/ol/style/Fill.js'; import _ol_style_Stroke_ from '../src/ol/style/Stroke.js'; import _ol_style_Style_ from '../src/ol/style/Style.js'; @@ -82,7 +82,7 @@ var getStackedStyle = function(feature, resolution) { // Create a vector layer that makes use of the style function above… var vectorLayer = new VectorLayer({ - source: new _ol_source_Vector_({ + source: new VectorSource({ url: 'data/geojson/countries.geojson', format: new GeoJSON() }), diff --git a/examples/center.js b/examples/center.js index 2c31999ecb..83f7df2753 100644 --- a/examples/center.js +++ b/examples/center.js @@ -5,13 +5,13 @@ import GeoJSON from '../src/ol/format/GeoJSON.js'; import TileLayer from '../src/ol/layer/Tile.js'; import VectorLayer from '../src/ol/layer/Vector.js'; import _ol_source_OSM_ from '../src/ol/source/OSM.js'; -import _ol_source_Vector_ from '../src/ol/source/Vector.js'; +import VectorSource from '../src/ol/source/Vector.js'; import _ol_style_Circle_ from '../src/ol/style/Circle.js'; import _ol_style_Fill_ from '../src/ol/style/Fill.js'; import _ol_style_Stroke_ from '../src/ol/style/Stroke.js'; import _ol_style_Style_ from '../src/ol/style/Style.js'; -var source = new _ol_source_Vector_({ +var source = new VectorSource({ url: 'data/geojson/switzerland.geojson', format: new GeoJSON() }); diff --git a/examples/cluster.js b/examples/cluster.js index c0246aab4a..eebeb953ad 100644 --- a/examples/cluster.js +++ b/examples/cluster.js @@ -6,7 +6,7 @@ import TileLayer from '../src/ol/layer/Tile.js'; import VectorLayer from '../src/ol/layer/Vector.js'; import _ol_source_Cluster_ from '../src/ol/source/Cluster.js'; import _ol_source_OSM_ from '../src/ol/source/OSM.js'; -import _ol_source_Vector_ from '../src/ol/source/Vector.js'; +import VectorSource from '../src/ol/source/Vector.js'; import _ol_style_Circle_ from '../src/ol/style/Circle.js'; import _ol_style_Fill_ from '../src/ol/style/Fill.js'; import _ol_style_Stroke_ from '../src/ol/style/Stroke.js'; @@ -24,7 +24,7 @@ for (var i = 0; i < count; ++i) { features[i] = new Feature(new Point(coordinates)); } -var source = new _ol_source_Vector_({ +var source = new VectorSource({ features: features }); diff --git a/examples/custom-interactions.js b/examples/custom-interactions.js index 3f0e936ef3..94c10c1150 100644 --- a/examples/custom-interactions.js +++ b/examples/custom-interactions.js @@ -10,7 +10,7 @@ import _ol_interaction_Pointer_ from '../src/ol/interaction/Pointer.js'; import TileLayer from '../src/ol/layer/Tile.js'; import VectorLayer from '../src/ol/layer/Vector.js'; import _ol_source_TileJSON_ from '../src/ol/source/TileJSON.js'; -import _ol_source_Vector_ from '../src/ol/source/Vector.js'; +import VectorSource from '../src/ol/source/Vector.js'; import _ol_style_Fill_ from '../src/ol/style/Fill.js'; import _ol_style_Icon_ from '../src/ol/style/Icon.js'; import _ol_style_Stroke_ from '../src/ol/style/Stroke.js'; @@ -153,7 +153,7 @@ var map = new Map({ }) }), new VectorLayer({ - source: new _ol_source_Vector_({ + source: new VectorSource({ features: [pointFeature, lineFeature, polygonFeature] }), style: new _ol_style_Style_({ diff --git a/examples/drag-and-drop-image-vector.js b/examples/drag-and-drop-image-vector.js index 2a40755dea..f7c1cab1d1 100644 --- a/examples/drag-and-drop-image-vector.js +++ b/examples/drag-and-drop-image-vector.js @@ -10,7 +10,7 @@ import DragAndDrop from '../src/ol/interaction/DragAndDrop.js'; import VectorLayer from '../src/ol/layer/Vector.js'; import TileLayer from '../src/ol/layer/Tile.js'; import _ol_source_BingMaps_ from '../src/ol/source/BingMaps.js'; -import _ol_source_Vector_ from '../src/ol/source/Vector.js'; +import VectorSource from '../src/ol/source/Vector.js'; import _ol_style_Circle_ from '../src/ol/style/Circle.js'; import _ol_style_Fill_ from '../src/ol/style/Fill.js'; import _ol_style_Stroke_ from '../src/ol/style/Stroke.js'; @@ -111,7 +111,7 @@ var map = new Map({ }); dragAndDropInteraction.on('addfeatures', function(event) { - var vectorSource = new _ol_source_Vector_({ + var vectorSource = new VectorSource({ features: event.features }); map.addLayer(new VectorLayer({ diff --git a/examples/drag-and-drop.js b/examples/drag-and-drop.js index 9cf67a93db..386338aa91 100644 --- a/examples/drag-and-drop.js +++ b/examples/drag-and-drop.js @@ -10,7 +10,7 @@ import DragAndDrop from '../src/ol/interaction/DragAndDrop.js'; import TileLayer from '../src/ol/layer/Tile.js'; import VectorLayer from '../src/ol/layer/Vector.js'; import _ol_source_BingMaps_ from '../src/ol/source/BingMaps.js'; -import _ol_source_Vector_ from '../src/ol/source/Vector.js'; +import VectorSource from '../src/ol/source/Vector.js'; import _ol_style_Circle_ from '../src/ol/style/Circle.js'; import _ol_style_Fill_ from '../src/ol/style/Fill.js'; import _ol_style_Stroke_ from '../src/ol/style/Stroke.js'; @@ -111,7 +111,7 @@ var map = new Map({ }); dragAndDropInteraction.on('addfeatures', function(event) { - var vectorSource = new _ol_source_Vector_({ + var vectorSource = new VectorSource({ features: event.features }); map.addLayer(new VectorLayer({ diff --git a/examples/draw-and-modify-features.js b/examples/draw-and-modify-features.js index 8e206e170c..2b70ea9d4c 100644 --- a/examples/draw-and-modify-features.js +++ b/examples/draw-and-modify-features.js @@ -6,7 +6,7 @@ import _ol_interaction_Snap_ from '../src/ol/interaction/Snap.js'; import TileLayer from '../src/ol/layer/Tile.js'; import VectorLayer from '../src/ol/layer/Vector.js'; import _ol_source_OSM_ from '../src/ol/source/OSM.js'; -import _ol_source_Vector_ from '../src/ol/source/Vector.js'; +import VectorSource from '../src/ol/source/Vector.js'; import _ol_style_Circle_ from '../src/ol/style/Circle.js'; import _ol_style_Fill_ from '../src/ol/style/Fill.js'; import _ol_style_Stroke_ from '../src/ol/style/Stroke.js'; @@ -16,7 +16,7 @@ var raster = new TileLayer({ source: new _ol_source_OSM_() }); -var source = new _ol_source_Vector_(); +var source = new VectorSource(); var vector = new VectorLayer({ source: source, style: new _ol_style_Style_({ diff --git a/examples/draw-features.js b/examples/draw-features.js index 8856cb38c9..22ac3e585f 100644 --- a/examples/draw-features.js +++ b/examples/draw-features.js @@ -4,13 +4,13 @@ import Draw from '../src/ol/interaction/Draw.js'; import TileLayer from '../src/ol/layer/Tile.js'; import VectorLayer from '../src/ol/layer/Vector.js'; import _ol_source_OSM_ from '../src/ol/source/OSM.js'; -import _ol_source_Vector_ from '../src/ol/source/Vector.js'; +import VectorSource from '../src/ol/source/Vector.js'; var raster = new TileLayer({ source: new _ol_source_OSM_() }); -var source = new _ol_source_Vector_({wrapX: false}); +var source = new VectorSource({wrapX: false}); var vector = new VectorLayer({ source: source diff --git a/examples/draw-freehand.js b/examples/draw-freehand.js index 493dd87050..b30c140b8a 100644 --- a/examples/draw-freehand.js +++ b/examples/draw-freehand.js @@ -4,13 +4,13 @@ import Draw from '../src/ol/interaction/Draw.js'; import TileLayer from '../src/ol/layer/Tile.js'; import VectorLayer from '../src/ol/layer/Vector.js'; import _ol_source_OSM_ from '../src/ol/source/OSM.js'; -import _ol_source_Vector_ from '../src/ol/source/Vector.js'; +import VectorSource from '../src/ol/source/Vector.js'; var raster = new TileLayer({ source: new _ol_source_OSM_() }); -var source = new _ol_source_Vector_({wrapX: false}); +var source = new VectorSource({wrapX: false}); var vector = new VectorLayer({ source: source diff --git a/examples/draw-shapes.js b/examples/draw-shapes.js index 8f38e044fc..99cc5fd51c 100644 --- a/examples/draw-shapes.js +++ b/examples/draw-shapes.js @@ -5,13 +5,13 @@ import Draw from '../src/ol/interaction/Draw.js'; import TileLayer from '../src/ol/layer/Tile.js'; import VectorLayer from '../src/ol/layer/Vector.js'; import _ol_source_OSM_ from '../src/ol/source/OSM.js'; -import _ol_source_Vector_ from '../src/ol/source/Vector.js'; +import VectorSource from '../src/ol/source/Vector.js'; var raster = new TileLayer({ source: new _ol_source_OSM_() }); -var source = new _ol_source_Vector_({wrapX: false}); +var source = new VectorSource({wrapX: false}); var vector = new VectorLayer({ source: source diff --git a/examples/earthquake-clusters.js b/examples/earthquake-clusters.js index cf6d36a9c8..e0a6a03b28 100644 --- a/examples/earthquake-clusters.js +++ b/examples/earthquake-clusters.js @@ -8,7 +8,7 @@ import TileLayer from '../src/ol/layer/Tile.js'; import VectorLayer from '../src/ol/layer/Vector.js'; import _ol_source_Cluster_ from '../src/ol/source/Cluster.js'; import _ol_source_Stamen_ from '../src/ol/source/Stamen.js'; -import _ol_source_Vector_ from '../src/ol/source/Vector.js'; +import VectorSource from '../src/ol/source/Vector.js'; import _ol_style_Circle_ from '../src/ol/style/Circle.js'; import _ol_style_Fill_ from '../src/ol/style/Fill.js'; import _ol_style_RegularShape_ from '../src/ol/style/RegularShape.js'; @@ -124,7 +124,7 @@ function selectStyleFunction(feature) { vector = new VectorLayer({ source: new _ol_source_Cluster_({ distance: 40, - source: new _ol_source_Vector_({ + source: new VectorSource({ url: 'data/kml/2012_Earthquakes_Mag5.kml', format: new KML({ extractStyles: false diff --git a/examples/earthquake-custom-symbol.js b/examples/earthquake-custom-symbol.js index c5576b272c..02fa0aeae6 100644 --- a/examples/earthquake-custom-symbol.js +++ b/examples/earthquake-custom-symbol.js @@ -6,7 +6,7 @@ import TileLayer from '../src/ol/layer/Tile.js'; import VectorLayer from '../src/ol/layer/Vector.js'; import _ol_render_ from '../src/ol/render.js'; import _ol_source_Stamen_ from '../src/ol/source/Stamen.js'; -import _ol_source_Vector_ from '../src/ol/source/Vector.js'; +import VectorSource from '../src/ol/source/Vector.js'; import _ol_style_Fill_ from '../src/ol/style/Fill.js'; import _ol_style_Icon_ from '../src/ol/style/Icon.js'; import _ol_style_Stroke_ from '../src/ol/style/Stroke.js'; @@ -53,7 +53,7 @@ var styleFunction = function(feature) { }; var vector = new VectorLayer({ - source: new _ol_source_Vector_({ + source: new VectorSource({ url: 'data/kml/2012_Earthquakes_Mag5.kml', format: new KML({ extractStyles: false diff --git a/examples/export-map.js b/examples/export-map.js index 080f7318f2..891d44b886 100644 --- a/examples/export-map.js +++ b/examples/export-map.js @@ -7,7 +7,7 @@ import GeoJSON from '../src/ol/format/GeoJSON.js'; import TileLayer from '../src/ol/layer/Tile.js'; import VectorLayer from '../src/ol/layer/Vector.js'; import _ol_source_OSM_ from '../src/ol/source/OSM.js'; -import _ol_source_Vector_ from '../src/ol/source/Vector.js'; +import VectorSource from '../src/ol/source/Vector.js'; var map = new Map({ layers: [ @@ -15,7 +15,7 @@ var map = new Map({ source: new _ol_source_OSM_() }), new VectorLayer({ - source: new _ol_source_Vector_({ + source: new VectorSource({ url: 'data/geojson/countries.geojson', format: new GeoJSON() }) diff --git a/examples/export-pdf.js b/examples/export-pdf.js index 4faedddee2..158565389b 100644 --- a/examples/export-pdf.js +++ b/examples/export-pdf.js @@ -6,7 +6,7 @@ import WKT from '../src/ol/format/WKT.js'; import TileLayer from '../src/ol/layer/Tile.js'; import VectorLayer from '../src/ol/layer/Vector.js'; import _ol_source_OSM_ from '../src/ol/source/OSM.js'; -import _ol_source_Vector_ from '../src/ol/source/Vector.js'; +import VectorSource from '../src/ol/source/Vector.js'; var raster = new TileLayer({ source: new _ol_source_OSM_() @@ -20,7 +20,7 @@ var feature = format.readFeature( feature.getGeometry().transform('EPSG:4326', 'EPSG:3857'); var vector = new VectorLayer({ - source: new _ol_source_Vector_({ + source: new VectorSource({ features: [feature] }) }); diff --git a/examples/extent-interaction.js b/examples/extent-interaction.js index 52f056abd9..7b2d8792c1 100644 --- a/examples/extent-interaction.js +++ b/examples/extent-interaction.js @@ -6,9 +6,9 @@ import _ol_interaction_Extent_ from '../src/ol/interaction/Extent.js'; import TileLayer from '../src/ol/layer/Tile.js'; import VectorLayer from '../src/ol/layer/Vector.js'; import _ol_source_OSM_ from '../src/ol/source/OSM.js'; -import _ol_source_Vector_ from '../src/ol/source/Vector.js'; +import VectorSource from '../src/ol/source/Vector.js'; -var vectorSource = new _ol_source_Vector_({ +var vectorSource = new VectorSource({ url: 'data/geojson/countries.geojson', format: new GeoJSON() }); diff --git a/examples/feature-animation.js b/examples/feature-animation.js index 18794dd397..0aabec3676 100644 --- a/examples/feature-animation.js +++ b/examples/feature-animation.js @@ -9,7 +9,7 @@ import TileLayer from '../src/ol/layer/Tile.js'; import VectorLayer from '../src/ol/layer/Vector.js'; import {fromLonLat} from '../src/ol/proj.js'; import _ol_source_OSM_ from '../src/ol/source/OSM.js'; -import _ol_source_Vector_ from '../src/ol/source/Vector.js'; +import VectorSource from '../src/ol/source/Vector.js'; import _ol_style_Circle_ from '../src/ol/style/Circle.js'; import _ol_style_Stroke_ from '../src/ol/style/Stroke.js'; import _ol_style_Style_ from '../src/ol/style/Style.js'; @@ -35,7 +35,7 @@ var map = new Map({ }) }); -var source = new _ol_source_Vector_({ +var source = new VectorSource({ wrapX: false }); var vector = new VectorLayer({ diff --git a/examples/feature-move-animation.js b/examples/feature-move-animation.js index 53fa7a1b76..cc33f7fb7b 100644 --- a/examples/feature-move-animation.js +++ b/examples/feature-move-animation.js @@ -6,7 +6,7 @@ import Point from '../src/ol/geom/Point.js'; import TileLayer from '../src/ol/layer/Tile.js'; import VectorLayer from '../src/ol/layer/Vector.js'; import _ol_source_BingMaps_ from '../src/ol/source/BingMaps.js'; -import _ol_source_Vector_ from '../src/ol/source/Vector.js'; +import VectorSource from '../src/ol/source/Vector.js'; import _ol_style_Circle_ from '../src/ol/style/Circle.js'; import _ol_style_Fill_ from '../src/ol/style/Fill.js'; import _ol_style_Icon_ from '../src/ol/style/Icon.js'; @@ -114,7 +114,7 @@ var speedInput = document.getElementById('speed'); var startButton = document.getElementById('start-animation'); var vectorLayer = new VectorLayer({ - source: new _ol_source_Vector_({ + source: new VectorSource({ features: [routeFeature, geoMarker, startMarker, endMarker] }), style: function(feature) { diff --git a/examples/flight-animation.js b/examples/flight-animation.js index ecf5fb3e87..09d4243886 100644 --- a/examples/flight-animation.js +++ b/examples/flight-animation.js @@ -6,7 +6,7 @@ import LineString from '../src/ol/geom/LineString.js'; import TileLayer from '../src/ol/layer/Tile.js'; import VectorLayer from '../src/ol/layer/Vector.js'; import _ol_source_Stamen_ from '../src/ol/source/Stamen.js'; -import _ol_source_Vector_ from '../src/ol/source/Vector.js'; +import VectorSource from '../src/ol/source/Vector.js'; import _ol_style_Stroke_ from '../src/ol/style/Stroke.js'; import _ol_style_Style_ from '../src/ol/style/Style.js'; @@ -70,7 +70,7 @@ var animateFlights = function(event) { map.render(); }; -flightsSource = new _ol_source_Vector_({ +flightsSource = new VectorSource({ wrapX: false, attributions: 'Flight data by ' + 'OpenFlights,', diff --git a/examples/fractal.js b/examples/fractal.js index 27807cef7f..8600e2b075 100644 --- a/examples/fractal.js +++ b/examples/fractal.js @@ -3,7 +3,7 @@ import Map from '../src/ol/Map.js'; import View from '../src/ol/View.js'; import LineString from '../src/ol/geom/LineString.js'; import VectorLayer from '../src/ol/layer/Vector.js'; -import _ol_source_Vector_ from '../src/ol/source/Vector.js'; +import VectorSource from '../src/ol/source/Vector.js'; var radius = 10e6; var cos30 = Math.cos(Math.PI / 6); @@ -18,7 +18,7 @@ var triangle = new LineString([ var feature = new Feature(triangle); var layer = new VectorLayer({ - source: new _ol_source_Vector_({ + source: new VectorSource({ features: [feature] }) }); diff --git a/examples/geojson.js b/examples/geojson.js index 291173b645..761c11562e 100644 --- a/examples/geojson.js +++ b/examples/geojson.js @@ -7,7 +7,7 @@ import Circle from '../src/ol/geom/Circle.js'; import TileLayer from '../src/ol/layer/Tile.js'; import VectorLayer from '../src/ol/layer/Vector.js'; import _ol_source_OSM_ from '../src/ol/source/OSM.js'; -import _ol_source_Vector_ from '../src/ol/source/Vector.js'; +import VectorSource from '../src/ol/source/Vector.js'; import _ol_style_Circle_ from '../src/ol/style/Circle.js'; import _ol_style_Fill_ from '../src/ol/style/Fill.js'; import _ol_style_Stroke_ from '../src/ol/style/Stroke.js'; @@ -160,7 +160,7 @@ var geojsonObject = { }] }; -var vectorSource = new _ol_source_Vector_({ +var vectorSource = new VectorSource({ features: (new GeoJSON()).readFeatures(geojsonObject) }); diff --git a/examples/geolocation.js b/examples/geolocation.js index 42f9cb045d..3c9368d3ad 100644 --- a/examples/geolocation.js +++ b/examples/geolocation.js @@ -7,7 +7,7 @@ import Point from '../src/ol/geom/Point.js'; import TileLayer from '../src/ol/layer/Tile.js'; import VectorLayer from '../src/ol/layer/Vector.js'; import _ol_source_OSM_ from '../src/ol/source/OSM.js'; -import _ol_source_Vector_ from '../src/ol/source/Vector.js'; +import VectorSource from '../src/ol/source/Vector.js'; import _ol_style_Circle_ from '../src/ol/style/Circle.js'; import _ol_style_Fill_ from '../src/ol/style/Fill.js'; import _ol_style_Stroke_ from '../src/ol/style/Stroke.js'; @@ -88,7 +88,7 @@ geolocation.on('change:position', function() { new VectorLayer({ map: map, - source: new _ol_source_Vector_({ + source: new VectorSource({ features: [accuracyFeature, positionFeature] }) }); diff --git a/examples/gpx.js b/examples/gpx.js index 8fee6c05b5..f1f8dde9d1 100644 --- a/examples/gpx.js +++ b/examples/gpx.js @@ -4,7 +4,7 @@ import GPX from '../src/ol/format/GPX.js'; import TileLayer from '../src/ol/layer/Tile.js'; import VectorLayer from '../src/ol/layer/Vector.js'; import _ol_source_BingMaps_ from '../src/ol/source/BingMaps.js'; -import _ol_source_Vector_ from '../src/ol/source/Vector.js'; +import VectorSource from '../src/ol/source/Vector.js'; import _ol_style_Circle_ from '../src/ol/style/Circle.js'; import _ol_style_Fill_ from '../src/ol/style/Fill.js'; import _ol_style_Stroke_ from '../src/ol/style/Stroke.js'; @@ -45,7 +45,7 @@ var style = { }; var vector = new VectorLayer({ - source: new _ol_source_Vector_({ + source: new VectorSource({ url: 'data/gpx/fells_loop.gpx', format: new GPX() }), diff --git a/examples/heatmap-earthquakes.js b/examples/heatmap-earthquakes.js index 6bf883c8ff..0b04dff1c3 100644 --- a/examples/heatmap-earthquakes.js +++ b/examples/heatmap-earthquakes.js @@ -4,13 +4,13 @@ import KML from '../src/ol/format/KML.js'; import HeatmapLayer from '../src/ol/layer/Heatmap.js'; import TileLayer from '../src/ol/layer/Tile.js'; import _ol_source_Stamen_ from '../src/ol/source/Stamen.js'; -import _ol_source_Vector_ from '../src/ol/source/Vector.js'; +import VectorSource from '../src/ol/source/Vector.js'; var blur = document.getElementById('blur'); var radius = document.getElementById('radius'); var vector = new HeatmapLayer({ - source: new _ol_source_Vector_({ + source: new VectorSource({ url: 'data/kml/2012_Earthquakes_Mag5.kml', format: new KML({ extractStyles: false diff --git a/examples/hit-tolerance.js b/examples/hit-tolerance.js index 781f31cf94..e22f009f86 100644 --- a/examples/hit-tolerance.js +++ b/examples/hit-tolerance.js @@ -3,7 +3,7 @@ import View from '../src/ol/View.js'; import TileLayer from '../src/ol/layer/Tile.js'; import VectorLayer from '../src/ol/layer/Vector.js'; import _ol_source_OSM_ from '../src/ol/source/OSM.js'; -import _ol_source_Vector_ from '../src/ol/source/Vector.js'; +import VectorSource from '../src/ol/source/Vector.js'; import Feature from '../src/ol/Feature.js'; import LineString from '../src/ol/geom/LineString.js'; import _ol_style_Style_ from '../src/ol/style/Style.js'; @@ -23,7 +23,7 @@ var style = new _ol_style_Style_({ var feature = new Feature(new LineString([[-4000000, 0], [4000000, 0]])); var vector = new VectorLayer({ - source: new _ol_source_Vector_({ + source: new VectorSource({ features: [feature] }), style: style diff --git a/examples/icon-color.js b/examples/icon-color.js index 9f0ab05ac0..cb6a1a67f6 100644 --- a/examples/icon-color.js +++ b/examples/icon-color.js @@ -6,7 +6,7 @@ import TileLayer from '../src/ol/layer/Tile.js'; import VectorLayer from '../src/ol/layer/Vector.js'; import {fromLonLat} from '../src/ol/proj.js'; import _ol_source_TileJSON_ from '../src/ol/source/TileJSON.js'; -import _ol_source_Vector_ from '../src/ol/source/Vector.js'; +import VectorSource from '../src/ol/source/Vector.js'; import _ol_style_Icon_ from '../src/ol/style/Icon.js'; import _ol_style_Style_ from '../src/ol/style/Style.js'; @@ -48,7 +48,7 @@ madrid.setStyle(new _ol_style_Style_({ })); -var vectorSource = new _ol_source_Vector_({ +var vectorSource = new VectorSource({ features: [rome, london, madrid] }); diff --git a/examples/icon-negative.js b/examples/icon-negative.js index 1ad87b9809..09d9ddd409 100644 --- a/examples/icon-negative.js +++ b/examples/icon-negative.js @@ -6,7 +6,7 @@ import _ol_interaction_Select_ from '../src/ol/interaction/Select.js'; import TileLayer from '../src/ol/layer/Tile.js'; import VectorLayer from '../src/ol/layer/Vector.js'; import _ol_source_Stamen_ from '../src/ol/source/Stamen.js'; -import _ol_source_Vector_ from '../src/ol/source/Vector.js'; +import VectorSource from '../src/ol/source/Vector.js'; import _ol_style_Icon_ from '../src/ol/style/Icon.js'; import _ol_style_Style_ from '../src/ol/style/Style.js'; @@ -35,7 +35,7 @@ var map = new Map({ style: function(feature) { return feature.get('style'); }, - source: new _ol_source_Vector_({features: [iconFeature]}) + source: new VectorSource({features: [iconFeature]}) }) ], target: document.getElementById('map'), diff --git a/examples/icon-sprite-webgl.js b/examples/icon-sprite-webgl.js index 1df4f84aa3..3e04f117e6 100644 --- a/examples/icon-sprite-webgl.js +++ b/examples/icon-sprite-webgl.js @@ -3,7 +3,7 @@ import Map from '../src/ol/Map.js'; import View from '../src/ol/View.js'; import Point from '../src/ol/geom/Point.js'; import VectorLayer from '../src/ol/layer/Vector.js'; -import _ol_source_Vector_ from '../src/ol/source/Vector.js'; +import VectorSource from '../src/ol/source/Vector.js'; import _ol_style_Icon_ from '../src/ol/style/Icon.js'; import _ol_style_Style_ from '../src/ol/style/Style.js'; @@ -72,7 +72,7 @@ for (i = 0; i < featureCount; ++i) { features[i] = feature; } -var vectorSource = new _ol_source_Vector_({ +var vectorSource = new VectorSource({ features: features }); var vector = new VectorLayer({ @@ -98,7 +98,7 @@ for (i = 0; i < featureCount; i += 30) { new VectorLayer({ map: map, - source: new _ol_source_Vector_({ + source: new VectorSource({ features: overlayFeatures }), style: new _ol_style_Style_({ diff --git a/examples/icon.js b/examples/icon.js index c315f0d251..57dc335bf1 100644 --- a/examples/icon.js +++ b/examples/icon.js @@ -6,7 +6,7 @@ import Point from '../src/ol/geom/Point.js'; import TileLayer from '../src/ol/layer/Tile.js'; import VectorLayer from '../src/ol/layer/Vector.js'; import _ol_source_TileJSON_ from '../src/ol/source/TileJSON.js'; -import _ol_source_Vector_ from '../src/ol/source/Vector.js'; +import VectorSource from '../src/ol/source/Vector.js'; import _ol_style_Icon_ from '../src/ol/style/Icon.js'; import _ol_style_Style_ from '../src/ol/style/Style.js'; @@ -29,7 +29,7 @@ var iconStyle = new _ol_style_Style_({ iconFeature.setStyle(iconStyle); -var vectorSource = new _ol_source_Vector_({ +var vectorSource = new VectorSource({ features: [iconFeature] }); diff --git a/examples/igc.js b/examples/igc.js index 33ab1d1cfa..68c8864d03 100644 --- a/examples/igc.js +++ b/examples/igc.js @@ -8,7 +8,7 @@ import Point from '../src/ol/geom/Point.js'; import TileLayer from '../src/ol/layer/Tile.js'; import VectorLayer from '../src/ol/layer/Vector.js'; import _ol_source_OSM_ from '../src/ol/source/OSM.js'; -import _ol_source_Vector_ from '../src/ol/source/Vector.js'; +import VectorSource from '../src/ol/source/Vector.js'; import _ol_style_Circle_ from '../src/ol/style/Circle.js'; import _ol_style_Fill_ from '../src/ol/style/Fill.js'; import _ol_style_Stroke_ from '../src/ol/style/Stroke.js'; @@ -39,7 +39,7 @@ var styleFunction = function(feature) { return style; }; -var vectorSource = new _ol_source_Vector_(); +var vectorSource = new VectorSource(); var igcUrls = [ 'data/igc/Clement-Latour.igc', @@ -176,7 +176,7 @@ map.on('postcompose', function(evt) { }); var featureOverlay = new VectorLayer({ - source: new _ol_source_Vector_(), + source: new VectorSource(), map: map, style: new _ol_style_Style_({ image: new _ol_style_Circle_({ diff --git a/examples/image-vector-layer.js b/examples/image-vector-layer.js index eecaed1b04..55a1d0ed65 100644 --- a/examples/image-vector-layer.js +++ b/examples/image-vector-layer.js @@ -2,7 +2,7 @@ import Map from '../src/ol/Map.js'; import View from '../src/ol/View.js'; import GeoJSON from '../src/ol/format/GeoJSON.js'; import VectorLayer from '../src/ol/layer/Vector.js'; -import _ol_source_Vector_ from '../src/ol/source/Vector.js'; +import VectorSource from '../src/ol/source/Vector.js'; import _ol_style_Fill_ from '../src/ol/style/Fill.js'; import _ol_style_Stroke_ from '../src/ol/style/Stroke.js'; import _ol_style_Style_ from '../src/ol/style/Style.js'; @@ -24,7 +24,7 @@ var map = new Map({ layers: [ new VectorLayer({ renderMode: 'image', - source: new _ol_source_Vector_({ + source: new VectorSource({ url: 'data/geojson/countries.geojson', format: new GeoJSON() }), @@ -42,7 +42,7 @@ var map = new Map({ }); var featureOverlay = new VectorLayer({ - source: new _ol_source_Vector_(), + source: new VectorSource(), map: map, style: new _ol_style_Style_({ stroke: new _ol_style_Stroke_({ diff --git a/examples/jsts.js b/examples/jsts.js index 5a13544bfe..c5556d37a6 100644 --- a/examples/jsts.js +++ b/examples/jsts.js @@ -7,10 +7,10 @@ import TileLayer from '../src/ol/layer/Tile.js'; import VectorLayer from '../src/ol/layer/Vector.js'; import {fromLonLat} from '../src/ol/proj.js'; import _ol_source_OSM_ from '../src/ol/source/OSM.js'; -import _ol_source_Vector_ from '../src/ol/source/Vector.js'; +import VectorSource from '../src/ol/source/Vector.js'; -var source = new _ol_source_Vector_(); +var source = new VectorSource(); fetch('data/geojson/roads-seoul.geojson').then(function(response) { return response.json(); }).then(function(json) { diff --git a/examples/kml-earthquakes.js b/examples/kml-earthquakes.js index 8f302419e6..103f6e7201 100644 --- a/examples/kml-earthquakes.js +++ b/examples/kml-earthquakes.js @@ -4,7 +4,7 @@ import KML from '../src/ol/format/KML.js'; import TileLayer from '../src/ol/layer/Tile.js'; import VectorLayer from '../src/ol/layer/Vector.js'; import _ol_source_Stamen_ from '../src/ol/source/Stamen.js'; -import _ol_source_Vector_ from '../src/ol/source/Vector.js'; +import VectorSource from '../src/ol/source/Vector.js'; import _ol_style_Circle_ from '../src/ol/style/Circle.js'; import _ol_style_Fill_ from '../src/ol/style/Fill.js'; import _ol_style_Stroke_ from '../src/ol/style/Stroke.js'; @@ -39,7 +39,7 @@ var styleFunction = function(feature) { }; var vector = new VectorLayer({ - source: new _ol_source_Vector_({ + source: new VectorSource({ url: 'data/kml/2012_Earthquakes_Mag5.kml', format: new KML({ extractStyles: false diff --git a/examples/kml-timezones.js b/examples/kml-timezones.js index 10f6ca387c..29ef2e70bf 100644 --- a/examples/kml-timezones.js +++ b/examples/kml-timezones.js @@ -4,7 +4,7 @@ import KML from '../src/ol/format/KML.js'; import TileLayer from '../src/ol/layer/Tile.js'; import VectorLayer from '../src/ol/layer/Vector.js'; import _ol_source_Stamen_ from '../src/ol/source/Stamen.js'; -import _ol_source_Vector_ from '../src/ol/source/Vector.js'; +import VectorSource from '../src/ol/source/Vector.js'; import _ol_style_Fill_ from '../src/ol/style/Fill.js'; import _ol_style_Stroke_ from '../src/ol/style/Stroke.js'; import _ol_style_Style_ from '../src/ol/style/Style.js'; @@ -46,7 +46,7 @@ var styleFunction = function(feature) { }; var vector = new VectorLayer({ - source: new _ol_source_Vector_({ + source: new VectorSource({ url: 'data/kml/timezones.kml', format: new KML({ extractStyles: false diff --git a/examples/kml.js b/examples/kml.js index d2004e04f6..0d0e694774 100644 --- a/examples/kml.js +++ b/examples/kml.js @@ -4,7 +4,7 @@ import KML from '../src/ol/format/KML.js'; import TileLayer from '../src/ol/layer/Tile.js'; import VectorLayer from '../src/ol/layer/Vector.js'; import _ol_source_BingMaps_ from '../src/ol/source/BingMaps.js'; -import _ol_source_Vector_ from '../src/ol/source/Vector.js'; +import VectorSource from '../src/ol/source/Vector.js'; var raster = new TileLayer({ source: new _ol_source_BingMaps_({ @@ -14,7 +14,7 @@ var raster = new TileLayer({ }); var vector = new VectorLayer({ - source: new _ol_source_Vector_({ + source: new VectorSource({ url: 'data/kml/2012-02-10.kml', format: new KML() }) diff --git a/examples/layer-z-index.js b/examples/layer-z-index.js index 3c87c0e0bf..7d13dd8a62 100644 --- a/examples/layer-z-index.js +++ b/examples/layer-z-index.js @@ -3,7 +3,7 @@ import Map from '../src/ol/Map.js'; import View from '../src/ol/View.js'; import Point from '../src/ol/geom/Point.js'; import VectorLayer from '../src/ol/layer/Vector.js'; -import _ol_source_Vector_ from '../src/ol/source/Vector.js'; +import VectorSource from '../src/ol/source/Vector.js'; import _ol_style_Fill_ from '../src/ol/style/Fill.js'; import _ol_style_RegularShape_ from '../src/ol/style/RegularShape.js'; import _ol_style_Stroke_ from '../src/ol/style/Stroke.js'; @@ -49,7 +49,7 @@ function createLayer(coordinates, style, zIndex) { var feature = new Feature(new Point(coordinates)); feature.setStyle(style); - var source = new _ol_source_Vector_({ + var source = new VectorSource({ features: [feature] }); diff --git a/examples/line-arrows.js b/examples/line-arrows.js index 0691346fc2..87a3528438 100644 --- a/examples/line-arrows.js +++ b/examples/line-arrows.js @@ -5,7 +5,7 @@ import Draw from '../src/ol/interaction/Draw.js'; import TileLayer from '../src/ol/layer/Tile.js'; import VectorLayer from '../src/ol/layer/Vector.js'; import _ol_source_OSM_ from '../src/ol/source/OSM.js'; -import _ol_source_Vector_ from '../src/ol/source/Vector.js'; +import VectorSource from '../src/ol/source/Vector.js'; import _ol_style_Icon_ from '../src/ol/style/Icon.js'; import _ol_style_Stroke_ from '../src/ol/style/Stroke.js'; import _ol_style_Style_ from '../src/ol/style/Style.js'; @@ -14,7 +14,7 @@ var raster = new TileLayer({ source: new _ol_source_OSM_() }); -var source = new _ol_source_Vector_(); +var source = new VectorSource(); var styleFunction = function(feature) { var geometry = feature.getGeometry(); diff --git a/examples/measure.js b/examples/measure.js index 8f736d0f21..9a5ff66694 100644 --- a/examples/measure.js +++ b/examples/measure.js @@ -9,7 +9,7 @@ import Draw from '../src/ol/interaction/Draw.js'; import TileLayer from '../src/ol/layer/Tile.js'; import VectorLayer from '../src/ol/layer/Vector.js'; import _ol_source_OSM_ from '../src/ol/source/OSM.js'; -import _ol_source_Vector_ from '../src/ol/source/Vector.js'; +import VectorSource from '../src/ol/source/Vector.js'; import _ol_style_Circle_ from '../src/ol/style/Circle.js'; import _ol_style_Fill_ from '../src/ol/style/Fill.js'; import _ol_style_Stroke_ from '../src/ol/style/Stroke.js'; @@ -20,7 +20,7 @@ var raster = new TileLayer({ source: new _ol_source_OSM_() }); -var source = new _ol_source_Vector_(); +var source = new VectorSource(); var vector = new VectorLayer({ source: source, diff --git a/examples/modify-features.js b/examples/modify-features.js index cc71a93180..b4220ad694 100644 --- a/examples/modify-features.js +++ b/examples/modify-features.js @@ -7,7 +7,7 @@ import _ol_interaction_Select_ from '../src/ol/interaction/Select.js'; import TileLayer from '../src/ol/layer/Tile.js'; import VectorLayer from '../src/ol/layer/Vector.js'; import _ol_source_OSM_ from '../src/ol/source/OSM.js'; -import _ol_source_Vector_ from '../src/ol/source/Vector.js'; +import VectorSource from '../src/ol/source/Vector.js'; var raster = new TileLayer({ @@ -15,7 +15,7 @@ var raster = new TileLayer({ }); var vector = new VectorLayer({ - source: new _ol_source_Vector_({ + source: new VectorSource({ url: 'data/geojson/countries.geojson', format: new GeoJSON(), wrapX: false diff --git a/examples/modify-test.js b/examples/modify-test.js index e107419d9e..e9991ff0c2 100644 --- a/examples/modify-test.js +++ b/examples/modify-test.js @@ -5,7 +5,7 @@ import {defaults as defaultInteractions} 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'; import VectorLayer from '../src/ol/layer/Vector.js'; -import _ol_source_Vector_ from '../src/ol/source/Vector.js'; +import VectorSource from '../src/ol/source/Vector.js'; import _ol_style_Circle_ from '../src/ol/style/Circle.js'; import _ol_style_Fill_ from '../src/ol/style/Fill.js'; import _ol_style_Stroke_ from '../src/ol/style/Stroke.js'; @@ -144,7 +144,7 @@ var geojsonObject = { }] }; -var source = new _ol_source_Vector_({ +var source = new VectorSource({ features: (new GeoJSON()).readFeatures(geojsonObject) }); diff --git a/examples/polygon-styles.js b/examples/polygon-styles.js index 498cf46bc0..20947b5126 100644 --- a/examples/polygon-styles.js +++ b/examples/polygon-styles.js @@ -3,7 +3,7 @@ import View from '../src/ol/View.js'; import GeoJSON from '../src/ol/format/GeoJSON.js'; import MultiPoint from '../src/ol/geom/MultiPoint.js'; import VectorLayer from '../src/ol/layer/Vector.js'; -import _ol_source_Vector_ from '../src/ol/source/Vector.js'; +import VectorSource from '../src/ol/source/Vector.js'; import _ol_style_Circle_ from '../src/ol/style/Circle.js'; import _ol_style_Fill_ from '../src/ol/style/Fill.js'; import _ol_style_Stroke_ from '../src/ol/style/Stroke.js'; @@ -80,7 +80,7 @@ var geojsonObject = { }] }; -var source = new _ol_source_Vector_({ +var source = new VectorSource({ features: (new GeoJSON()).readFeatures(geojsonObject) }); diff --git a/examples/regularshape.js b/examples/regularshape.js index a542739342..88dde56b95 100644 --- a/examples/regularshape.js +++ b/examples/regularshape.js @@ -3,7 +3,7 @@ import Map from '../src/ol/Map.js'; import View from '../src/ol/View.js'; import Point from '../src/ol/geom/Point.js'; import VectorLayer from '../src/ol/layer/Vector.js'; -import _ol_source_Vector_ from '../src/ol/source/Vector.js'; +import VectorSource from '../src/ol/source/Vector.js'; import _ol_style_Fill_ from '../src/ol/style/Fill.js'; import _ol_style_RegularShape_ from '../src/ol/style/RegularShape.js'; import _ol_style_Stroke_ from '../src/ol/style/Stroke.js'; @@ -76,7 +76,7 @@ for (var i = 0; i < count; ++i) { features[i].setStyle(styles[styleKeys[Math.floor(Math.random() * 5)]]); } -var source = new _ol_source_Vector_({ +var source = new VectorSource({ features: features }); diff --git a/examples/select-features.js b/examples/select-features.js index b50efd30be..652f30e3d8 100644 --- a/examples/select-features.js +++ b/examples/select-features.js @@ -6,14 +6,14 @@ import _ol_interaction_Select_ from '../src/ol/interaction/Select.js'; import TileLayer from '../src/ol/layer/Tile.js'; import VectorLayer from '../src/ol/layer/Vector.js'; import _ol_source_OSM_ from '../src/ol/source/OSM.js'; -import _ol_source_Vector_ from '../src/ol/source/Vector.js'; +import VectorSource from '../src/ol/source/Vector.js'; var raster = new TileLayer({ source: new _ol_source_OSM_() }); var vector = new VectorLayer({ - source: new _ol_source_Vector_({ + source: new VectorSource({ url: 'data/geojson/countries.geojson', format: new GeoJSON() }) diff --git a/examples/snap.js b/examples/snap.js index 2e72267561..6a52b7e199 100644 --- a/examples/snap.js +++ b/examples/snap.js @@ -7,7 +7,7 @@ import _ol_interaction_Snap_ from '../src/ol/interaction/Snap.js'; import TileLayer from '../src/ol/layer/Tile.js'; import VectorLayer from '../src/ol/layer/Vector.js'; import _ol_source_OSM_ from '../src/ol/source/OSM.js'; -import _ol_source_Vector_ from '../src/ol/source/Vector.js'; +import VectorSource from '../src/ol/source/Vector.js'; import _ol_style_Circle_ from '../src/ol/style/Circle.js'; import _ol_style_Fill_ from '../src/ol/style/Fill.js'; import _ol_style_Stroke_ from '../src/ol/style/Stroke.js'; @@ -18,7 +18,7 @@ var raster = new TileLayer({ }); var vector = new VectorLayer({ - source: new _ol_source_Vector_(), + source: new VectorSource(), style: new _ol_style_Style_({ fill: new _ol_style_Fill_({ color: 'rgba(255, 255, 255, 0.2)' diff --git a/examples/sphere-mollweide.js b/examples/sphere-mollweide.js index 910909093d..71ff806e43 100644 --- a/examples/sphere-mollweide.js +++ b/examples/sphere-mollweide.js @@ -4,7 +4,7 @@ import View from '../src/ol/View.js'; import GeoJSON from '../src/ol/format/GeoJSON.js'; import VectorLayer 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'; +import VectorSource from '../src/ol/source/Vector.js'; import {register} from '../src/ol/proj/proj4.js'; import proj4 from 'proj4'; @@ -26,7 +26,7 @@ var map = new Map({ keyboardEventTarget: document, layers: [ new VectorLayer({ - source: new _ol_source_Vector_({ + source: new VectorSource({ url: 'data/geojson/countries-110m.geojson', format: new GeoJSON() }) diff --git a/examples/street-labels.js b/examples/street-labels.js index d2791cdcb9..71a34e94e3 100644 --- a/examples/street-labels.js +++ b/examples/street-labels.js @@ -5,7 +5,7 @@ import GeoJSON from '../src/ol/format/GeoJSON.js'; import TileLayer from '../src/ol/layer/Tile.js'; import VectorLayer from '../src/ol/layer/Vector.js'; import _ol_source_BingMaps_ from '../src/ol/source/BingMaps.js'; -import _ol_source_Vector_ from '../src/ol/source/Vector.js'; +import VectorSource from '../src/ol/source/Vector.js'; import _ol_style_Fill_ from '../src/ol/style/Fill.js'; import _ol_style_Style_ from '../src/ol/style/Style.js'; import _ol_style_Text_ from '../src/ol/style/Text.js'; @@ -29,7 +29,7 @@ var map = new Map({ }) }), new VectorLayer({ declutter: true, - source: new _ol_source_Vector_({ + source: new VectorSource({ format: new GeoJSON(), url: 'data/geojson/vienna-streets.geojson' }), diff --git a/examples/symbol-atlas-webgl.js b/examples/symbol-atlas-webgl.js index 2e09a2c2fd..c3dae93cb0 100644 --- a/examples/symbol-atlas-webgl.js +++ b/examples/symbol-atlas-webgl.js @@ -3,7 +3,7 @@ import Map from '../src/ol/Map.js'; import View from '../src/ol/View.js'; import Point from '../src/ol/geom/Point.js'; import VectorLayer from '../src/ol/layer/Vector.js'; -import _ol_source_Vector_ from '../src/ol/source/Vector.js'; +import VectorSource from '../src/ol/source/Vector.js'; import _ol_style_AtlasManager_ from '../src/ol/style/AtlasManager.js'; import _ol_style_Circle_ from '../src/ol/style/Circle.js'; import _ol_style_Fill_ from '../src/ol/style/Fill.js'; @@ -99,7 +99,7 @@ for (i = 0; i < featureCount; ++i) { features[i] = feature; } -var vectorSource = new _ol_source_Vector_({ +var vectorSource = new VectorSource({ features: features }); var vector = new VectorLayer({ diff --git a/examples/synthetic-lines.js b/examples/synthetic-lines.js index 862e736849..a5e41f051b 100644 --- a/examples/synthetic-lines.js +++ b/examples/synthetic-lines.js @@ -3,7 +3,7 @@ import Map from '../src/ol/Map.js'; import View from '../src/ol/View.js'; import LineString from '../src/ol/geom/LineString.js'; import VectorLayer from '../src/ol/layer/Vector.js'; -import _ol_source_Vector_ from '../src/ol/source/Vector.js'; +import VectorSource from '../src/ol/source/Vector.js'; import _ol_style_Stroke_ from '../src/ol/style/Stroke.js'; import _ol_style_Style_ from '../src/ol/style/Style.js'; @@ -37,7 +37,7 @@ for (i = 0; i < count; ++i) { } var vector = new VectorLayer({ - source: new _ol_source_Vector_({ + source: new VectorSource({ features: features, wrapX: false }), diff --git a/examples/synthetic-points.js b/examples/synthetic-points.js index 644fc49235..84b48cbd0f 100644 --- a/examples/synthetic-points.js +++ b/examples/synthetic-points.js @@ -4,7 +4,7 @@ import View from '../src/ol/View.js'; import LineString from '../src/ol/geom/LineString.js'; import Point from '../src/ol/geom/Point.js'; import VectorLayer from '../src/ol/layer/Vector.js'; -import _ol_source_Vector_ from '../src/ol/source/Vector.js'; +import VectorSource from '../src/ol/source/Vector.js'; import _ol_style_Circle_ from '../src/ol/style/Circle.js'; import _ol_style_Fill_ from '../src/ol/style/Fill.js'; import _ol_style_Stroke_ from '../src/ol/style/Stroke.js'; @@ -40,7 +40,7 @@ var styles = { }) }; -var vectorSource = new _ol_source_Vector_({ +var vectorSource = new VectorSource({ features: features, wrapX: false }); diff --git a/examples/tissot.js b/examples/tissot.js index d9d0d17f28..79d8138979 100644 --- a/examples/tissot.js +++ b/examples/tissot.js @@ -5,14 +5,14 @@ import {circular as circularPolygon} from '../src/ol/geom/Polygon.js'; import TileLayer from '../src/ol/layer/Tile.js'; import VectorLayer from '../src/ol/layer/Vector.js'; import _ol_source_TileWMS_ from '../src/ol/source/TileWMS.js'; -import _ol_source_Vector_ from '../src/ol/source/Vector.js'; +import VectorSource from '../src/ol/source/Vector.js'; var vectorLayer4326 = new VectorLayer({ - source: new _ol_source_Vector_() + source: new VectorSource() }); var vectorLayer3857 = new VectorLayer({ - source: new _ol_source_Vector_() + source: new VectorSource() }); var map4326 = new Map({ diff --git a/examples/topojson.js b/examples/topojson.js index b413d33c86..d78070ddea 100644 --- a/examples/topojson.js +++ b/examples/topojson.js @@ -4,7 +4,7 @@ import TopoJSON from '../src/ol/format/TopoJSON.js'; import TileLayer from '../src/ol/layer/Tile.js'; import VectorLayer from '../src/ol/layer/Vector.js'; import _ol_source_TileJSON_ from '../src/ol/source/TileJSON.js'; -import _ol_source_Vector_ from '../src/ol/source/Vector.js'; +import VectorSource from '../src/ol/source/Vector.js'; import _ol_style_Fill_ from '../src/ol/style/Fill.js'; import _ol_style_Stroke_ from '../src/ol/style/Stroke.js'; import _ol_style_Style_ from '../src/ol/style/Style.js'; @@ -27,7 +27,7 @@ var style = new _ol_style_Style_({ }); var vector = new VectorLayer({ - source: new _ol_source_Vector_({ + source: new VectorSource({ url: 'data/topojson/world-110m.json', format: new TopoJSON({ // don't want to render the full world polygon (stored as 'land' layer), diff --git a/examples/topolis.js b/examples/topolis.js index 0838df6bc8..1ef51ba729 100644 --- a/examples/topolis.js +++ b/examples/topolis.js @@ -12,7 +12,7 @@ import _ol_interaction_Snap_ from '../src/ol/interaction/Snap.js'; import TileLayer from '../src/ol/layer/Tile.js'; import VectorLayer from '../src/ol/layer/Vector.js'; import _ol_source_OSM_ from '../src/ol/source/OSM.js'; -import _ol_source_Vector_ from '../src/ol/source/Vector.js'; +import VectorSource from '../src/ol/source/Vector.js'; import _ol_style_Style_ from '../src/ol/style/Style.js'; import _ol_style_Stroke_ from '../src/ol/style/Stroke.js'; import _ol_style_Fill_ from '../src/ol/style/Fill.js'; @@ -24,7 +24,7 @@ var raster = new TileLayer({ source: new _ol_source_OSM_() }); -var nodes = new _ol_source_Vector_({wrapX: false}); +var nodes = new VectorSource({wrapX: false}); var nodesLayer = new VectorLayer({ source: nodes, style: function(f) { @@ -47,7 +47,7 @@ var nodesLayer = new VectorLayer({ } }); -var edges = new _ol_source_Vector_({wrapX: false}); +var edges = new VectorSource({wrapX: false}); var edgesLayer = new VectorLayer({ source: edges, style: function(f) { @@ -69,7 +69,7 @@ var edgesLayer = new VectorLayer({ } }); -var faces = new _ol_source_Vector_({wrapX: false}); +var faces = new VectorSource({wrapX: false}); var facesLayer = new VectorLayer({ source: faces, style: function(f) { diff --git a/examples/translate-features.js b/examples/translate-features.js index 48c99f7174..357d9e10f1 100644 --- a/examples/translate-features.js +++ b/examples/translate-features.js @@ -7,7 +7,7 @@ import _ol_interaction_Translate_ from '../src/ol/interaction/Translate.js'; import TileLayer from '../src/ol/layer/Tile.js'; import VectorLayer from '../src/ol/layer/Vector.js'; import _ol_source_OSM_ from '../src/ol/source/OSM.js'; -import _ol_source_Vector_ from '../src/ol/source/Vector.js'; +import VectorSource from '../src/ol/source/Vector.js'; var raster = new TileLayer({ @@ -15,7 +15,7 @@ var raster = new TileLayer({ }); var vector = new VectorLayer({ - source: new _ol_source_Vector_({ + source: new VectorSource({ url: 'data/geojson/countries.geojson', format: new GeoJSON() }) diff --git a/examples/turf.js b/examples/turf.js index df41816da2..8f15165f0e 100644 --- a/examples/turf.js +++ b/examples/turf.js @@ -7,10 +7,10 @@ import TileLayer from '../src/ol/layer/Tile.js'; import VectorLayer from '../src/ol/layer/Vector.js'; import {fromLonLat} from '../src/ol/proj.js'; import _ol_source_OSM_ from '../src/ol/source/OSM.js'; -import _ol_source_Vector_ from '../src/ol/source/Vector.js'; +import VectorSource from '../src/ol/source/Vector.js'; -var source = new _ol_source_Vector_(); +var source = new VectorSource(); fetch('data/geojson/roads-seoul.geojson').then(function(response) { return response.json(); }).then(function(json) { diff --git a/examples/vector-esri-edit.js b/examples/vector-esri-edit.js index fa3fd18991..6498d26b8e 100644 --- a/examples/vector-esri-edit.js +++ b/examples/vector-esri-edit.js @@ -9,7 +9,7 @@ import TileLayer from '../src/ol/layer/Tile.js'; import VectorLayer from '../src/ol/layer/Vector.js'; import _ol_loadingstrategy_ from '../src/ol/loadingstrategy.js'; import {fromLonLat} from '../src/ol/proj.js'; -import _ol_source_Vector_ from '../src/ol/source/Vector.js'; +import VectorSource from '../src/ol/source/Vector.js'; import _ol_source_XYZ_ from '../src/ol/source/XYZ.js'; import _ol_tilegrid_ from '../src/ol/tilegrid.js'; @@ -20,7 +20,7 @@ var layer = '0'; var esrijsonFormat = new EsriJSON(); -var vectorSource = new _ol_source_Vector_({ +var vectorSource = new VectorSource({ loader: function(extent, resolution, projection) { var url = serviceUrl + layer + '/query/?f=json&' + 'returnGeometry=true&spatialRel=esriSpatialRelIntersects&geometry=' + diff --git a/examples/vector-esri.js b/examples/vector-esri.js index cda1aa5aab..4fe5305d33 100644 --- a/examples/vector-esri.js +++ b/examples/vector-esri.js @@ -5,7 +5,7 @@ import TileLayer from '../src/ol/layer/Tile.js'; import VectorLayer from '../src/ol/layer/Vector.js'; import _ol_loadingstrategy_ from '../src/ol/loadingstrategy.js'; import {fromLonLat} from '../src/ol/proj.js'; -import _ol_source_Vector_ from '../src/ol/source/Vector.js'; +import VectorSource from '../src/ol/source/Vector.js'; import _ol_source_XYZ_ from '../src/ol/source/XYZ.js'; import _ol_style_Fill_ from '../src/ol/style/Fill.js'; import _ol_style_Stroke_ from '../src/ol/style/Stroke.js'; @@ -58,7 +58,7 @@ var styleCache = { }) }; -var vectorSource = new _ol_source_Vector_({ +var vectorSource = new VectorSource({ loader: function(extent, resolution, projection) { var url = serviceUrl + layer + '/query/?f=json&' + 'returnGeometry=true&spatialRel=esriSpatialRelIntersects&geometry=' + diff --git a/examples/vector-label-decluttering.js b/examples/vector-label-decluttering.js index e345c321c9..5557e09e50 100644 --- a/examples/vector-label-decluttering.js +++ b/examples/vector-label-decluttering.js @@ -3,7 +3,7 @@ import View from '../src/ol/View.js'; import * as _ol_extent_ from '../src/ol/extent.js'; import GeoJSON from '../src/ol/format/GeoJSON.js'; import VectorLayer from '../src/ol/layer/Vector.js'; -import _ol_source_Vector_ from '../src/ol/source/Vector.js'; +import VectorSource from '../src/ol/source/Vector.js'; import _ol_style_Fill_ from '../src/ol/style/Fill.js'; import _ol_style_Stroke_ from '../src/ol/style/Stroke.js'; import _ol_style_Style_ from '../src/ol/style/Style.js'; @@ -59,7 +59,7 @@ var countryStyle = new _ol_style_Style_({ var style = [countryStyle, labelStyle]; var vectorLayer = new VectorLayer({ - source: new _ol_source_Vector_({ + source: new VectorSource({ url: 'data/geojson/countries.geojson', format: new GeoJSON() }), diff --git a/examples/vector-labels.js b/examples/vector-labels.js index cdafad6667..5acd0e9bb0 100644 --- a/examples/vector-labels.js +++ b/examples/vector-labels.js @@ -4,7 +4,7 @@ import GeoJSON from '../src/ol/format/GeoJSON.js'; import TileLayer from '../src/ol/layer/Tile.js'; import VectorLayer from '../src/ol/layer/Vector.js'; import _ol_source_OSM_ from '../src/ol/source/OSM.js'; -import _ol_source_Vector_ from '../src/ol/source/Vector.js'; +import VectorSource from '../src/ol/source/Vector.js'; import _ol_style_Circle_ from '../src/ol/style/Circle.js'; import _ol_style_Fill_ from '../src/ol/style/Fill.js'; import _ol_style_Stroke_ from '../src/ol/style/Stroke.js'; @@ -141,7 +141,7 @@ function polygonStyleFunction(feature, resolution) { } var vectorPolygons = new VectorLayer({ - source: new _ol_source_Vector_({ + source: new VectorSource({ url: 'data/geojson/polygon-samples.geojson', format: new GeoJSON() }), @@ -161,7 +161,7 @@ function lineStyleFunction(feature, resolution) { } var vectorLines = new VectorLayer({ - source: new _ol_source_Vector_({ + source: new VectorSource({ url: 'data/geojson/line-samples.geojson', format: new GeoJSON() }), @@ -182,7 +182,7 @@ function pointStyleFunction(feature, resolution) { } var vectorPoints = new VectorLayer({ - source: new _ol_source_Vector_({ + source: new VectorSource({ url: 'data/geojson/point-samples.geojson', format: new GeoJSON() }), diff --git a/examples/vector-layer.js b/examples/vector-layer.js index 8e20a4b882..22dcd5e206 100644 --- a/examples/vector-layer.js +++ b/examples/vector-layer.js @@ -2,7 +2,7 @@ import Map from '../src/ol/Map.js'; import View from '../src/ol/View.js'; import GeoJSON from '../src/ol/format/GeoJSON.js'; import VectorLayer from '../src/ol/layer/Vector.js'; -import _ol_source_Vector_ from '../src/ol/source/Vector.js'; +import VectorSource from '../src/ol/source/Vector.js'; import _ol_style_Fill_ from '../src/ol/style/Fill.js'; import _ol_style_Stroke_ from '../src/ol/style/Stroke.js'; import _ol_style_Style_ from '../src/ol/style/Style.js'; @@ -30,7 +30,7 @@ var style = new _ol_style_Style_({ }); var vectorLayer = new VectorLayer({ - source: new _ol_source_Vector_({ + source: new VectorSource({ url: 'data/geojson/countries.geojson', format: new GeoJSON() }), @@ -70,7 +70,7 @@ var highlightStyle = new _ol_style_Style_({ }); var featureOverlay = new VectorLayer({ - source: new _ol_source_Vector_(), + source: new VectorSource(), map: map, style: function(feature) { highlightStyle.getText().setText(feature.get('name')); diff --git a/examples/vector-osm.js b/examples/vector-osm.js index c0b271fb7b..93913457b3 100644 --- a/examples/vector-osm.js +++ b/examples/vector-osm.js @@ -7,7 +7,7 @@ import VectorLayer from '../src/ol/layer/Vector.js'; import _ol_loadingstrategy_ from '../src/ol/loadingstrategy.js'; import {transformExtent} from '../src/ol/proj.js'; import _ol_source_BingMaps_ from '../src/ol/source/BingMaps.js'; -import _ol_source_Vector_ from '../src/ol/source/Vector.js'; +import VectorSource from '../src/ol/source/Vector.js'; import _ol_style_Circle_ from '../src/ol/style/Circle.js'; import _ol_style_Fill_ from '../src/ol/style/Fill.js'; import _ol_style_Stroke_ from '../src/ol/style/Stroke.js'; @@ -77,7 +77,7 @@ var styles = { } }; -var vectorSource = new _ol_source_Vector_({ +var vectorSource = new VectorSource({ format: new OSMXML(), loader: function(extent, resolution, projection) { var epsg4326Extent = transformExtent(extent, projection, 'EPSG:4326'); diff --git a/examples/vector-wfs-getfeature.js b/examples/vector-wfs-getfeature.js index 831e10e802..86278c2f26 100644 --- a/examples/vector-wfs-getfeature.js +++ b/examples/vector-wfs-getfeature.js @@ -6,12 +6,12 @@ import GeoJSON from '../src/ol/format/GeoJSON.js'; import TileLayer from '../src/ol/layer/Tile.js'; import VectorLayer from '../src/ol/layer/Vector.js'; import _ol_source_BingMaps_ from '../src/ol/source/BingMaps.js'; -import _ol_source_Vector_ from '../src/ol/source/Vector.js'; +import VectorSource from '../src/ol/source/Vector.js'; import _ol_style_Stroke_ from '../src/ol/style/Stroke.js'; import _ol_style_Style_ from '../src/ol/style/Style.js'; -var vectorSource = new _ol_source_Vector_(); +var vectorSource = new VectorSource(); var vector = new VectorLayer({ source: vectorSource, style: new _ol_style_Style_({ diff --git a/examples/vector-wfs.js b/examples/vector-wfs.js index 22d8036eb9..3132fc89a9 100644 --- a/examples/vector-wfs.js +++ b/examples/vector-wfs.js @@ -5,12 +5,12 @@ import TileLayer from '../src/ol/layer/Tile.js'; import VectorLayer from '../src/ol/layer/Vector.js'; import _ol_loadingstrategy_ from '../src/ol/loadingstrategy.js'; import _ol_source_BingMaps_ from '../src/ol/source/BingMaps.js'; -import _ol_source_Vector_ from '../src/ol/source/Vector.js'; +import VectorSource from '../src/ol/source/Vector.js'; import _ol_style_Stroke_ from '../src/ol/style/Stroke.js'; import _ol_style_Style_ from '../src/ol/style/Style.js'; -var vectorSource = new _ol_source_Vector_({ +var vectorSource = new VectorSource({ format: new GeoJSON(), url: function(extent) { return 'https://ahocevar.com/geoserver/wfs?service=WFS&' + diff --git a/examples/wkt.js b/examples/wkt.js index efb54cbf68..fda8514988 100644 --- a/examples/wkt.js +++ b/examples/wkt.js @@ -4,7 +4,7 @@ import WKT from '../src/ol/format/WKT.js'; import TileLayer from '../src/ol/layer/Tile.js'; import VectorLayer from '../src/ol/layer/Vector.js'; import _ol_source_OSM_ from '../src/ol/source/OSM.js'; -import _ol_source_Vector_ from '../src/ol/source/Vector.js'; +import VectorSource from '../src/ol/source/Vector.js'; var raster = new TileLayer({ source: new _ol_source_OSM_() @@ -22,7 +22,7 @@ var feature = format.readFeature(wkt, { }); var vector = new VectorLayer({ - source: new _ol_source_Vector_({ + source: new VectorSource({ features: [feature] }) }); diff --git a/src/ol/interaction/Draw.js b/src/ol/interaction/Draw.js index 5f1278a028..0c6913eefc 100644 --- a/src/ol/interaction/Draw.js +++ b/src/ol/interaction/Draw.js @@ -23,7 +23,7 @@ import DrawEventType from '../interaction/DrawEventType.js'; import _ol_interaction_Pointer_ from '../interaction/Pointer.js'; import _ol_interaction_Property_ from '../interaction/Property.js'; import VectorLayer from '../layer/Vector.js'; -import _ol_source_Vector_ from '../source/Vector.js'; +import VectorSource from '../source/Vector.js'; import _ol_style_Style_ from '../style/Style.js'; /** @@ -250,7 +250,7 @@ var Draw = function(options) { * @private */ this.overlay_ = new VectorLayer({ - source: new _ol_source_Vector_({ + source: new VectorSource({ useSpatialIndex: false, wrapX: options.wrapX ? options.wrapX : false }), diff --git a/src/ol/interaction/Extent.js b/src/ol/interaction/Extent.js index 013b77c7a5..16a829c766 100644 --- a/src/ol/interaction/Extent.js +++ b/src/ol/interaction/Extent.js @@ -14,7 +14,7 @@ import {fromExtent as polygonFromExtent} from '../geom/Polygon.js'; import _ol_interaction_ExtentEventType_ from '../interaction/ExtentEventType.js'; import _ol_interaction_Pointer_ from '../interaction/Pointer.js'; import VectorLayer from '../layer/Vector.js'; -import _ol_source_Vector_ from '../source/Vector.js'; +import VectorSource from '../source/Vector.js'; import _ol_style_Style_ from '../style/Style.js'; /** @@ -94,7 +94,7 @@ var _ol_interaction_Extent_ = function(opt_options) { * @private */ this.extentOverlay_ = new VectorLayer({ - source: new _ol_source_Vector_({ + source: new VectorSource({ useSpatialIndex: false, wrapX: !!opt_options.wrapX }), @@ -109,7 +109,7 @@ var _ol_interaction_Extent_ = function(opt_options) { * @private */ this.vertexOverlay_ = new VectorLayer({ - source: new _ol_source_Vector_({ + source: new VectorSource({ useSpatialIndex: false, wrapX: !!opt_options.wrapX }), diff --git a/src/ol/interaction/Modify.js b/src/ol/interaction/Modify.js index 798804d4da..e5c362d59d 100644 --- a/src/ol/interaction/Modify.js +++ b/src/ol/interaction/Modify.js @@ -19,7 +19,7 @@ import Point from '../geom/Point.js'; import _ol_interaction_ModifyEventType_ from '../interaction/ModifyEventType.js'; import _ol_interaction_Pointer_ from '../interaction/Pointer.js'; import VectorLayer from '../layer/Vector.js'; -import _ol_source_Vector_ from '../source/Vector.js'; +import VectorSource from '../source/Vector.js'; import VectorEventType from '../source/VectorEventType.js'; import RBush from '../structs/RBush.js'; import _ol_style_Style_ from '../style/Style.js'; @@ -158,7 +158,7 @@ var _ol_interaction_Modify_ = function(options) { * @private */ this.overlay_ = new VectorLayer({ - source: new _ol_source_Vector_({ + source: new VectorSource({ useSpatialIndex: false, wrapX: !!options.wrapX }), diff --git a/src/ol/interaction/Select.js b/src/ol/interaction/Select.js index e8943266bf..da8e6ab6e3 100644 --- a/src/ol/interaction/Select.js +++ b/src/ol/interaction/Select.js @@ -12,7 +12,7 @@ import GeometryType from '../geom/GeometryType.js'; import Interaction from '../interaction/Interaction.js'; import VectorLayer from '../layer/Vector.js'; import _ol_obj_ from '../obj.js'; -import _ol_source_Vector_ from '../source/Vector.js'; +import VectorSource from '../source/Vector.js'; import _ol_style_Style_ from '../style/Style.js'; /** @@ -88,7 +88,7 @@ var _ol_interaction_Select_ = function(opt_options) { this.hitTolerance_ = options.hitTolerance ? options.hitTolerance : 0; var featureOverlay = new VectorLayer({ - source: new _ol_source_Vector_({ + source: new VectorSource({ useSpatialIndex: false, features: options.features, wrapX: options.wrapX diff --git a/src/ol/interaction/Snap.js b/src/ol/interaction/Snap.js index 92a1627952..2556f32ed8 100644 --- a/src/ol/interaction/Snap.js +++ b/src/ol/interaction/Snap.js @@ -13,7 +13,7 @@ import GeometryType from '../geom/GeometryType.js'; import {fromCircle} from '../geom/Polygon.js'; import _ol_interaction_Pointer_ from '../interaction/Pointer.js'; import _ol_obj_ from '../obj.js'; -import _ol_source_Vector_ from '../source/Vector.js'; +import VectorSource from '../source/Vector.js'; import VectorEventType from '../source/VectorEventType.js'; import RBush from '../structs/RBush.js'; @@ -219,7 +219,7 @@ _ol_interaction_Snap_.prototype.getFeatures_ = function() { */ _ol_interaction_Snap_.prototype.handleFeatureAdd_ = function(evt) { var feature; - if (evt instanceof _ol_source_Vector_.Event) { + if (evt instanceof VectorSource.Event) { feature = evt.feature; } else if (evt instanceof _ol_Collection_.Event) { feature = evt.element; @@ -234,7 +234,7 @@ _ol_interaction_Snap_.prototype.handleFeatureAdd_ = function(evt) { */ _ol_interaction_Snap_.prototype.handleFeatureRemove_ = function(evt) { var feature; - if (evt instanceof _ol_source_Vector_.Event) { + if (evt instanceof VectorSource.Event) { feature = evt.feature; } else if (evt instanceof _ol_Collection_.Event) { feature = evt.element; diff --git a/src/ol/source/Cluster.js b/src/ol/source/Cluster.js index 4ee3dc8a04..f1ffb7b8da 100644 --- a/src/ol/source/Cluster.js +++ b/src/ol/source/Cluster.js @@ -9,7 +9,7 @@ import _ol_coordinate_ from '../coordinate.js'; import EventType from '../events/EventType.js'; import {buffer, createEmpty, createOrUpdateFromCoordinate} from '../extent.js'; import Point from '../geom/Point.js'; -import _ol_source_Vector_ from '../source/Vector.js'; +import VectorSource from '../source/Vector.js'; /** * @classdesc @@ -23,7 +23,7 @@ import _ol_source_Vector_ from '../source/Vector.js'; * @api */ var _ol_source_Cluster_ = function(options) { - _ol_source_Vector_.call(this, { + VectorSource.call(this, { attributions: options.attributions, extent: options.extent, projection: options.projection, @@ -70,7 +70,7 @@ var _ol_source_Cluster_ = function(options) { _ol_source_Cluster_.prototype.refresh, this); }; -inherits(_ol_source_Cluster_, _ol_source_Vector_); +inherits(_ol_source_Cluster_, VectorSource); /** @@ -127,7 +127,7 @@ _ol_source_Cluster_.prototype.refresh = function() { this.clear(); this.cluster(); this.addFeatures(this.features); - _ol_source_Vector_.prototype.refresh.call(this); + VectorSource.prototype.refresh.call(this); }; diff --git a/src/ol/source/Vector.js b/src/ol/source/Vector.js index ea1594297e..462e832c77 100644 --- a/src/ol/source/Vector.js +++ b/src/ol/source/Vector.js @@ -33,7 +33,7 @@ import RBush from '../structs/RBush.js'; * @param {olx.source.VectorOptions=} opt_options Vector source options. * @api */ -var _ol_source_Vector_ = function(opt_options) { +var VectorSource = function(opt_options) { var options = opt_options || {}; @@ -149,7 +149,7 @@ var _ol_source_Vector_ = function(opt_options) { }; -inherits(_ol_source_Vector_, Source); +inherits(VectorSource, Source); /** @@ -161,7 +161,7 @@ inherits(_ol_source_Vector_, Source); * @param {ol.Feature} feature Feature to add. * @api */ -_ol_source_Vector_.prototype.addFeature = function(feature) { +VectorSource.prototype.addFeature = function(feature) { this.addFeatureInternal(feature); this.changed(); }; @@ -172,7 +172,7 @@ _ol_source_Vector_.prototype.addFeature = function(feature) { * @param {ol.Feature} feature Feature. * @protected */ -_ol_source_Vector_.prototype.addFeatureInternal = function(feature) { +VectorSource.prototype.addFeatureInternal = function(feature) { var featureKey = getUid(feature).toString(); if (!this.addToIndex_(featureKey, feature)) { @@ -192,7 +192,7 @@ _ol_source_Vector_.prototype.addFeatureInternal = function(feature) { } this.dispatchEvent( - new _ol_source_Vector_.Event(VectorEventType.ADDFEATURE, feature)); + new VectorSource.Event(VectorEventType.ADDFEATURE, feature)); }; @@ -201,7 +201,7 @@ _ol_source_Vector_.prototype.addFeatureInternal = function(feature) { * @param {ol.Feature} feature The feature. * @private */ -_ol_source_Vector_.prototype.setupChangeEvents_ = function(featureKey, feature) { +VectorSource.prototype.setupChangeEvents_ = function(featureKey, feature) { this.featureChangeKeys_[featureKey] = [ _ol_events_.listen(feature, EventType.CHANGE, this.handleFeatureChange_, this), @@ -218,7 +218,7 @@ _ol_source_Vector_.prototype.setupChangeEvents_ = function(featureKey, feature) * candidate for insertion into the Rtree. * @private */ -_ol_source_Vector_.prototype.addToIndex_ = function(featureKey, feature) { +VectorSource.prototype.addToIndex_ = function(featureKey, feature) { var valid = true; var id = feature.getId(); if (id !== undefined) { @@ -241,7 +241,7 @@ _ol_source_Vector_.prototype.addToIndex_ = function(featureKey, feature) { * @param {Array.} features Features to add. * @api */ -_ol_source_Vector_.prototype.addFeatures = function(features) { +VectorSource.prototype.addFeatures = function(features) { this.addFeaturesInternal(features); this.changed(); }; @@ -252,7 +252,7 @@ _ol_source_Vector_.prototype.addFeatures = function(features) { * @param {Array.} features Features. * @protected */ -_ol_source_Vector_.prototype.addFeaturesInternal = function(features) { +VectorSource.prototype.addFeaturesInternal = function(features) { var featureKey, i, length, feature; var extents = []; @@ -286,7 +286,7 @@ _ol_source_Vector_.prototype.addFeaturesInternal = function(features) { } for (i = 0, length = newFeatures.length; i < length; i++) { - this.dispatchEvent(new _ol_source_Vector_.Event( + this.dispatchEvent(new VectorSource.Event( VectorEventType.ADDFEATURE, newFeatures[i])); } }; @@ -296,7 +296,7 @@ _ol_source_Vector_.prototype.addFeaturesInternal = function(features) { * @param {!ol.Collection.} collection Collection. * @private */ -_ol_source_Vector_.prototype.bindFeaturesCollection_ = function(collection) { +VectorSource.prototype.bindFeaturesCollection_ = function(collection) { var modifyingCollection = false; _ol_events_.listen(this, VectorEventType.ADDFEATURE, function(evt) { @@ -339,7 +339,7 @@ _ol_source_Vector_.prototype.bindFeaturesCollection_ = function(collection) { * @param {boolean=} opt_fast Skip dispatching of {@link removefeature} events. * @api */ -_ol_source_Vector_.prototype.clear = function(opt_fast) { +VectorSource.prototype.clear = function(opt_fast) { if (opt_fast) { for (var featureId in this.featureChangeKeys_) { var keys = this.featureChangeKeys_[featureId]; @@ -368,7 +368,7 @@ _ol_source_Vector_.prototype.clear = function(opt_fast) { this.loadedExtentsRtree_.clear(); this.nullGeometryFeatures_ = {}; - var clearEvent = new _ol_source_Vector_.Event(VectorEventType.CLEAR); + var clearEvent = new VectorSource.Event(VectorEventType.CLEAR); this.dispatchEvent(clearEvent); this.changed(); }; @@ -385,7 +385,7 @@ _ol_source_Vector_.prototype.clear = function(opt_fast) { * @template T * @api */ -_ol_source_Vector_.prototype.forEachFeature = function(callback) { +VectorSource.prototype.forEachFeature = function(callback) { if (this.featuresRtree_) { return this.featuresRtree_.forEach(callback); } else if (this.featuresCollection_) { @@ -406,7 +406,7 @@ _ol_source_Vector_.prototype.forEachFeature = function(callback) { * @return {T|undefined} The return value from the last call to the callback. * @template T */ -_ol_source_Vector_.prototype.forEachFeatureAtCoordinateDirect = function(coordinate, callback) { +VectorSource.prototype.forEachFeatureAtCoordinateDirect = function(coordinate, callback) { var extent = [coordinate[0], coordinate[1], coordinate[0], coordinate[1]]; return this.forEachFeatureInExtent(extent, function(feature) { var geometry = feature.getGeometry(); @@ -439,7 +439,7 @@ _ol_source_Vector_.prototype.forEachFeatureAtCoordinateDirect = function(coordin * @template T * @api */ -_ol_source_Vector_.prototype.forEachFeatureInExtent = function(extent, callback) { +VectorSource.prototype.forEachFeatureInExtent = function(extent, callback) { if (this.featuresRtree_) { return this.featuresRtree_.forEachInExtent(extent, callback); } else if (this.featuresCollection_) { @@ -464,7 +464,7 @@ _ol_source_Vector_.prototype.forEachFeatureInExtent = function(extent, callback) * @template T * @api */ -_ol_source_Vector_.prototype.forEachFeatureIntersectingExtent = function(extent, callback) { +VectorSource.prototype.forEachFeatureIntersectingExtent = function(extent, callback) { return this.forEachFeatureInExtent(extent, /** * @param {ol.Feature} feature Feature. @@ -490,7 +490,7 @@ _ol_source_Vector_.prototype.forEachFeatureIntersectingExtent = function(extent, * @return {ol.Collection.} The collection of features. * @api */ -_ol_source_Vector_.prototype.getFeaturesCollection = function() { +VectorSource.prototype.getFeaturesCollection = function() { return this.featuresCollection_; }; @@ -500,7 +500,7 @@ _ol_source_Vector_.prototype.getFeaturesCollection = function() { * @return {Array.} Features. * @api */ -_ol_source_Vector_.prototype.getFeatures = function() { +VectorSource.prototype.getFeatures = function() { var features; if (this.featuresCollection_) { features = this.featuresCollection_.getArray(); @@ -520,7 +520,7 @@ _ol_source_Vector_.prototype.getFeatures = function() { * @return {Array.} Features. * @api */ -_ol_source_Vector_.prototype.getFeaturesAtCoordinate = function(coordinate) { +VectorSource.prototype.getFeaturesAtCoordinate = function(coordinate) { var features = []; this.forEachFeatureAtCoordinateDirect(coordinate, function(feature) { features.push(feature); @@ -540,7 +540,7 @@ _ol_source_Vector_.prototype.getFeaturesAtCoordinate = function(coordinate) { * @return {Array.} Features. * @api */ -_ol_source_Vector_.prototype.getFeaturesInExtent = function(extent) { +VectorSource.prototype.getFeaturesInExtent = function(extent) { return this.featuresRtree_.getInExtent(extent); }; @@ -557,7 +557,7 @@ _ol_source_Vector_.prototype.getFeaturesInExtent = function(extent) { * @return {ol.Feature} Closest feature. * @api */ -_ol_source_Vector_.prototype.getClosestFeatureToCoordinate = function(coordinate, opt_filter) { +VectorSource.prototype.getClosestFeatureToCoordinate = function(coordinate, opt_filter) { // Find the closest feature using branch and bound. We start searching an // infinite extent, and find the distance from the first feature found. This // becomes the closest feature. We then compute a smaller extent which any @@ -610,7 +610,7 @@ _ol_source_Vector_.prototype.getClosestFeatureToCoordinate = function(coordinate * @return {ol.Extent} Extent. * @api */ -_ol_source_Vector_.prototype.getExtent = function(opt_extent) { +VectorSource.prototype.getExtent = function(opt_extent) { return this.featuresRtree_.getExtent(opt_extent); }; @@ -624,7 +624,7 @@ _ol_source_Vector_.prototype.getExtent = function(opt_extent) { * @return {ol.Feature} The feature (or `null` if not found). * @api */ -_ol_source_Vector_.prototype.getFeatureById = function(id) { +VectorSource.prototype.getFeatureById = function(id) { var feature = this.idIndex_[id.toString()]; return feature !== undefined ? feature : null; }; @@ -636,7 +636,7 @@ _ol_source_Vector_.prototype.getFeatureById = function(id) { * @return {ol.format.Feature|undefined} The feature format. * @api */ -_ol_source_Vector_.prototype.getFormat = function() { +VectorSource.prototype.getFormat = function() { return this.format_; }; @@ -644,7 +644,7 @@ _ol_source_Vector_.prototype.getFormat = function() { /** * @return {boolean} The source can have overlapping geometries. */ -_ol_source_Vector_.prototype.getOverlaps = function() { +VectorSource.prototype.getOverlaps = function() { return this.overlaps_; }; @@ -652,7 +652,7 @@ _ol_source_Vector_.prototype.getOverlaps = function() { /** * @override */ -_ol_source_Vector_.prototype.getResolutions = function() {}; +VectorSource.prototype.getResolutions = function() {}; /** @@ -661,7 +661,7 @@ _ol_source_Vector_.prototype.getResolutions = function() {}; * @return {string|ol.FeatureUrlFunction|undefined} The url. * @api */ -_ol_source_Vector_.prototype.getUrl = function() { +VectorSource.prototype.getUrl = function() { return this.url_; }; @@ -670,7 +670,7 @@ _ol_source_Vector_.prototype.getUrl = function() { * @param {ol.events.Event} event Event. * @private */ -_ol_source_Vector_.prototype.handleFeatureChange_ = function(event) { +VectorSource.prototype.handleFeatureChange_ = function(event) { var feature = /** @type {ol.Feature} */ (event.target); var featureKey = getUid(feature).toString(); var geometry = feature.getGeometry(); @@ -713,7 +713,7 @@ _ol_source_Vector_.prototype.handleFeatureChange_ = function(event) { } } this.changed(); - this.dispatchEvent(new _ol_source_Vector_.Event( + this.dispatchEvent(new VectorSource.Event( VectorEventType.CHANGEFEATURE, feature)); }; @@ -721,7 +721,7 @@ _ol_source_Vector_.prototype.handleFeatureChange_ = function(event) { /** * @return {boolean} Is empty. */ -_ol_source_Vector_.prototype.isEmpty = function() { +VectorSource.prototype.isEmpty = function() { return this.featuresRtree_.isEmpty() && _ol_obj_.isEmpty(this.nullGeometryFeatures_); }; @@ -732,7 +732,7 @@ _ol_source_Vector_.prototype.isEmpty = function() { * @param {number} resolution Resolution. * @param {ol.proj.Projection} projection Projection. */ -_ol_source_Vector_.prototype.loadFeatures = function( +VectorSource.prototype.loadFeatures = function( extent, resolution, projection) { var loadedExtentsRtree = this.loadedExtentsRtree_; var extentsToLoad = this.strategy_(extent, resolution); @@ -760,7 +760,7 @@ _ol_source_Vector_.prototype.loadFeatures = function( * @param {ol.Extent} extent Extent. * @api */ -_ol_source_Vector_.prototype.removeLoadedExtent = function(extent) { +VectorSource.prototype.removeLoadedExtent = function(extent) { var loadedExtentsRtree = this.loadedExtentsRtree_; var obj; loadedExtentsRtree.forEachInExtent(extent, function(object) { @@ -782,7 +782,7 @@ _ol_source_Vector_.prototype.removeLoadedExtent = function(extent) { * @param {ol.Feature} feature Feature to remove. * @api */ -_ol_source_Vector_.prototype.removeFeature = function(feature) { +VectorSource.prototype.removeFeature = function(feature) { var featureKey = getUid(feature).toString(); if (featureKey in this.nullGeometryFeatures_) { delete this.nullGeometryFeatures_[featureKey]; @@ -801,7 +801,7 @@ _ol_source_Vector_.prototype.removeFeature = function(feature) { * @param {ol.Feature} feature Feature. * @protected */ -_ol_source_Vector_.prototype.removeFeatureInternal = function(feature) { +VectorSource.prototype.removeFeatureInternal = function(feature) { var featureKey = getUid(feature).toString(); this.featureChangeKeys_[featureKey].forEach(_ol_events_.unlistenByKey); delete this.featureChangeKeys_[featureKey]; @@ -811,7 +811,7 @@ _ol_source_Vector_.prototype.removeFeatureInternal = function(feature) { } else { delete this.undefIdIndex_[featureKey]; } - this.dispatchEvent(new _ol_source_Vector_.Event( + this.dispatchEvent(new VectorSource.Event( VectorEventType.REMOVEFEATURE, feature)); }; @@ -823,7 +823,7 @@ _ol_source_Vector_.prototype.removeFeatureInternal = function(feature) { * @return {boolean} Removed the feature from the index. * @private */ -_ol_source_Vector_.prototype.removeFromIdIndex_ = function(feature) { +VectorSource.prototype.removeFromIdIndex_ = function(feature) { var removed = false; for (var id in this.idIndex_) { if (this.idIndex_[id] === feature) { @@ -842,7 +842,7 @@ _ol_source_Vector_.prototype.removeFromIdIndex_ = function(feature) { * @param {ol.FeatureLoader} loader The loader to set. * @api */ -_ol_source_Vector_.prototype.setLoader = function(loader) { +VectorSource.prototype.setLoader = function(loader) { this.loader_ = loader; }; @@ -858,7 +858,7 @@ _ol_source_Vector_.prototype.setLoader = function(loader) { * @param {string} type Type. * @param {ol.Feature=} opt_feature Feature. */ -_ol_source_Vector_.Event = function(type, opt_feature) { +VectorSource.Event = function(type, opt_feature) { Event.call(this, type); @@ -870,5 +870,5 @@ _ol_source_Vector_.Event = function(type, opt_feature) { this.feature = opt_feature; }; -inherits(_ol_source_Vector_.Event, Event); -export default _ol_source_Vector_; +inherits(VectorSource.Event, Event); +export default VectorSource; diff --git a/test/rendering/ol/layer/vector.test.js b/test/rendering/ol/layer/vector.test.js index 9fa9ffbab3..c034d5701b 100644 --- a/test/rendering/ol/layer/vector.test.js +++ b/test/rendering/ol/layer/vector.test.js @@ -7,7 +7,7 @@ import LineString from '../../../../src/ol/geom/LineString.js'; import Point from '../../../../src/ol/geom/Point.js'; import Polygon from '../../../../src/ol/geom/Polygon.js'; import VectorLayer from '../../../../src/ol/layer/Vector.js'; -import _ol_source_Vector_ from '../../../../src/ol/source/Vector.js'; +import VectorSource from '../../../../src/ol/source/Vector.js'; import _ol_style_Circle_ from '../../../../src/ol/style/Circle.js'; import _ol_style_Fill_ from '../../../../src/ol/style/Fill.js'; import _ol_style_Stroke_ from '../../../../src/ol/style/Stroke.js'; @@ -70,7 +70,7 @@ describe('ol.rendering.layer.Vector', function() { describe('vector layer', function() { beforeEach(function() { - source = new _ol_source_Vector_(); + source = new VectorSource(); }); it('renders opacity correctly with the canvas renderer', function(done) { @@ -274,7 +274,7 @@ describe('ol.rendering.layer.Vector', function() { it('renders fill/stroke batches correctly with the canvas renderer', function(done) { createMap('canvas'); - source = new _ol_source_Vector_({ + source = new VectorSource({ overlaps: false }); addPolygon(100); @@ -300,7 +300,7 @@ describe('ol.rendering.layer.Vector', function() { it('renders stroke batches correctly with the canvas renderer', function(done) { createMap('canvas'); - source = new _ol_source_Vector_({ + source = new VectorSource({ overlaps: false }); addLineString(100); @@ -327,7 +327,7 @@ describe('ol.rendering.layer.Vector', function() { var color; function createSource(overlaps) { color = '#3399CC'; - source = new _ol_source_Vector_({ + source = new VectorSource({ overlaps: overlaps }); addPolygon(720); @@ -380,7 +380,7 @@ describe('ol.rendering.layer.Vector', function() { var color; function createSource(overlaps) { color = '#3399CC'; - source = new _ol_source_Vector_({ + source = new VectorSource({ overlaps: overlaps }); addLineString(720); @@ -467,7 +467,7 @@ describe('ol.rendering.layer.Vector', function() { var feature = format.readFeature(json); var layer = new VectorLayer({ - source: new _ol_source_Vector_({ + source: new VectorSource({ features: [feature] }), style: new _ol_style_Style_({ @@ -492,7 +492,7 @@ describe('ol.rendering.layer.Vector', function() { var layer, map3; beforeEach(function() { - var src = new _ol_source_Vector_({ + var src = new VectorSource({ features: [ new Feature(new Polygon([[ [-22, 58], @@ -579,7 +579,7 @@ describe('ol.rendering.layer.Vector', function() { describe('decluttering', function() { beforeEach(function() { - source = new _ol_source_Vector_(); + source = new VectorSource(); }); it('declutters text', function(done) { diff --git a/test/rendering/ol/layer/vectortile.test.js b/test/rendering/ol/layer/vectortile.test.js index a8eeab0add..357384b358 100644 --- a/test/rendering/ol/layer/vectortile.test.js +++ b/test/rendering/ol/layer/vectortile.test.js @@ -6,7 +6,7 @@ import Point from '../../../../src/ol/geom/Point.js'; import VectorLayer from '../../../../src/ol/layer/Vector.js'; import _ol_layer_VectorTile_ from '../../../../src/ol/layer/VectorTile.js'; import _ol_obj_ from '../../../../src/ol/obj.js'; -import _ol_source_Vector_ from '../../../../src/ol/source/Vector.js'; +import VectorSource from '../../../../src/ol/source/Vector.js'; import _ol_source_VectorTile_ from '../../../../src/ol/source/VectorTile.js'; import _ol_style_Circle_ from '../../../../src/ol/style/Circle.js'; import _ol_style_Fill_ from '../../../../src/ol/style/Fill.js'; @@ -96,7 +96,7 @@ describe('ol.rendering.layer.VectorTile', function() { it('renders rotated view correctly with vector layer on top', function(done) { createMap('canvas'); - var vectorSource = new _ol_source_Vector_({ + var vectorSource = new VectorSource({ features: [ new Feature(new Point([1825727.7316762917, 6143091.089223046])) ] diff --git a/test/rendering/ol/map.test.js b/test/rendering/ol/map.test.js index 159a3c4b81..0942db006e 100644 --- a/test/rendering/ol/map.test.js +++ b/test/rendering/ol/map.test.js @@ -3,7 +3,7 @@ import Point from '../../../src/ol/geom/Point.js'; import Map from '../../../src/ol/Map.js'; import View from '../../../src/ol/View.js'; import VectorLayer from '../../../src/ol/layer/Vector.js'; -import _ol_source_Vector_ from '../../../src/ol/source/Vector.js'; +import VectorSource from '../../../src/ol/source/Vector.js'; describe('ol.rendering.Map', function() { @@ -11,7 +11,7 @@ describe('ol.rendering.Map', function() { var map; function createMap(renderer) { var vectorLayer = new VectorLayer({ - source: new _ol_source_Vector_({ + source: new VectorSource({ features: [new Feature({ geometry: new Point([0, 0]) })] diff --git a/test/rendering/ol/style/circle.test.js b/test/rendering/ol/style/circle.test.js index 6a795f0431..4bf090bac1 100644 --- a/test/rendering/ol/style/circle.test.js +++ b/test/rendering/ol/style/circle.test.js @@ -4,7 +4,7 @@ import MultiPoint from '../../../../src/ol/geom/MultiPoint.js'; import Map from '../../../../src/ol/Map.js'; import View from '../../../../src/ol/View.js'; import VectorLayer from '../../../../src/ol/layer/Vector.js'; -import _ol_source_Vector_ from '../../../../src/ol/source/Vector.js'; +import VectorSource from '../../../../src/ol/source/Vector.js'; import _ol_style_Circle_ from '../../../../src/ol/style/Circle.js'; import _ol_style_Fill_ from '../../../../src/ol/style/Fill.js'; import _ol_style_Style_ from '../../../../src/ol/style/Style.js'; @@ -16,7 +16,7 @@ describe('ol.rendering.style.Circle', function() { var map, vectorSource; function createMap(renderer) { - vectorSource = new _ol_source_Vector_(); + vectorSource = new VectorSource(); var vectorLayer = new VectorLayer({ source: vectorSource }); diff --git a/test/rendering/ol/style/icon.test.js b/test/rendering/ol/style/icon.test.js index b1a1d67c25..234e437378 100644 --- a/test/rendering/ol/style/icon.test.js +++ b/test/rendering/ol/style/icon.test.js @@ -3,7 +3,7 @@ import Point from '../../../../src/ol/geom/Point.js'; import Map from '../../../../src/ol/Map.js'; import View from '../../../../src/ol/View.js'; import VectorLayer from '../../../../src/ol/layer/Vector.js'; -import _ol_source_Vector_ from '../../../../src/ol/source/Vector.js'; +import VectorSource from '../../../../src/ol/source/Vector.js'; import _ol_style_Icon_ from '../../../../src/ol/style/Icon.js'; import _ol_style_Style_ from '../../../../src/ol/style/Style.js'; @@ -22,7 +22,7 @@ describe('ol.rendering.style.Icon', function() { }; function createMap(renderer, width, height) { - vectorSource = new _ol_source_Vector_(); + vectorSource = new VectorSource(); var vectorLayer = new VectorLayer({ source: vectorSource }); diff --git a/test/rendering/ol/style/linestring.test.js b/test/rendering/ol/style/linestring.test.js index 5ad79bf3b6..00cdfa5ee9 100644 --- a/test/rendering/ol/style/linestring.test.js +++ b/test/rendering/ol/style/linestring.test.js @@ -3,7 +3,7 @@ import LineString from '../../../../src/ol/geom/LineString.js'; import Map from '../../../../src/ol/Map.js'; import View from '../../../../src/ol/View.js'; import VectorLayer from '../../../../src/ol/layer/Vector.js'; -import _ol_source_Vector_ from '../../../../src/ol/source/Vector.js'; +import VectorSource from '../../../../src/ol/source/Vector.js'; import _ol_style_Style_ from '../../../../src/ol/style/Style.js'; import _ol_style_Stroke_ from '../../../../src/ol/style/Stroke.js'; @@ -13,7 +13,7 @@ describe('ol.rendering.style.LineString', function() { var map, vectorSource; function createMap(renderer, opt_pixelRatio) { - vectorSource = new _ol_source_Vector_(); + vectorSource = new VectorSource(); var vectorLayer = new VectorLayer({ source: vectorSource }); diff --git a/test/rendering/ol/style/polygon.test.js b/test/rendering/ol/style/polygon.test.js index aaf91ac3a2..e1ac2fa2a8 100644 --- a/test/rendering/ol/style/polygon.test.js +++ b/test/rendering/ol/style/polygon.test.js @@ -3,7 +3,7 @@ import Polygon from '../../../../src/ol/geom/Polygon.js'; import Map from '../../../../src/ol/Map.js'; import View from '../../../../src/ol/View.js'; import VectorLayer from '../../../../src/ol/layer/Vector.js'; -import _ol_source_Vector_ from '../../../../src/ol/source/Vector.js'; +import VectorSource from '../../../../src/ol/source/Vector.js'; import _ol_style_Fill_ from '../../../../src/ol/style/Fill.js'; import _ol_style_Style_ from '../../../../src/ol/style/Style.js'; import _ol_style_Stroke_ from '../../../../src/ol/style/Stroke.js'; @@ -16,7 +16,7 @@ describe('ol.rendering.style.Polygon', function() { function createMap(renderer, opt_size) { var size = opt_size || 50; - vectorSource = new _ol_source_Vector_(); + vectorSource = new VectorSource(); var vectorLayer = new VectorLayer({ source: vectorSource }); diff --git a/test/rendering/ol/style/regularshape.test.js b/test/rendering/ol/style/regularshape.test.js index 978b5cff42..ee120eda97 100644 --- a/test/rendering/ol/style/regularshape.test.js +++ b/test/rendering/ol/style/regularshape.test.js @@ -3,7 +3,7 @@ import Point from '../../../../src/ol/geom/Point.js'; import Map from '../../../../src/ol/Map.js'; import View from '../../../../src/ol/View.js'; import VectorLayer from '../../../../src/ol/layer/Vector.js'; -import _ol_source_Vector_ from '../../../../src/ol/source/Vector.js'; +import VectorSource from '../../../../src/ol/source/Vector.js'; import _ol_style_Fill_ from '../../../../src/ol/style/Fill.js'; import _ol_style_RegularShape_ from '../../../../src/ol/style/RegularShape.js'; import _ol_style_Style_ from '../../../../src/ol/style/Style.js'; @@ -15,7 +15,7 @@ describe('ol.rendering.style.RegularShape', function() { var map, vectorSource; function createMap(renderer) { - vectorSource = new _ol_source_Vector_(); + vectorSource = new VectorSource(); var vectorLayer = new VectorLayer({ source: vectorSource }); diff --git a/test/rendering/ol/style/text.test.js b/test/rendering/ol/style/text.test.js index 67e07f79a9..73fc4760e8 100644 --- a/test/rendering/ol/style/text.test.js +++ b/test/rendering/ol/style/text.test.js @@ -7,7 +7,7 @@ import Polygon from '../../../../src/ol/geom/Polygon.js'; import Map from '../../../../src/ol/Map.js'; import View from '../../../../src/ol/View.js'; import VectorLayer from '../../../../src/ol/layer/Vector.js'; -import _ol_source_Vector_ from '../../../../src/ol/source/Vector.js'; +import VectorSource from '../../../../src/ol/source/Vector.js'; import _ol_style_Text_ from '../../../../src/ol/style/Text.js'; import _ol_style_Fill_ from '../../../../src/ol/style/Fill.js'; import _ol_style_Style_ from '../../../../src/ol/style/Style.js'; @@ -19,7 +19,7 @@ describe('ol.rendering.style.Text', function() { function createMap(renderer, opt_pixelRatio) { var pixelRatio = opt_pixelRatio || 1; - vectorSource = new _ol_source_Vector_(); + vectorSource = new VectorSource(); var vectorLayer = new VectorLayer({ source: vectorSource }); diff --git a/test/spec/ol/featureloader.test.js b/test/spec/ol/featureloader.test.js index 6865ef1ef3..67643fb119 100644 --- a/test/spec/ol/featureloader.test.js +++ b/test/spec/ol/featureloader.test.js @@ -1,6 +1,6 @@ import {xhr} from '../../../src/ol/featureloader.js'; import GeoJSON from '../../../src/ol/format/GeoJSON.js'; -import _ol_source_Vector_ from '../../../src/ol/source/Vector.js'; +import VectorSource from '../../../src/ol/source/Vector.js'; describe('ol.featureloader', function() { @@ -15,7 +15,7 @@ describe('ol.featureloader', function() { url = 'spec/ol/data/point.json'; format = new GeoJSON(); - source = new _ol_source_Vector_(); + source = new VectorSource(); }); it('adds features to the source', function(done) { diff --git a/test/spec/ol/interaction/draganddrop.test.js b/test/spec/ol/interaction/draganddrop.test.js index 69858d0594..a40f561e38 100644 --- a/test/spec/ol/interaction/draganddrop.test.js +++ b/test/spec/ol/interaction/draganddrop.test.js @@ -4,7 +4,7 @@ import Event from '../../../../src/ol/events/Event.js'; import EventTarget from '../../../../src/ol/events/EventTarget.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'; +import VectorSource from '../../../../src/ol/source/Vector.js'; where('FileReader').describe('ol.interaction.DragAndDrop', function() { var viewport, map, interaction; @@ -36,7 +36,7 @@ where('FileReader').describe('ol.interaction.DragAndDrop', function() { }); it('accepts a source option', function() { - var source = new _ol_source_Vector_(); + var source = new VectorSource(); var drop = new DragAndDrop({ formatConstructors: [GeoJSON], source: source @@ -136,7 +136,7 @@ where('FileReader').describe('ol.interaction.DragAndDrop', function() { }); it('adds dropped features to a source', function(done) { - var source = new _ol_source_Vector_(); + var source = new VectorSource(); var drop = new DragAndDrop({ formatConstructors: [GeoJSON], source: source diff --git a/test/spec/ol/interaction/dragrotateandzoom.test.js b/test/spec/ol/interaction/dragrotateandzoom.test.js index ea00313edc..4c8ab28ffc 100644 --- a/test/spec/ol/interaction/dragrotateandzoom.test.js +++ b/test/spec/ol/interaction/dragrotateandzoom.test.js @@ -5,7 +5,7 @@ import DragRotateAndZoom from '../../../../src/ol/interaction/DragRotateAndZoom. import Interaction from '../../../../src/ol/interaction/Interaction.js'; import VectorLayer from '../../../../src/ol/layer/Vector.js'; import _ol_pointer_PointerEvent_ from '../../../../src/ol/pointer/PointerEvent.js'; -import _ol_source_Vector_ from '../../../../src/ol/source/Vector.js'; +import VectorSource from '../../../../src/ol/source/Vector.js'; describe('ol.interaction.DragRotateAndZoom', function() { @@ -34,7 +34,7 @@ describe('ol.interaction.DragRotateAndZoom', function() { style.width = width + 'px'; style.height = height + 'px'; document.body.appendChild(target); - var source = new _ol_source_Vector_(); + var source = new VectorSource(); var layer = new VectorLayer({source: source}); interaction = new DragRotateAndZoom(); map = new Map({ diff --git a/test/spec/ol/interaction/dragzoom.test.js b/test/spec/ol/interaction/dragzoom.test.js index cedc563da3..77dfe3a2a2 100644 --- a/test/spec/ol/interaction/dragzoom.test.js +++ b/test/spec/ol/interaction/dragzoom.test.js @@ -5,7 +5,7 @@ import {fromExtent as polygonFromExtent} from '../../../../src/ol/geom/Polygon.j import DragZoom from '../../../../src/ol/interaction/DragZoom.js'; import VectorLayer from '../../../../src/ol/layer/Vector.js'; import _ol_render_Box_ from '../../../../src/ol/render/Box.js'; -import _ol_source_Vector_ from '../../../../src/ol/source/Vector.js'; +import VectorSource from '../../../../src/ol/source/Vector.js'; describe('ol.interaction.DragZoom', function() { @@ -24,7 +24,7 @@ describe('ol.interaction.DragZoom', function() { style.width = width + 'px'; style.height = height + 'px'; document.body.appendChild(target); - source = new _ol_source_Vector_(); + source = new VectorSource(); var layer = new VectorLayer({source: source}); map = new Map({ target: target, diff --git a/test/spec/ol/interaction/draw.test.js b/test/spec/ol/interaction/draw.test.js index 4d7a22005a..5371118549 100644 --- a/test/spec/ol/interaction/draw.test.js +++ b/test/spec/ol/interaction/draw.test.js @@ -16,7 +16,7 @@ import Draw from '../../../../src/ol/interaction/Draw.js'; import Interaction from '../../../../src/ol/interaction/Interaction.js'; import VectorLayer from '../../../../src/ol/layer/Vector.js'; import _ol_pointer_PointerEvent_ from '../../../../src/ol/pointer/PointerEvent.js'; -import _ol_source_Vector_ from '../../../../src/ol/source/Vector.js'; +import VectorSource from '../../../../src/ol/source/Vector.js'; describe('ol.interaction.Draw', function() { @@ -34,7 +34,7 @@ describe('ol.interaction.Draw', function() { style.width = width + 'px'; style.height = height + 'px'; document.body.appendChild(target); - source = new _ol_source_Vector_(); + source = new VectorSource(); var layer = new VectorLayer({source: source}); map = new Map({ target: target, diff --git a/test/spec/ol/interaction/modify.test.js b/test/spec/ol/interaction/modify.test.js index 49de0990a3..eb38ad0780 100644 --- a/test/spec/ol/interaction/modify.test.js +++ b/test/spec/ol/interaction/modify.test.js @@ -12,7 +12,7 @@ import Polygon from '../../../../src/ol/geom/Polygon.js'; import _ol_interaction_Modify_ from '../../../../src/ol/interaction/Modify.js'; import VectorLayer from '../../../../src/ol/layer/Vector.js'; import _ol_pointer_PointerEvent_ from '../../../../src/ol/pointer/PointerEvent.js'; -import _ol_source_Vector_ from '../../../../src/ol/source/Vector.js'; +import VectorSource from '../../../../src/ol/source/Vector.js'; describe('ol.interaction.Modify', function() { @@ -41,7 +41,7 @@ describe('ol.interaction.Modify', function() { }) ]; - source = new _ol_source_Vector_({ + source = new VectorSource({ features: features }); @@ -180,7 +180,7 @@ describe('ol.interaction.Modify', function() { it('accepts a source', function() { var feature = new Feature( new Point([0, 0])); - var source = new _ol_source_Vector_({features: [feature]}); + var source = new VectorSource({features: [feature]}); var modify = new _ol_interaction_Modify_({source: source}); var rbushEntries = modify.rBush_.getAll(); expect(rbushEntries.length).to.be(1); diff --git a/test/spec/ol/interaction/select.test.js b/test/spec/ol/interaction/select.test.js index abf087a005..b31a2faa71 100644 --- a/test/spec/ol/interaction/select.test.js +++ b/test/spec/ol/interaction/select.test.js @@ -9,7 +9,7 @@ import Interaction from '../../../../src/ol/interaction/Interaction.js'; import _ol_interaction_Select_ from '../../../../src/ol/interaction/Select.js'; import VectorLayer from '../../../../src/ol/layer/Vector.js'; import _ol_pointer_PointerEvent_ from '../../../../src/ol/pointer/PointerEvent.js'; -import _ol_source_Vector_ from '../../../../src/ol/source/Vector.js'; +import VectorSource from '../../../../src/ol/source/Vector.js'; describe('ol.interaction.Select', function() { @@ -53,7 +53,7 @@ describe('ol.interaction.Select', function() { type: 'foo' })); - source = new _ol_source_Vector_({ + source = new VectorSource({ features: features }); diff --git a/test/spec/ol/interaction/translate.test.js b/test/spec/ol/interaction/translate.test.js index 568c710474..4d080b44bc 100644 --- a/test/spec/ol/interaction/translate.test.js +++ b/test/spec/ol/interaction/translate.test.js @@ -8,7 +8,7 @@ import _ol_interaction_Translate_ from '../../../../src/ol/interaction/Translate import Interaction from '../../../../src/ol/interaction/Interaction.js'; import VectorLayer from '../../../../src/ol/layer/Vector.js'; import _ol_pointer_PointerEvent_ from '../../../../src/ol/pointer/PointerEvent.js'; -import _ol_source_Vector_ from '../../../../src/ol/source/Vector.js'; +import VectorSource from '../../../../src/ol/source/Vector.js'; describe('ol.interaction.Translate', function() { @@ -26,7 +26,7 @@ describe('ol.interaction.Translate', function() { style.width = width + 'px'; style.height = height + 'px'; document.body.appendChild(target); - source = new _ol_source_Vector_(); + source = new VectorSource(); features = [new Feature({ geometry: new Point([10, -20]) }), new Feature({ diff --git a/test/spec/ol/layer/vector.test.js b/test/spec/ol/layer/vector.test.js index 871dd4c51c..28a1de9c1a 100644 --- a/test/spec/ol/layer/vector.test.js +++ b/test/spec/ol/layer/vector.test.js @@ -1,13 +1,13 @@ import _ol_layer_Layer_ from '../../../../src/ol/layer/Layer.js'; import VectorLayer from '../../../../src/ol/layer/Vector.js'; -import _ol_source_Vector_ from '../../../../src/ol/source/Vector.js'; +import VectorSource from '../../../../src/ol/source/Vector.js'; import _ol_style_Style_ from '../../../../src/ol/style/Style.js'; describe('ol.layer.Vector', function() { describe('constructor', function() { - var source = new _ol_source_Vector_(); + var source = new VectorSource(); var style = new _ol_style_Style_(); it('creates a new layer', function() { @@ -56,7 +56,7 @@ describe('ol.layer.Vector', function() { beforeEach(function() { layer = new VectorLayer({ - source: new _ol_source_Vector_() + source: new VectorSource() }); style = new _ol_style_Style_(); }); @@ -97,7 +97,7 @@ describe('ol.layer.Vector', function() { describe('#getStyle()', function() { - var source = new _ol_source_Vector_(); + var source = new VectorSource(); var style = new _ol_style_Style_(); it('returns what is provided to setStyle', function() { diff --git a/test/spec/ol/map.test.js b/test/spec/ol/map.test.js index e1807b66b4..2debf0da91 100644 --- a/test/spec/ol/map.test.js +++ b/test/spec/ol/map.test.js @@ -13,7 +13,7 @@ import _ol_interaction_PinchZoom_ from '../../../src/ol/interaction/PinchZoom.js import TileLayer from '../../../src/ol/layer/Tile.js'; import VectorLayer from '../../../src/ol/layer/Vector.js'; import _ol_renderer_canvas_IntermediateCanvas_ from '../../../src/ol/renderer/canvas/IntermediateCanvas.js'; -import _ol_source_Vector_ from '../../../src/ol/source/Vector.js'; +import VectorSource from '../../../src/ol/source/Vector.js'; import _ol_source_XYZ_ from '../../../src/ol/source/XYZ.js'; describe('ol.Map', function() { @@ -196,7 +196,7 @@ describe('ol.Map', function() { map = new Map({ target: target, layers: [new VectorLayer({ - source: new _ol_source_Vector_({ + source: new VectorSource({ features: [new Feature(new LineString([[-50, 0], [50, 0]]))] }) })], @@ -238,7 +238,7 @@ describe('ol.Map', function() { it('respects options', function() { var otherLayer = new VectorLayer({ - source: new _ol_source_Vector_ + source: new VectorSource }); map.addLayer(otherLayer); var features = map.getFeaturesAtPixel([50, 50], { diff --git a/test/spec/ol/renderer/canvas/map.test.js b/test/spec/ol/renderer/canvas/map.test.js index d2bffadfd7..f5e5ca787c 100644 --- a/test/spec/ol/renderer/canvas/map.test.js +++ b/test/spec/ol/renderer/canvas/map.test.js @@ -7,7 +7,7 @@ import TileLayer from '../../../../../src/ol/layer/Tile.js'; import VectorLayer from '../../../../../src/ol/layer/Vector.js'; import _ol_renderer_canvas_Layer_ from '../../../../../src/ol/renderer/canvas/Layer.js'; import CanvasMapRenderer from '../../../../../src/ol/renderer/canvas/Map.js'; -import _ol_source_Vector_ from '../../../../../src/ol/source/Vector.js'; +import VectorSource from '../../../../../src/ol/source/Vector.js'; import _ol_style_Icon_ from '../../../../../src/ol/style/Icon.js'; import _ol_style_Style_ from '../../../../../src/ol/style/Style.js'; @@ -51,7 +51,7 @@ describe('ol.renderer.canvas.Map', function() { img.src = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAAAAAA6fptVAAAACklEQVR4nGNiAAAABgADNjd8qAAAAABJRU5ErkJggg=='; layer = new VectorLayer({ - source: new _ol_source_Vector_({ + source: new VectorSource({ features: [ new Feature({ geometry: new Point([0, 0]) @@ -93,7 +93,7 @@ describe('ol.renderer.canvas.Map', function() { it('calls callback with main layer when skipped feature on unmanaged layer', function() { var feature = layer.getSource().getFeatures()[0]; var managedLayer = new VectorLayer({ - source: new _ol_source_Vector_({ + source: new VectorSource({ features: [feature] }) }); @@ -170,7 +170,7 @@ describe('ol.renderer.canvas.Map', function() { map = new Map({}); map.on('postcompose', function() {}); layer = new VectorLayer({ - source: new _ol_source_Vector_({wrapX: true}) + source: new VectorSource({wrapX: true}) }); renderer = map.getRenderer(); renderer.layerRenderers_ = {}; diff --git a/test/spec/ol/renderer/canvas/vectorlayer.test.js b/test/spec/ol/renderer/canvas/vectorlayer.test.js index 3138e1bc28..4d393b4c09 100644 --- a/test/spec/ol/renderer/canvas/vectorlayer.test.js +++ b/test/spec/ol/renderer/canvas/vectorlayer.test.js @@ -9,7 +9,7 @@ import _ol_obj_ from '../../../../../src/ol/obj.js'; import {get as getProjection} from '../../../../../src/ol/proj.js'; import _ol_render_canvas_ from '../../../../../src/ol/render/canvas.js'; import CanvasVectorLayerRenderer from '../../../../../src/ol/renderer/canvas/VectorLayer.js'; -import _ol_source_Vector_ from '../../../../../src/ol/source/Vector.js'; +import VectorSource from '../../../../../src/ol/source/Vector.js'; import _ol_style_Style_ from '../../../../../src/ol/style/Style.js'; import _ol_style_Text_ from '../../../../../src/ol/style/Text.js'; @@ -38,7 +38,7 @@ describe('ol.renderer.canvas.VectorLayer', function() { it('creates a new instance', function() { var layer = new VectorLayer({ - source: new _ol_source_Vector_() + source: new VectorSource() }); var renderer = new CanvasVectorLayerRenderer(layer); expect(renderer).to.be.a(CanvasVectorLayerRenderer); @@ -70,7 +70,7 @@ describe('ol.renderer.canvas.VectorLayer', function() { var feature2 = new Feature(new Point([0, 0])); feature2.setStyle(featureStyle); var layer = new VectorLayer({ - source: new _ol_source_Vector_({ + source: new VectorSource({ features: [feature1, feature2] }), style: layerStyle @@ -102,7 +102,7 @@ describe('ol.renderer.canvas.VectorLayer', function() { var feature = new Feature(new Point([0, 0])); var layer = new VectorLayer({ - source: new _ol_source_Vector_({ + source: new VectorSource({ features: [feature] }), style: layerStyle @@ -133,7 +133,7 @@ describe('ol.renderer.canvas.VectorLayer', function() { var feature = new Feature(new Point([0, 0])); var layer = new VectorLayer({ - source: new _ol_source_Vector_({ + source: new VectorSource({ features: [feature] }), style: layerStyle @@ -165,7 +165,7 @@ describe('ol.renderer.canvas.VectorLayer', function() { var feature = new Feature(new Point([0, 0])); var layer = new VectorLayer({ - source: new _ol_source_Vector_({ + source: new VectorSource({ features: [feature] }), style: layerStyle @@ -186,7 +186,7 @@ describe('ol.renderer.canvas.VectorLayer', function() { beforeEach(function() { layer = new VectorLayer({ - source: new _ol_source_Vector_() + source: new VectorSource() }); renderer = new CanvasVectorLayerRenderer(layer); var replayGroup = {}; @@ -223,7 +223,7 @@ describe('ol.renderer.canvas.VectorLayer', function() { beforeEach(function() { var layer = new VectorLayer({ - source: new _ol_source_Vector_({wrapX: true}) + source: new VectorSource({wrapX: true}) }); renderer = new CanvasVectorLayerRenderer(layer); var projection = getProjection('EPSG:3857'); diff --git a/test/spec/ol/source/cluster.test.js b/test/spec/ol/source/cluster.test.js index fc4881ce91..9e2116c20b 100644 --- a/test/spec/ol/source/cluster.test.js +++ b/test/spec/ol/source/cluster.test.js @@ -5,7 +5,7 @@ import Polygon from '../../../../src/ol/geom/Polygon.js'; import {get as getProjection} from '../../../../src/ol/proj.js'; import _ol_source_Cluster_ from '../../../../src/ol/source/Cluster.js'; import Source from '../../../../src/ol/source/Source.js'; -import _ol_source_Vector_ from '../../../../src/ol/source/Vector.js'; +import VectorSource from '../../../../src/ol/source/Vector.js'; describe('ol.source.Cluster', function() { @@ -13,7 +13,7 @@ describe('ol.source.Cluster', function() { it('returns a cluster source', function() { var source = new _ol_source_Cluster_({ projection: getProjection('EPSG:4326'), - source: new _ol_source_Vector_() + source: new VectorSource() }); expect(source).to.be.a(Source); expect(source).to.be.a(_ol_source_Cluster_); @@ -26,7 +26,7 @@ describe('ol.source.Cluster', function() { var projection = getProjection('EPSG:3857'); it('clusters a source with point features', function() { var source = new _ol_source_Cluster_({ - source: new _ol_source_Vector_({ + source: new VectorSource({ features: [ new Feature(new Point([0, 0])), new Feature(new Point([0, 0])) @@ -48,7 +48,7 @@ describe('ol.source.Cluster', function() { } return null; }, - source: new _ol_source_Vector_({ + source: new VectorSource({ features: [ new Feature(new Point([0, 0])), new Feature(new LineString([[0, 0], [1, 1]])), @@ -67,7 +67,7 @@ describe('ol.source.Cluster', function() { it('changes the distance value', function() { var source = new _ol_source_Cluster_({ distance: 100, - source: new _ol_source_Vector_() + source: new VectorSource() }); expect(source.getDistance()).to.be(100); source.setDistance(10); diff --git a/test/spec/ol/source/vector.test.js b/test/spec/ol/source/vector.test.js index 184a6c63aa..a35872cb59 100644 --- a/test/spec/ol/source/vector.test.js +++ b/test/spec/ol/source/vector.test.js @@ -8,7 +8,7 @@ import LineString from '../../../../src/ol/geom/LineString.js'; import VectorLayer from '../../../../src/ol/layer/Vector.js'; import _ol_loadingstrategy_ from '../../../../src/ol/loadingstrategy.js'; import {get as getProjection, transformExtent, fromLonLat} from '../../../../src/ol/proj.js'; -import _ol_source_Vector_ from '../../../../src/ol/source/Vector.js'; +import VectorSource from '../../../../src/ol/source/Vector.js'; describe('ol.source.Vector', function() { @@ -24,7 +24,7 @@ describe('ol.source.Vector', function() { var vectorSource; beforeEach(function() { - vectorSource = new _ol_source_Vector_(); + vectorSource = new VectorSource(); }); describe('#forEachFeatureInExtent', function() { @@ -73,7 +73,7 @@ describe('ol.source.Vector', function() { }); it('adds same id features only once', function() { - var source = new _ol_source_Vector_(); + var source = new VectorSource(); var feature1 = new Feature(); feature1.setId('1'); var feature2 = new Feature(); @@ -95,7 +95,7 @@ describe('ol.source.Vector', function() { features.push(new Feature(new LineString([[0, 0], [10, 10]]))); features.push(new Feature(new Point([0, 10]))); features.push(new Feature(new Point([10, 5]))); - vectorSource = new _ol_source_Vector_({ + vectorSource = new VectorSource({ features: features }); }); @@ -130,7 +130,7 @@ describe('ol.source.Vector', function() { new Feature(new Point([Math.random(), Math.random()])); } features.push(new Feature(null)); - vectorSource = new _ol_source_Vector_({ + vectorSource = new VectorSource({ features: features }); }); @@ -265,7 +265,7 @@ describe('ol.source.Vector', function() { var vectorSource; beforeEach(function() { - vectorSource = new _ol_source_Vector_(); + vectorSource = new VectorSource(); }); it('keeps its index up-to-date', function() { @@ -332,7 +332,7 @@ describe('ol.source.Vector', function() { describe('#getFeatureById()', function() { var source; beforeEach(function() { - source = new _ol_source_Vector_(); + source = new VectorSource(); }); it('returns a feature by id', function() { @@ -424,7 +424,7 @@ describe('ol.source.Vector', function() { it('requests the view extent plus render buffer', function(done) { var center = [-97.6114, 38.8403]; - var source = new _ol_source_Vector_({ + var source = new VectorSource({ strategy: _ol_loadingstrategy_.bbox, loader: function(extent) { setTimeout(function() { @@ -460,7 +460,7 @@ describe('ol.source.Vector', function() { describe('with no loader and the "all" strategy', function() { it('stores the infinity extent in the Rtree', function() { - var source = new _ol_source_Vector_(); + var source = new VectorSource(); source.loadFeatures([-10000, -10000, 10000, 10000], 1, getProjection('EPSG:3857')); var loadedExtents = source.loadedExtentsRtree_.getAll(); @@ -481,7 +481,7 @@ describe('ol.source.Vector', function() { var loader2 = function(bbox, resolution, projection) { count2++; }; - var source = new _ol_source_Vector_({loader: loader1}); + var source = new VectorSource({loader: loader1}); source.loadFeatures([-10000, -10000, 10000, 10000], 1, getProjection('EPSG:3857')); source.setLoader(loader2); @@ -493,7 +493,7 @@ describe('ol.source.Vector', function() { }); it('removes extents with #removeLoadedExtent()', function(done) { - var source = new _ol_source_Vector_(); + var source = new VectorSource(); source.setLoader(function(bbox, resolution, projection) { setTimeout(function() { expect(source.loadedExtentsRtree_.getAll()).to.have.length(1); @@ -511,7 +511,7 @@ describe('ol.source.Vector', function() { describe('the feature id index', function() { var source; beforeEach(function() { - source = new _ol_source_Vector_(); + source = new VectorSource(); }); it('ignores features with the same id', function() { @@ -541,7 +541,7 @@ describe('ol.source.Vector', function() { describe('the undefined feature id index', function() { var source; beforeEach(function() { - source = new _ol_source_Vector_(); + source = new VectorSource(); }); it('disallows adding the same feature twice', function() { @@ -556,7 +556,7 @@ describe('ol.source.Vector', function() { describe('with useSpatialIndex set to false', function() { var source; beforeEach(function() { - source = new _ol_source_Vector_({useSpatialIndex: false}); + source = new VectorSource({useSpatialIndex: false}); }); it('returns a features collection', function() { @@ -575,7 +575,7 @@ describe('ol.source.Vector', function() { describe('with a collection of features', function() { var collection, source; beforeEach(function() { - source = new _ol_source_Vector_({ + source = new VectorSource({ useSpatialIndex: false }); collection = source.getFeaturesCollection(); @@ -623,7 +623,7 @@ describe('ol.source.Vector', function() { var collection, source; beforeEach(function() { collection = new _ol_Collection_(); - source = new _ol_source_Vector_({ + source = new VectorSource({ features: collection }); });