Rename _ol_source_Vector_ to VectorSource
This commit is contained in:
@@ -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_({
|
||||
|
||||
@@ -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()
|
||||
});
|
||||
|
||||
@@ -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()
|
||||
}),
|
||||
|
||||
@@ -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()
|
||||
});
|
||||
|
||||
@@ -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
|
||||
});
|
||||
|
||||
|
||||
@@ -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_({
|
||||
|
||||
@@ -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({
|
||||
|
||||
@@ -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({
|
||||
|
||||
@@ -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_({
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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()
|
||||
})
|
||||
|
||||
@@ -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]
|
||||
})
|
||||
});
|
||||
|
||||
@@ -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()
|
||||
});
|
||||
|
||||
@@ -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({
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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 ' +
|
||||
'<a href="http://openflights.org/data.html">OpenFlights</a>,',
|
||||
|
||||
@@ -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]
|
||||
})
|
||||
});
|
||||
|
||||
@@ -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)
|
||||
});
|
||||
|
||||
|
||||
@@ -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]
|
||||
})
|
||||
});
|
||||
|
||||
@@ -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()
|
||||
}),
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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]
|
||||
});
|
||||
|
||||
|
||||
@@ -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'),
|
||||
|
||||
@@ -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_({
|
||||
|
||||
@@ -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]
|
||||
});
|
||||
|
||||
|
||||
@@ -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_({
|
||||
|
||||
@@ -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_({
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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()
|
||||
})
|
||||
|
||||
@@ -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]
|
||||
});
|
||||
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
});
|
||||
|
||||
|
||||
@@ -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)
|
||||
});
|
||||
|
||||
|
||||
@@ -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
|
||||
});
|
||||
|
||||
|
||||
@@ -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()
|
||||
})
|
||||
|
||||
@@ -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)'
|
||||
|
||||
@@ -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()
|
||||
})
|
||||
|
||||
@@ -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'
|
||||
}),
|
||||
|
||||
@@ -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({
|
||||
|
||||
@@ -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
|
||||
}),
|
||||
|
||||
@@ -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
|
||||
});
|
||||
|
||||
@@ -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({
|
||||
|
||||
@@ -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),
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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()
|
||||
})
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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=' +
|
||||
|
||||
@@ -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=' +
|
||||
|
||||
@@ -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()
|
||||
}),
|
||||
|
||||
@@ -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()
|
||||
}),
|
||||
|
||||
@@ -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'));
|
||||
|
||||
@@ -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');
|
||||
|
||||
@@ -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_({
|
||||
|
||||
@@ -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&' +
|
||||
|
||||
@@ -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]
|
||||
})
|
||||
});
|
||||
|
||||
@@ -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
|
||||
}),
|
||||
|
||||
@@ -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
|
||||
}),
|
||||
|
||||
@@ -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
|
||||
}),
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -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.<ol.Feature>} 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.<ol.Feature>} 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.<ol.Feature>} 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.<ol.Feature>} 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.<ol.Feature>} 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.<ol.Feature>} 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.<ol.Feature>} 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;
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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]))
|
||||
]
|
||||
|
||||
@@ -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])
|
||||
})]
|
||||
|
||||
@@ -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
|
||||
});
|
||||
|
||||
@@ -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
|
||||
});
|
||||
|
||||
@@ -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
|
||||
});
|
||||
|
||||
@@ -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
|
||||
});
|
||||
|
||||
@@ -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
|
||||
});
|
||||
|
||||
@@ -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
|
||||
});
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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({
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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
|
||||
});
|
||||
|
||||
|
||||
@@ -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({
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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], {
|
||||
|
||||
@@ -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_ = {};
|
||||
|
||||
@@ -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');
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user