Rename _ol_source_Vector_ to VectorSource

This commit is contained in:
Tim Schaub
2018-01-08 10:06:23 -07:00
parent 45c6e43b42
commit ca6ea355e6
94 changed files with 279 additions and 279 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -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
});

View File

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

View File

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

View File

@@ -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], {

View File

@@ -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_ = {};

View File

@@ -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');

View File

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

View File

@@ -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
});
});