Rename _ol_Feature_ to Feature
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import _ol_Feature_ from '../src/ol/Feature.js';
|
||||
import Feature from '../src/ol/Feature.js';
|
||||
import Map from '../src/ol/Map.js';
|
||||
import _ol_View_ from '../src/ol/View.js';
|
||||
import Point from '../src/ol/geom/Point.js';
|
||||
@@ -16,7 +16,7 @@ import _ol_style_Style_ from '../src/ol/style/Style.js';
|
||||
// features form the corners of an equilateral triangle and their styles overlap
|
||||
var redLayer = new _ol_layer_Vector_({
|
||||
source: new _ol_source_Vector_({
|
||||
features: [new _ol_Feature_(new Point([0, 0]))]
|
||||
features: [new Feature(new Point([0, 0]))]
|
||||
}),
|
||||
style: new _ol_style_Style_({
|
||||
image: new _ol_style_Circle_({
|
||||
@@ -34,7 +34,7 @@ var redLayer = new _ol_layer_Vector_({
|
||||
var greenLayer = new _ol_layer_Vector_({
|
||||
source: new _ol_source_Vector_({
|
||||
// 433.013 is roughly 250 * Math.sqrt(3)
|
||||
features: [new _ol_Feature_(new Point([250, 433.013]))]
|
||||
features: [new Feature(new Point([250, 433.013]))]
|
||||
}),
|
||||
style: new _ol_style_Style_({
|
||||
image: new _ol_style_Circle_({
|
||||
@@ -51,7 +51,7 @@ var greenLayer = new _ol_layer_Vector_({
|
||||
});
|
||||
var blueLayer = new _ol_layer_Vector_({
|
||||
source: new _ol_source_Vector_({
|
||||
features: [new _ol_Feature_(new Point([500, 0]))]
|
||||
features: [new Feature(new Point([500, 0]))]
|
||||
}),
|
||||
style: new _ol_style_Style_({
|
||||
image: new _ol_style_Circle_({
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import _ol_Feature_ from '../src/ol/Feature.js';
|
||||
import Feature from '../src/ol/Feature.js';
|
||||
import Map from '../src/ol/Map.js';
|
||||
import _ol_View_ from '../src/ol/View.js';
|
||||
import Point from '../src/ol/geom/Point.js';
|
||||
@@ -21,7 +21,7 @@ var features = new Array(count);
|
||||
var e = 4500000;
|
||||
for (var i = 0; i < count; ++i) {
|
||||
var coordinates = [2 * e * Math.random() - e, 2 * e * Math.random() - e];
|
||||
features[i] = new _ol_Feature_(new Point(coordinates));
|
||||
features[i] = new Feature(new Point(coordinates));
|
||||
}
|
||||
|
||||
var source = new _ol_source_Vector_({
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import {inherits} from '../src/ol/index.js';
|
||||
import _ol_Feature_ from '../src/ol/Feature.js';
|
||||
import Feature from '../src/ol/Feature.js';
|
||||
import Map from '../src/ol/Map.js';
|
||||
import _ol_View_ from '../src/ol/View.js';
|
||||
import LineString from '../src/ol/geom/LineString.js';
|
||||
@@ -134,12 +134,12 @@ app.Drag.prototype.handleUpEvent = function() {
|
||||
};
|
||||
|
||||
|
||||
var pointFeature = new _ol_Feature_(new Point([0, 0]));
|
||||
var pointFeature = new Feature(new Point([0, 0]));
|
||||
|
||||
var lineFeature = new _ol_Feature_(
|
||||
var lineFeature = new Feature(
|
||||
new LineString([[-1e7, 1e6], [-1e6, 3e6]]));
|
||||
|
||||
var polygonFeature = new _ol_Feature_(
|
||||
var polygonFeature = new Feature(
|
||||
new Polygon([[[-3e6, -1e6], [-3e6, 1e6],
|
||||
[-1e6, 1e6], [-1e6, -1e6], [-3e6, -1e6]]]));
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import _ol_Feature_ from '../src/ol/Feature.js';
|
||||
import Feature from '../src/ol/Feature.js';
|
||||
import Map from '../src/ol/Map.js';
|
||||
import _ol_Observable_ from '../src/ol/Observable.js';
|
||||
import _ol_View_ from '../src/ol/View.js';
|
||||
@@ -47,7 +47,7 @@ function addRandomFeature() {
|
||||
var x = Math.random() * 360 - 180;
|
||||
var y = Math.random() * 180 - 90;
|
||||
var geom = new Point(fromLonLat([x, y]));
|
||||
var feature = new _ol_Feature_(geom);
|
||||
var feature = new Feature(geom);
|
||||
source.addFeature(feature);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import _ol_Feature_ from '../src/ol/Feature.js';
|
||||
import Feature from '../src/ol/Feature.js';
|
||||
import Map from '../src/ol/Map.js';
|
||||
import _ol_View_ from '../src/ol/View.js';
|
||||
import Polyline from '../src/ol/format/Polyline.js';
|
||||
@@ -67,19 +67,19 @@ var route = /** @type {ol.geom.LineString} */ (new Polyline({
|
||||
var routeCoords = route.getCoordinates();
|
||||
var routeLength = routeCoords.length;
|
||||
|
||||
var routeFeature = new _ol_Feature_({
|
||||
var routeFeature = new Feature({
|
||||
type: 'route',
|
||||
geometry: route
|
||||
});
|
||||
var geoMarker = new _ol_Feature_({
|
||||
var geoMarker = new Feature({
|
||||
type: 'geoMarker',
|
||||
geometry: new Point(routeCoords[0])
|
||||
});
|
||||
var startMarker = new _ol_Feature_({
|
||||
var startMarker = new Feature({
|
||||
type: 'icon',
|
||||
geometry: new Point(routeCoords[0])
|
||||
});
|
||||
var endMarker = new _ol_Feature_({
|
||||
var endMarker = new Feature({
|
||||
type: 'icon',
|
||||
geometry: new Point(routeCoords[routeLength - 1])
|
||||
});
|
||||
@@ -163,7 +163,7 @@ var moveFeature = function(event) {
|
||||
}
|
||||
|
||||
var currentPoint = new Point(routeCoords[index]);
|
||||
var feature = new _ol_Feature_(currentPoint);
|
||||
var feature = new Feature(currentPoint);
|
||||
vectorContext.drawFeature(feature, styles.geoMarker);
|
||||
}
|
||||
// tell OpenLayers to continue the postcompose animation
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// NOCOMPILE
|
||||
import _ol_Feature_ from '../src/ol/Feature.js';
|
||||
import Feature from '../src/ol/Feature.js';
|
||||
import Map from '../src/ol/Map.js';
|
||||
import _ol_View_ from '../src/ol/View.js';
|
||||
import LineString from '../src/ol/geom/LineString.js';
|
||||
@@ -95,7 +95,7 @@ flightsSource = new _ol_source_Vector_({
|
||||
var line = new LineString(arcLine.geometries[0].coords);
|
||||
line.transform('EPSG:4326', 'EPSG:3857');
|
||||
|
||||
var feature = new _ol_Feature_({
|
||||
var feature = new Feature({
|
||||
geometry: line,
|
||||
finished: false
|
||||
});
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import _ol_Feature_ from '../src/ol/Feature.js';
|
||||
import Feature from '../src/ol/Feature.js';
|
||||
import Map from '../src/ol/Map.js';
|
||||
import _ol_View_ from '../src/ol/View.js';
|
||||
import LineString from '../src/ol/geom/LineString.js';
|
||||
@@ -15,7 +15,7 @@ var triangle = new LineString([
|
||||
[0, radius], [run, -rise], [-run, -rise], [0, radius]
|
||||
]);
|
||||
|
||||
var feature = new _ol_Feature_(triangle);
|
||||
var feature = new Feature(triangle);
|
||||
|
||||
var layer = new _ol_layer_Vector_({
|
||||
source: new _ol_source_Vector_({
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import _ol_Feature_ from '../src/ol/Feature.js';
|
||||
import Feature from '../src/ol/Feature.js';
|
||||
import Map from '../src/ol/Map.js';
|
||||
import _ol_View_ from '../src/ol/View.js';
|
||||
import {defaults as defaultControls} from '../src/ol/control.js';
|
||||
@@ -164,7 +164,7 @@ var vectorSource = new _ol_source_Vector_({
|
||||
features: (new GeoJSON()).readFeatures(geojsonObject)
|
||||
});
|
||||
|
||||
vectorSource.addFeature(new _ol_Feature_(new Circle([5e6, 7e6], 1e6)));
|
||||
vectorSource.addFeature(new Feature(new Circle([5e6, 7e6], 1e6)));
|
||||
|
||||
var vectorLayer = new _ol_layer_Vector_({
|
||||
source: vectorSource,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import _ol_Feature_ from '../src/ol/Feature.js';
|
||||
import Feature from '../src/ol/Feature.js';
|
||||
import Geolocation from '../src/ol/Geolocation.js';
|
||||
import Map from '../src/ol/Map.js';
|
||||
import _ol_View_ from '../src/ol/View.js';
|
||||
@@ -61,12 +61,12 @@ geolocation.on('error', function(error) {
|
||||
info.style.display = '';
|
||||
});
|
||||
|
||||
var accuracyFeature = new _ol_Feature_();
|
||||
var accuracyFeature = new Feature();
|
||||
geolocation.on('change:accuracyGeometry', function() {
|
||||
accuracyFeature.setGeometry(geolocation.getAccuracyGeometry());
|
||||
});
|
||||
|
||||
var positionFeature = new _ol_Feature_();
|
||||
var positionFeature = new Feature();
|
||||
positionFeature.setStyle(new _ol_style_Style_({
|
||||
image: new _ol_style_Circle_({
|
||||
radius: 6,
|
||||
|
||||
@@ -4,7 +4,7 @@ import TileLayer from '../src/ol/layer/Tile.js';
|
||||
import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
|
||||
import _ol_source_OSM_ from '../src/ol/source/OSM.js';
|
||||
import _ol_source_Vector_ from '../src/ol/source/Vector.js';
|
||||
import _ol_Feature_ from '../src/ol/Feature.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';
|
||||
import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
|
||||
@@ -20,7 +20,7 @@ var style = new _ol_style_Style_({
|
||||
})
|
||||
});
|
||||
|
||||
var feature = new _ol_Feature_(new LineString([[-4000000, 0], [4000000, 0]]));
|
||||
var feature = new Feature(new LineString([[-4000000, 0], [4000000, 0]]));
|
||||
|
||||
var vector = new _ol_layer_Vector_({
|
||||
source: new _ol_source_Vector_({
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import _ol_Feature_ from '../src/ol/Feature.js';
|
||||
import Feature from '../src/ol/Feature.js';
|
||||
import Map from '../src/ol/Map.js';
|
||||
import _ol_View_ from '../src/ol/View.js';
|
||||
import Point from '../src/ol/geom/Point.js';
|
||||
@@ -11,15 +11,15 @@ import _ol_style_Icon_ from '../src/ol/style/Icon.js';
|
||||
import _ol_style_Style_ from '../src/ol/style/Style.js';
|
||||
|
||||
|
||||
var rome = new _ol_Feature_({
|
||||
var rome = new Feature({
|
||||
geometry: new Point(fromLonLat([12.5, 41.9]))
|
||||
});
|
||||
|
||||
var london = new _ol_Feature_({
|
||||
var london = new Feature({
|
||||
geometry: new Point(fromLonLat([-0.12755, 51.507222]))
|
||||
});
|
||||
|
||||
var madrid = new _ol_Feature_({
|
||||
var madrid = new Feature({
|
||||
geometry: new Point(fromLonLat([-3.683333, 40.4]))
|
||||
});
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import _ol_Feature_ from '../src/ol/Feature.js';
|
||||
import Feature from '../src/ol/Feature.js';
|
||||
import Map from '../src/ol/Map.js';
|
||||
import _ol_View_ from '../src/ol/View.js';
|
||||
import Point from '../src/ol/geom/Point.js';
|
||||
@@ -23,7 +23,7 @@ function createStyle(src, img) {
|
||||
});
|
||||
}
|
||||
|
||||
var iconFeature = new _ol_Feature_(new Point([0, 0]));
|
||||
var iconFeature = new Feature(new Point([0, 0]));
|
||||
iconFeature.set('style', createStyle('data/icon.png', undefined));
|
||||
|
||||
var map = new Map({
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import _ol_Feature_ from '../src/ol/Feature.js';
|
||||
import Feature from '../src/ol/Feature.js';
|
||||
import Map from '../src/ol/Map.js';
|
||||
import _ol_View_ from '../src/ol/View.js';
|
||||
import Point from '../src/ol/geom/Point.js';
|
||||
@@ -63,7 +63,7 @@ var e = 25000000;
|
||||
for (i = 0; i < featureCount; ++i) {
|
||||
geometry = new Point(
|
||||
[2 * e * Math.random() - e, 2 * e * Math.random() - e]);
|
||||
feature = new _ol_Feature_(geometry);
|
||||
feature = new Feature(geometry);
|
||||
feature.setStyle(
|
||||
new _ol_style_Style_({
|
||||
image: icons[i % (iconCount - 1)]
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import _ol_Feature_ from '../src/ol/Feature.js';
|
||||
import Feature from '../src/ol/Feature.js';
|
||||
import Map from '../src/ol/Map.js';
|
||||
import _ol_Overlay_ from '../src/ol/Overlay.js';
|
||||
import _ol_View_ from '../src/ol/View.js';
|
||||
@@ -11,7 +11,7 @@ import _ol_style_Icon_ from '../src/ol/style/Icon.js';
|
||||
import _ol_style_Style_ from '../src/ol/style/Style.js';
|
||||
|
||||
|
||||
var iconFeature = new _ol_Feature_({
|
||||
var iconFeature = new Feature({
|
||||
geometry: new Point([0, 0]),
|
||||
name: 'Null Island',
|
||||
population: 4000,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import _ol_Feature_ from '../src/ol/Feature.js';
|
||||
import Feature from '../src/ol/Feature.js';
|
||||
import Map from '../src/ol/Map.js';
|
||||
import _ol_View_ from '../src/ol/View.js';
|
||||
import {defaults as defaultControls} from '../src/ol/control.js';
|
||||
@@ -196,7 +196,7 @@ document.getElementById('time').addEventListener('input', function() {
|
||||
var coordinate = geometry.getCoordinateAtM(m, true);
|
||||
var highlight = feature.get('highlight');
|
||||
if (highlight === undefined) {
|
||||
highlight = new _ol_Feature_(new Point(coordinate));
|
||||
highlight = new Feature(new Point(coordinate));
|
||||
feature.set('highlight', highlight);
|
||||
featureOverlay.getSource().addFeature(highlight);
|
||||
} else {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import _ol_Feature_ from '../src/ol/Feature.js';
|
||||
import Feature from '../src/ol/Feature.js';
|
||||
import Map from '../src/ol/Map.js';
|
||||
import _ol_View_ from '../src/ol/View.js';
|
||||
import Point from '../src/ol/geom/Point.js';
|
||||
@@ -46,7 +46,7 @@ var styles = {
|
||||
|
||||
|
||||
function createLayer(coordinates, style, zIndex) {
|
||||
var feature = new _ol_Feature_(new Point(coordinates));
|
||||
var feature = new Feature(new Point(coordinates));
|
||||
feature.setStyle(style);
|
||||
|
||||
var source = new _ol_source_Vector_({
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import _ol_Feature_ from '../src/ol/Feature.js';
|
||||
import Feature from '../src/ol/Feature.js';
|
||||
import Map from '../src/ol/Map.js';
|
||||
import _ol_View_ from '../src/ol/View.js';
|
||||
import Point from '../src/ol/geom/Point.js';
|
||||
@@ -72,7 +72,7 @@ var features = new Array(count);
|
||||
var e = 4500000;
|
||||
for (var i = 0; i < count; ++i) {
|
||||
var coordinates = [2 * e * Math.random() - e, 2 * e * Math.random() - e];
|
||||
features[i] = new _ol_Feature_(new Point(coordinates));
|
||||
features[i] = new Feature(new Point(coordinates));
|
||||
features[i].setStyle(styles[styleKeys[Math.floor(Math.random() * 5)]]);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import _ol_Feature_ from '../src/ol/Feature.js';
|
||||
import Feature from '../src/ol/Feature.js';
|
||||
import Map from '../src/ol/Map.js';
|
||||
import _ol_View_ from '../src/ol/View.js';
|
||||
import Point from '../src/ol/geom/Point.js';
|
||||
@@ -90,7 +90,7 @@ var e = 25000000;
|
||||
for (i = 0; i < featureCount; ++i) {
|
||||
geometry = new Point(
|
||||
[2 * e * Math.random() - e, 2 * e * Math.random() - e]);
|
||||
feature = new _ol_Feature_(geometry);
|
||||
feature = new Feature(geometry);
|
||||
feature.setStyle(
|
||||
new _ol_style_Style_({
|
||||
image: symbols[i % symbolCount]
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import _ol_Feature_ from '../src/ol/Feature.js';
|
||||
import Feature from '../src/ol/Feature.js';
|
||||
import Map from '../src/ol/Map.js';
|
||||
import _ol_View_ from '../src/ol/View.js';
|
||||
import LineString from '../src/ol/geom/LineString.js';
|
||||
@@ -30,7 +30,7 @@ for (i = 0; i < count; ++i) {
|
||||
deltaX = delta * signX;
|
||||
deltaY = delta * signY;
|
||||
endPoint = [startPoint[0] + deltaX, startPoint[1] + deltaY];
|
||||
features[i] = new _ol_Feature_({
|
||||
features[i] = new Feature({
|
||||
'geometry': new LineString([startPoint, endPoint])
|
||||
});
|
||||
startPoint = endPoint;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import _ol_Feature_ from '../src/ol/Feature.js';
|
||||
import Feature from '../src/ol/Feature.js';
|
||||
import Map from '../src/ol/Map.js';
|
||||
import _ol_View_ from '../src/ol/View.js';
|
||||
import LineString from '../src/ol/geom/LineString.js';
|
||||
@@ -15,7 +15,7 @@ var count = 20000;
|
||||
var features = new Array(count);
|
||||
var e = 18000000;
|
||||
for (var i = 0; i < count; ++i) {
|
||||
features[i] = new _ol_Feature_({
|
||||
features[i] = new Feature({
|
||||
'geometry': new Point(
|
||||
[2 * e * Math.random() - e, 2 * e * Math.random() - e]),
|
||||
'i': i,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import _ol_Feature_ from '../src/ol/Feature.js';
|
||||
import Feature from '../src/ol/Feature.js';
|
||||
import Map from '../src/ol/Map.js';
|
||||
import _ol_View_ from '../src/ol/View.js';
|
||||
import {circular as circularPolygon} from '../src/ol/geom/Polygon.js';
|
||||
@@ -62,7 +62,7 @@ for (x = -180; x < 180; x += 30) {
|
||||
for (y = -90; y < 90; y += 30) {
|
||||
var circle4326 = circularPolygon([x, y], radius, 64);
|
||||
var circle3857 = circle4326.clone().transform('EPSG:4326', 'EPSG:3857');
|
||||
vectorLayer4326.getSource().addFeature(new _ol_Feature_(circle4326));
|
||||
vectorLayer3857.getSource().addFeature(new _ol_Feature_(circle3857));
|
||||
vectorLayer4326.getSource().addFeature(new Feature(circle4326));
|
||||
vectorLayer3857.getSource().addFeature(new Feature(circle3857));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// NOCOMPILE
|
||||
// this example uses topolis and toastr for which we don't have an externs file.
|
||||
|
||||
import _ol_Feature_ from '../src/ol/Feature.js';
|
||||
import Feature from '../src/ol/Feature.js';
|
||||
import Map from '../src/ol/Map.js';
|
||||
import _ol_View_ from '../src/ol/View.js';
|
||||
import Point from '../src/ol/geom/Point.js';
|
||||
@@ -129,7 +129,7 @@ function removeElementFeature(source, element) {
|
||||
}
|
||||
|
||||
function nodeToFeature(node) {
|
||||
var feature = new _ol_Feature_({
|
||||
var feature = new Feature({
|
||||
geometry: new Point(node.coordinate),
|
||||
node: node
|
||||
});
|
||||
@@ -138,7 +138,7 @@ function nodeToFeature(node) {
|
||||
}
|
||||
|
||||
function edgeToFeature(edge) {
|
||||
var feature = new _ol_Feature_({
|
||||
var feature = new Feature({
|
||||
geometry: new LineString(edge.coordinates),
|
||||
edge: edge
|
||||
});
|
||||
@@ -148,7 +148,7 @@ function edgeToFeature(edge) {
|
||||
|
||||
function faceToFeature(face) {
|
||||
var coordinates = topo.getFaceGeometry(face);
|
||||
var feature = new _ol_Feature_({
|
||||
var feature = new Feature({
|
||||
geometry: new Polygon(coordinates),
|
||||
face: face
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user