Rename _ol_geom_Point_ to Point
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
import _ol_Feature_ from '../src/ol/Feature.js';
|
import _ol_Feature_ from '../src/ol/Feature.js';
|
||||||
import _ol_Map_ from '../src/ol/Map.js';
|
import _ol_Map_ from '../src/ol/Map.js';
|
||||||
import _ol_View_ from '../src/ol/View.js';
|
import _ol_View_ from '../src/ol/View.js';
|
||||||
import _ol_geom_Point_ from '../src/ol/geom/Point.js';
|
import Point from '../src/ol/geom/Point.js';
|
||||||
import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
|
import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
|
||||||
import _ol_source_Vector_ from '../src/ol/source/Vector.js';
|
import _ol_source_Vector_ from '../src/ol/source/Vector.js';
|
||||||
import _ol_style_Circle_ from '../src/ol/style/Circle.js';
|
import _ol_style_Circle_ from '../src/ol/style/Circle.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
|
// features form the corners of an equilateral triangle and their styles overlap
|
||||||
var redLayer = new _ol_layer_Vector_({
|
var redLayer = new _ol_layer_Vector_({
|
||||||
source: new _ol_source_Vector_({
|
source: new _ol_source_Vector_({
|
||||||
features: [new _ol_Feature_(new _ol_geom_Point_([0, 0]))]
|
features: [new _ol_Feature_(new Point([0, 0]))]
|
||||||
}),
|
}),
|
||||||
style: new _ol_style_Style_({
|
style: new _ol_style_Style_({
|
||||||
image: new _ol_style_Circle_({
|
image: new _ol_style_Circle_({
|
||||||
@@ -34,7 +34,7 @@ var redLayer = new _ol_layer_Vector_({
|
|||||||
var greenLayer = new _ol_layer_Vector_({
|
var greenLayer = new _ol_layer_Vector_({
|
||||||
source: new _ol_source_Vector_({
|
source: new _ol_source_Vector_({
|
||||||
// 433.013 is roughly 250 * Math.sqrt(3)
|
// 433.013 is roughly 250 * Math.sqrt(3)
|
||||||
features: [new _ol_Feature_(new _ol_geom_Point_([250, 433.013]))]
|
features: [new _ol_Feature_(new Point([250, 433.013]))]
|
||||||
}),
|
}),
|
||||||
style: new _ol_style_Style_({
|
style: new _ol_style_Style_({
|
||||||
image: new _ol_style_Circle_({
|
image: new _ol_style_Circle_({
|
||||||
@@ -51,7 +51,7 @@ var greenLayer = new _ol_layer_Vector_({
|
|||||||
});
|
});
|
||||||
var blueLayer = new _ol_layer_Vector_({
|
var blueLayer = new _ol_layer_Vector_({
|
||||||
source: new _ol_source_Vector_({
|
source: new _ol_source_Vector_({
|
||||||
features: [new _ol_Feature_(new _ol_geom_Point_([500, 0]))]
|
features: [new _ol_Feature_(new Point([500, 0]))]
|
||||||
}),
|
}),
|
||||||
style: new _ol_style_Style_({
|
style: new _ol_style_Style_({
|
||||||
image: new _ol_style_Circle_({
|
image: new _ol_style_Circle_({
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import _ol_Feature_ from '../src/ol/Feature.js';
|
import _ol_Feature_ from '../src/ol/Feature.js';
|
||||||
import _ol_Map_ from '../src/ol/Map.js';
|
import _ol_Map_ from '../src/ol/Map.js';
|
||||||
import _ol_View_ from '../src/ol/View.js';
|
import _ol_View_ from '../src/ol/View.js';
|
||||||
import _ol_geom_Point_ from '../src/ol/geom/Point.js';
|
import Point from '../src/ol/geom/Point.js';
|
||||||
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
|
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
|
||||||
import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
|
import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
|
||||||
import _ol_source_Cluster_ from '../src/ol/source/Cluster.js';
|
import _ol_source_Cluster_ from '../src/ol/source/Cluster.js';
|
||||||
@@ -21,7 +21,7 @@ var features = new Array(count);
|
|||||||
var e = 4500000;
|
var e = 4500000;
|
||||||
for (var i = 0; i < count; ++i) {
|
for (var i = 0; i < count; ++i) {
|
||||||
var coordinates = [2 * e * Math.random() - e, 2 * e * Math.random() - e];
|
var coordinates = [2 * e * Math.random() - e, 2 * e * Math.random() - e];
|
||||||
features[i] = new _ol_Feature_(new _ol_geom_Point_(coordinates));
|
features[i] = new _ol_Feature_(new Point(coordinates));
|
||||||
}
|
}
|
||||||
|
|
||||||
var source = new _ol_source_Vector_({
|
var source = new _ol_source_Vector_({
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import _ol_Feature_ from '../src/ol/Feature.js';
|
|||||||
import _ol_Map_ from '../src/ol/Map.js';
|
import _ol_Map_ from '../src/ol/Map.js';
|
||||||
import _ol_View_ from '../src/ol/View.js';
|
import _ol_View_ from '../src/ol/View.js';
|
||||||
import _ol_geom_LineString_ from '../src/ol/geom/LineString.js';
|
import _ol_geom_LineString_ from '../src/ol/geom/LineString.js';
|
||||||
import _ol_geom_Point_ from '../src/ol/geom/Point.js';
|
import Point from '../src/ol/geom/Point.js';
|
||||||
import _ol_geom_Polygon_ from '../src/ol/geom/Polygon.js';
|
import _ol_geom_Polygon_ from '../src/ol/geom/Polygon.js';
|
||||||
import _ol_interaction_ from '../src/ol/interaction.js';
|
import _ol_interaction_ from '../src/ol/interaction.js';
|
||||||
import _ol_interaction_Pointer_ from '../src/ol/interaction/Pointer.js';
|
import _ol_interaction_Pointer_ from '../src/ol/interaction/Pointer.js';
|
||||||
@@ -134,7 +134,7 @@ app.Drag.prototype.handleUpEvent = function() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
var pointFeature = new _ol_Feature_(new _ol_geom_Point_([0, 0]));
|
var pointFeature = new _ol_Feature_(new Point([0, 0]));
|
||||||
|
|
||||||
var lineFeature = new _ol_Feature_(
|
var lineFeature = new _ol_Feature_(
|
||||||
new _ol_geom_LineString_([[-1e7, 1e6], [-1e6, 3e6]]));
|
new _ol_geom_LineString_([[-1e7, 1e6], [-1e6, 3e6]]));
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import _ol_Map_ from '../src/ol/Map.js';
|
import _ol_Map_ from '../src/ol/Map.js';
|
||||||
import _ol_View_ from '../src/ol/View.js';
|
import _ol_View_ from '../src/ol/View.js';
|
||||||
import _ol_geom_MultiPoint_ from '../src/ol/geom/MultiPoint.js';
|
import _ol_geom_MultiPoint_ from '../src/ol/geom/MultiPoint.js';
|
||||||
import _ol_geom_Point_ from '../src/ol/geom/Point.js';
|
import Point from '../src/ol/geom/Point.js';
|
||||||
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
|
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
|
||||||
import _ol_source_OSM_ from '../src/ol/source/OSM.js';
|
import _ol_source_OSM_ from '../src/ol/source/OSM.js';
|
||||||
import _ol_style_Circle_ from '../src/ol/style/Circle.js';
|
import _ol_style_Circle_ from '../src/ol/style/Circle.js';
|
||||||
@@ -68,7 +68,7 @@ map.on('postcompose', function(event) {
|
|||||||
vectorContext.setStyle(imageStyle);
|
vectorContext.setStyle(imageStyle);
|
||||||
vectorContext.drawGeometry(new _ol_geom_MultiPoint_(coordinates));
|
vectorContext.drawGeometry(new _ol_geom_MultiPoint_(coordinates));
|
||||||
|
|
||||||
var headPoint = new _ol_geom_Point_(coordinates[coordinates.length - 1]);
|
var headPoint = new Point(coordinates[coordinates.length - 1]);
|
||||||
|
|
||||||
vectorContext.setStyle(headOuterImageStyle);
|
vectorContext.setStyle(headOuterImageStyle);
|
||||||
vectorContext.drawGeometry(headPoint);
|
vectorContext.drawGeometry(headPoint);
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import _ol_Observable_ from '../src/ol/Observable.js';
|
|||||||
import _ol_View_ from '../src/ol/View.js';
|
import _ol_View_ from '../src/ol/View.js';
|
||||||
import _ol_control_ from '../src/ol/control.js';
|
import _ol_control_ from '../src/ol/control.js';
|
||||||
import {easeOut} from '../src/ol/easing.js';
|
import {easeOut} from '../src/ol/easing.js';
|
||||||
import _ol_geom_Point_ from '../src/ol/geom/Point.js';
|
import Point from '../src/ol/geom/Point.js';
|
||||||
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
|
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
|
||||||
import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
|
import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
|
||||||
import {fromLonLat} from '../src/ol/proj.js';
|
import {fromLonLat} from '../src/ol/proj.js';
|
||||||
@@ -46,7 +46,7 @@ map.addLayer(vector);
|
|||||||
function addRandomFeature() {
|
function addRandomFeature() {
|
||||||
var x = Math.random() * 360 - 180;
|
var x = Math.random() * 360 - 180;
|
||||||
var y = Math.random() * 180 - 90;
|
var y = Math.random() * 180 - 90;
|
||||||
var geom = new _ol_geom_Point_(fromLonLat([x, y]));
|
var geom = new Point(fromLonLat([x, y]));
|
||||||
var feature = new _ol_Feature_(geom);
|
var feature = new _ol_Feature_(geom);
|
||||||
source.addFeature(feature);
|
source.addFeature(feature);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import _ol_Feature_ from '../src/ol/Feature.js';
|
|||||||
import _ol_Map_ from '../src/ol/Map.js';
|
import _ol_Map_ from '../src/ol/Map.js';
|
||||||
import _ol_View_ from '../src/ol/View.js';
|
import _ol_View_ from '../src/ol/View.js';
|
||||||
import _ol_format_Polyline_ from '../src/ol/format/Polyline.js';
|
import _ol_format_Polyline_ from '../src/ol/format/Polyline.js';
|
||||||
import _ol_geom_Point_ from '../src/ol/geom/Point.js';
|
import Point from '../src/ol/geom/Point.js';
|
||||||
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
|
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
|
||||||
import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
|
import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
|
||||||
import _ol_source_BingMaps_ from '../src/ol/source/BingMaps.js';
|
import _ol_source_BingMaps_ from '../src/ol/source/BingMaps.js';
|
||||||
@@ -73,15 +73,15 @@ var routeFeature = new _ol_Feature_({
|
|||||||
});
|
});
|
||||||
var geoMarker = new _ol_Feature_({
|
var geoMarker = new _ol_Feature_({
|
||||||
type: 'geoMarker',
|
type: 'geoMarker',
|
||||||
geometry: new _ol_geom_Point_(routeCoords[0])
|
geometry: new Point(routeCoords[0])
|
||||||
});
|
});
|
||||||
var startMarker = new _ol_Feature_({
|
var startMarker = new _ol_Feature_({
|
||||||
type: 'icon',
|
type: 'icon',
|
||||||
geometry: new _ol_geom_Point_(routeCoords[0])
|
geometry: new Point(routeCoords[0])
|
||||||
});
|
});
|
||||||
var endMarker = new _ol_Feature_({
|
var endMarker = new _ol_Feature_({
|
||||||
type: 'icon',
|
type: 'icon',
|
||||||
geometry: new _ol_geom_Point_(routeCoords[routeLength - 1])
|
geometry: new Point(routeCoords[routeLength - 1])
|
||||||
});
|
});
|
||||||
|
|
||||||
var styles = {
|
var styles = {
|
||||||
@@ -162,7 +162,7 @@ var moveFeature = function(event) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var currentPoint = new _ol_geom_Point_(routeCoords[index]);
|
var currentPoint = new Point(routeCoords[index]);
|
||||||
var feature = new _ol_Feature_(currentPoint);
|
var feature = new _ol_Feature_(currentPoint);
|
||||||
vectorContext.drawFeature(feature, styles.geoMarker);
|
vectorContext.drawFeature(feature, styles.geoMarker);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import _ol_Geolocation_ from '../src/ol/Geolocation.js';
|
|||||||
import _ol_Map_ from '../src/ol/Map.js';
|
import _ol_Map_ from '../src/ol/Map.js';
|
||||||
import _ol_View_ from '../src/ol/View.js';
|
import _ol_View_ from '../src/ol/View.js';
|
||||||
import _ol_control_ from '../src/ol/control.js';
|
import _ol_control_ from '../src/ol/control.js';
|
||||||
import _ol_geom_Point_ from '../src/ol/geom/Point.js';
|
import Point from '../src/ol/geom/Point.js';
|
||||||
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
|
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
|
||||||
import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
|
import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
|
||||||
import _ol_source_OSM_ from '../src/ol/source/OSM.js';
|
import _ol_source_OSM_ from '../src/ol/source/OSM.js';
|
||||||
@@ -83,7 +83,7 @@ positionFeature.setStyle(new _ol_style_Style_({
|
|||||||
geolocation.on('change:position', function() {
|
geolocation.on('change:position', function() {
|
||||||
var coordinates = geolocation.getPosition();
|
var coordinates = geolocation.getPosition();
|
||||||
positionFeature.setGeometry(coordinates ?
|
positionFeature.setGeometry(coordinates ?
|
||||||
new _ol_geom_Point_(coordinates) : null);
|
new Point(coordinates) : null);
|
||||||
});
|
});
|
||||||
|
|
||||||
new _ol_layer_Vector_({
|
new _ol_layer_Vector_({
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import _ol_Feature_ from '../src/ol/Feature.js';
|
import _ol_Feature_ from '../src/ol/Feature.js';
|
||||||
import _ol_Map_ from '../src/ol/Map.js';
|
import _ol_Map_ from '../src/ol/Map.js';
|
||||||
import _ol_View_ from '../src/ol/View.js';
|
import _ol_View_ from '../src/ol/View.js';
|
||||||
import _ol_geom_Point_ from '../src/ol/geom/Point.js';
|
import Point from '../src/ol/geom/Point.js';
|
||||||
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
|
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
|
||||||
import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
|
import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
|
||||||
import {fromLonLat} from '../src/ol/proj.js';
|
import {fromLonLat} from '../src/ol/proj.js';
|
||||||
@@ -12,15 +12,15 @@ import _ol_style_Style_ from '../src/ol/style/Style.js';
|
|||||||
|
|
||||||
|
|
||||||
var rome = new _ol_Feature_({
|
var rome = new _ol_Feature_({
|
||||||
geometry: new _ol_geom_Point_(fromLonLat([12.5, 41.9]))
|
geometry: new Point(fromLonLat([12.5, 41.9]))
|
||||||
});
|
});
|
||||||
|
|
||||||
var london = new _ol_Feature_({
|
var london = new _ol_Feature_({
|
||||||
geometry: new _ol_geom_Point_(fromLonLat([-0.12755, 51.507222]))
|
geometry: new Point(fromLonLat([-0.12755, 51.507222]))
|
||||||
});
|
});
|
||||||
|
|
||||||
var madrid = new _ol_Feature_({
|
var madrid = new _ol_Feature_({
|
||||||
geometry: new _ol_geom_Point_(fromLonLat([-3.683333, 40.4]))
|
geometry: new Point(fromLonLat([-3.683333, 40.4]))
|
||||||
});
|
});
|
||||||
|
|
||||||
rome.setStyle(new _ol_style_Style_({
|
rome.setStyle(new _ol_style_Style_({
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import _ol_Feature_ from '../src/ol/Feature.js';
|
import _ol_Feature_ from '../src/ol/Feature.js';
|
||||||
import _ol_Map_ from '../src/ol/Map.js';
|
import _ol_Map_ from '../src/ol/Map.js';
|
||||||
import _ol_View_ from '../src/ol/View.js';
|
import _ol_View_ from '../src/ol/View.js';
|
||||||
import _ol_geom_Point_ from '../src/ol/geom/Point.js';
|
import Point from '../src/ol/geom/Point.js';
|
||||||
import _ol_interaction_Select_ from '../src/ol/interaction/Select.js';
|
import _ol_interaction_Select_ from '../src/ol/interaction/Select.js';
|
||||||
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
|
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
|
||||||
import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
|
import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
|
||||||
@@ -23,7 +23,7 @@ function createStyle(src, img) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
var iconFeature = new _ol_Feature_(new _ol_geom_Point_([0, 0]));
|
var iconFeature = new _ol_Feature_(new Point([0, 0]));
|
||||||
iconFeature.set('style', createStyle('data/icon.png', undefined));
|
iconFeature.set('style', createStyle('data/icon.png', undefined));
|
||||||
|
|
||||||
var map = new _ol_Map_({
|
var map = new _ol_Map_({
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import _ol_Feature_ from '../src/ol/Feature.js';
|
import _ol_Feature_ from '../src/ol/Feature.js';
|
||||||
import _ol_Map_ from '../src/ol/Map.js';
|
import _ol_Map_ from '../src/ol/Map.js';
|
||||||
import _ol_View_ from '../src/ol/View.js';
|
import _ol_View_ from '../src/ol/View.js';
|
||||||
import _ol_geom_Point_ from '../src/ol/geom/Point.js';
|
import Point from '../src/ol/geom/Point.js';
|
||||||
import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
|
import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
|
||||||
import _ol_source_Vector_ from '../src/ol/source/Vector.js';
|
import _ol_source_Vector_ from '../src/ol/source/Vector.js';
|
||||||
import _ol_style_Icon_ from '../src/ol/style/Icon.js';
|
import _ol_style_Icon_ from '../src/ol/style/Icon.js';
|
||||||
@@ -61,7 +61,7 @@ var features = new Array(featureCount);
|
|||||||
var feature, geometry;
|
var feature, geometry;
|
||||||
var e = 25000000;
|
var e = 25000000;
|
||||||
for (i = 0; i < featureCount; ++i) {
|
for (i = 0; i < featureCount; ++i) {
|
||||||
geometry = new _ol_geom_Point_(
|
geometry = new Point(
|
||||||
[2 * e * Math.random() - e, 2 * e * Math.random() - e]);
|
[2 * e * Math.random() - e, 2 * e * Math.random() - e]);
|
||||||
feature = new _ol_Feature_(geometry);
|
feature = new _ol_Feature_(geometry);
|
||||||
feature.setStyle(
|
feature.setStyle(
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import _ol_Feature_ from '../src/ol/Feature.js';
|
|||||||
import _ol_Map_ from '../src/ol/Map.js';
|
import _ol_Map_ from '../src/ol/Map.js';
|
||||||
import _ol_Overlay_ from '../src/ol/Overlay.js';
|
import _ol_Overlay_ from '../src/ol/Overlay.js';
|
||||||
import _ol_View_ from '../src/ol/View.js';
|
import _ol_View_ from '../src/ol/View.js';
|
||||||
import _ol_geom_Point_ from '../src/ol/geom/Point.js';
|
import Point from '../src/ol/geom/Point.js';
|
||||||
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
|
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
|
||||||
import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
|
import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
|
||||||
import _ol_source_TileJSON_ from '../src/ol/source/TileJSON.js';
|
import _ol_source_TileJSON_ from '../src/ol/source/TileJSON.js';
|
||||||
@@ -12,7 +12,7 @@ import _ol_style_Style_ from '../src/ol/style/Style.js';
|
|||||||
|
|
||||||
|
|
||||||
var iconFeature = new _ol_Feature_({
|
var iconFeature = new _ol_Feature_({
|
||||||
geometry: new _ol_geom_Point_([0, 0]),
|
geometry: new Point([0, 0]),
|
||||||
name: 'Null Island',
|
name: 'Null Island',
|
||||||
population: 4000,
|
population: 4000,
|
||||||
rainfall: 500
|
rainfall: 500
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import _ol_View_ from '../src/ol/View.js';
|
|||||||
import _ol_control_ from '../src/ol/control.js';
|
import _ol_control_ from '../src/ol/control.js';
|
||||||
import _ol_format_IGC_ from '../src/ol/format/IGC.js';
|
import _ol_format_IGC_ from '../src/ol/format/IGC.js';
|
||||||
import _ol_geom_LineString_ from '../src/ol/geom/LineString.js';
|
import _ol_geom_LineString_ from '../src/ol/geom/LineString.js';
|
||||||
import _ol_geom_Point_ from '../src/ol/geom/Point.js';
|
import Point from '../src/ol/geom/Point.js';
|
||||||
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
|
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
|
||||||
import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
|
import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
|
||||||
import _ol_source_OSM_ from '../src/ol/source/OSM.js';
|
import _ol_source_OSM_ from '../src/ol/source/OSM.js';
|
||||||
@@ -123,7 +123,7 @@ var displaySnap = function(coordinate) {
|
|||||||
var geometry = closestFeature.getGeometry();
|
var geometry = closestFeature.getGeometry();
|
||||||
var closestPoint = geometry.getClosestPoint(coordinate);
|
var closestPoint = geometry.getClosestPoint(coordinate);
|
||||||
if (point === null) {
|
if (point === null) {
|
||||||
point = new _ol_geom_Point_(closestPoint);
|
point = new Point(closestPoint);
|
||||||
} else {
|
} else {
|
||||||
point.setCoordinates(closestPoint);
|
point.setCoordinates(closestPoint);
|
||||||
}
|
}
|
||||||
@@ -196,7 +196,7 @@ document.getElementById('time').addEventListener('input', function() {
|
|||||||
var coordinate = geometry.getCoordinateAtM(m, true);
|
var coordinate = geometry.getCoordinateAtM(m, true);
|
||||||
var highlight = feature.get('highlight');
|
var highlight = feature.get('highlight');
|
||||||
if (highlight === undefined) {
|
if (highlight === undefined) {
|
||||||
highlight = new _ol_Feature_(new _ol_geom_Point_(coordinate));
|
highlight = new _ol_Feature_(new Point(coordinate));
|
||||||
feature.set('highlight', highlight);
|
feature.set('highlight', highlight);
|
||||||
featureOverlay.getSource().addFeature(highlight);
|
featureOverlay.getSource().addFeature(highlight);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import _ol_Feature_ from '../src/ol/Feature.js';
|
import _ol_Feature_ from '../src/ol/Feature.js';
|
||||||
import _ol_Map_ from '../src/ol/Map.js';
|
import _ol_Map_ from '../src/ol/Map.js';
|
||||||
import _ol_View_ from '../src/ol/View.js';
|
import _ol_View_ from '../src/ol/View.js';
|
||||||
import _ol_geom_Point_ from '../src/ol/geom/Point.js';
|
import Point from '../src/ol/geom/Point.js';
|
||||||
import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
|
import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
|
||||||
import _ol_source_Vector_ from '../src/ol/source/Vector.js';
|
import _ol_source_Vector_ from '../src/ol/source/Vector.js';
|
||||||
import _ol_style_Fill_ from '../src/ol/style/Fill.js';
|
import _ol_style_Fill_ from '../src/ol/style/Fill.js';
|
||||||
@@ -46,7 +46,7 @@ var styles = {
|
|||||||
|
|
||||||
|
|
||||||
function createLayer(coordinates, style, zIndex) {
|
function createLayer(coordinates, style, zIndex) {
|
||||||
var feature = new _ol_Feature_(new _ol_geom_Point_(coordinates));
|
var feature = new _ol_Feature_(new Point(coordinates));
|
||||||
feature.setStyle(style);
|
feature.setStyle(style);
|
||||||
|
|
||||||
var source = new _ol_source_Vector_({
|
var source = new _ol_source_Vector_({
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import _ol_Map_ from '../src/ol/Map.js';
|
import _ol_Map_ from '../src/ol/Map.js';
|
||||||
import _ol_View_ from '../src/ol/View.js';
|
import _ol_View_ from '../src/ol/View.js';
|
||||||
import _ol_geom_Point_ from '../src/ol/geom/Point.js';
|
import Point from '../src/ol/geom/Point.js';
|
||||||
import _ol_interaction_Draw_ from '../src/ol/interaction/Draw.js';
|
import _ol_interaction_Draw_ from '../src/ol/interaction/Draw.js';
|
||||||
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
|
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
|
||||||
import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
|
import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
|
||||||
@@ -34,7 +34,7 @@ var styleFunction = function(feature) {
|
|||||||
var rotation = Math.atan2(dy, dx);
|
var rotation = Math.atan2(dy, dx);
|
||||||
// arrows
|
// arrows
|
||||||
styles.push(new _ol_style_Style_({
|
styles.push(new _ol_style_Style_({
|
||||||
geometry: new _ol_geom_Point_(end),
|
geometry: new Point(end),
|
||||||
image: new _ol_style_Icon_({
|
image: new _ol_style_Icon_({
|
||||||
src: 'data/arrow.png',
|
src: 'data/arrow.png',
|
||||||
anchor: [0.75, 0.5],
|
anchor: [0.75, 0.5],
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import _ol_Feature_ from '../src/ol/Feature.js';
|
import _ol_Feature_ from '../src/ol/Feature.js';
|
||||||
import _ol_Map_ from '../src/ol/Map.js';
|
import _ol_Map_ from '../src/ol/Map.js';
|
||||||
import _ol_View_ from '../src/ol/View.js';
|
import _ol_View_ from '../src/ol/View.js';
|
||||||
import _ol_geom_Point_ from '../src/ol/geom/Point.js';
|
import Point from '../src/ol/geom/Point.js';
|
||||||
import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
|
import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
|
||||||
import _ol_source_Vector_ from '../src/ol/source/Vector.js';
|
import _ol_source_Vector_ from '../src/ol/source/Vector.js';
|
||||||
import _ol_style_Fill_ from '../src/ol/style/Fill.js';
|
import _ol_style_Fill_ from '../src/ol/style/Fill.js';
|
||||||
@@ -72,7 +72,7 @@ var features = new Array(count);
|
|||||||
var e = 4500000;
|
var e = 4500000;
|
||||||
for (var i = 0; i < count; ++i) {
|
for (var i = 0; i < count; ++i) {
|
||||||
var coordinates = [2 * e * Math.random() - e, 2 * e * Math.random() - e];
|
var coordinates = [2 * e * Math.random() - e, 2 * e * Math.random() - e];
|
||||||
features[i] = new _ol_Feature_(new _ol_geom_Point_(coordinates));
|
features[i] = new _ol_Feature_(new Point(coordinates));
|
||||||
features[i].setStyle(styles[styleKeys[Math.floor(Math.random() * 5)]]);
|
features[i].setStyle(styles[styleKeys[Math.floor(Math.random() * 5)]]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import _ol_geom_LineString_ from '../src/ol/geom/LineString.js';
|
import _ol_geom_LineString_ from '../src/ol/geom/LineString.js';
|
||||||
import _ol_geom_Point_ from '../src/ol/geom/Point.js';
|
import Point from '../src/ol/geom/Point.js';
|
||||||
import _ol_geom_Polygon_ from '../src/ol/geom/Polygon.js';
|
import _ol_geom_Polygon_ from '../src/ol/geom/Polygon.js';
|
||||||
import _ol_render_ from '../src/ol/render.js';
|
import _ol_render_ from '../src/ol/render.js';
|
||||||
import _ol_style_Circle_ from '../src/ol/style/Circle.js';
|
import _ol_style_Circle_ from '../src/ol/style/Circle.js';
|
||||||
@@ -26,4 +26,4 @@ vectorContext.setStyle(style);
|
|||||||
|
|
||||||
vectorContext.drawGeometry(new _ol_geom_LineString_([[10, 10], [90, 90]]));
|
vectorContext.drawGeometry(new _ol_geom_LineString_([[10, 10], [90, 90]]));
|
||||||
vectorContext.drawGeometry(new _ol_geom_Polygon_([[[2, 2], [98, 2], [2, 98], [2, 2]]]));
|
vectorContext.drawGeometry(new _ol_geom_Polygon_([[[2, 2], [98, 2], [2, 98], [2, 2]]]));
|
||||||
vectorContext.drawGeometry(new _ol_geom_Point_([88, 88]));
|
vectorContext.drawGeometry(new Point([88, 88]));
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import _ol_Feature_ from '../src/ol/Feature.js';
|
import _ol_Feature_ from '../src/ol/Feature.js';
|
||||||
import _ol_Map_ from '../src/ol/Map.js';
|
import _ol_Map_ from '../src/ol/Map.js';
|
||||||
import _ol_View_ from '../src/ol/View.js';
|
import _ol_View_ from '../src/ol/View.js';
|
||||||
import _ol_geom_Point_ from '../src/ol/geom/Point.js';
|
import Point from '../src/ol/geom/Point.js';
|
||||||
import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
|
import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
|
||||||
import _ol_source_Vector_ from '../src/ol/source/Vector.js';
|
import _ol_source_Vector_ from '../src/ol/source/Vector.js';
|
||||||
import _ol_style_AtlasManager_ from '../src/ol/style/AtlasManager.js';
|
import _ol_style_AtlasManager_ from '../src/ol/style/AtlasManager.js';
|
||||||
@@ -88,7 +88,7 @@ var features = new Array(featureCount);
|
|||||||
var feature, geometry;
|
var feature, geometry;
|
||||||
var e = 25000000;
|
var e = 25000000;
|
||||||
for (i = 0; i < featureCount; ++i) {
|
for (i = 0; i < featureCount; ++i) {
|
||||||
geometry = new _ol_geom_Point_(
|
geometry = new Point(
|
||||||
[2 * e * Math.random() - e, 2 * e * Math.random() - e]);
|
[2 * e * Math.random() - e, 2 * e * Math.random() - e]);
|
||||||
feature = new _ol_Feature_(geometry);
|
feature = new _ol_Feature_(geometry);
|
||||||
feature.setStyle(
|
feature.setStyle(
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import _ol_Feature_ from '../src/ol/Feature.js';
|
|||||||
import _ol_Map_ from '../src/ol/Map.js';
|
import _ol_Map_ from '../src/ol/Map.js';
|
||||||
import _ol_View_ from '../src/ol/View.js';
|
import _ol_View_ from '../src/ol/View.js';
|
||||||
import _ol_geom_LineString_ from '../src/ol/geom/LineString.js';
|
import _ol_geom_LineString_ from '../src/ol/geom/LineString.js';
|
||||||
import _ol_geom_Point_ from '../src/ol/geom/Point.js';
|
import Point from '../src/ol/geom/Point.js';
|
||||||
import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
|
import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
|
||||||
import _ol_source_Vector_ from '../src/ol/source/Vector.js';
|
import _ol_source_Vector_ from '../src/ol/source/Vector.js';
|
||||||
import _ol_style_Circle_ from '../src/ol/style/Circle.js';
|
import _ol_style_Circle_ from '../src/ol/style/Circle.js';
|
||||||
@@ -16,7 +16,7 @@ var features = new Array(count);
|
|||||||
var e = 18000000;
|
var e = 18000000;
|
||||||
for (var i = 0; i < count; ++i) {
|
for (var i = 0; i < count; ++i) {
|
||||||
features[i] = new _ol_Feature_({
|
features[i] = new _ol_Feature_({
|
||||||
'geometry': new _ol_geom_Point_(
|
'geometry': new Point(
|
||||||
[2 * e * Math.random() - e, 2 * e * Math.random() - e]),
|
[2 * e * Math.random() - e, 2 * e * Math.random() - e]),
|
||||||
'i': i,
|
'i': i,
|
||||||
'size': i % 2 ? 10 : 20
|
'size': i % 2 ? 10 : 20
|
||||||
@@ -71,7 +71,7 @@ var displaySnap = function(coordinate) {
|
|||||||
var geometry = closestFeature.getGeometry();
|
var geometry = closestFeature.getGeometry();
|
||||||
var closestPoint = geometry.getClosestPoint(coordinate);
|
var closestPoint = geometry.getClosestPoint(coordinate);
|
||||||
if (point === null) {
|
if (point === null) {
|
||||||
point = new _ol_geom_Point_(closestPoint);
|
point = new Point(closestPoint);
|
||||||
} else {
|
} else {
|
||||||
point.setCoordinates(closestPoint);
|
point.setCoordinates(closestPoint);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
import _ol_Feature_ from '../src/ol/Feature.js';
|
import _ol_Feature_ from '../src/ol/Feature.js';
|
||||||
import _ol_Map_ from '../src/ol/Map.js';
|
import _ol_Map_ from '../src/ol/Map.js';
|
||||||
import _ol_View_ from '../src/ol/View.js';
|
import _ol_View_ from '../src/ol/View.js';
|
||||||
import _ol_geom_Point_ from '../src/ol/geom/Point.js';
|
import Point from '../src/ol/geom/Point.js';
|
||||||
import _ol_geom_LineString_ from '../src/ol/geom/LineString.js';
|
import _ol_geom_LineString_ from '../src/ol/geom/LineString.js';
|
||||||
import _ol_geom_Polygon_ from '../src/ol/geom/Polygon.js';
|
import _ol_geom_Polygon_ from '../src/ol/geom/Polygon.js';
|
||||||
import _ol_interaction_Draw_ from '../src/ol/interaction/Draw.js';
|
import _ol_interaction_Draw_ from '../src/ol/interaction/Draw.js';
|
||||||
@@ -130,7 +130,7 @@ function removeElementFeature(source, element) {
|
|||||||
|
|
||||||
function nodeToFeature(node) {
|
function nodeToFeature(node) {
|
||||||
var feature = new _ol_Feature_({
|
var feature = new _ol_Feature_({
|
||||||
geometry: new _ol_geom_Point_(node.coordinate),
|
geometry: new Point(node.coordinate),
|
||||||
node: node
|
node: node
|
||||||
});
|
});
|
||||||
feature.setId(node.id);
|
feature.setId(node.id);
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import _ol_coordinate_ from './coordinate.js';
|
|||||||
import {intersects, getCenter} from './extent.js';
|
import {intersects, getCenter} from './extent.js';
|
||||||
import _ol_geom_GeometryLayout_ from './geom/GeometryLayout.js';
|
import _ol_geom_GeometryLayout_ from './geom/GeometryLayout.js';
|
||||||
import _ol_geom_LineString_ from './geom/LineString.js';
|
import _ol_geom_LineString_ from './geom/LineString.js';
|
||||||
import _ol_geom_Point_ from './geom/Point.js';
|
import Point from './geom/Point.js';
|
||||||
import _ol_geom_flat_geodesic_ from './geom/flat/geodesic.js';
|
import _ol_geom_flat_geodesic_ from './geom/flat/geodesic.js';
|
||||||
import _ol_math_ from './math.js';
|
import _ol_math_ from './math.js';
|
||||||
import {get as getProjection, equivalent as equivalentProjection, getTransform, transformExtent} from './proj.js';
|
import {get as getProjection, equivalent as equivalentProjection, getTransform, transformExtent} from './proj.js';
|
||||||
@@ -283,7 +283,7 @@ _ol_Graticule_.prototype.getMeridianPoint_ = function(lineString, extent, index)
|
|||||||
clampedBottom, clampedTop);
|
clampedBottom, clampedTop);
|
||||||
var coordinate = [flatCoordinates[0], lat];
|
var coordinate = [flatCoordinates[0], lat];
|
||||||
var point = this.meridiansLabels_[index] !== undefined ?
|
var point = this.meridiansLabels_[index] !== undefined ?
|
||||||
this.meridiansLabels_[index].geom : new _ol_geom_Point_(null);
|
this.meridiansLabels_[index].geom : new Point(null);
|
||||||
point.setCoordinates(coordinate);
|
point.setCoordinates(coordinate);
|
||||||
return point;
|
return point;
|
||||||
};
|
};
|
||||||
@@ -332,7 +332,7 @@ _ol_Graticule_.prototype.getParallelPoint_ = function(lineString, extent, index)
|
|||||||
clampedLeft, clampedRight);
|
clampedLeft, clampedRight);
|
||||||
var coordinate = [lon, flatCoordinates[1]];
|
var coordinate = [lon, flatCoordinates[1]];
|
||||||
var point = this.parallelsLabels_[index] !== undefined ?
|
var point = this.parallelsLabels_[index] !== undefined ?
|
||||||
this.parallelsLabels_[index].geom : new _ol_geom_Point_(null);
|
this.parallelsLabels_[index].geom : new Point(null);
|
||||||
point.setCoordinates(coordinate);
|
point.setCoordinates(coordinate);
|
||||||
return point;
|
return point;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ import _ol_geom_LinearRing_ from '../geom/LinearRing.js';
|
|||||||
import _ol_geom_MultiLineString_ from '../geom/MultiLineString.js';
|
import _ol_geom_MultiLineString_ from '../geom/MultiLineString.js';
|
||||||
import _ol_geom_MultiPoint_ from '../geom/MultiPoint.js';
|
import _ol_geom_MultiPoint_ from '../geom/MultiPoint.js';
|
||||||
import _ol_geom_MultiPolygon_ from '../geom/MultiPolygon.js';
|
import _ol_geom_MultiPolygon_ from '../geom/MultiPolygon.js';
|
||||||
import _ol_geom_Point_ from '../geom/Point.js';
|
import Point from '../geom/Point.js';
|
||||||
import _ol_geom_Polygon_ from '../geom/Polygon.js';
|
import _ol_geom_Polygon_ from '../geom/Polygon.js';
|
||||||
import _ol_geom_flat_deflate_ from '../geom/flat/deflate.js';
|
import _ol_geom_flat_deflate_ from '../geom/flat/deflate.js';
|
||||||
import _ol_geom_flat_orient_ from '../geom/flat/orient.js';
|
import _ol_geom_flat_orient_ from '../geom/flat/orient.js';
|
||||||
@@ -152,16 +152,16 @@ _ol_format_EsriJSON_.convertRings_ = function(rings, layout) {
|
|||||||
_ol_format_EsriJSON_.readPointGeometry_ = function(object) {
|
_ol_format_EsriJSON_.readPointGeometry_ = function(object) {
|
||||||
var point;
|
var point;
|
||||||
if (object.m !== undefined && object.z !== undefined) {
|
if (object.m !== undefined && object.z !== undefined) {
|
||||||
point = new _ol_geom_Point_([object.x, object.y, object.z, object.m],
|
point = new Point([object.x, object.y, object.z, object.m],
|
||||||
_ol_geom_GeometryLayout_.XYZM);
|
_ol_geom_GeometryLayout_.XYZM);
|
||||||
} else if (object.z !== undefined) {
|
} else if (object.z !== undefined) {
|
||||||
point = new _ol_geom_Point_([object.x, object.y, object.z],
|
point = new Point([object.x, object.y, object.z],
|
||||||
_ol_geom_GeometryLayout_.XYZ);
|
_ol_geom_GeometryLayout_.XYZ);
|
||||||
} else if (object.m !== undefined) {
|
} else if (object.m !== undefined) {
|
||||||
point = new _ol_geom_Point_([object.x, object.y, object.m],
|
point = new Point([object.x, object.y, object.m],
|
||||||
_ol_geom_GeometryLayout_.XYM);
|
_ol_geom_GeometryLayout_.XYM);
|
||||||
} else {
|
} else {
|
||||||
point = new _ol_geom_Point_([object.x, object.y]);
|
point = new Point([object.x, object.y]);
|
||||||
}
|
}
|
||||||
return point;
|
return point;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ import _ol_geom_LinearRing_ from '../geom/LinearRing.js';
|
|||||||
import _ol_geom_MultiLineString_ from '../geom/MultiLineString.js';
|
import _ol_geom_MultiLineString_ from '../geom/MultiLineString.js';
|
||||||
import _ol_geom_MultiPoint_ from '../geom/MultiPoint.js';
|
import _ol_geom_MultiPoint_ from '../geom/MultiPoint.js';
|
||||||
import _ol_geom_MultiPolygon_ from '../geom/MultiPolygon.js';
|
import _ol_geom_MultiPolygon_ from '../geom/MultiPolygon.js';
|
||||||
import _ol_geom_Point_ from '../geom/Point.js';
|
import Point from '../geom/Point.js';
|
||||||
import _ol_geom_Polygon_ from '../geom/Polygon.js';
|
import _ol_geom_Polygon_ from '../geom/Polygon.js';
|
||||||
import _ol_obj_ from '../obj.js';
|
import _ol_obj_ from '../obj.js';
|
||||||
import {get as getProjection} from '../proj.js';
|
import {get as getProjection} from '../proj.js';
|
||||||
@@ -264,7 +264,7 @@ _ol_format_GMLBase_.prototype.readPoint = function(node, objectStack) {
|
|||||||
var flatCoordinates =
|
var flatCoordinates =
|
||||||
this.readFlatCoordinatesFromNode_(node, objectStack);
|
this.readFlatCoordinatesFromNode_(node, objectStack);
|
||||||
if (flatCoordinates) {
|
if (flatCoordinates) {
|
||||||
var point = new _ol_geom_Point_(null);
|
var point = new Point(null);
|
||||||
point.setFlatCoordinates(_ol_geom_GeometryLayout_.XYZ, flatCoordinates);
|
point.setFlatCoordinates(_ol_geom_GeometryLayout_.XYZ, flatCoordinates);
|
||||||
return point;
|
return point;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import _ol_format_XSD_ from '../format/XSD.js';
|
|||||||
import _ol_geom_GeometryLayout_ from '../geom/GeometryLayout.js';
|
import _ol_geom_GeometryLayout_ from '../geom/GeometryLayout.js';
|
||||||
import _ol_geom_LineString_ from '../geom/LineString.js';
|
import _ol_geom_LineString_ from '../geom/LineString.js';
|
||||||
import _ol_geom_MultiLineString_ from '../geom/MultiLineString.js';
|
import _ol_geom_MultiLineString_ from '../geom/MultiLineString.js';
|
||||||
import _ol_geom_Point_ from '../geom/Point.js';
|
import Point from '../geom/Point.js';
|
||||||
import {get as getProjection} from '../proj.js';
|
import {get as getProjection} from '../proj.js';
|
||||||
import _ol_xml_ from '../xml.js';
|
import _ol_xml_ from '../xml.js';
|
||||||
|
|
||||||
@@ -298,7 +298,7 @@ _ol_format_GPX_.readWpt_ = function(node, objectStack) {
|
|||||||
var layoutOptions = /** @type {ol.LayoutOptions} */ ({});
|
var layoutOptions = /** @type {ol.LayoutOptions} */ ({});
|
||||||
var coordinates = _ol_format_GPX_.appendCoordinate_([], layoutOptions, node, values);
|
var coordinates = _ol_format_GPX_.appendCoordinate_([], layoutOptions, node, values);
|
||||||
var layout = _ol_format_GPX_.applyLayoutOptions_(layoutOptions, coordinates);
|
var layout = _ol_format_GPX_.applyLayoutOptions_(layoutOptions, coordinates);
|
||||||
var geometry = new _ol_geom_Point_(coordinates, layout);
|
var geometry = new Point(coordinates, layout);
|
||||||
_ol_format_Feature_.transformWithOptions(geometry, false, options);
|
_ol_format_Feature_.transformWithOptions(geometry, false, options);
|
||||||
var feature = new _ol_Feature_(geometry);
|
var feature = new _ol_Feature_(geometry);
|
||||||
feature.setProperties(values);
|
feature.setProperties(values);
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ import _ol_geom_LineString_ from '../geom/LineString.js';
|
|||||||
import _ol_geom_MultiLineString_ from '../geom/MultiLineString.js';
|
import _ol_geom_MultiLineString_ from '../geom/MultiLineString.js';
|
||||||
import _ol_geom_MultiPoint_ from '../geom/MultiPoint.js';
|
import _ol_geom_MultiPoint_ from '../geom/MultiPoint.js';
|
||||||
import _ol_geom_MultiPolygon_ from '../geom/MultiPolygon.js';
|
import _ol_geom_MultiPolygon_ from '../geom/MultiPolygon.js';
|
||||||
import _ol_geom_Point_ from '../geom/Point.js';
|
import Point from '../geom/Point.js';
|
||||||
import _ol_geom_Polygon_ from '../geom/Polygon.js';
|
import _ol_geom_Polygon_ from '../geom/Polygon.js';
|
||||||
import _ol_obj_ from '../obj.js';
|
import _ol_obj_ from '../obj.js';
|
||||||
import {get as getProjection} from '../proj.js';
|
import {get as getProjection} from '../proj.js';
|
||||||
@@ -109,7 +109,7 @@ _ol_format_GeoJSON_.readGeometryCollectionGeometry_ = function(
|
|||||||
* @return {ol.geom.Point} Point.
|
* @return {ol.geom.Point} Point.
|
||||||
*/
|
*/
|
||||||
_ol_format_GeoJSON_.readPointGeometry_ = function(object) {
|
_ol_format_GeoJSON_.readPointGeometry_ = function(object) {
|
||||||
return new _ol_geom_Point_(object.coordinates);
|
return new Point(object.coordinates);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ import _ol_geom_LineString_ from '../geom/LineString.js';
|
|||||||
import _ol_geom_MultiLineString_ from '../geom/MultiLineString.js';
|
import _ol_geom_MultiLineString_ from '../geom/MultiLineString.js';
|
||||||
import _ol_geom_MultiPoint_ from '../geom/MultiPoint.js';
|
import _ol_geom_MultiPoint_ from '../geom/MultiPoint.js';
|
||||||
import _ol_geom_MultiPolygon_ from '../geom/MultiPolygon.js';
|
import _ol_geom_MultiPolygon_ from '../geom/MultiPolygon.js';
|
||||||
import _ol_geom_Point_ from '../geom/Point.js';
|
import Point from '../geom/Point.js';
|
||||||
import _ol_geom_Polygon_ from '../geom/Polygon.js';
|
import _ol_geom_Polygon_ from '../geom/Polygon.js';
|
||||||
import _ol_math_ from '../math.js';
|
import _ol_math_ from '../math.js';
|
||||||
import {get as getProjection} from '../proj.js';
|
import {get as getProjection} from '../proj.js';
|
||||||
@@ -972,7 +972,7 @@ _ol_format_KML_.readPoint_ = function(node, objectStack) {
|
|||||||
var flatCoordinates =
|
var flatCoordinates =
|
||||||
_ol_format_KML_.readFlatCoordinatesFromNode_(node, objectStack);
|
_ol_format_KML_.readFlatCoordinatesFromNode_(node, objectStack);
|
||||||
if (flatCoordinates) {
|
if (flatCoordinates) {
|
||||||
var point = new _ol_geom_Point_(null);
|
var point = new Point(null);
|
||||||
point.setFlatCoordinates(_ol_geom_GeometryLayout_.XYZ, flatCoordinates);
|
point.setFlatCoordinates(_ol_geom_GeometryLayout_.XYZ, flatCoordinates);
|
||||||
point.setProperties(properties);
|
point.setProperties(properties);
|
||||||
return point;
|
return point;
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ import _ol_geom_LineString_ from '../geom/LineString.js';
|
|||||||
import _ol_geom_MultiLineString_ from '../geom/MultiLineString.js';
|
import _ol_geom_MultiLineString_ from '../geom/MultiLineString.js';
|
||||||
import _ol_geom_MultiPoint_ from '../geom/MultiPoint.js';
|
import _ol_geom_MultiPoint_ from '../geom/MultiPoint.js';
|
||||||
import _ol_geom_MultiPolygon_ from '../geom/MultiPolygon.js';
|
import _ol_geom_MultiPolygon_ from '../geom/MultiPolygon.js';
|
||||||
import _ol_geom_Point_ from '../geom/Point.js';
|
import Point from '../geom/Point.js';
|
||||||
import _ol_geom_Polygon_ from '../geom/Polygon.js';
|
import _ol_geom_Polygon_ from '../geom/Polygon.js';
|
||||||
import _ol_geom_flat_orient_ from '../geom/flat/orient.js';
|
import _ol_geom_flat_orient_ from '../geom/flat/orient.js';
|
||||||
import _ol_proj_Projection_ from '../proj/Projection.js';
|
import _ol_proj_Projection_ from '../proj/Projection.js';
|
||||||
@@ -310,7 +310,7 @@ _ol_format_MVT_.prototype.createFeature_ = function(pbf, rawFeature, opt_options
|
|||||||
geom = new _ol_geom_Polygon_(null);
|
geom = new _ol_geom_Polygon_(null);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
geom = geometryType === _ol_geom_GeometryType_.POINT ? new _ol_geom_Point_(null) :
|
geom = geometryType === _ol_geom_GeometryType_.POINT ? new Point(null) :
|
||||||
geometryType === _ol_geom_GeometryType_.LINE_STRING ? new _ol_geom_LineString_(null) :
|
geometryType === _ol_geom_GeometryType_.LINE_STRING ? new _ol_geom_LineString_(null) :
|
||||||
geometryType === _ol_geom_GeometryType_.POLYGON ? new _ol_geom_Polygon_(null) :
|
geometryType === _ol_geom_GeometryType_.POLYGON ? new _ol_geom_Polygon_(null) :
|
||||||
geometryType === _ol_geom_GeometryType_.MULTI_POINT ? new _ol_geom_MultiPoint_ (null) :
|
geometryType === _ol_geom_GeometryType_.MULTI_POINT ? new _ol_geom_MultiPoint_ (null) :
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import _ol_format_Feature_ from '../format/Feature.js';
|
|||||||
import _ol_format_XMLFeature_ from '../format/XMLFeature.js';
|
import _ol_format_XMLFeature_ from '../format/XMLFeature.js';
|
||||||
import _ol_geom_GeometryLayout_ from '../geom/GeometryLayout.js';
|
import _ol_geom_GeometryLayout_ from '../geom/GeometryLayout.js';
|
||||||
import _ol_geom_LineString_ from '../geom/LineString.js';
|
import _ol_geom_LineString_ from '../geom/LineString.js';
|
||||||
import _ol_geom_Point_ from '../geom/Point.js';
|
import Point from '../geom/Point.js';
|
||||||
import _ol_geom_Polygon_ from '../geom/Polygon.js';
|
import _ol_geom_Polygon_ from '../geom/Polygon.js';
|
||||||
import _ol_obj_ from '../obj.js';
|
import _ol_obj_ from '../obj.js';
|
||||||
import {get as getProjection} from '../proj.js';
|
import {get as getProjection} from '../proj.js';
|
||||||
@@ -56,7 +56,7 @@ _ol_format_OSMXML_.readNode_ = function(node, objectStack) {
|
|||||||
tags: {}
|
tags: {}
|
||||||
}, _ol_format_OSMXML_.NODE_PARSERS_, node, objectStack);
|
}, _ol_format_OSMXML_.NODE_PARSERS_, node, objectStack);
|
||||||
if (!_ol_obj_.isEmpty(values.tags)) {
|
if (!_ol_obj_.isEmpty(values.tags)) {
|
||||||
var geometry = new _ol_geom_Point_(coordinates);
|
var geometry = new Point(coordinates);
|
||||||
_ol_format_Feature_.transformWithOptions(geometry, false, options);
|
_ol_format_Feature_.transformWithOptions(geometry, false, options);
|
||||||
var feature = new _ol_Feature_(geometry);
|
var feature = new _ol_Feature_(geometry);
|
||||||
feature.setId(id);
|
feature.setId(id);
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import _ol_geom_LineString_ from '../geom/LineString.js';
|
|||||||
import _ol_geom_MultiLineString_ from '../geom/MultiLineString.js';
|
import _ol_geom_MultiLineString_ from '../geom/MultiLineString.js';
|
||||||
import _ol_geom_MultiPoint_ from '../geom/MultiPoint.js';
|
import _ol_geom_MultiPoint_ from '../geom/MultiPoint.js';
|
||||||
import _ol_geom_MultiPolygon_ from '../geom/MultiPolygon.js';
|
import _ol_geom_MultiPolygon_ from '../geom/MultiPolygon.js';
|
||||||
import _ol_geom_Point_ from '../geom/Point.js';
|
import Point from '../geom/Point.js';
|
||||||
import _ol_geom_Polygon_ from '../geom/Polygon.js';
|
import _ol_geom_Polygon_ from '../geom/Polygon.js';
|
||||||
import {get as getProjection} from '../proj.js';
|
import {get as getProjection} from '../proj.js';
|
||||||
|
|
||||||
@@ -104,7 +104,7 @@ _ol_format_TopoJSON_.readPointGeometry_ = function(object, scale, translate) {
|
|||||||
if (scale && translate) {
|
if (scale && translate) {
|
||||||
_ol_format_TopoJSON_.transformVertex_(coordinates, scale, translate);
|
_ol_format_TopoJSON_.transformVertex_(coordinates, scale, translate);
|
||||||
}
|
}
|
||||||
return new _ol_geom_Point_(coordinates);
|
return new Point(coordinates);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import _ol_geom_LineString_ from '../geom/LineString.js';
|
|||||||
import _ol_geom_MultiLineString_ from '../geom/MultiLineString.js';
|
import _ol_geom_MultiLineString_ from '../geom/MultiLineString.js';
|
||||||
import _ol_geom_MultiPoint_ from '../geom/MultiPoint.js';
|
import _ol_geom_MultiPoint_ from '../geom/MultiPoint.js';
|
||||||
import _ol_geom_MultiPolygon_ from '../geom/MultiPolygon.js';
|
import _ol_geom_MultiPolygon_ from '../geom/MultiPolygon.js';
|
||||||
import _ol_geom_Point_ from '../geom/Point.js';
|
import Point from '../geom/Point.js';
|
||||||
import _ol_geom_Polygon_ from '../geom/Polygon.js';
|
import _ol_geom_Polygon_ from '../geom/Polygon.js';
|
||||||
import _ol_geom_SimpleGeometry_ from '../geom/SimpleGeometry.js';
|
import _ol_geom_SimpleGeometry_ from '../geom/SimpleGeometry.js';
|
||||||
|
|
||||||
@@ -918,7 +918,7 @@ _ol_format_WKT_.Parser.prototype.formatErrorMessage_ = function() {
|
|||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
_ol_format_WKT_.Parser.GeometryConstructor_ = {
|
_ol_format_WKT_.Parser.GeometryConstructor_ = {
|
||||||
'POINT': _ol_geom_Point_,
|
'POINT': Point,
|
||||||
'LINESTRING': _ol_geom_LineString_,
|
'LINESTRING': _ol_geom_LineString_,
|
||||||
'POLYGON': _ol_geom_Polygon_,
|
'POLYGON': _ol_geom_Polygon_,
|
||||||
'MULTIPOINT': _ol_geom_MultiPoint_,
|
'MULTIPOINT': _ol_geom_MultiPoint_,
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import _ol_array_ from '../array.js';
|
|||||||
import {closestSquaredDistanceXY, containsXY} from '../extent.js';
|
import {closestSquaredDistanceXY, containsXY} from '../extent.js';
|
||||||
import _ol_geom_GeometryLayout_ from '../geom/GeometryLayout.js';
|
import _ol_geom_GeometryLayout_ from '../geom/GeometryLayout.js';
|
||||||
import _ol_geom_GeometryType_ from '../geom/GeometryType.js';
|
import _ol_geom_GeometryType_ from '../geom/GeometryType.js';
|
||||||
import _ol_geom_Point_ from '../geom/Point.js';
|
import Point from '../geom/Point.js';
|
||||||
import _ol_geom_SimpleGeometry_ from '../geom/SimpleGeometry.js';
|
import _ol_geom_SimpleGeometry_ from '../geom/SimpleGeometry.js';
|
||||||
import _ol_geom_flat_deflate_ from '../geom/flat/deflate.js';
|
import _ol_geom_flat_deflate_ from '../geom/flat/deflate.js';
|
||||||
import _ol_geom_flat_inflate_ from '../geom/flat/inflate.js';
|
import _ol_geom_flat_inflate_ from '../geom/flat/inflate.js';
|
||||||
@@ -107,7 +107,7 @@ _ol_geom_MultiPoint_.prototype.getPoint = function(index) {
|
|||||||
if (index < 0 || n <= index) {
|
if (index < 0 || n <= index) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
var point = new _ol_geom_Point_(null);
|
var point = new Point(null);
|
||||||
point.setFlatCoordinates(this.layout, this.flatCoordinates.slice(
|
point.setFlatCoordinates(this.layout, this.flatCoordinates.slice(
|
||||||
index * this.stride, (index + 1) * this.stride));
|
index * this.stride, (index + 1) * this.stride));
|
||||||
return point;
|
return point;
|
||||||
@@ -127,7 +127,7 @@ _ol_geom_MultiPoint_.prototype.getPoints = function() {
|
|||||||
var points = [];
|
var points = [];
|
||||||
var i, ii;
|
var i, ii;
|
||||||
for (i = 0, ii = flatCoordinates.length; i < ii; i += stride) {
|
for (i = 0, ii = flatCoordinates.length; i < ii; i += stride) {
|
||||||
var point = new _ol_geom_Point_(null);
|
var point = new Point(null);
|
||||||
point.setFlatCoordinates(layout, flatCoordinates.slice(i, i + stride));
|
point.setFlatCoordinates(layout, flatCoordinates.slice(i, i + stride));
|
||||||
points.push(point);
|
points.push(point);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,12 +19,12 @@ import _ol_math_ from '../math.js';
|
|||||||
* @param {ol.geom.GeometryLayout=} opt_layout Layout.
|
* @param {ol.geom.GeometryLayout=} opt_layout Layout.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
var _ol_geom_Point_ = function(coordinates, opt_layout) {
|
var Point = function(coordinates, opt_layout) {
|
||||||
_ol_geom_SimpleGeometry_.call(this);
|
_ol_geom_SimpleGeometry_.call(this);
|
||||||
this.setCoordinates(coordinates, opt_layout);
|
this.setCoordinates(coordinates, opt_layout);
|
||||||
};
|
};
|
||||||
|
|
||||||
inherits(_ol_geom_Point_, _ol_geom_SimpleGeometry_);
|
inherits(Point, _ol_geom_SimpleGeometry_);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -33,8 +33,8 @@ inherits(_ol_geom_Point_, _ol_geom_SimpleGeometry_);
|
|||||||
* @override
|
* @override
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
_ol_geom_Point_.prototype.clone = function() {
|
Point.prototype.clone = function() {
|
||||||
var point = new _ol_geom_Point_(null);
|
var point = new Point(null);
|
||||||
point.setFlatCoordinates(this.layout, this.flatCoordinates.slice());
|
point.setFlatCoordinates(this.layout, this.flatCoordinates.slice());
|
||||||
return point;
|
return point;
|
||||||
};
|
};
|
||||||
@@ -43,7 +43,7 @@ _ol_geom_Point_.prototype.clone = function() {
|
|||||||
/**
|
/**
|
||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
*/
|
*/
|
||||||
_ol_geom_Point_.prototype.closestPointXY = function(x, y, closestPoint, minSquaredDistance) {
|
Point.prototype.closestPointXY = function(x, y, closestPoint, minSquaredDistance) {
|
||||||
var flatCoordinates = this.flatCoordinates;
|
var flatCoordinates = this.flatCoordinates;
|
||||||
var squaredDistance = _ol_math_.squaredDistance(
|
var squaredDistance = _ol_math_.squaredDistance(
|
||||||
x, y, flatCoordinates[0], flatCoordinates[1]);
|
x, y, flatCoordinates[0], flatCoordinates[1]);
|
||||||
@@ -67,7 +67,7 @@ _ol_geom_Point_.prototype.closestPointXY = function(x, y, closestPoint, minSquar
|
|||||||
* @override
|
* @override
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
_ol_geom_Point_.prototype.getCoordinates = function() {
|
Point.prototype.getCoordinates = function() {
|
||||||
return !this.flatCoordinates ? [] : this.flatCoordinates.slice();
|
return !this.flatCoordinates ? [] : this.flatCoordinates.slice();
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -75,7 +75,7 @@ _ol_geom_Point_.prototype.getCoordinates = function() {
|
|||||||
/**
|
/**
|
||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
*/
|
*/
|
||||||
_ol_geom_Point_.prototype.computeExtent = function(extent) {
|
Point.prototype.computeExtent = function(extent) {
|
||||||
return createOrUpdateFromCoordinate(this.flatCoordinates, extent);
|
return createOrUpdateFromCoordinate(this.flatCoordinates, extent);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -84,7 +84,7 @@ _ol_geom_Point_.prototype.computeExtent = function(extent) {
|
|||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
_ol_geom_Point_.prototype.getType = function() {
|
Point.prototype.getType = function() {
|
||||||
return _ol_geom_GeometryType_.POINT;
|
return _ol_geom_GeometryType_.POINT;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -93,7 +93,7 @@ _ol_geom_Point_.prototype.getType = function() {
|
|||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
_ol_geom_Point_.prototype.intersectsExtent = function(extent) {
|
Point.prototype.intersectsExtent = function(extent) {
|
||||||
return containsXY(extent, this.flatCoordinates[0], this.flatCoordinates[1]);
|
return containsXY(extent, this.flatCoordinates[0], this.flatCoordinates[1]);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -102,7 +102,7 @@ _ol_geom_Point_.prototype.intersectsExtent = function(extent) {
|
|||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
_ol_geom_Point_.prototype.setCoordinates = function(coordinates, opt_layout) {
|
Point.prototype.setCoordinates = function(coordinates, opt_layout) {
|
||||||
if (!coordinates) {
|
if (!coordinates) {
|
||||||
this.setFlatCoordinates(_ol_geom_GeometryLayout_.XY, null);
|
this.setFlatCoordinates(_ol_geom_GeometryLayout_.XY, null);
|
||||||
} else {
|
} else {
|
||||||
@@ -121,8 +121,8 @@ _ol_geom_Point_.prototype.setCoordinates = function(coordinates, opt_layout) {
|
|||||||
* @param {ol.geom.GeometryLayout} layout Layout.
|
* @param {ol.geom.GeometryLayout} layout Layout.
|
||||||
* @param {Array.<number>} flatCoordinates Flat coordinates.
|
* @param {Array.<number>} flatCoordinates Flat coordinates.
|
||||||
*/
|
*/
|
||||||
_ol_geom_Point_.prototype.setFlatCoordinates = function(layout, flatCoordinates) {
|
Point.prototype.setFlatCoordinates = function(layout, flatCoordinates) {
|
||||||
this.setFlatCoordinatesInternal(layout, flatCoordinates);
|
this.setFlatCoordinatesInternal(layout, flatCoordinates);
|
||||||
this.changed();
|
this.changed();
|
||||||
};
|
};
|
||||||
export default _ol_geom_Point_;
|
export default Point;
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import {closestSquaredDistanceXY, getCenter} from '../extent.js';
|
|||||||
import _ol_geom_GeometryLayout_ from '../geom/GeometryLayout.js';
|
import _ol_geom_GeometryLayout_ from '../geom/GeometryLayout.js';
|
||||||
import _ol_geom_GeometryType_ from '../geom/GeometryType.js';
|
import _ol_geom_GeometryType_ from '../geom/GeometryType.js';
|
||||||
import _ol_geom_LinearRing_ from '../geom/LinearRing.js';
|
import _ol_geom_LinearRing_ from '../geom/LinearRing.js';
|
||||||
import _ol_geom_Point_ from '../geom/Point.js';
|
import Point from '../geom/Point.js';
|
||||||
import _ol_geom_SimpleGeometry_ from '../geom/SimpleGeometry.js';
|
import _ol_geom_SimpleGeometry_ from '../geom/SimpleGeometry.js';
|
||||||
import _ol_geom_flat_area_ from '../geom/flat/area.js';
|
import _ol_geom_flat_area_ from '../geom/flat/area.js';
|
||||||
import _ol_geom_flat_closest_ from '../geom/flat/closest.js';
|
import _ol_geom_flat_closest_ from '../geom/flat/closest.js';
|
||||||
@@ -215,7 +215,7 @@ _ol_geom_Polygon_.prototype.getFlatInteriorPoint = function() {
|
|||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
_ol_geom_Polygon_.prototype.getInteriorPoint = function() {
|
_ol_geom_Polygon_.prototype.getInteriorPoint = function() {
|
||||||
return new _ol_geom_Point_(this.getFlatInteriorPoint(), _ol_geom_GeometryLayout_.XYM);
|
return new Point(this.getFlatInteriorPoint(), _ol_geom_GeometryLayout_.XYM);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ import _ol_geom_LineString_ from '../geom/LineString.js';
|
|||||||
import _ol_geom_MultiLineString_ from '../geom/MultiLineString.js';
|
import _ol_geom_MultiLineString_ from '../geom/MultiLineString.js';
|
||||||
import _ol_geom_MultiPoint_ from '../geom/MultiPoint.js';
|
import _ol_geom_MultiPoint_ from '../geom/MultiPoint.js';
|
||||||
import _ol_geom_MultiPolygon_ from '../geom/MultiPolygon.js';
|
import _ol_geom_MultiPolygon_ from '../geom/MultiPolygon.js';
|
||||||
import _ol_geom_Point_ from '../geom/Point.js';
|
import Point from '../geom/Point.js';
|
||||||
import _ol_geom_Polygon_ from '../geom/Polygon.js';
|
import _ol_geom_Polygon_ from '../geom/Polygon.js';
|
||||||
import _ol_interaction_DrawEventType_ from '../interaction/DrawEventType.js';
|
import _ol_interaction_DrawEventType_ from '../interaction/DrawEventType.js';
|
||||||
import _ol_interaction_Pointer_ from '../interaction/Pointer.js';
|
import _ol_interaction_Pointer_ from '../interaction/Pointer.js';
|
||||||
@@ -152,7 +152,7 @@ var _ol_interaction_Draw_ = function(options) {
|
|||||||
var Constructor;
|
var Constructor;
|
||||||
var mode = this.mode_;
|
var mode = this.mode_;
|
||||||
if (mode === _ol_interaction_Draw_.Mode_.POINT) {
|
if (mode === _ol_interaction_Draw_.Mode_.POINT) {
|
||||||
Constructor = _ol_geom_Point_;
|
Constructor = Point;
|
||||||
} else if (mode === _ol_interaction_Draw_.Mode_.LINE_STRING) {
|
} else if (mode === _ol_interaction_Draw_.Mode_.LINE_STRING) {
|
||||||
Constructor = _ol_geom_LineString_;
|
Constructor = _ol_geom_LineString_;
|
||||||
} else if (mode === _ol_interaction_Draw_.Mode_.POLYGON) {
|
} else if (mode === _ol_interaction_Draw_.Mode_.POLYGON) {
|
||||||
@@ -481,7 +481,7 @@ _ol_interaction_Draw_.prototype.atFinish_ = function(event) {
|
|||||||
_ol_interaction_Draw_.prototype.createOrUpdateSketchPoint_ = function(event) {
|
_ol_interaction_Draw_.prototype.createOrUpdateSketchPoint_ = function(event) {
|
||||||
var coordinates = event.coordinate.slice();
|
var coordinates = event.coordinate.slice();
|
||||||
if (!this.sketchPoint_) {
|
if (!this.sketchPoint_) {
|
||||||
this.sketchPoint_ = new _ol_Feature_(new _ol_geom_Point_(coordinates));
|
this.sketchPoint_ = new _ol_Feature_(new Point(coordinates));
|
||||||
this.updateSketchFeatures_();
|
this.updateSketchFeatures_();
|
||||||
} else {
|
} else {
|
||||||
var sketchPointGeom = /** @type {ol.geom.Point} */ (this.sketchPoint_.getGeometry());
|
var sketchPointGeom = /** @type {ol.geom.Point} */ (this.sketchPoint_.getGeometry());
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import _ol_coordinate_ from '../coordinate.js';
|
|||||||
import _ol_events_Event_ from '../events/Event.js';
|
import _ol_events_Event_ from '../events/Event.js';
|
||||||
import {boundingExtent, getArea} from '../extent.js';
|
import {boundingExtent, getArea} from '../extent.js';
|
||||||
import _ol_geom_GeometryType_ from '../geom/GeometryType.js';
|
import _ol_geom_GeometryType_ from '../geom/GeometryType.js';
|
||||||
import _ol_geom_Point_ from '../geom/Point.js';
|
import Point from '../geom/Point.js';
|
||||||
import _ol_geom_Polygon_ from '../geom/Polygon.js';
|
import _ol_geom_Polygon_ from '../geom/Polygon.js';
|
||||||
import _ol_interaction_ExtentEventType_ from '../interaction/ExtentEventType.js';
|
import _ol_interaction_ExtentEventType_ from '../interaction/ExtentEventType.js';
|
||||||
import _ol_interaction_Pointer_ from '../interaction/Pointer.js';
|
import _ol_interaction_Pointer_ from '../interaction/Pointer.js';
|
||||||
@@ -399,7 +399,7 @@ _ol_interaction_Extent_.prototype.createOrUpdateExtentFeature_ = function(extent
|
|||||||
_ol_interaction_Extent_.prototype.createOrUpdatePointerFeature_ = function(vertex) {
|
_ol_interaction_Extent_.prototype.createOrUpdatePointerFeature_ = function(vertex) {
|
||||||
var vertexFeature = this.vertexFeature_;
|
var vertexFeature = this.vertexFeature_;
|
||||||
if (!vertexFeature) {
|
if (!vertexFeature) {
|
||||||
vertexFeature = new _ol_Feature_(new _ol_geom_Point_(vertex));
|
vertexFeature = new _ol_Feature_(new Point(vertex));
|
||||||
this.vertexFeature_ = vertexFeature;
|
this.vertexFeature_ = vertexFeature;
|
||||||
this.vertexOverlay_.getSource().addFeature(vertexFeature);
|
this.vertexOverlay_.getSource().addFeature(vertexFeature);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ import _ol_events_EventType_ from '../events/EventType.js';
|
|||||||
import _ol_events_condition_ from '../events/condition.js';
|
import _ol_events_condition_ from '../events/condition.js';
|
||||||
import {boundingExtent, buffer, createOrUpdateFromCoordinate} from '../extent.js';
|
import {boundingExtent, buffer, createOrUpdateFromCoordinate} from '../extent.js';
|
||||||
import _ol_geom_GeometryType_ from '../geom/GeometryType.js';
|
import _ol_geom_GeometryType_ from '../geom/GeometryType.js';
|
||||||
import _ol_geom_Point_ from '../geom/Point.js';
|
import Point from '../geom/Point.js';
|
||||||
import _ol_interaction_ModifyEventType_ from '../interaction/ModifyEventType.js';
|
import _ol_interaction_ModifyEventType_ from '../interaction/ModifyEventType.js';
|
||||||
import _ol_interaction_Pointer_ from '../interaction/Pointer.js';
|
import _ol_interaction_Pointer_ from '../interaction/Pointer.js';
|
||||||
import _ol_layer_Vector_ from '../layer/Vector.js';
|
import _ol_layer_Vector_ from '../layer/Vector.js';
|
||||||
@@ -579,7 +579,7 @@ _ol_interaction_Modify_.prototype.writeGeometryCollectionGeometry_ = function(fe
|
|||||||
_ol_interaction_Modify_.prototype.createOrUpdateVertexFeature_ = function(coordinates) {
|
_ol_interaction_Modify_.prototype.createOrUpdateVertexFeature_ = function(coordinates) {
|
||||||
var vertexFeature = this.vertexFeature_;
|
var vertexFeature = this.vertexFeature_;
|
||||||
if (!vertexFeature) {
|
if (!vertexFeature) {
|
||||||
vertexFeature = new _ol_Feature_(new _ol_geom_Point_(coordinates));
|
vertexFeature = new _ol_Feature_(new Point(coordinates));
|
||||||
this.vertexFeature_ = vertexFeature;
|
this.vertexFeature_ = vertexFeature;
|
||||||
this.overlay_.getSource().addFeature(vertexFeature);
|
this.overlay_.getSource().addFeature(vertexFeature);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import _ol_Feature_ from '../Feature.js';
|
|||||||
import _ol_coordinate_ from '../coordinate.js';
|
import _ol_coordinate_ from '../coordinate.js';
|
||||||
import _ol_events_EventType_ from '../events/EventType.js';
|
import _ol_events_EventType_ from '../events/EventType.js';
|
||||||
import {buffer, createEmpty, createOrUpdateFromCoordinate} from '../extent.js';
|
import {buffer, createEmpty, createOrUpdateFromCoordinate} from '../extent.js';
|
||||||
import _ol_geom_Point_ from '../geom/Point.js';
|
import Point from '../geom/Point.js';
|
||||||
import _ol_source_Vector_ from '../source/Vector.js';
|
import _ol_source_Vector_ from '../source/Vector.js';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -56,7 +56,7 @@ var _ol_source_Cluster_ = function(options) {
|
|||||||
*/
|
*/
|
||||||
this.geometryFunction = options.geometryFunction || function(feature) {
|
this.geometryFunction = options.geometryFunction || function(feature) {
|
||||||
var geometry = /** @type {ol.geom.Point} */ (feature.getGeometry());
|
var geometry = /** @type {ol.geom.Point} */ (feature.getGeometry());
|
||||||
_ol_asserts_.assert(geometry instanceof _ol_geom_Point_,
|
_ol_asserts_.assert(geometry instanceof Point,
|
||||||
10); // The default `geometryFunction` can only handle `ol.geom.Point` geometries
|
10); // The default `geometryFunction` can only handle `ol.geom.Point` geometries
|
||||||
return geometry;
|
return geometry;
|
||||||
};
|
};
|
||||||
@@ -192,7 +192,7 @@ _ol_source_Cluster_.prototype.createCluster = function(features) {
|
|||||||
}
|
}
|
||||||
_ol_coordinate_.scale(centroid, 1 / features.length);
|
_ol_coordinate_.scale(centroid, 1 / features.length);
|
||||||
|
|
||||||
var cluster = new _ol_Feature_(new _ol_geom_Point_(centroid));
|
var cluster = new _ol_Feature_(new Point(centroid));
|
||||||
cluster.set('features', features);
|
cluster.set('features', features);
|
||||||
return cluster;
|
return cluster;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import _ol_Map_ from '../../../../src/ol/Map.js';
|
import _ol_Map_ from '../../../../src/ol/Map.js';
|
||||||
import _ol_View_ from '../../../../src/ol/View.js';
|
import _ol_View_ from '../../../../src/ol/View.js';
|
||||||
import * as _ol_extent_ from '../../../../src/ol/extent.js';
|
import * as _ol_extent_ from '../../../../src/ol/extent.js';
|
||||||
import _ol_geom_Point_ from '../../../../src/ol/geom/Point.js';
|
import Point from '../../../../src/ol/geom/Point.js';
|
||||||
import _ol_layer_Tile_ from '../../../../src/ol/layer/Tile.js';
|
import _ol_layer_Tile_ from '../../../../src/ol/layer/Tile.js';
|
||||||
import _ol_obj_ from '../../../../src/ol/obj.js';
|
import _ol_obj_ from '../../../../src/ol/obj.js';
|
||||||
import {transform} from '../../../../src/ol/proj.js';
|
import {transform} from '../../../../src/ol/proj.js';
|
||||||
@@ -284,7 +284,7 @@ describe('ol.rendering.layer.Tile', function() {
|
|||||||
fill: new _ol_style_Fill_({color: 'yellow'}),
|
fill: new _ol_style_Fill_({color: 'yellow'}),
|
||||||
stroke: new _ol_style_Stroke_({color: 'red', width: 1})
|
stroke: new _ol_style_Stroke_({color: 'red', width: 1})
|
||||||
}));
|
}));
|
||||||
e.vectorContext.drawPoint(new _ol_geom_Point_(
|
e.vectorContext.drawPoint(new Point(
|
||||||
transform([-123, 38], 'EPSG:4326', 'EPSG:3857')));
|
transform([-123, 38], 'EPSG:4326', 'EPSG:3857')));
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import _ol_View_ from '../../../../src/ol/View.js';
|
|||||||
import _ol_format_GeoJSON_ from '../../../../src/ol/format/GeoJSON.js';
|
import _ol_format_GeoJSON_ from '../../../../src/ol/format/GeoJSON.js';
|
||||||
import _ol_geom_Circle_ from '../../../../src/ol/geom/Circle.js';
|
import _ol_geom_Circle_ from '../../../../src/ol/geom/Circle.js';
|
||||||
import _ol_geom_LineString_ from '../../../../src/ol/geom/LineString.js';
|
import _ol_geom_LineString_ from '../../../../src/ol/geom/LineString.js';
|
||||||
import _ol_geom_Point_ from '../../../../src/ol/geom/Point.js';
|
import Point from '../../../../src/ol/geom/Point.js';
|
||||||
import _ol_geom_Polygon_ from '../../../../src/ol/geom/Polygon.js';
|
import _ol_geom_Polygon_ from '../../../../src/ol/geom/Polygon.js';
|
||||||
import _ol_layer_Vector_ from '../../../../src/ol/layer/Vector.js';
|
import _ol_layer_Vector_ from '../../../../src/ol/layer/Vector.js';
|
||||||
import _ol_source_Vector_ from '../../../../src/ol/source/Vector.js';
|
import _ol_source_Vector_ from '../../../../src/ol/source/Vector.js';
|
||||||
@@ -590,16 +590,16 @@ describe('ol.rendering.layer.Vector', function() {
|
|||||||
map.addLayer(layer);
|
map.addLayer(layer);
|
||||||
|
|
||||||
var centerFeature = new _ol_Feature_({
|
var centerFeature = new _ol_Feature_({
|
||||||
geometry: new _ol_geom_Point_(center),
|
geometry: new Point(center),
|
||||||
text: 'center'
|
text: 'center'
|
||||||
});
|
});
|
||||||
source.addFeature(centerFeature);
|
source.addFeature(centerFeature);
|
||||||
source.addFeature(new _ol_Feature_({
|
source.addFeature(new _ol_Feature_({
|
||||||
geometry: new _ol_geom_Point_([center[0] - 540, center[1]]),
|
geometry: new Point([center[0] - 540, center[1]]),
|
||||||
text: 'west'
|
text: 'west'
|
||||||
}));
|
}));
|
||||||
source.addFeature(new _ol_Feature_({
|
source.addFeature(new _ol_Feature_({
|
||||||
geometry: new _ol_geom_Point_([center[0] + 540, center[1]]),
|
geometry: new Point([center[0] + 540, center[1]]),
|
||||||
text: 'east'
|
text: 'east'
|
||||||
}));
|
}));
|
||||||
|
|
||||||
@@ -631,16 +631,16 @@ describe('ol.rendering.layer.Vector', function() {
|
|||||||
map.addLayer(layer);
|
map.addLayer(layer);
|
||||||
|
|
||||||
var centerFeature = new _ol_Feature_({
|
var centerFeature = new _ol_Feature_({
|
||||||
geometry: new _ol_geom_Point_(center),
|
geometry: new Point(center),
|
||||||
text: 'center'
|
text: 'center'
|
||||||
});
|
});
|
||||||
source.addFeature(centerFeature);
|
source.addFeature(centerFeature);
|
||||||
source.addFeature(new _ol_Feature_({
|
source.addFeature(new _ol_Feature_({
|
||||||
geometry: new _ol_geom_Point_([center[0] - 540, center[1]]),
|
geometry: new Point([center[0] - 540, center[1]]),
|
||||||
text: 'west'
|
text: 'west'
|
||||||
}));
|
}));
|
||||||
source.addFeature(new _ol_Feature_({
|
source.addFeature(new _ol_Feature_({
|
||||||
geometry: new _ol_geom_Point_([center[0] + 540, center[1]]),
|
geometry: new Point([center[0] + 540, center[1]]),
|
||||||
text: 'east'
|
text: 'east'
|
||||||
}));
|
}));
|
||||||
|
|
||||||
@@ -671,17 +671,17 @@ describe('ol.rendering.layer.Vector', function() {
|
|||||||
map.addLayer(layer);
|
map.addLayer(layer);
|
||||||
|
|
||||||
source.addFeature(new _ol_Feature_({
|
source.addFeature(new _ol_Feature_({
|
||||||
geometry: new _ol_geom_Point_(center),
|
geometry: new Point(center),
|
||||||
text: 'center',
|
text: 'center',
|
||||||
zIndex: 2
|
zIndex: 2
|
||||||
}));
|
}));
|
||||||
source.addFeature(new _ol_Feature_({
|
source.addFeature(new _ol_Feature_({
|
||||||
geometry: new _ol_geom_Point_([center[0] - 540, center[1]]),
|
geometry: new Point([center[0] - 540, center[1]]),
|
||||||
text: 'west',
|
text: 'west',
|
||||||
zIndex: 3
|
zIndex: 3
|
||||||
}));
|
}));
|
||||||
source.addFeature(new _ol_Feature_({
|
source.addFeature(new _ol_Feature_({
|
||||||
geometry: new _ol_geom_Point_([center[0] + 540, center[1]]),
|
geometry: new Point([center[0] + 540, center[1]]),
|
||||||
text: 'east',
|
text: 'east',
|
||||||
zIndex: 1
|
zIndex: 1
|
||||||
}));
|
}));
|
||||||
@@ -711,14 +711,14 @@ describe('ol.rendering.layer.Vector', function() {
|
|||||||
map.addLayer(layer);
|
map.addLayer(layer);
|
||||||
|
|
||||||
var centerFeature = new _ol_Feature_({
|
var centerFeature = new _ol_Feature_({
|
||||||
geometry: new _ol_geom_Point_(center)
|
geometry: new Point(center)
|
||||||
});
|
});
|
||||||
source.addFeature(centerFeature);
|
source.addFeature(centerFeature);
|
||||||
source.addFeature(new _ol_Feature_({
|
source.addFeature(new _ol_Feature_({
|
||||||
geometry: new _ol_geom_Point_([center[0] - 540, center[1]])
|
geometry: new Point([center[0] - 540, center[1]])
|
||||||
}));
|
}));
|
||||||
source.addFeature(new _ol_Feature_({
|
source.addFeature(new _ol_Feature_({
|
||||||
geometry: new _ol_geom_Point_([center[0] + 540, center[1]])
|
geometry: new Point([center[0] + 540, center[1]])
|
||||||
}));
|
}));
|
||||||
|
|
||||||
layer.setDeclutter(true);
|
layer.setDeclutter(true);
|
||||||
@@ -751,14 +751,14 @@ describe('ol.rendering.layer.Vector', function() {
|
|||||||
map.addLayer(layer);
|
map.addLayer(layer);
|
||||||
|
|
||||||
var centerFeature = new _ol_Feature_({
|
var centerFeature = new _ol_Feature_({
|
||||||
geometry: new _ol_geom_Point_(center)
|
geometry: new Point(center)
|
||||||
});
|
});
|
||||||
source.addFeature(centerFeature);
|
source.addFeature(centerFeature);
|
||||||
source.addFeature(new _ol_Feature_({
|
source.addFeature(new _ol_Feature_({
|
||||||
geometry: new _ol_geom_Point_([center[0] - 540, center[1]])
|
geometry: new Point([center[0] - 540, center[1]])
|
||||||
}));
|
}));
|
||||||
source.addFeature(new _ol_Feature_({
|
source.addFeature(new _ol_Feature_({
|
||||||
geometry: new _ol_geom_Point_([center[0] + 540, center[1]])
|
geometry: new Point([center[0] + 540, center[1]])
|
||||||
}));
|
}));
|
||||||
|
|
||||||
layer.setDeclutter(true);
|
layer.setDeclutter(true);
|
||||||
@@ -790,15 +790,15 @@ describe('ol.rendering.layer.Vector', function() {
|
|||||||
map.addLayer(layer);
|
map.addLayer(layer);
|
||||||
|
|
||||||
source.addFeature(new _ol_Feature_({
|
source.addFeature(new _ol_Feature_({
|
||||||
geometry: new _ol_geom_Point_(center),
|
geometry: new Point(center),
|
||||||
zIndex: 2
|
zIndex: 2
|
||||||
}));
|
}));
|
||||||
source.addFeature(new _ol_Feature_({
|
source.addFeature(new _ol_Feature_({
|
||||||
geometry: new _ol_geom_Point_([center[0] - 540, center[1]]),
|
geometry: new Point([center[0] - 540, center[1]]),
|
||||||
zIndex: 3
|
zIndex: 3
|
||||||
}));
|
}));
|
||||||
source.addFeature(new _ol_Feature_({
|
source.addFeature(new _ol_Feature_({
|
||||||
geometry: new _ol_geom_Point_([center[0] + 540, center[1]]),
|
geometry: new Point([center[0] + 540, center[1]]),
|
||||||
zIndex: 1
|
zIndex: 1
|
||||||
}));
|
}));
|
||||||
|
|
||||||
@@ -829,15 +829,15 @@ describe('ol.rendering.layer.Vector', function() {
|
|||||||
map.addLayer(layer);
|
map.addLayer(layer);
|
||||||
|
|
||||||
source.addFeature(new _ol_Feature_({
|
source.addFeature(new _ol_Feature_({
|
||||||
geometry: new _ol_geom_Point_(center),
|
geometry: new Point(center),
|
||||||
text: 'center'
|
text: 'center'
|
||||||
}));
|
}));
|
||||||
source.addFeature(new _ol_Feature_({
|
source.addFeature(new _ol_Feature_({
|
||||||
geometry: new _ol_geom_Point_([center[0] - 540, center[1]]),
|
geometry: new Point([center[0] - 540, center[1]]),
|
||||||
text: 'west'
|
text: 'west'
|
||||||
}));
|
}));
|
||||||
source.addFeature(new _ol_Feature_({
|
source.addFeature(new _ol_Feature_({
|
||||||
geometry: new _ol_geom_Point_([center[0] + 540, center[1]]),
|
geometry: new Point([center[0] + 540, center[1]]),
|
||||||
text: 'east'
|
text: 'east'
|
||||||
}));
|
}));
|
||||||
|
|
||||||
@@ -872,7 +872,7 @@ describe('ol.rendering.layer.Vector', function() {
|
|||||||
});
|
});
|
||||||
map.addLayer(layer);
|
map.addLayer(layer);
|
||||||
|
|
||||||
var point = new _ol_Feature_(new _ol_geom_Point_(center));
|
var point = new _ol_Feature_(new Point(center));
|
||||||
point.setStyle(new _ol_style_Style_({
|
point.setStyle(new _ol_style_Style_({
|
||||||
image: new _ol_style_Circle_({
|
image: new _ol_style_Circle_({
|
||||||
radius: 8,
|
radius: 8,
|
||||||
@@ -915,7 +915,7 @@ describe('ol.rendering.layer.Vector', function() {
|
|||||||
});
|
});
|
||||||
map.addLayer(layer);
|
map.addLayer(layer);
|
||||||
|
|
||||||
var point = new _ol_Feature_(new _ol_geom_Point_(center));
|
var point = new _ol_Feature_(new Point(center));
|
||||||
point.setStyle(new _ol_style_Style_({
|
point.setStyle(new _ol_style_Style_({
|
||||||
image: new _ol_style_Circle_({
|
image: new _ol_style_Circle_({
|
||||||
radius: 8,
|
radius: 8,
|
||||||
@@ -958,7 +958,7 @@ describe('ol.rendering.layer.Vector', function() {
|
|||||||
});
|
});
|
||||||
map.addLayer(layer);
|
map.addLayer(layer);
|
||||||
|
|
||||||
var point = new _ol_Feature_(new _ol_geom_Point_(center));
|
var point = new _ol_Feature_(new Point(center));
|
||||||
point.setStyle(new _ol_style_Style_({
|
point.setStyle(new _ol_style_Style_({
|
||||||
zIndex: 2,
|
zIndex: 2,
|
||||||
image: new _ol_style_Circle_({
|
image: new _ol_style_Circle_({
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import _ol_Feature_ from '../../../../src/ol/Feature.js';
|
|||||||
import _ol_Map_ from '../../../../src/ol/Map.js';
|
import _ol_Map_ from '../../../../src/ol/Map.js';
|
||||||
import _ol_View_ from '../../../../src/ol/View.js';
|
import _ol_View_ from '../../../../src/ol/View.js';
|
||||||
import _ol_format_MVT_ from '../../../../src/ol/format/MVT.js';
|
import _ol_format_MVT_ from '../../../../src/ol/format/MVT.js';
|
||||||
import _ol_geom_Point_ from '../../../../src/ol/geom/Point.js';
|
import Point from '../../../../src/ol/geom/Point.js';
|
||||||
import _ol_layer_Vector_ from '../../../../src/ol/layer/Vector.js';
|
import _ol_layer_Vector_ from '../../../../src/ol/layer/Vector.js';
|
||||||
import _ol_layer_VectorTile_ from '../../../../src/ol/layer/VectorTile.js';
|
import _ol_layer_VectorTile_ from '../../../../src/ol/layer/VectorTile.js';
|
||||||
import _ol_obj_ from '../../../../src/ol/obj.js';
|
import _ol_obj_ from '../../../../src/ol/obj.js';
|
||||||
@@ -98,7 +98,7 @@ describe('ol.rendering.layer.VectorTile', function() {
|
|||||||
createMap('canvas');
|
createMap('canvas');
|
||||||
var vectorSource = new _ol_source_Vector_({
|
var vectorSource = new _ol_source_Vector_({
|
||||||
features: [
|
features: [
|
||||||
new _ol_Feature_(new _ol_geom_Point_([1825727.7316762917, 6143091.089223046]))
|
new _ol_Feature_(new Point([1825727.7316762917, 6143091.089223046]))
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
map.addLayer(new _ol_layer_Vector_({
|
map.addLayer(new _ol_layer_Vector_({
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import _ol_Feature_ from '../../../src/ol/Feature.js';
|
import _ol_Feature_ from '../../../src/ol/Feature.js';
|
||||||
import _ol_geom_Point_ from '../../../src/ol/geom/Point.js';
|
import Point from '../../../src/ol/geom/Point.js';
|
||||||
import _ol_Map_ from '../../../src/ol/Map.js';
|
import _ol_Map_ from '../../../src/ol/Map.js';
|
||||||
import _ol_View_ from '../../../src/ol/View.js';
|
import _ol_View_ from '../../../src/ol/View.js';
|
||||||
import _ol_layer_Vector_ from '../../../src/ol/layer/Vector.js';
|
import _ol_layer_Vector_ from '../../../src/ol/layer/Vector.js';
|
||||||
@@ -13,7 +13,7 @@ describe('ol.rendering.Map', function() {
|
|||||||
var vectorLayer = new _ol_layer_Vector_({
|
var vectorLayer = new _ol_layer_Vector_({
|
||||||
source: new _ol_source_Vector_({
|
source: new _ol_source_Vector_({
|
||||||
features: [new _ol_Feature_({
|
features: [new _ol_Feature_({
|
||||||
geometry: new _ol_geom_Point_([0, 0])
|
geometry: new Point([0, 0])
|
||||||
})]
|
})]
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import _ol_geom_LineString_ from '../../../src/ol/geom/LineString.js';
|
import _ol_geom_LineString_ from '../../../src/ol/geom/LineString.js';
|
||||||
import _ol_geom_Point_ from '../../../src/ol/geom/Point.js';
|
import Point from '../../../src/ol/geom/Point.js';
|
||||||
import _ol_geom_Polygon_ from '../../../src/ol/geom/Polygon.js';
|
import _ol_geom_Polygon_ from '../../../src/ol/geom/Polygon.js';
|
||||||
import _ol_render_ from '../../../src/ol/render.js';
|
import _ol_render_ from '../../../src/ol/render.js';
|
||||||
import _ol_render_VectorContext_ from '../../../src/ol/render/VectorContext.js';
|
import _ol_render_VectorContext_ from '../../../src/ol/render/VectorContext.js';
|
||||||
@@ -43,7 +43,7 @@ describe('ol.render', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
vectorContext.setStyle(style);
|
vectorContext.setStyle(style);
|
||||||
vectorContext.drawGeometry(new _ol_geom_Point_([50, 50]));
|
vectorContext.drawGeometry(new Point([50, 50]));
|
||||||
|
|
||||||
resembleCanvas(context.canvas,
|
resembleCanvas(context.canvas,
|
||||||
'rendering/ol/expected/render-point.png', IMAGE_TOLERANCE, done);
|
'rendering/ol/expected/render-point.png', IMAGE_TOLERANCE, done);
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import _ol_Feature_ from '../../../../src/ol/Feature.js';
|
import _ol_Feature_ from '../../../../src/ol/Feature.js';
|
||||||
import _ol_geom_Point_ from '../../../../src/ol/geom/Point.js';
|
import Point from '../../../../src/ol/geom/Point.js';
|
||||||
import _ol_geom_MultiPoint_ from '../../../../src/ol/geom/MultiPoint.js';
|
import _ol_geom_MultiPoint_ from '../../../../src/ol/geom/MultiPoint.js';
|
||||||
import _ol_Map_ from '../../../../src/ol/Map.js';
|
import _ol_Map_ from '../../../../src/ol/Map.js';
|
||||||
import _ol_View_ from '../../../../src/ol/View.js';
|
import _ol_View_ from '../../../../src/ol/View.js';
|
||||||
@@ -46,7 +46,7 @@ describe('ol.rendering.style.Circle', function() {
|
|||||||
function createFeatures(multi) {
|
function createFeatures(multi) {
|
||||||
var feature;
|
var feature;
|
||||||
feature = new _ol_Feature_({
|
feature = new _ol_Feature_({
|
||||||
geometry: multi ? new _ol_geom_MultiPoint_([[-20, 18]]) : new _ol_geom_Point_([-20, 18])
|
geometry: multi ? new _ol_geom_MultiPoint_([[-20, 18]]) : new Point([-20, 18])
|
||||||
});
|
});
|
||||||
feature.setStyle(new _ol_style_Style_({
|
feature.setStyle(new _ol_style_Style_({
|
||||||
image: new _ol_style_Circle_({
|
image: new _ol_style_Circle_({
|
||||||
@@ -59,7 +59,7 @@ describe('ol.rendering.style.Circle', function() {
|
|||||||
vectorSource.addFeature(feature);
|
vectorSource.addFeature(feature);
|
||||||
|
|
||||||
feature = new _ol_Feature_({
|
feature = new _ol_Feature_({
|
||||||
geometry: multi ? new _ol_geom_MultiPoint_([[-10, 18]]) : new _ol_geom_Point_([-10, 18])
|
geometry: multi ? new _ol_geom_MultiPoint_([[-10, 18]]) : new Point([-10, 18])
|
||||||
});
|
});
|
||||||
feature.setStyle(new _ol_style_Style_({
|
feature.setStyle(new _ol_style_Style_({
|
||||||
image: new _ol_style_Circle_({
|
image: new _ol_style_Circle_({
|
||||||
@@ -72,7 +72,7 @@ describe('ol.rendering.style.Circle', function() {
|
|||||||
vectorSource.addFeature(feature);
|
vectorSource.addFeature(feature);
|
||||||
|
|
||||||
feature = new _ol_Feature_({
|
feature = new _ol_Feature_({
|
||||||
geometry: multi ? new _ol_geom_MultiPoint_([[4, 18]]) : new _ol_geom_Point_([4, 18])
|
geometry: multi ? new _ol_geom_MultiPoint_([[4, 18]]) : new Point([4, 18])
|
||||||
});
|
});
|
||||||
feature.setStyle(new _ol_style_Style_({
|
feature.setStyle(new _ol_style_Style_({
|
||||||
image: new _ol_style_Circle_({
|
image: new _ol_style_Circle_({
|
||||||
@@ -85,7 +85,7 @@ describe('ol.rendering.style.Circle', function() {
|
|||||||
vectorSource.addFeature(feature);
|
vectorSource.addFeature(feature);
|
||||||
|
|
||||||
feature = new _ol_Feature_({
|
feature = new _ol_Feature_({
|
||||||
geometry: multi ? new _ol_geom_MultiPoint_([[-20, 3]]) : new _ol_geom_Point_([-20, 3])
|
geometry: multi ? new _ol_geom_MultiPoint_([[-20, 3]]) : new Point([-20, 3])
|
||||||
});
|
});
|
||||||
feature.setStyle(new _ol_style_Style_({
|
feature.setStyle(new _ol_style_Style_({
|
||||||
image: new _ol_style_Circle_({
|
image: new _ol_style_Circle_({
|
||||||
@@ -102,7 +102,7 @@ describe('ol.rendering.style.Circle', function() {
|
|||||||
vectorSource.addFeature(feature);
|
vectorSource.addFeature(feature);
|
||||||
|
|
||||||
feature = new _ol_Feature_({
|
feature = new _ol_Feature_({
|
||||||
geometry: multi ? new _ol_geom_MultiPoint_([[-10, 3]]) : new _ol_geom_Point_([-10, 3])
|
geometry: multi ? new _ol_geom_MultiPoint_([[-10, 3]]) : new Point([-10, 3])
|
||||||
});
|
});
|
||||||
feature.setStyle(new _ol_style_Style_({
|
feature.setStyle(new _ol_style_Style_({
|
||||||
image: new _ol_style_Circle_({
|
image: new _ol_style_Circle_({
|
||||||
@@ -119,7 +119,7 @@ describe('ol.rendering.style.Circle', function() {
|
|||||||
vectorSource.addFeature(feature);
|
vectorSource.addFeature(feature);
|
||||||
|
|
||||||
feature = new _ol_Feature_({
|
feature = new _ol_Feature_({
|
||||||
geometry: multi ? new _ol_geom_MultiPoint_([[4, 3]]) : new _ol_geom_Point_([4, 3])
|
geometry: multi ? new _ol_geom_MultiPoint_([[4, 3]]) : new Point([4, 3])
|
||||||
});
|
});
|
||||||
feature.setStyle(new _ol_style_Style_({
|
feature.setStyle(new _ol_style_Style_({
|
||||||
image: new _ol_style_Circle_({
|
image: new _ol_style_Circle_({
|
||||||
@@ -136,7 +136,7 @@ describe('ol.rendering.style.Circle', function() {
|
|||||||
vectorSource.addFeature(feature);
|
vectorSource.addFeature(feature);
|
||||||
|
|
||||||
feature = new _ol_Feature_({
|
feature = new _ol_Feature_({
|
||||||
geometry: multi ? new _ol_geom_MultiPoint_([[-20, -15]]) : new _ol_geom_Point_([-20, -15])
|
geometry: multi ? new _ol_geom_MultiPoint_([[-20, -15]]) : new Point([-20, -15])
|
||||||
});
|
});
|
||||||
feature.setStyle(new _ol_style_Style_({
|
feature.setStyle(new _ol_style_Style_({
|
||||||
image: new _ol_style_Circle_({
|
image: new _ol_style_Circle_({
|
||||||
@@ -150,7 +150,7 @@ describe('ol.rendering.style.Circle', function() {
|
|||||||
vectorSource.addFeature(feature);
|
vectorSource.addFeature(feature);
|
||||||
|
|
||||||
feature = new _ol_Feature_({
|
feature = new _ol_Feature_({
|
||||||
geometry: multi ? new _ol_geom_MultiPoint_([[-10, -15]]) : new _ol_geom_Point_([-10, -15])
|
geometry: multi ? new _ol_geom_MultiPoint_([[-10, -15]]) : new Point([-10, -15])
|
||||||
});
|
});
|
||||||
feature.setStyle(new _ol_style_Style_({
|
feature.setStyle(new _ol_style_Style_({
|
||||||
image: new _ol_style_Circle_({
|
image: new _ol_style_Circle_({
|
||||||
@@ -167,7 +167,7 @@ describe('ol.rendering.style.Circle', function() {
|
|||||||
vectorSource.addFeature(feature);
|
vectorSource.addFeature(feature);
|
||||||
|
|
||||||
feature = new _ol_Feature_({
|
feature = new _ol_Feature_({
|
||||||
geometry: multi ? new _ol_geom_MultiPoint_([[4, -15]]) : new _ol_geom_Point_([4, -15])
|
geometry: multi ? new _ol_geom_MultiPoint_([[4, -15]]) : new Point([4, -15])
|
||||||
});
|
});
|
||||||
feature.setStyle(new _ol_style_Style_({
|
feature.setStyle(new _ol_style_Style_({
|
||||||
image: new _ol_style_Circle_({
|
image: new _ol_style_Circle_({
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import _ol_Feature_ from '../../../../src/ol/Feature.js';
|
import _ol_Feature_ from '../../../../src/ol/Feature.js';
|
||||||
import _ol_geom_Point_ from '../../../../src/ol/geom/Point.js';
|
import Point from '../../../../src/ol/geom/Point.js';
|
||||||
import _ol_Map_ from '../../../../src/ol/Map.js';
|
import _ol_Map_ from '../../../../src/ol/Map.js';
|
||||||
import _ol_View_ from '../../../../src/ol/View.js';
|
import _ol_View_ from '../../../../src/ol/View.js';
|
||||||
import _ol_layer_Vector_ from '../../../../src/ol/layer/Vector.js';
|
import _ol_layer_Vector_ from '../../../../src/ol/layer/Vector.js';
|
||||||
@@ -52,7 +52,7 @@ describe('ol.rendering.style.Icon', function() {
|
|||||||
function createFeatures(src, imgInfo, callback) {
|
function createFeatures(src, imgInfo, callback) {
|
||||||
var feature;
|
var feature;
|
||||||
feature = new _ol_Feature_({
|
feature = new _ol_Feature_({
|
||||||
geometry: new _ol_geom_Point_([0, 0])
|
geometry: new Point([0, 0])
|
||||||
});
|
});
|
||||||
|
|
||||||
var img = new Image();
|
var img = new Image();
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import _ol_Feature_ from '../../../../src/ol/Feature.js';
|
import _ol_Feature_ from '../../../../src/ol/Feature.js';
|
||||||
import _ol_geom_Point_ from '../../../../src/ol/geom/Point.js';
|
import Point from '../../../../src/ol/geom/Point.js';
|
||||||
import _ol_Map_ from '../../../../src/ol/Map.js';
|
import _ol_Map_ from '../../../../src/ol/Map.js';
|
||||||
import _ol_View_ from '../../../../src/ol/View.js';
|
import _ol_View_ from '../../../../src/ol/View.js';
|
||||||
import _ol_layer_Vector_ from '../../../../src/ol/layer/Vector.js';
|
import _ol_layer_Vector_ from '../../../../src/ol/layer/Vector.js';
|
||||||
@@ -43,7 +43,7 @@ describe('ol.rendering.style.RegularShape', function() {
|
|||||||
function createFeatures(stroke, fill) {
|
function createFeatures(stroke, fill) {
|
||||||
var feature;
|
var feature;
|
||||||
feature = new _ol_Feature_({
|
feature = new _ol_Feature_({
|
||||||
geometry: new _ol_geom_Point_([-15, 15])
|
geometry: new Point([-15, 15])
|
||||||
});
|
});
|
||||||
// square
|
// square
|
||||||
feature.setStyle(new _ol_style_Style_({
|
feature.setStyle(new _ol_style_Style_({
|
||||||
@@ -58,7 +58,7 @@ describe('ol.rendering.style.RegularShape', function() {
|
|||||||
vectorSource.addFeature(feature);
|
vectorSource.addFeature(feature);
|
||||||
|
|
||||||
feature = new _ol_Feature_({
|
feature = new _ol_Feature_({
|
||||||
geometry: new _ol_geom_Point_([8, 15])
|
geometry: new Point([8, 15])
|
||||||
});
|
});
|
||||||
// triangle
|
// triangle
|
||||||
feature.setStyle(new _ol_style_Style_({
|
feature.setStyle(new _ol_style_Style_({
|
||||||
@@ -74,7 +74,7 @@ describe('ol.rendering.style.RegularShape', function() {
|
|||||||
vectorSource.addFeature(feature);
|
vectorSource.addFeature(feature);
|
||||||
|
|
||||||
feature = new _ol_Feature_({
|
feature = new _ol_Feature_({
|
||||||
geometry: new _ol_geom_Point_([-10, -8])
|
geometry: new Point([-10, -8])
|
||||||
});
|
});
|
||||||
// star
|
// star
|
||||||
feature.setStyle(new _ol_style_Style_({
|
feature.setStyle(new _ol_style_Style_({
|
||||||
@@ -90,7 +90,7 @@ describe('ol.rendering.style.RegularShape', function() {
|
|||||||
vectorSource.addFeature(feature);
|
vectorSource.addFeature(feature);
|
||||||
|
|
||||||
feature = new _ol_Feature_({
|
feature = new _ol_Feature_({
|
||||||
geometry: new _ol_geom_Point_([12, -8])
|
geometry: new Point([12, -8])
|
||||||
});
|
});
|
||||||
// cross
|
// cross
|
||||||
feature.setStyle(new _ol_style_Style_({
|
feature.setStyle(new _ol_style_Style_({
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import _ol_Feature_ from '../../../../src/ol/Feature.js';
|
|||||||
import _ol_geom_LineString_ from '../../../../src/ol/geom/LineString.js';
|
import _ol_geom_LineString_ from '../../../../src/ol/geom/LineString.js';
|
||||||
import _ol_geom_MultiLineString_ from '../../../../src/ol/geom/MultiLineString.js';
|
import _ol_geom_MultiLineString_ from '../../../../src/ol/geom/MultiLineString.js';
|
||||||
import _ol_geom_MultiPolygon_ from '../../../../src/ol/geom/MultiPolygon.js';
|
import _ol_geom_MultiPolygon_ from '../../../../src/ol/geom/MultiPolygon.js';
|
||||||
import _ol_geom_Point_ from '../../../../src/ol/geom/Point.js';
|
import Point from '../../../../src/ol/geom/Point.js';
|
||||||
import _ol_geom_Polygon_ from '../../../../src/ol/geom/Polygon.js';
|
import _ol_geom_Polygon_ from '../../../../src/ol/geom/Polygon.js';
|
||||||
import _ol_Map_ from '../../../../src/ol/Map.js';
|
import _ol_Map_ from '../../../../src/ol/Map.js';
|
||||||
import _ol_View_ from '../../../../src/ol/View.js';
|
import _ol_View_ from '../../../../src/ol/View.js';
|
||||||
@@ -50,7 +50,7 @@ describe('ol.rendering.style.Text', function() {
|
|||||||
var scale = opt_scale || 1;
|
var scale = opt_scale || 1;
|
||||||
var feature;
|
var feature;
|
||||||
feature = new _ol_Feature_({
|
feature = new _ol_Feature_({
|
||||||
geometry: new _ol_geom_Point_([-20, 18])
|
geometry: new Point([-20, 18])
|
||||||
});
|
});
|
||||||
feature.setStyle(new _ol_style_Style_({
|
feature.setStyle(new _ol_style_Style_({
|
||||||
text: new _ol_style_Text_({
|
text: new _ol_style_Text_({
|
||||||
@@ -62,7 +62,7 @@ describe('ol.rendering.style.Text', function() {
|
|||||||
vectorSource.addFeature(feature);
|
vectorSource.addFeature(feature);
|
||||||
|
|
||||||
feature = new _ol_Feature_({
|
feature = new _ol_Feature_({
|
||||||
geometry: new _ol_geom_Point_([-10, 0])
|
geometry: new Point([-10, 0])
|
||||||
});
|
});
|
||||||
feature.setStyle(new _ol_style_Style_({
|
feature.setStyle(new _ol_style_Style_({
|
||||||
text: new _ol_style_Text_({
|
text: new _ol_style_Text_({
|
||||||
@@ -81,7 +81,7 @@ describe('ol.rendering.style.Text', function() {
|
|||||||
vectorSource.addFeature(feature);
|
vectorSource.addFeature(feature);
|
||||||
|
|
||||||
feature = new _ol_Feature_({
|
feature = new _ol_Feature_({
|
||||||
geometry: new _ol_geom_Point_([20, 10])
|
geometry: new Point([20, 10])
|
||||||
});
|
});
|
||||||
feature.setStyle(new _ol_style_Style_({
|
feature.setStyle(new _ol_style_Style_({
|
||||||
text: new _ol_style_Text_({
|
text: new _ol_style_Text_({
|
||||||
@@ -175,7 +175,7 @@ describe('ol.rendering.style.Text', function() {
|
|||||||
it('renders multiline text with alignment options', function(done) {
|
it('renders multiline text with alignment options', function(done) {
|
||||||
createMap('canvas');
|
createMap('canvas');
|
||||||
var feature;
|
var feature;
|
||||||
feature = new _ol_Feature_(new _ol_geom_Point_([25, 0]));
|
feature = new _ol_Feature_(new Point([25, 0]));
|
||||||
feature.setStyle(new _ol_style_Style_({
|
feature.setStyle(new _ol_style_Style_({
|
||||||
text: new _ol_style_Text_({
|
text: new _ol_style_Text_({
|
||||||
text: 'Hello world\nleft',
|
text: 'Hello world\nleft',
|
||||||
@@ -184,7 +184,7 @@ describe('ol.rendering.style.Text', function() {
|
|||||||
})
|
})
|
||||||
}));
|
}));
|
||||||
vectorSource.addFeature(feature);
|
vectorSource.addFeature(feature);
|
||||||
feature = new _ol_Feature_(new _ol_geom_Point_([-25, 0]));
|
feature = new _ol_Feature_(new Point([-25, 0]));
|
||||||
feature.setStyle(new _ol_style_Style_({
|
feature.setStyle(new _ol_style_Style_({
|
||||||
text: new _ol_style_Text_({
|
text: new _ol_style_Text_({
|
||||||
text: 'Hello world\nright',
|
text: 'Hello world\nright',
|
||||||
@@ -193,7 +193,7 @@ describe('ol.rendering.style.Text', function() {
|
|||||||
})
|
})
|
||||||
}));
|
}));
|
||||||
vectorSource.addFeature(feature);
|
vectorSource.addFeature(feature);
|
||||||
feature = new _ol_Feature_(new _ol_geom_Point_([0, 25]));
|
feature = new _ol_Feature_(new Point([0, 25]));
|
||||||
feature.setStyle(new _ol_style_Style_({
|
feature.setStyle(new _ol_style_Style_({
|
||||||
text: new _ol_style_Text_({
|
text: new _ol_style_Text_({
|
||||||
text: 'Hello world\nbottom',
|
text: 'Hello world\nbottom',
|
||||||
@@ -202,7 +202,7 @@ describe('ol.rendering.style.Text', function() {
|
|||||||
})
|
})
|
||||||
}));
|
}));
|
||||||
vectorSource.addFeature(feature);
|
vectorSource.addFeature(feature);
|
||||||
feature = new _ol_Feature_(new _ol_geom_Point_([0, -25]));
|
feature = new _ol_Feature_(new Point([0, -25]));
|
||||||
feature.setStyle(new _ol_style_Style_({
|
feature.setStyle(new _ol_style_Style_({
|
||||||
text: new _ol_style_Text_({
|
text: new _ol_style_Text_({
|
||||||
text: 'top\nHello world',
|
text: 'top\nHello world',
|
||||||
@@ -217,7 +217,7 @@ describe('ol.rendering.style.Text', function() {
|
|||||||
it('renders multiline text with positioning options', function(done) {
|
it('renders multiline text with positioning options', function(done) {
|
||||||
createMap('canvas');
|
createMap('canvas');
|
||||||
var feature;
|
var feature;
|
||||||
feature = new _ol_Feature_(new _ol_geom_Point_([0, 0]));
|
feature = new _ol_Feature_(new Point([0, 0]));
|
||||||
feature.setStyle(new _ol_style_Style_({
|
feature.setStyle(new _ol_style_Style_({
|
||||||
text: new _ol_style_Text_({
|
text: new _ol_style_Text_({
|
||||||
text: 'Hello world\nleft',
|
text: 'Hello world\nleft',
|
||||||
@@ -227,7 +227,7 @@ describe('ol.rendering.style.Text', function() {
|
|||||||
})
|
})
|
||||||
}));
|
}));
|
||||||
vectorSource.addFeature(feature);
|
vectorSource.addFeature(feature);
|
||||||
feature = new _ol_Feature_(new _ol_geom_Point_([0, 0]));
|
feature = new _ol_Feature_(new Point([0, 0]));
|
||||||
feature.setStyle(new _ol_style_Style_({
|
feature.setStyle(new _ol_style_Style_({
|
||||||
text: new _ol_style_Text_({
|
text: new _ol_style_Text_({
|
||||||
text: 'Hello world\nright',
|
text: 'Hello world\nright',
|
||||||
@@ -237,7 +237,7 @@ describe('ol.rendering.style.Text', function() {
|
|||||||
})
|
})
|
||||||
}));
|
}));
|
||||||
vectorSource.addFeature(feature);
|
vectorSource.addFeature(feature);
|
||||||
feature = new _ol_Feature_(new _ol_geom_Point_([0, 0]));
|
feature = new _ol_Feature_(new Point([0, 0]));
|
||||||
feature.setStyle(new _ol_style_Style_({
|
feature.setStyle(new _ol_style_Style_({
|
||||||
text: new _ol_style_Text_({
|
text: new _ol_style_Text_({
|
||||||
text: 'Hello world\nbottom',
|
text: 'Hello world\nbottom',
|
||||||
@@ -247,7 +247,7 @@ describe('ol.rendering.style.Text', function() {
|
|||||||
})
|
})
|
||||||
}));
|
}));
|
||||||
vectorSource.addFeature(feature);
|
vectorSource.addFeature(feature);
|
||||||
feature = new _ol_Feature_(new _ol_geom_Point_([0, 0]));
|
feature = new _ol_Feature_(new Point([0, 0]));
|
||||||
feature.setStyle(new _ol_style_Style_({
|
feature.setStyle(new _ol_style_Style_({
|
||||||
text: new _ol_style_Text_({
|
text: new _ol_style_Text_({
|
||||||
text: 'top\nHello world',
|
text: 'top\nHello world',
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import _ol_Feature_ from '../../../src/ol/Feature.js';
|
import _ol_Feature_ from '../../../src/ol/Feature.js';
|
||||||
import _ol_geom_Point_ from '../../../src/ol/geom/Point.js';
|
import Point from '../../../src/ol/geom/Point.js';
|
||||||
import _ol_obj_ from '../../../src/ol/obj.js';
|
import _ol_obj_ from '../../../src/ol/obj.js';
|
||||||
import _ol_style_Style_ from '../../../src/ol/style/Style.js';
|
import _ol_style_Style_ from '../../../src/ol/style/Style.js';
|
||||||
|
|
||||||
@@ -28,11 +28,11 @@ describe('ol.Feature', function() {
|
|||||||
|
|
||||||
it('will set the default geometry', function() {
|
it('will set the default geometry', function() {
|
||||||
var feature = new _ol_Feature_({
|
var feature = new _ol_Feature_({
|
||||||
geometry: new _ol_geom_Point_([10, 20]),
|
geometry: new Point([10, 20]),
|
||||||
foo: 'bar'
|
foo: 'bar'
|
||||||
});
|
});
|
||||||
var geometry = feature.getGeometry();
|
var geometry = feature.getGeometry();
|
||||||
expect(geometry).to.be.a(_ol_geom_Point_);
|
expect(geometry).to.be.a(Point);
|
||||||
expect(feature.get('geometry')).to.be(geometry);
|
expect(feature.get('geometry')).to.be(geometry);
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -65,7 +65,7 @@ describe('ol.Feature', function() {
|
|||||||
describe('#getProperties()', function() {
|
describe('#getProperties()', function() {
|
||||||
|
|
||||||
it('returns an object with all attributes', function() {
|
it('returns an object with all attributes', function() {
|
||||||
var point = new _ol_geom_Point_([15, 30]);
|
var point = new Point([15, 30]);
|
||||||
var feature = new _ol_Feature_({
|
var feature = new _ol_Feature_({
|
||||||
foo: 'bar',
|
foo: 'bar',
|
||||||
ten: 10,
|
ten: 10,
|
||||||
@@ -93,7 +93,7 @@ describe('ol.Feature', function() {
|
|||||||
|
|
||||||
describe('#getGeometry()', function() {
|
describe('#getGeometry()', function() {
|
||||||
|
|
||||||
var point = new _ol_geom_Point_([15, 30]);
|
var point = new Point([15, 30]);
|
||||||
|
|
||||||
it('returns undefined for unset geometry', function() {
|
it('returns undefined for unset geometry', function() {
|
||||||
var feature = new _ol_Feature_();
|
var feature = new _ol_Feature_();
|
||||||
@@ -123,7 +123,7 @@ describe('ol.Feature', function() {
|
|||||||
feature.setGeometry(point);
|
feature.setGeometry(point);
|
||||||
expect(feature.getGeometry()).to.be(point);
|
expect(feature.getGeometry()).to.be(point);
|
||||||
|
|
||||||
var point2 = new _ol_geom_Point_([1, 2]);
|
var point2 = new Point([1, 2]);
|
||||||
feature.setGeometry(point2);
|
feature.setGeometry(point2);
|
||||||
expect(feature.getGeometry()).to.be(point2);
|
expect(feature.getGeometry()).to.be(point2);
|
||||||
});
|
});
|
||||||
@@ -142,9 +142,9 @@ describe('ol.Feature', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('can be used to set the geometry', function() {
|
it('can be used to set the geometry', function() {
|
||||||
var point = new _ol_geom_Point_([3, 4]);
|
var point = new Point([3, 4]);
|
||||||
var feature = new _ol_Feature_({
|
var feature = new _ol_Feature_({
|
||||||
geometry: new _ol_geom_Point_([1, 2])
|
geometry: new Point([1, 2])
|
||||||
});
|
});
|
||||||
feature.set('geometry', point);
|
feature.set('geometry', point);
|
||||||
expect(feature.get('geometry')).to.be(point);
|
expect(feature.get('geometry')).to.be(point);
|
||||||
@@ -162,8 +162,8 @@ describe('ol.Feature', function() {
|
|||||||
feature.set('getGeometry', 'x');
|
feature.set('getGeometry', 'x');
|
||||||
expect(feature.get('getGeometry')).to.be('x');
|
expect(feature.get('getGeometry')).to.be('x');
|
||||||
|
|
||||||
feature.set('geometry', new _ol_geom_Point_([1, 2]));
|
feature.set('geometry', new Point([1, 2]));
|
||||||
expect(feature.getGeometry()).to.be.a(_ol_geom_Point_);
|
expect(feature.getGeometry()).to.be.a(Point);
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -171,7 +171,7 @@ describe('ol.Feature', function() {
|
|||||||
|
|
||||||
describe('#setGeometry()', function() {
|
describe('#setGeometry()', function() {
|
||||||
|
|
||||||
var point = new _ol_geom_Point_([15, 30]);
|
var point = new Point([15, 30]);
|
||||||
|
|
||||||
it('sets the default geometry', function() {
|
it('sets the default geometry', function() {
|
||||||
var feature = new _ol_Feature_();
|
var feature = new _ol_Feature_();
|
||||||
@@ -185,7 +185,7 @@ describe('ol.Feature', function() {
|
|||||||
});
|
});
|
||||||
expect(feature.getGeometry()).to.be(point);
|
expect(feature.getGeometry()).to.be(point);
|
||||||
|
|
||||||
var point2 = new _ol_geom_Point_([1, 2]);
|
var point2 = new Point([1, 2]);
|
||||||
feature.setGeometry(point2);
|
feature.setGeometry(point2);
|
||||||
expect(feature.getGeometry()).to.be(point2);
|
expect(feature.getGeometry()).to.be(point2);
|
||||||
});
|
});
|
||||||
@@ -194,14 +194,14 @@ describe('ol.Feature', function() {
|
|||||||
|
|
||||||
describe('#setGeometryName()', function() {
|
describe('#setGeometryName()', function() {
|
||||||
|
|
||||||
var point = new _ol_geom_Point_([15, 30]);
|
var point = new Point([15, 30]);
|
||||||
|
|
||||||
it('sets property where to to look at geometry', function() {
|
it('sets property where to to look at geometry', function() {
|
||||||
var feature = new _ol_Feature_();
|
var feature = new _ol_Feature_();
|
||||||
feature.setGeometry(point);
|
feature.setGeometry(point);
|
||||||
expect(feature.getGeometry()).to.be(point);
|
expect(feature.getGeometry()).to.be(point);
|
||||||
|
|
||||||
var point2 = new _ol_geom_Point_([1, 2]);
|
var point2 = new Point([1, 2]);
|
||||||
feature.set('altGeometry', point2);
|
feature.set('altGeometry', point2);
|
||||||
expect(feature.getGeometry()).to.be(point);
|
expect(feature.getGeometry()).to.be(point);
|
||||||
feature.setGeometryName('altGeometry');
|
feature.setGeometryName('altGeometry');
|
||||||
@@ -216,7 +216,7 @@ describe('ol.Feature', function() {
|
|||||||
it('changes property listener', function() {
|
it('changes property listener', function() {
|
||||||
var feature = new _ol_Feature_();
|
var feature = new _ol_Feature_();
|
||||||
feature.setGeometry(point);
|
feature.setGeometry(point);
|
||||||
var point2 = new _ol_geom_Point_([1, 2]);
|
var point2 = new Point([1, 2]);
|
||||||
feature.set('altGeometry', point2);
|
feature.set('altGeometry', point2);
|
||||||
feature.setGeometryName('altGeometry');
|
feature.setGeometryName('altGeometry');
|
||||||
|
|
||||||
@@ -229,7 +229,7 @@ describe('ol.Feature', function() {
|
|||||||
it('can use a different geometry name', function() {
|
it('can use a different geometry name', function() {
|
||||||
var feature = new _ol_Feature_();
|
var feature = new _ol_Feature_();
|
||||||
feature.setGeometryName('foo');
|
feature.setGeometryName('foo');
|
||||||
var point = new _ol_geom_Point_([10, 20]);
|
var point = new Point([10, 20]);
|
||||||
feature.setGeometry(point);
|
feature.setGeometry(point);
|
||||||
expect(feature.getGeometry()).to.be(point);
|
expect(feature.getGeometry()).to.be(point);
|
||||||
});
|
});
|
||||||
@@ -401,7 +401,7 @@ describe('ol.Feature', function() {
|
|||||||
feature.setProperties({'fookey': 'fooval'});
|
feature.setProperties({'fookey': 'fooval'});
|
||||||
feature.setId(1);
|
feature.setId(1);
|
||||||
feature.setGeometryName('geom');
|
feature.setGeometryName('geom');
|
||||||
var geometry = new _ol_geom_Point_([1, 2]);
|
var geometry = new Point([1, 2]);
|
||||||
feature.setGeometry(geometry);
|
feature.setGeometry(geometry);
|
||||||
var style = new _ol_style_Style_({});
|
var style = new _ol_style_Style_({});
|
||||||
feature.setStyle(style);
|
feature.setStyle(style);
|
||||||
@@ -436,7 +436,7 @@ describe('ol.Feature', function() {
|
|||||||
it('dispatches a change event when geometry is set to null',
|
it('dispatches a change event when geometry is set to null',
|
||||||
function() {
|
function() {
|
||||||
var feature = new _ol_Feature_({
|
var feature = new _ol_Feature_({
|
||||||
geometry: new _ol_geom_Point_([0, 0])
|
geometry: new Point([0, 0])
|
||||||
});
|
});
|
||||||
var spy = sinon.spy();
|
var spy = sinon.spy();
|
||||||
feature.on('change', spy);
|
feature.on('change', spy);
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import _ol_geom_LinearRing_ from '../../../../src/ol/geom/LinearRing.js';
|
|||||||
import _ol_geom_MultiLineString_ from '../../../../src/ol/geom/MultiLineString.js';
|
import _ol_geom_MultiLineString_ from '../../../../src/ol/geom/MultiLineString.js';
|
||||||
import _ol_geom_MultiPoint_ from '../../../../src/ol/geom/MultiPoint.js';
|
import _ol_geom_MultiPoint_ from '../../../../src/ol/geom/MultiPoint.js';
|
||||||
import _ol_geom_MultiPolygon_ from '../../../../src/ol/geom/MultiPolygon.js';
|
import _ol_geom_MultiPolygon_ from '../../../../src/ol/geom/MultiPolygon.js';
|
||||||
import _ol_geom_Point_ from '../../../../src/ol/geom/Point.js';
|
import Point from '../../../../src/ol/geom/Point.js';
|
||||||
import _ol_geom_Polygon_ from '../../../../src/ol/geom/Polygon.js';
|
import _ol_geom_Polygon_ from '../../../../src/ol/geom/Polygon.js';
|
||||||
import {get as getProjection, transform} from '../../../../src/ol/proj.js';
|
import {get as getProjection, transform} from '../../../../src/ol/proj.js';
|
||||||
|
|
||||||
@@ -163,7 +163,7 @@ describe('ol.format.EsriJSON', function() {
|
|||||||
var feature = format.readFeature(pointEsriJSON);
|
var feature = format.readFeature(pointEsriJSON);
|
||||||
expect(feature).to.be.an(_ol_Feature_);
|
expect(feature).to.be.an(_ol_Feature_);
|
||||||
var geometry = feature.getGeometry();
|
var geometry = feature.getGeometry();
|
||||||
expect(geometry).to.be.an(_ol_geom_Point_);
|
expect(geometry).to.be.an(Point);
|
||||||
expect(geometry.getCoordinates()).to.eql([102.0, 0.5]);
|
expect(geometry.getCoordinates()).to.eql([102.0, 0.5]);
|
||||||
expect(feature.get('prop0')).to.be('value0');
|
expect(feature.get('prop0')).to.be('value0');
|
||||||
});
|
});
|
||||||
@@ -227,7 +227,7 @@ describe('ol.format.EsriJSON', function() {
|
|||||||
it('can read a feature collection', function() {
|
it('can read a feature collection', function() {
|
||||||
var features = format.readFeatures(featureCollectionEsriJSON);
|
var features = format.readFeatures(featureCollectionEsriJSON);
|
||||||
expect(features).to.have.length(3);
|
expect(features).to.have.length(3);
|
||||||
expect(features[0].getGeometry()).to.be.an(_ol_geom_Point_);
|
expect(features[0].getGeometry()).to.be.an(Point);
|
||||||
expect(features[1].getGeometry()).to.be.an(_ol_geom_LineString_);
|
expect(features[1].getGeometry()).to.be.an(_ol_geom_LineString_);
|
||||||
expect(features[2].getGeometry()).to.be.an(_ol_geom_Polygon_);
|
expect(features[2].getGeometry()).to.be.an(_ol_geom_Polygon_);
|
||||||
});
|
});
|
||||||
@@ -237,7 +237,7 @@ describe('ol.format.EsriJSON', function() {
|
|||||||
featureProjection: 'EPSG:3857',
|
featureProjection: 'EPSG:3857',
|
||||||
dataProjection: 'EPSG:4326'
|
dataProjection: 'EPSG:4326'
|
||||||
});
|
});
|
||||||
expect(feature[0].getGeometry()).to.be.an(_ol_geom_Point_);
|
expect(feature[0].getGeometry()).to.be.an(Point);
|
||||||
expect(feature[0].getGeometry().getCoordinates()).to.eql(
|
expect(feature[0].getGeometry().getCoordinates()).to.eql(
|
||||||
transform([102.0, 0.5], 'EPSG:4326', 'EPSG:3857'));
|
transform([102.0, 0.5], 'EPSG:4326', 'EPSG:3857'));
|
||||||
});
|
});
|
||||||
@@ -247,7 +247,7 @@ describe('ol.format.EsriJSON', function() {
|
|||||||
featureProjection: 'EPSG:3857',
|
featureProjection: 'EPSG:3857',
|
||||||
dataProjection: 'EPSG:4326'
|
dataProjection: 'EPSG:4326'
|
||||||
});
|
});
|
||||||
expect(features[0].getGeometry()).to.be.an(_ol_geom_Point_);
|
expect(features[0].getGeometry()).to.be.an(Point);
|
||||||
expect(features[0].getGeometry().getCoordinates()).to.eql(
|
expect(features[0].getGeometry().getCoordinates()).to.eql(
|
||||||
transform([102.0, 0.5], 'EPSG:4326', 'EPSG:3857'));
|
transform([102.0, 0.5], 'EPSG:4326', 'EPSG:3857'));
|
||||||
expect(features[1].getGeometry().getCoordinates()).to.eql([
|
expect(features[1].getGeometry().getCoordinates()).to.eql([
|
||||||
@@ -268,7 +268,7 @@ describe('ol.format.EsriJSON', function() {
|
|||||||
var feature = new _ol_format_EsriJSON_({geometryName: 'the_geom'}).
|
var feature = new _ol_format_EsriJSON_({geometryName: 'the_geom'}).
|
||||||
readFeature(pointEsriJSON);
|
readFeature(pointEsriJSON);
|
||||||
expect(feature.getGeometryName()).to.be('the_geom');
|
expect(feature.getGeometryName()).to.be('the_geom');
|
||||||
expect(feature.getGeometry()).to.be.an(_ol_geom_Point_);
|
expect(feature.getGeometry()).to.be.an(Point);
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
@@ -336,7 +336,7 @@ describe('ol.format.EsriJSON', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
var obj = format.readGeometry(str);
|
var obj = format.readGeometry(str);
|
||||||
expect(obj).to.be.a(_ol_geom_Point_);
|
expect(obj).to.be.a(Point);
|
||||||
expect(obj.getCoordinates()).to.eql([10, 20]);
|
expect(obj.getCoordinates()).to.eql([10, 20]);
|
||||||
expect(obj.getLayout()).to.eql('XY');
|
expect(obj.getLayout()).to.eql('XY');
|
||||||
});
|
});
|
||||||
@@ -349,7 +349,7 @@ describe('ol.format.EsriJSON', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
var obj = format.readGeometry(str);
|
var obj = format.readGeometry(str);
|
||||||
expect(obj).to.be.a(_ol_geom_Point_);
|
expect(obj).to.be.a(Point);
|
||||||
expect(obj.getCoordinates()).to.eql([10, 20, 10]);
|
expect(obj.getCoordinates()).to.eql([10, 20, 10]);
|
||||||
expect(obj.getLayout()).to.eql('XYZ');
|
expect(obj.getLayout()).to.eql('XYZ');
|
||||||
});
|
});
|
||||||
@@ -362,7 +362,7 @@ describe('ol.format.EsriJSON', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
var obj = format.readGeometry(str);
|
var obj = format.readGeometry(str);
|
||||||
expect(obj).to.be.a(_ol_geom_Point_);
|
expect(obj).to.be.a(Point);
|
||||||
expect(obj.getCoordinates()).to.eql([10, 20, 10]);
|
expect(obj.getCoordinates()).to.eql([10, 20, 10]);
|
||||||
expect(obj.getLayout()).to.eql('XYM');
|
expect(obj.getLayout()).to.eql('XYM');
|
||||||
});
|
});
|
||||||
@@ -376,7 +376,7 @@ describe('ol.format.EsriJSON', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
var obj = format.readGeometry(str);
|
var obj = format.readGeometry(str);
|
||||||
expect(obj).to.be.a(_ol_geom_Point_);
|
expect(obj).to.be.a(Point);
|
||||||
expect(obj.getCoordinates()).to.eql([10, 20, 0, 10]);
|
expect(obj.getCoordinates()).to.eql([10, 20, 0, 10]);
|
||||||
expect(obj.getLayout()).to.eql('XYZM');
|
expect(obj.getLayout()).to.eql('XYZM');
|
||||||
});
|
});
|
||||||
@@ -746,7 +746,7 @@ describe('ol.format.EsriJSON', function() {
|
|||||||
var first = features[0];
|
var first = features[0];
|
||||||
expect(first).to.be.a(_ol_Feature_);
|
expect(first).to.be.a(_ol_Feature_);
|
||||||
expect(first.get('foo')).to.be('bar');
|
expect(first.get('foo')).to.be('bar');
|
||||||
expect(first.getGeometry()).to.be.a(_ol_geom_Point_);
|
expect(first.getGeometry()).to.be.a(Point);
|
||||||
|
|
||||||
var second = features[1];
|
var second = features[1];
|
||||||
expect(second).to.be.a(_ol_Feature_);
|
expect(second).to.be.a(_ol_Feature_);
|
||||||
@@ -762,28 +762,28 @@ describe('ol.format.EsriJSON', function() {
|
|||||||
describe('#writeGeometry', function() {
|
describe('#writeGeometry', function() {
|
||||||
|
|
||||||
it('encodes point', function() {
|
it('encodes point', function() {
|
||||||
var point = new _ol_geom_Point_([10, 20]);
|
var point = new Point([10, 20]);
|
||||||
var esrijson = format.writeGeometry(point);
|
var esrijson = format.writeGeometry(point);
|
||||||
expect(point.getCoordinates()).to.eql(
|
expect(point.getCoordinates()).to.eql(
|
||||||
format.readGeometry(esrijson).getCoordinates());
|
format.readGeometry(esrijson).getCoordinates());
|
||||||
});
|
});
|
||||||
|
|
||||||
it('encodes XYZ point', function() {
|
it('encodes XYZ point', function() {
|
||||||
var point = new _ol_geom_Point_([10, 20, 0], 'XYZ');
|
var point = new Point([10, 20, 0], 'XYZ');
|
||||||
var esrijson = format.writeGeometry(point);
|
var esrijson = format.writeGeometry(point);
|
||||||
expect(point.getCoordinates()).to.eql(
|
expect(point.getCoordinates()).to.eql(
|
||||||
format.readGeometry(esrijson).getCoordinates());
|
format.readGeometry(esrijson).getCoordinates());
|
||||||
});
|
});
|
||||||
|
|
||||||
it('encodes XYM point', function() {
|
it('encodes XYM point', function() {
|
||||||
var point = new _ol_geom_Point_([10, 20, 0], 'XYM');
|
var point = new Point([10, 20, 0], 'XYM');
|
||||||
var esrijson = format.writeGeometry(point);
|
var esrijson = format.writeGeometry(point);
|
||||||
expect(point.getCoordinates()).to.eql(
|
expect(point.getCoordinates()).to.eql(
|
||||||
format.readGeometry(esrijson).getCoordinates());
|
format.readGeometry(esrijson).getCoordinates());
|
||||||
});
|
});
|
||||||
|
|
||||||
it('encodes XYZM point', function() {
|
it('encodes XYZM point', function() {
|
||||||
var point = new _ol_geom_Point_([10, 20, 5, 0],
|
var point = new Point([10, 20, 5, 0],
|
||||||
'XYZM');
|
'XYZM');
|
||||||
var esrijson = format.writeGeometry(point);
|
var esrijson = format.writeGeometry(point);
|
||||||
expect(point.getCoordinates()).to.eql(
|
expect(point.getCoordinates()).to.eql(
|
||||||
@@ -989,7 +989,7 @@ describe('ol.format.EsriJSON', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('transforms and encodes a point', function() {
|
it('transforms and encodes a point', function() {
|
||||||
var point = new _ol_geom_Point_([2, 3]);
|
var point = new Point([2, 3]);
|
||||||
var esrijson = format.writeGeometry(point, {
|
var esrijson = format.writeGeometry(point, {
|
||||||
dataProjection: 'EPSG:4326',
|
dataProjection: 'EPSG:4326',
|
||||||
featureProjection: 'EPSG:3857'
|
featureProjection: 'EPSG:3857'
|
||||||
@@ -1050,13 +1050,13 @@ describe('ol.format.EsriJSON', function() {
|
|||||||
function() {
|
function() {
|
||||||
var feature = new _ol_Feature_({'foo': 'bar'});
|
var feature = new _ol_Feature_({'foo': 'bar'});
|
||||||
feature.setGeometryName('mygeom');
|
feature.setGeometryName('mygeom');
|
||||||
feature.setGeometry(new _ol_geom_Point_([5, 10]));
|
feature.setGeometry(new Point([5, 10]));
|
||||||
var esrijson = format.writeFeaturesObject([feature]);
|
var esrijson = format.writeFeaturesObject([feature]);
|
||||||
expect(esrijson.features[0].attributes.mygeom).to.eql(undefined);
|
expect(esrijson.features[0].attributes.mygeom).to.eql(undefined);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('writes out a feature without properties correctly', function() {
|
it('writes out a feature without properties correctly', function() {
|
||||||
var feature = new _ol_Feature_(new _ol_geom_Point_([5, 10]));
|
var feature = new _ol_Feature_(new Point([5, 10]));
|
||||||
var esrijson = format.writeFeatureObject(feature);
|
var esrijson = format.writeFeatureObject(feature);
|
||||||
expect(esrijson.attributes).to.eql({});
|
expect(esrijson.attributes).to.eql({});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import _ol_geom_GeometryCollection_ from '../../../../src/ol/geom/GeometryCollec
|
|||||||
import _ol_geom_LineString_ from '../../../../src/ol/geom/LineString.js';
|
import _ol_geom_LineString_ from '../../../../src/ol/geom/LineString.js';
|
||||||
import _ol_geom_LinearRing_ from '../../../../src/ol/geom/LinearRing.js';
|
import _ol_geom_LinearRing_ from '../../../../src/ol/geom/LinearRing.js';
|
||||||
import _ol_geom_MultiPolygon_ from '../../../../src/ol/geom/MultiPolygon.js';
|
import _ol_geom_MultiPolygon_ from '../../../../src/ol/geom/MultiPolygon.js';
|
||||||
import _ol_geom_Point_ from '../../../../src/ol/geom/Point.js';
|
import Point from '../../../../src/ol/geom/Point.js';
|
||||||
import _ol_geom_Polygon_ from '../../../../src/ol/geom/Polygon.js';
|
import _ol_geom_Polygon_ from '../../../../src/ol/geom/Polygon.js';
|
||||||
import {fromLonLat, get as getProjection, toLonLat, transform} from '../../../../src/ol/proj.js';
|
import {fromLonLat, get as getProjection, toLonLat, transform} from '../../../../src/ol/proj.js';
|
||||||
|
|
||||||
@@ -147,7 +147,7 @@ describe('ol.format.GeoJSON', function() {
|
|||||||
var feature = format.readFeature(pointGeoJSON);
|
var feature = format.readFeature(pointGeoJSON);
|
||||||
expect(feature).to.be.an(_ol_Feature_);
|
expect(feature).to.be.an(_ol_Feature_);
|
||||||
var geometry = feature.getGeometry();
|
var geometry = feature.getGeometry();
|
||||||
expect(geometry).to.be.an(_ol_geom_Point_);
|
expect(geometry).to.be.an(Point);
|
||||||
expect(geometry.getCoordinates()).to.eql([102.0, 0.5]);
|
expect(geometry.getCoordinates()).to.eql([102.0, 0.5]);
|
||||||
expect(feature.get('prop0')).to.be('value0');
|
expect(feature.get('prop0')).to.be('value0');
|
||||||
});
|
});
|
||||||
@@ -156,7 +156,7 @@ describe('ol.format.GeoJSON', function() {
|
|||||||
var feature = format.readFeature(pointGeoJSON.geometry);
|
var feature = format.readFeature(pointGeoJSON.geometry);
|
||||||
expect(feature).to.be.an(_ol_Feature_);
|
expect(feature).to.be.an(_ol_Feature_);
|
||||||
var geometry = feature.getGeometry();
|
var geometry = feature.getGeometry();
|
||||||
expect(geometry).to.be.an(_ol_geom_Point_);
|
expect(geometry).to.be.an(Point);
|
||||||
expect(geometry.getCoordinates()).to.eql([102.0, 0.5]);
|
expect(geometry.getCoordinates()).to.eql([102.0, 0.5]);
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -200,7 +200,7 @@ describe('ol.format.GeoJSON', function() {
|
|||||||
it('can read a feature collection', function() {
|
it('can read a feature collection', function() {
|
||||||
var features = format.readFeatures(featureCollectionGeoJSON);
|
var features = format.readFeatures(featureCollectionGeoJSON);
|
||||||
expect(features).to.have.length(3);
|
expect(features).to.have.length(3);
|
||||||
expect(features[0].getGeometry()).to.be.an(_ol_geom_Point_);
|
expect(features[0].getGeometry()).to.be.an(Point);
|
||||||
expect(features[1].getGeometry()).to.be.an(_ol_geom_LineString_);
|
expect(features[1].getGeometry()).to.be.an(_ol_geom_LineString_);
|
||||||
expect(features[2].getGeometry()).to.be.an(_ol_geom_Polygon_);
|
expect(features[2].getGeometry()).to.be.an(_ol_geom_Polygon_);
|
||||||
});
|
});
|
||||||
@@ -209,7 +209,7 @@ describe('ol.format.GeoJSON', function() {
|
|||||||
var feature = format.readFeatures(pointGeoJSON, {
|
var feature = format.readFeatures(pointGeoJSON, {
|
||||||
featureProjection: 'EPSG:3857'
|
featureProjection: 'EPSG:3857'
|
||||||
});
|
});
|
||||||
expect(feature[0].getGeometry()).to.be.an(_ol_geom_Point_);
|
expect(feature[0].getGeometry()).to.be.an(Point);
|
||||||
expect(feature[0].getGeometry().getCoordinates()).to.eql(
|
expect(feature[0].getGeometry().getCoordinates()).to.eql(
|
||||||
transform([102.0, 0.5], 'EPSG:4326', 'EPSG:3857'));
|
transform([102.0, 0.5], 'EPSG:4326', 'EPSG:3857'));
|
||||||
});
|
});
|
||||||
@@ -217,7 +217,7 @@ describe('ol.format.GeoJSON', function() {
|
|||||||
it('uses featureProjection passed to the constructor', function() {
|
it('uses featureProjection passed to the constructor', function() {
|
||||||
var format = new _ol_format_GeoJSON_({featureProjection: 'EPSG:3857'});
|
var format = new _ol_format_GeoJSON_({featureProjection: 'EPSG:3857'});
|
||||||
var feature = format.readFeatures(pointGeoJSON);
|
var feature = format.readFeatures(pointGeoJSON);
|
||||||
expect(feature[0].getGeometry()).to.be.an(_ol_geom_Point_);
|
expect(feature[0].getGeometry()).to.be.an(Point);
|
||||||
expect(feature[0].getGeometry().getCoordinates()).to.eql(
|
expect(feature[0].getGeometry().getCoordinates()).to.eql(
|
||||||
transform([102.0, 0.5], 'EPSG:4326', 'EPSG:3857'));
|
transform([102.0, 0.5], 'EPSG:4326', 'EPSG:3857'));
|
||||||
});
|
});
|
||||||
@@ -227,7 +227,7 @@ describe('ol.format.GeoJSON', function() {
|
|||||||
var feature = format.readFeatures(pointGeoJSON, {
|
var feature = format.readFeatures(pointGeoJSON, {
|
||||||
featureProjection: 'EPSG:3857'
|
featureProjection: 'EPSG:3857'
|
||||||
});
|
});
|
||||||
expect(feature[0].getGeometry()).to.be.an(_ol_geom_Point_);
|
expect(feature[0].getGeometry()).to.be.an(Point);
|
||||||
expect(feature[0].getGeometry().getCoordinates()).to.eql(
|
expect(feature[0].getGeometry().getCoordinates()).to.eql(
|
||||||
transform([102.0, 0.5], 'EPSG:4326', 'EPSG:3857'));
|
transform([102.0, 0.5], 'EPSG:4326', 'EPSG:3857'));
|
||||||
});
|
});
|
||||||
@@ -236,7 +236,7 @@ describe('ol.format.GeoJSON', function() {
|
|||||||
var features = format.readFeatures(featureCollectionGeoJSON, {
|
var features = format.readFeatures(featureCollectionGeoJSON, {
|
||||||
featureProjection: 'EPSG:3857'
|
featureProjection: 'EPSG:3857'
|
||||||
});
|
});
|
||||||
expect(features[0].getGeometry()).to.be.an(_ol_geom_Point_);
|
expect(features[0].getGeometry()).to.be.an(Point);
|
||||||
expect(features[0].getGeometry().getCoordinates()).to.eql(
|
expect(features[0].getGeometry().getCoordinates()).to.eql(
|
||||||
transform([102.0, 0.5], 'EPSG:4326', 'EPSG:3857'));
|
transform([102.0, 0.5], 'EPSG:4326', 'EPSG:3857'));
|
||||||
expect(features[1].getGeometry().getCoordinates()).to.eql([
|
expect(features[1].getGeometry().getCoordinates()).to.eql([
|
||||||
@@ -257,7 +257,7 @@ describe('ol.format.GeoJSON', function() {
|
|||||||
var feature = new _ol_format_GeoJSON_({geometryName: 'the_geom'}).
|
var feature = new _ol_format_GeoJSON_({geometryName: 'the_geom'}).
|
||||||
readFeature(pointGeoJSON);
|
readFeature(pointGeoJSON);
|
||||||
expect(feature.getGeometryName()).to.be('the_geom');
|
expect(feature.getGeometryName()).to.be('the_geom');
|
||||||
expect(feature.getGeometry()).to.be.an(_ol_geom_Point_);
|
expect(feature.getGeometry()).to.be.an(Point);
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
@@ -356,7 +356,7 @@ describe('ol.format.GeoJSON', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
var obj = format.readGeometry(str);
|
var obj = format.readGeometry(str);
|
||||||
expect(obj).to.be.a(_ol_geom_Point_);
|
expect(obj).to.be.a(Point);
|
||||||
expect(obj.getCoordinates()).to.eql([10, 20]);
|
expect(obj.getCoordinates()).to.eql([10, 20]);
|
||||||
expect(obj.getLayout()).to.eql('XY');
|
expect(obj.getLayout()).to.eql('XY');
|
||||||
});
|
});
|
||||||
@@ -417,7 +417,7 @@ describe('ol.format.GeoJSON', function() {
|
|||||||
expect(geometryCollection).to.be.an(_ol_geom_GeometryCollection_);
|
expect(geometryCollection).to.be.an(_ol_geom_GeometryCollection_);
|
||||||
var array = geometryCollection.getGeometries();
|
var array = geometryCollection.getGeometries();
|
||||||
expect(array.length).to.be(2);
|
expect(array.length).to.be(2);
|
||||||
expect(array[0]).to.be.a(_ol_geom_Point_);
|
expect(array[0]).to.be.a(Point);
|
||||||
expect(array[0].getLayout()).to.eql('XY');
|
expect(array[0].getLayout()).to.eql('XY');
|
||||||
expect(array[1]).to.be.a(_ol_geom_LineString_);
|
expect(array[1]).to.be.a(_ol_geom_LineString_);
|
||||||
expect(array[1].getLayout()).to.eql('XY');
|
expect(array[1].getLayout()).to.eql('XY');
|
||||||
@@ -464,7 +464,7 @@ describe('ol.format.GeoJSON', function() {
|
|||||||
var first = features[0];
|
var first = features[0];
|
||||||
expect(first).to.be.a(_ol_Feature_);
|
expect(first).to.be.a(_ol_Feature_);
|
||||||
expect(first.get('foo')).to.be('bar');
|
expect(first.get('foo')).to.be('bar');
|
||||||
expect(first.getGeometry()).to.be.a(_ol_geom_Point_);
|
expect(first.getGeometry()).to.be.a(Point);
|
||||||
|
|
||||||
var second = features[1];
|
var second = features[1];
|
||||||
expect(second).to.be.a(_ol_Feature_);
|
expect(second).to.be.a(_ol_Feature_);
|
||||||
@@ -507,7 +507,7 @@ describe('ol.format.GeoJSON', function() {
|
|||||||
var first = features[0];
|
var first = features[0];
|
||||||
expect(first).to.be.a(_ol_Feature_);
|
expect(first).to.be.a(_ol_Feature_);
|
||||||
expect(first.get('foo')).to.be('bar');
|
expect(first.get('foo')).to.be('bar');
|
||||||
expect(first.getGeometry()).to.be.a(_ol_geom_Point_);
|
expect(first.getGeometry()).to.be.a(Point);
|
||||||
|
|
||||||
var second = features[1];
|
var second = features[1];
|
||||||
expect(second).to.be.a(_ol_Feature_);
|
expect(second).to.be.a(_ol_Feature_);
|
||||||
@@ -562,13 +562,13 @@ describe('ol.format.GeoJSON', function() {
|
|||||||
function() {
|
function() {
|
||||||
var feature = new _ol_Feature_({'foo': 'bar'});
|
var feature = new _ol_Feature_({'foo': 'bar'});
|
||||||
feature.setGeometryName('mygeom');
|
feature.setGeometryName('mygeom');
|
||||||
feature.setGeometry(new _ol_geom_Point_([5, 10]));
|
feature.setGeometry(new Point([5, 10]));
|
||||||
var geojson = format.writeFeaturesObject([feature]);
|
var geojson = format.writeFeaturesObject([feature]);
|
||||||
expect(geojson.features[0].properties.mygeom).to.eql(undefined);
|
expect(geojson.features[0].properties.mygeom).to.eql(undefined);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('writes out a feature without properties correctly', function() {
|
it('writes out a feature without properties correctly', function() {
|
||||||
var feature = new _ol_Feature_(new _ol_geom_Point_([5, 10]));
|
var feature = new _ol_Feature_(new Point([5, 10]));
|
||||||
var geojson = format.writeFeatureObject(feature);
|
var geojson = format.writeFeatureObject(feature);
|
||||||
expect(geojson.properties).to.eql(null);
|
expect(geojson.properties).to.eql(null);
|
||||||
});
|
});
|
||||||
@@ -590,14 +590,14 @@ describe('ol.format.GeoJSON', function() {
|
|||||||
describe('#writeGeometry', function() {
|
describe('#writeGeometry', function() {
|
||||||
|
|
||||||
it('encodes point', function() {
|
it('encodes point', function() {
|
||||||
var point = new _ol_geom_Point_([10, 20]);
|
var point = new Point([10, 20]);
|
||||||
var geojson = format.writeGeometry(point);
|
var geojson = format.writeGeometry(point);
|
||||||
expect(point.getCoordinates()).to.eql(
|
expect(point.getCoordinates()).to.eql(
|
||||||
format.readGeometry(geojson).getCoordinates());
|
format.readGeometry(geojson).getCoordinates());
|
||||||
});
|
});
|
||||||
|
|
||||||
it('accepts featureProjection', function() {
|
it('accepts featureProjection', function() {
|
||||||
var point = new _ol_geom_Point_(fromLonLat([10, 20]));
|
var point = new Point(fromLonLat([10, 20]));
|
||||||
var geojson = format.writeGeometry(point, {featureProjection: 'EPSG:3857'});
|
var geojson = format.writeGeometry(point, {featureProjection: 'EPSG:3857'});
|
||||||
var obj = JSON.parse(geojson);
|
var obj = JSON.parse(geojson);
|
||||||
expect(obj.coordinates).to.eql(toLonLat(point.getCoordinates()));
|
expect(obj.coordinates).to.eql(toLonLat(point.getCoordinates()));
|
||||||
@@ -605,7 +605,7 @@ describe('ol.format.GeoJSON', function() {
|
|||||||
|
|
||||||
it('respects featureProjection passed to constructor', function() {
|
it('respects featureProjection passed to constructor', function() {
|
||||||
var format = new _ol_format_GeoJSON_({featureProjection: 'EPSG:3857'});
|
var format = new _ol_format_GeoJSON_({featureProjection: 'EPSG:3857'});
|
||||||
var point = new _ol_geom_Point_(fromLonLat([10, 20]));
|
var point = new Point(fromLonLat([10, 20]));
|
||||||
var geojson = format.writeGeometry(point);
|
var geojson = format.writeGeometry(point);
|
||||||
var obj = JSON.parse(geojson);
|
var obj = JSON.parse(geojson);
|
||||||
expect(obj.coordinates).to.eql(toLonLat(point.getCoordinates()));
|
expect(obj.coordinates).to.eql(toLonLat(point.getCoordinates()));
|
||||||
@@ -730,7 +730,7 @@ describe('ol.format.GeoJSON', function() {
|
|||||||
|
|
||||||
it('encodes geometry collection', function() {
|
it('encodes geometry collection', function() {
|
||||||
var collection = new _ol_geom_GeometryCollection_([
|
var collection = new _ol_geom_GeometryCollection_([
|
||||||
new _ol_geom_Point_([10, 20]),
|
new Point([10, 20]),
|
||||||
new _ol_geom_LineString_([[30, 40], [50, 60]])
|
new _ol_geom_LineString_([[30, 40], [50, 60]])
|
||||||
]);
|
]);
|
||||||
var geojson = format.writeGeometry(collection);
|
var geojson = format.writeGeometry(collection);
|
||||||
@@ -756,7 +756,7 @@ describe('ol.format.GeoJSON', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('transforms and encodes a point', function() {
|
it('transforms and encodes a point', function() {
|
||||||
var point = new _ol_geom_Point_([2, 3]);
|
var point = new Point([2, 3]);
|
||||||
var geojson = format.writeGeometry(point, {
|
var geojson = format.writeGeometry(point, {
|
||||||
featureProjection: 'EPSG:3857'
|
featureProjection: 'EPSG:3857'
|
||||||
});
|
});
|
||||||
@@ -771,7 +771,7 @@ describe('ol.format.GeoJSON', function() {
|
|||||||
|
|
||||||
it('transforms and encodes geometry collection', function() {
|
it('transforms and encodes geometry collection', function() {
|
||||||
var collection = new _ol_geom_GeometryCollection_([
|
var collection = new _ol_geom_GeometryCollection_([
|
||||||
new _ol_geom_Point_([2, 3]),
|
new Point([2, 3]),
|
||||||
new _ol_geom_LineString_([[3, 2], [2, 1]])
|
new _ol_geom_LineString_([[3, 2], [2, 1]])
|
||||||
]);
|
]);
|
||||||
var geojson = format.writeGeometry(collection, {
|
var geojson = format.writeGeometry(collection, {
|
||||||
@@ -793,7 +793,7 @@ describe('ol.format.GeoJSON', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('truncates transformed point with decimals option', function() {
|
it('truncates transformed point with decimals option', function() {
|
||||||
var point = new _ol_geom_Point_([2, 3]).transform('EPSG:4326', 'EPSG:3857');
|
var point = new Point([2, 3]).transform('EPSG:4326', 'EPSG:3857');
|
||||||
var geojson = format.writeGeometry(point, {
|
var geojson = format.writeGeometry(point, {
|
||||||
featureProjection: 'EPSG:3857',
|
featureProjection: 'EPSG:3857',
|
||||||
decimals: 2
|
decimals: 2
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import _ol_geom_LinearRing_ from '../../../../src/ol/geom/LinearRing.js';
|
|||||||
import _ol_geom_MultiLineString_ from '../../../../src/ol/geom/MultiLineString.js';
|
import _ol_geom_MultiLineString_ from '../../../../src/ol/geom/MultiLineString.js';
|
||||||
import _ol_geom_MultiPoint_ from '../../../../src/ol/geom/MultiPoint.js';
|
import _ol_geom_MultiPoint_ from '../../../../src/ol/geom/MultiPoint.js';
|
||||||
import _ol_geom_MultiPolygon_ from '../../../../src/ol/geom/MultiPolygon.js';
|
import _ol_geom_MultiPolygon_ from '../../../../src/ol/geom/MultiPolygon.js';
|
||||||
import _ol_geom_Point_ from '../../../../src/ol/geom/Point.js';
|
import Point from '../../../../src/ol/geom/Point.js';
|
||||||
import _ol_geom_Polygon_ from '../../../../src/ol/geom/Polygon.js';
|
import _ol_geom_Polygon_ from '../../../../src/ol/geom/Polygon.js';
|
||||||
import {transform} from '../../../../src/ol/proj.js';
|
import {transform} from '../../../../src/ol/proj.js';
|
||||||
import _ol_xml_ from '../../../../src/ol/xml.js';
|
import _ol_xml_ from '../../../../src/ol/xml.js';
|
||||||
@@ -57,7 +57,7 @@ describe('ol.format.GML2', function() {
|
|||||||
'</gml:Point>';
|
'</gml:Point>';
|
||||||
|
|
||||||
var g = readGeometry(format, text);
|
var g = readGeometry(format, text);
|
||||||
expect(g).to.be.an(_ol_geom_Point_);
|
expect(g).to.be.an(Point);
|
||||||
expect(g.getCoordinates()).to.eql([-180, -90, 0]);
|
expect(g.getCoordinates()).to.eql([-180, -90, 0]);
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -68,7 +68,7 @@ describe('ol.format.GML2', function() {
|
|||||||
'</gml:Point>';
|
'</gml:Point>';
|
||||||
|
|
||||||
var g = readGeometry(format, text);
|
var g = readGeometry(format, text);
|
||||||
expect(g).to.be.an(_ol_geom_Point_);
|
expect(g).to.be.an(Point);
|
||||||
expect(g.getCoordinates()).to.eql([-180, -90, 42]);
|
expect(g.getCoordinates()).to.eql([-180, -90, 42]);
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -222,7 +222,7 @@ describe('ol.format.GML2', function() {
|
|||||||
' </layer>';
|
' </layer>';
|
||||||
|
|
||||||
var feature = new _ol_Feature_({
|
var feature = new _ol_Feature_({
|
||||||
geometry: new _ol_geom_Point_([1.1, 2])
|
geometry: new Point([1.1, 2])
|
||||||
});
|
});
|
||||||
feature.setId(1);
|
feature.setId(1);
|
||||||
var objectStack = [{
|
var objectStack = [{
|
||||||
@@ -355,7 +355,7 @@ describe('ol.format.GML3', function() {
|
|||||||
' <gml:pos srsDimension="2">1 2</gml:pos>' +
|
' <gml:pos srsDimension="2">1 2</gml:pos>' +
|
||||||
'</gml:Point>';
|
'</gml:Point>';
|
||||||
var g = readGeometry(format, text);
|
var g = readGeometry(format, text);
|
||||||
expect(g).to.be.an(_ol_geom_Point_);
|
expect(g).to.be.an(Point);
|
||||||
expect(g.getCoordinates()).to.eql([1, 2, 0]);
|
expect(g.getCoordinates()).to.eql([1, 2, 0]);
|
||||||
var serialized = format.writeGeometryNode(g);
|
var serialized = format.writeGeometryNode(g);
|
||||||
expect(serialized.firstElementChild).to.xmleql(_ol_xml_.parse(text));
|
expect(serialized.firstElementChild).to.xmleql(_ol_xml_.parse(text));
|
||||||
@@ -368,7 +368,7 @@ describe('ol.format.GML3', function() {
|
|||||||
' <gml:pos>1E7 2</gml:pos>' +
|
' <gml:pos>1E7 2</gml:pos>' +
|
||||||
'</gml:Point>';
|
'</gml:Point>';
|
||||||
var g = readGeometry(format, text);
|
var g = readGeometry(format, text);
|
||||||
expect(g).to.be.an(_ol_geom_Point_);
|
expect(g).to.be.an(Point);
|
||||||
expect(g.getCoordinates()).to.eql([10000000, 2, 0]);
|
expect(g.getCoordinates()).to.eql([10000000, 2, 0]);
|
||||||
text =
|
text =
|
||||||
'<gml:Point xmlns:gml="http://www.opengis.net/gml" ' +
|
'<gml:Point xmlns:gml="http://www.opengis.net/gml" ' +
|
||||||
@@ -376,7 +376,7 @@ describe('ol.format.GML3', function() {
|
|||||||
' <gml:pos>1e7 2</gml:pos>' +
|
' <gml:pos>1e7 2</gml:pos>' +
|
||||||
'</gml:Point>';
|
'</gml:Point>';
|
||||||
g = readGeometry(format, text);
|
g = readGeometry(format, text);
|
||||||
expect(g).to.be.an(_ol_geom_Point_);
|
expect(g).to.be.an(Point);
|
||||||
expect(g.getCoordinates()).to.eql([10000000, 2, 0]);
|
expect(g.getCoordinates()).to.eql([10000000, 2, 0]);
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -390,7 +390,7 @@ describe('ol.format.GML3', function() {
|
|||||||
' <gml:pos>1 2</gml:pos>' +
|
' <gml:pos>1 2</gml:pos>' +
|
||||||
'</gml:Point>';
|
'</gml:Point>';
|
||||||
var g = readGeometry(format, text, config);
|
var g = readGeometry(format, text, config);
|
||||||
expect(g).to.be.an(_ol_geom_Point_);
|
expect(g).to.be.an(Point);
|
||||||
var coordinates = g.getCoordinates();
|
var coordinates = g.getCoordinates();
|
||||||
expect(coordinates.splice(0, 2)).to.eql(
|
expect(coordinates.splice(0, 2)).to.eql(
|
||||||
transform([1, 2], 'CRS:84', 'EPSG:3857'));
|
transform([1, 2], 'CRS:84', 'EPSG:3857'));
|
||||||
@@ -412,7 +412,7 @@ describe('ol.format.GML3', function() {
|
|||||||
' <gml:pos>1 2</gml:pos>' +
|
' <gml:pos>1 2</gml:pos>' +
|
||||||
'</gml:Point>';
|
'</gml:Point>';
|
||||||
var g = readGeometry(formatNoSrs, text, config);
|
var g = readGeometry(formatNoSrs, text, config);
|
||||||
expect(g).to.be.an(_ol_geom_Point_);
|
expect(g).to.be.an(Point);
|
||||||
var coordinates = g.getCoordinates();
|
var coordinates = g.getCoordinates();
|
||||||
expect(coordinates.splice(0, 2)).to.eql(
|
expect(coordinates.splice(0, 2)).to.eql(
|
||||||
transform([1, 2], 'CRS:84', 'EPSG:3857'));
|
transform([1, 2], 'CRS:84', 'EPSG:3857'));
|
||||||
@@ -425,7 +425,7 @@ describe('ol.format.GML3', function() {
|
|||||||
' <gml:pos srsDimension="2">2 1</gml:pos>' +
|
' <gml:pos srsDimension="2">2 1</gml:pos>' +
|
||||||
'</gml:Point>';
|
'</gml:Point>';
|
||||||
var g = readGeometry(formatWGS84, text);
|
var g = readGeometry(formatWGS84, text);
|
||||||
expect(g).to.be.an(_ol_geom_Point_);
|
expect(g).to.be.an(Point);
|
||||||
expect(g.getCoordinates()).to.eql([1, 2, 0]);
|
expect(g.getCoordinates()).to.eql([1, 2, 0]);
|
||||||
var serialized = formatWGS84.writeGeometryNode(g);
|
var serialized = formatWGS84.writeGeometryNode(g);
|
||||||
expect(serialized.firstElementChild).to.xmleql(_ol_xml_.parse(text));
|
expect(serialized.firstElementChild).to.xmleql(_ol_xml_.parse(text));
|
||||||
@@ -514,7 +514,7 @@ describe('ol.format.GML3', function() {
|
|||||||
' <gml:pos srsDimension="2">-90 -180</gml:pos>' +
|
' <gml:pos srsDimension="2">-90 -180</gml:pos>' +
|
||||||
'</gml:Point>';
|
'</gml:Point>';
|
||||||
var g = readGeometry(format, text);
|
var g = readGeometry(format, text);
|
||||||
expect(g).to.be.an(_ol_geom_Point_);
|
expect(g).to.be.an(Point);
|
||||||
expect(g.getCoordinates()).to.eql([-180, -90, 0]);
|
expect(g.getCoordinates()).to.eql([-180, -90, 0]);
|
||||||
var serialized = formatWGS84.writeGeometryNode(g);
|
var serialized = formatWGS84.writeGeometryNode(g);
|
||||||
expect(serialized.firstElementChild).to.xmleql(_ol_xml_.parse(text));
|
expect(serialized.firstElementChild).to.xmleql(_ol_xml_.parse(text));
|
||||||
@@ -1333,7 +1333,7 @@ describe('ol.format.GML3', function() {
|
|||||||
|
|
||||||
it('creates 2 geometries', function() {
|
it('creates 2 geometries', function() {
|
||||||
var feature = features[0];
|
var feature = features[0];
|
||||||
expect(feature.get('center')).to.be.a(_ol_geom_Point_);
|
expect(feature.get('center')).to.be.a(Point);
|
||||||
expect(feature.get('the_geom')).to.be.a(_ol_geom_MultiPolygon_);
|
expect(feature.get('the_geom')).to.be.a(_ol_geom_MultiPolygon_);
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -1534,7 +1534,7 @@ describe('ol.format.GML3', function() {
|
|||||||
it('creates a Point', function() {
|
it('creates a Point', function() {
|
||||||
feature = features[2];
|
feature = features[2];
|
||||||
expect(feature.getId()).to.equal('geoserver_layer.3');
|
expect(feature.getId()).to.equal('geoserver_layer.3');
|
||||||
expect(feature.getGeometry()).to.be.an(_ol_geom_Point_);
|
expect(feature.getGeometry()).to.be.an(Point);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import _ol_Feature_ from '../../../../src/ol/Feature.js';
|
|||||||
import _ol_format_GPX_ from '../../../../src/ol/format/GPX.js';
|
import _ol_format_GPX_ from '../../../../src/ol/format/GPX.js';
|
||||||
import _ol_geom_LineString_ from '../../../../src/ol/geom/LineString.js';
|
import _ol_geom_LineString_ from '../../../../src/ol/geom/LineString.js';
|
||||||
import _ol_geom_MultiLineString_ from '../../../../src/ol/geom/MultiLineString.js';
|
import _ol_geom_MultiLineString_ from '../../../../src/ol/geom/MultiLineString.js';
|
||||||
import _ol_geom_Point_ from '../../../../src/ol/geom/Point.js';
|
import Point from '../../../../src/ol/geom/Point.js';
|
||||||
import _ol_geom_Polygon_ from '../../../../src/ol/geom/Polygon.js';
|
import _ol_geom_Polygon_ from '../../../../src/ol/geom/Polygon.js';
|
||||||
import {get as getProjection, transform} from '../../../../src/ol/proj.js';
|
import {get as getProjection, transform} from '../../../../src/ol/proj.js';
|
||||||
import _ol_xml_ from '../../../../src/ol/xml.js';
|
import _ol_xml_ from '../../../../src/ol/xml.js';
|
||||||
@@ -393,7 +393,7 @@ describe('ol.format.GPX', function() {
|
|||||||
var f = fs[0];
|
var f = fs[0];
|
||||||
expect(f).to.be.an(_ol_Feature_);
|
expect(f).to.be.an(_ol_Feature_);
|
||||||
var g = f.getGeometry();
|
var g = f.getGeometry();
|
||||||
expect(g).to.be.an(_ol_geom_Point_);
|
expect(g).to.be.an(Point);
|
||||||
expect(g.getCoordinates()).to.eql([2, 1]);
|
expect(g.getCoordinates()).to.eql([2, 1]);
|
||||||
expect(g.getLayout()).to.be('XY');
|
expect(g.getLayout()).to.be('XY');
|
||||||
var serialized = format.writeFeaturesNode(fs);
|
var serialized = format.writeFeaturesNode(fs);
|
||||||
@@ -415,7 +415,7 @@ describe('ol.format.GPX', function() {
|
|||||||
var f = fs[0];
|
var f = fs[0];
|
||||||
expect(f).to.be.an(_ol_Feature_);
|
expect(f).to.be.an(_ol_Feature_);
|
||||||
var g = f.getGeometry();
|
var g = f.getGeometry();
|
||||||
expect(g).to.be.an(_ol_geom_Point_);
|
expect(g).to.be.an(Point);
|
||||||
var expectedPoint = transform([2, 1], 'EPSG:4326', 'EPSG:3857');
|
var expectedPoint = transform([2, 1], 'EPSG:4326', 'EPSG:3857');
|
||||||
expect(g.getCoordinates()).to.eql(expectedPoint);
|
expect(g.getCoordinates()).to.eql(expectedPoint);
|
||||||
expect(g.getLayout()).to.be('XY');
|
expect(g.getLayout()).to.be('XY');
|
||||||
@@ -440,7 +440,7 @@ describe('ol.format.GPX', function() {
|
|||||||
var f = fs[0];
|
var f = fs[0];
|
||||||
expect(f).to.be.an(_ol_Feature_);
|
expect(f).to.be.an(_ol_Feature_);
|
||||||
var g = f.getGeometry();
|
var g = f.getGeometry();
|
||||||
expect(g).to.be.an(_ol_geom_Point_);
|
expect(g).to.be.an(Point);
|
||||||
expect(g.getCoordinates()).to.eql([2, 1, 3]);
|
expect(g.getCoordinates()).to.eql([2, 1, 3]);
|
||||||
expect(g.getLayout()).to.be('XYZ');
|
expect(g.getLayout()).to.be('XYZ');
|
||||||
var serialized = format.writeFeaturesNode(fs);
|
var serialized = format.writeFeaturesNode(fs);
|
||||||
@@ -462,7 +462,7 @@ describe('ol.format.GPX', function() {
|
|||||||
var f = fs[0];
|
var f = fs[0];
|
||||||
expect(f).to.be.an(_ol_Feature_);
|
expect(f).to.be.an(_ol_Feature_);
|
||||||
var g = f.getGeometry();
|
var g = f.getGeometry();
|
||||||
expect(g).to.be.an(_ol_geom_Point_);
|
expect(g).to.be.an(Point);
|
||||||
expect(g.getCoordinates()).to.eql([2, 1, 1263115752]);
|
expect(g.getCoordinates()).to.eql([2, 1, 1263115752]);
|
||||||
expect(g.getLayout()).to.be('XYM');
|
expect(g.getLayout()).to.be('XYM');
|
||||||
var serialized = format.writeFeaturesNode(fs);
|
var serialized = format.writeFeaturesNode(fs);
|
||||||
@@ -485,7 +485,7 @@ describe('ol.format.GPX', function() {
|
|||||||
var f = fs[0];
|
var f = fs[0];
|
||||||
expect(f).to.be.an(_ol_Feature_);
|
expect(f).to.be.an(_ol_Feature_);
|
||||||
var g = f.getGeometry();
|
var g = f.getGeometry();
|
||||||
expect(g).to.be.an(_ol_geom_Point_);
|
expect(g).to.be.an(Point);
|
||||||
expect(g.getCoordinates()).to.eql([2, 1, 3, 1263115752]);
|
expect(g.getCoordinates()).to.eql([2, 1, 3, 1263115752]);
|
||||||
expect(g.getLayout()).to.be('XYZM');
|
expect(g.getLayout()).to.be('XYZM');
|
||||||
var serialized = format.writeFeaturesNode(fs);
|
var serialized = format.writeFeaturesNode(fs);
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import _ol_geom_LinearRing_ from '../../../../src/ol/geom/LinearRing.js';
|
|||||||
import _ol_geom_MultiLineString_ from '../../../../src/ol/geom/MultiLineString.js';
|
import _ol_geom_MultiLineString_ from '../../../../src/ol/geom/MultiLineString.js';
|
||||||
import _ol_geom_MultiPoint_ from '../../../../src/ol/geom/MultiPoint.js';
|
import _ol_geom_MultiPoint_ from '../../../../src/ol/geom/MultiPoint.js';
|
||||||
import _ol_geom_MultiPolygon_ from '../../../../src/ol/geom/MultiPolygon.js';
|
import _ol_geom_MultiPolygon_ from '../../../../src/ol/geom/MultiPolygon.js';
|
||||||
import _ol_geom_Point_ from '../../../../src/ol/geom/Point.js';
|
import Point from '../../../../src/ol/geom/Point.js';
|
||||||
import _ol_geom_Polygon_ from '../../../../src/ol/geom/Polygon.js';
|
import _ol_geom_Polygon_ from '../../../../src/ol/geom/Polygon.js';
|
||||||
import {addProjection, addCoordinateTransforms, transform, get as getProjection} from '../../../../src/ol/proj.js';
|
import {addProjection, addCoordinateTransforms, transform, get as getProjection} from '../../../../src/ol/proj.js';
|
||||||
import _ol_proj_Projection_ from '../../../../src/ol/proj/Projection.js';
|
import _ol_proj_Projection_ from '../../../../src/ol/proj/Projection.js';
|
||||||
@@ -239,7 +239,7 @@ describe('ol.format.KML', function() {
|
|||||||
var f = fs[0];
|
var f = fs[0];
|
||||||
expect(f).to.be.an(_ol_Feature_);
|
expect(f).to.be.an(_ol_Feature_);
|
||||||
var g = f.getGeometry();
|
var g = f.getGeometry();
|
||||||
expect(g).to.be.an(_ol_geom_Point_);
|
expect(g).to.be.an(Point);
|
||||||
expect(g.getCoordinates()).to.eql([1, 2, 3]);
|
expect(g.getCoordinates()).to.eql([1, 2, 3]);
|
||||||
expect(g.get('extrude')).to.be(false);
|
expect(g.get('extrude')).to.be(false);
|
||||||
expect(g.get('altitudeMode')).to.be('absolute');
|
expect(g.get('altitudeMode')).to.be('absolute');
|
||||||
@@ -265,7 +265,7 @@ describe('ol.format.KML', function() {
|
|||||||
var f = fs[0];
|
var f = fs[0];
|
||||||
expect(f).to.be.an(_ol_Feature_);
|
expect(f).to.be.an(_ol_Feature_);
|
||||||
var g = f.getGeometry();
|
var g = f.getGeometry();
|
||||||
expect(g).to.be.an(_ol_geom_Point_);
|
expect(g).to.be.an(Point);
|
||||||
var expectedPoint = transform([1, 2], 'EPSG:4326', 'EPSG:3857');
|
var expectedPoint = transform([1, 2], 'EPSG:4326', 'EPSG:3857');
|
||||||
expectedPoint.push(3);
|
expectedPoint.push(3);
|
||||||
expect(g.getCoordinates()).to.eql(expectedPoint);
|
expect(g.getCoordinates()).to.eql(expectedPoint);
|
||||||
@@ -287,7 +287,7 @@ describe('ol.format.KML', function() {
|
|||||||
var f = format.readFeature(text);
|
var f = format.readFeature(text);
|
||||||
expect(f).to.be.an(_ol_Feature_);
|
expect(f).to.be.an(_ol_Feature_);
|
||||||
var g = f.getGeometry();
|
var g = f.getGeometry();
|
||||||
expect(g).to.be.an(_ol_geom_Point_);
|
expect(g).to.be.an(Point);
|
||||||
expect(g.getCoordinates()).to.eql([1, 2, 3]);
|
expect(g.getCoordinates()).to.eql([1, 2, 3]);
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -309,7 +309,7 @@ describe('ol.format.KML', function() {
|
|||||||
});
|
});
|
||||||
expect(f).to.be.an(_ol_Feature_);
|
expect(f).to.be.an(_ol_Feature_);
|
||||||
var g = f.getGeometry();
|
var g = f.getGeometry();
|
||||||
expect(g).to.be.an(_ol_geom_Point_);
|
expect(g).to.be.an(Point);
|
||||||
var expectedPoint = transform([1, 2], 'EPSG:4326', 'EPSG:3857');
|
var expectedPoint = transform([1, 2], 'EPSG:4326', 'EPSG:3857');
|
||||||
expectedPoint.push(3);
|
expectedPoint.push(3);
|
||||||
expect(g.getCoordinates()).to.eql(expectedPoint);
|
expect(g.getCoordinates()).to.eql(expectedPoint);
|
||||||
@@ -317,7 +317,7 @@ describe('ol.format.KML', function() {
|
|||||||
|
|
||||||
it('can write XY Point geometries', function() {
|
it('can write XY Point geometries', function() {
|
||||||
var layout = 'XY';
|
var layout = 'XY';
|
||||||
var point = new _ol_geom_Point_([1, 2], layout);
|
var point = new Point([1, 2], layout);
|
||||||
var features = [new _ol_Feature_(point)];
|
var features = [new _ol_Feature_(point)];
|
||||||
var node = format.writeFeaturesNode(features);
|
var node = format.writeFeaturesNode(features);
|
||||||
var text =
|
var text =
|
||||||
@@ -337,7 +337,7 @@ describe('ol.format.KML', function() {
|
|||||||
|
|
||||||
it('can write XYZ Point geometries', function() {
|
it('can write XYZ Point geometries', function() {
|
||||||
var layout = 'XYZ';
|
var layout = 'XYZ';
|
||||||
var point = new _ol_geom_Point_([1, 2, 3], layout);
|
var point = new Point([1, 2, 3], layout);
|
||||||
var features = [new _ol_Feature_(point)];
|
var features = [new _ol_Feature_(point)];
|
||||||
var node = format.writeFeaturesNode(features);
|
var node = format.writeFeaturesNode(features);
|
||||||
var text =
|
var text =
|
||||||
@@ -366,7 +366,7 @@ describe('ol.format.KML', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
var layout = 'XYZ';
|
var layout = 'XYZ';
|
||||||
var point = new _ol_geom_Point_([1, 2, 3], layout).transform(
|
var point = new Point([1, 2, 3], layout).transform(
|
||||||
'EPSG:4326', 'double');
|
'EPSG:4326', 'double');
|
||||||
var features = [new _ol_Feature_(point)];
|
var features = [new _ol_Feature_(point)];
|
||||||
var node = format.writeFeaturesNode(features, {
|
var node = format.writeFeaturesNode(features, {
|
||||||
@@ -394,7 +394,7 @@ describe('ol.format.KML', function() {
|
|||||||
|
|
||||||
it('can write XYM Point geometries', function() {
|
it('can write XYM Point geometries', function() {
|
||||||
var layout = 'XYM';
|
var layout = 'XYM';
|
||||||
var point = new _ol_geom_Point_([1, 2, 100], layout);
|
var point = new Point([1, 2, 100], layout);
|
||||||
var features = [new _ol_Feature_(point)];
|
var features = [new _ol_Feature_(point)];
|
||||||
var node = format.writeFeaturesNode(features);
|
var node = format.writeFeaturesNode(features);
|
||||||
var text =
|
var text =
|
||||||
@@ -414,7 +414,7 @@ describe('ol.format.KML', function() {
|
|||||||
|
|
||||||
it('can write XYZM Point geometries', function() {
|
it('can write XYZM Point geometries', function() {
|
||||||
var layout = 'XYZM';
|
var layout = 'XYZM';
|
||||||
var point = new _ol_geom_Point_([1, 2, 3, 100], layout);
|
var point = new Point([1, 2, 3, 100], layout);
|
||||||
var features = [new _ol_Feature_(point)];
|
var features = [new _ol_Feature_(point)];
|
||||||
var node = format.writeFeaturesNode(features);
|
var node = format.writeFeaturesNode(features);
|
||||||
var text =
|
var text =
|
||||||
@@ -1180,7 +1180,7 @@ describe('ol.format.KML', function() {
|
|||||||
expect(g).to.be.an(_ol_geom_GeometryCollection_);
|
expect(g).to.be.an(_ol_geom_GeometryCollection_);
|
||||||
var gs = g.getGeometries();
|
var gs = g.getGeometries();
|
||||||
expect(gs).to.have.length(4);
|
expect(gs).to.have.length(4);
|
||||||
expect(gs[0]).to.be.an(_ol_geom_Point_);
|
expect(gs[0]).to.be.an(Point);
|
||||||
expect(gs[1]).to.be.an(_ol_geom_LineString_);
|
expect(gs[1]).to.be.an(_ol_geom_LineString_);
|
||||||
expect(gs[2]).to.be.an(_ol_geom_Polygon_);
|
expect(gs[2]).to.be.an(_ol_geom_Polygon_);
|
||||||
expect(gs[3]).to.be.an(_ol_geom_Polygon_);
|
expect(gs[3]).to.be.an(_ol_geom_Polygon_);
|
||||||
@@ -1209,7 +1209,7 @@ describe('ol.format.KML', function() {
|
|||||||
|
|
||||||
it('can write GeometryCollection geometries', function() {
|
it('can write GeometryCollection geometries', function() {
|
||||||
var collection = new _ol_geom_GeometryCollection_([
|
var collection = new _ol_geom_GeometryCollection_([
|
||||||
new _ol_geom_Point_([1, 2]),
|
new Point([1, 2]),
|
||||||
new _ol_geom_LineString_([[1, 2], [3, 4]]),
|
new _ol_geom_LineString_([[1, 2], [3, 4]]),
|
||||||
new _ol_geom_Polygon_([[[1, 2], [3, 4], [3, 2], [1, 2]]])
|
new _ol_geom_Polygon_([[[1, 2], [3, 4], [3, 2], [1, 2]]])
|
||||||
]);
|
]);
|
||||||
@@ -2848,7 +2848,7 @@ describe('ol.format.KML', function() {
|
|||||||
var f = fs[0];
|
var f = fs[0];
|
||||||
expect(f).to.be.an(_ol_Feature_);
|
expect(f).to.be.an(_ol_Feature_);
|
||||||
var g = f.getGeometry();
|
var g = f.getGeometry();
|
||||||
expect(g).to.be.an(_ol_geom_Point_);
|
expect(g).to.be.an(Point);
|
||||||
var expectedPoint = transform([1, 2], 'EPSG:4326', 'EPSG:3857');
|
var expectedPoint = transform([1, 2], 'EPSG:4326', 'EPSG:3857');
|
||||||
expectedPoint.push(3);
|
expectedPoint.push(3);
|
||||||
expect(g.getCoordinates()).to.eql(expectedPoint);
|
expect(g.getCoordinates()).to.eql(expectedPoint);
|
||||||
@@ -3198,7 +3198,7 @@ describe('ol.format.KML', function() {
|
|||||||
expect(geometry).to.be.an(_ol_geom_GeometryCollection_);
|
expect(geometry).to.be.an(_ol_geom_GeometryCollection_);
|
||||||
var components = geometry.getGeometries();
|
var components = geometry.getGeometries();
|
||||||
expect(components).to.have.length(2);
|
expect(components).to.have.length(2);
|
||||||
expect(components[0]).to.be.an(_ol_geom_Point_);
|
expect(components[0]).to.be.an(Point);
|
||||||
expect(components[1]).to.be.an(_ol_geom_MultiPolygon_);
|
expect(components[1]).to.be.an(_ol_geom_MultiPolygon_);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import _ol_Feature_ from '../../../../src/ol/Feature.js';
|
import _ol_Feature_ from '../../../../src/ol/Feature.js';
|
||||||
import * as _ol_extent_ from '../../../../src/ol/extent.js';
|
import * as _ol_extent_ from '../../../../src/ol/extent.js';
|
||||||
import _ol_format_MVT_ from '../../../../src/ol/format/MVT.js';
|
import _ol_format_MVT_ from '../../../../src/ol/format/MVT.js';
|
||||||
import _ol_geom_Point_ from '../../../../src/ol/geom/Point.js';
|
import Point from '../../../../src/ol/geom/Point.js';
|
||||||
import _ol_geom_Polygon_ from '../../../../src/ol/geom/Polygon.js';
|
import _ol_geom_Polygon_ from '../../../../src/ol/geom/Polygon.js';
|
||||||
import _ol_geom_MultiPolygon_ from '../../../../src/ol/geom/MultiPolygon.js';
|
import _ol_geom_MultiPolygon_ from '../../../../src/ol/geom/MultiPolygon.js';
|
||||||
import _ol_render_Feature_ from '../../../../src/ol/render/Feature.js';
|
import _ol_render_Feature_ from '../../../../src/ol/render/Feature.js';
|
||||||
@@ -111,7 +111,7 @@ describe('ol.format.MVT', function() {
|
|||||||
var feature = format.createFeature_({}, rawFeature);
|
var feature = format.createFeature_({}, rawFeature);
|
||||||
_ol_format_MVT_.readRawGeometry_ = readRawGeometry_;
|
_ol_format_MVT_.readRawGeometry_ = readRawGeometry_;
|
||||||
var geometry = feature.getGeometry();
|
var geometry = feature.getGeometry();
|
||||||
expect(geometry).to.be.a(_ol_geom_Point_);
|
expect(geometry).to.be.a(Point);
|
||||||
expect(feature.get('myGeom')).to.equal(geometry);
|
expect(feature.get('myGeom')).to.equal(geometry);
|
||||||
expect(feature.get('geometry')).to.be('foo');
|
expect(feature.get('geometry')).to.be('foo');
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import _ol_Feature_ from '../../../../src/ol/Feature.js';
|
import _ol_Feature_ from '../../../../src/ol/Feature.js';
|
||||||
import _ol_format_OSMXML_ from '../../../../src/ol/format/OSMXML.js';
|
import _ol_format_OSMXML_ from '../../../../src/ol/format/OSMXML.js';
|
||||||
import _ol_geom_Point_ from '../../../../src/ol/geom/Point.js';
|
import Point from '../../../../src/ol/geom/Point.js';
|
||||||
import _ol_geom_LineString_ from '../../../../src/ol/geom/LineString.js';
|
import _ol_geom_LineString_ from '../../../../src/ol/geom/LineString.js';
|
||||||
import {get as getProjection, transform} from '../../../../src/ol/proj.js';
|
import {get as getProjection, transform} from '../../../../src/ol/proj.js';
|
||||||
|
|
||||||
@@ -51,7 +51,7 @@ describe('ol.format.OSMXML', function() {
|
|||||||
var f = fs[0];
|
var f = fs[0];
|
||||||
expect(f).to.be.an(_ol_Feature_);
|
expect(f).to.be.an(_ol_Feature_);
|
||||||
var g = f.getGeometry();
|
var g = f.getGeometry();
|
||||||
expect(g).to.be.an(_ol_geom_Point_);
|
expect(g).to.be.an(Point);
|
||||||
expect(g.getCoordinates()).to.eql([2, 1]);
|
expect(g.getCoordinates()).to.eql([2, 1]);
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -76,7 +76,7 @@ describe('ol.format.OSMXML', function() {
|
|||||||
var point = fs[0];
|
var point = fs[0];
|
||||||
expect(point).to.be.an(_ol_Feature_);
|
expect(point).to.be.an(_ol_Feature_);
|
||||||
var g = point.getGeometry();
|
var g = point.getGeometry();
|
||||||
expect(g).to.be.an(_ol_geom_Point_);
|
expect(g).to.be.an(Point);
|
||||||
expect(g.getCoordinates()).to.eql([2, 1]);
|
expect(g.getCoordinates()).to.eql([2, 1]);
|
||||||
var line = fs[2];
|
var line = fs[2];
|
||||||
expect(line).to.be.an(_ol_Feature_);
|
expect(line).to.be.an(_ol_Feature_);
|
||||||
@@ -130,7 +130,7 @@ describe('ol.format.OSMXML', function() {
|
|||||||
var f = fs[0];
|
var f = fs[0];
|
||||||
expect(f).to.be.an(_ol_Feature_);
|
expect(f).to.be.an(_ol_Feature_);
|
||||||
var g = f.getGeometry();
|
var g = f.getGeometry();
|
||||||
expect(g).to.be.an(_ol_geom_Point_);
|
expect(g).to.be.an(Point);
|
||||||
expect(g.getCoordinates()).to.eql(
|
expect(g.getCoordinates()).to.eql(
|
||||||
transform([2, 1], 'EPSG:4326', 'EPSG:3857'));
|
transform([2, 1], 'EPSG:4326', 'EPSG:3857'));
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import _ol_Feature_ from '../../../../src/ol/Feature.js';
|
import _ol_Feature_ from '../../../../src/ol/Feature.js';
|
||||||
import _ol_geom_Point_ from '../../../../src/ol/geom/Point.js';
|
import Point from '../../../../src/ol/geom/Point.js';
|
||||||
import _ol_format_WKT_ from '../../../../src/ol/format/WKT.js';
|
import _ol_format_WKT_ from '../../../../src/ol/format/WKT.js';
|
||||||
import {transform} from '../../../../src/ol/proj.js';
|
import {transform} from '../../../../src/ol/proj.js';
|
||||||
|
|
||||||
@@ -32,7 +32,7 @@ describe('ol.format.WKT', function() {
|
|||||||
describe('#writeGeometry()', function() {
|
describe('#writeGeometry()', function() {
|
||||||
|
|
||||||
it('transforms with dataProjection and featureProjection', function() {
|
it('transforms with dataProjection and featureProjection', function() {
|
||||||
var geom = new _ol_geom_Point_([1, 2]).transform('EPSG:4326', 'EPSG:3857');
|
var geom = new Point([1, 2]).transform('EPSG:4326', 'EPSG:3857');
|
||||||
var wkt = format.writeGeometry(geom, {
|
var wkt = format.writeGeometry(geom, {
|
||||||
dataProjection: 'EPSG:4326',
|
dataProjection: 'EPSG:4326',
|
||||||
featureProjection: 'EPSG:3857'
|
featureProjection: 'EPSG:3857'
|
||||||
@@ -63,7 +63,7 @@ describe('ol.format.WKT', function() {
|
|||||||
|
|
||||||
it('transforms with dataProjection and featureProjection', function() {
|
it('transforms with dataProjection and featureProjection', function() {
|
||||||
var feature = new _ol_Feature_(
|
var feature = new _ol_Feature_(
|
||||||
new _ol_geom_Point_([1, 2]).transform('EPSG:4326', 'EPSG:3857'));
|
new Point([1, 2]).transform('EPSG:4326', 'EPSG:3857'));
|
||||||
var wkt = format.writeFeature(feature, {
|
var wkt = format.writeFeature(feature, {
|
||||||
dataProjection: 'EPSG:4326',
|
dataProjection: 'EPSG:4326',
|
||||||
featureProjection: 'EPSG:3857'
|
featureProjection: 'EPSG:3857'
|
||||||
@@ -102,9 +102,9 @@ describe('ol.format.WKT', function() {
|
|||||||
it('transforms with dataProjection and featureProjection', function() {
|
it('transforms with dataProjection and featureProjection', function() {
|
||||||
var features = [
|
var features = [
|
||||||
new _ol_Feature_(
|
new _ol_Feature_(
|
||||||
new _ol_geom_Point_([1, 2]).transform('EPSG:4326', 'EPSG:3857')),
|
new Point([1, 2]).transform('EPSG:4326', 'EPSG:3857')),
|
||||||
new _ol_Feature_(
|
new _ol_Feature_(
|
||||||
new _ol_geom_Point_([4, 5]).transform('EPSG:4326', 'EPSG:3857'))
|
new Point([4, 5]).transform('EPSG:4326', 'EPSG:3857'))
|
||||||
];
|
];
|
||||||
var wkt = format.writeFeatures(features, {
|
var wkt = format.writeFeatures(features, {
|
||||||
dataProjection: 'EPSG:4326',
|
dataProjection: 'EPSG:4326',
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import _ol_geom_Geometry_ from '../../../../src/ol/geom/Geometry.js';
|
import _ol_geom_Geometry_ from '../../../../src/ol/geom/Geometry.js';
|
||||||
import _ol_geom_GeometryCollection_ from '../../../../src/ol/geom/GeometryCollection.js';
|
import _ol_geom_GeometryCollection_ from '../../../../src/ol/geom/GeometryCollection.js';
|
||||||
import _ol_geom_LineString_ from '../../../../src/ol/geom/LineString.js';
|
import _ol_geom_LineString_ from '../../../../src/ol/geom/LineString.js';
|
||||||
import _ol_geom_Point_ from '../../../../src/ol/geom/Point.js';
|
import Point from '../../../../src/ol/geom/Point.js';
|
||||||
import _ol_geom_Polygon_ from '../../../../src/ol/geom/Polygon.js';
|
import _ol_geom_Polygon_ from '../../../../src/ol/geom/Polygon.js';
|
||||||
|
|
||||||
describe('ol.geom.GeometryCollection', function() {
|
describe('ol.geom.GeometryCollection', function() {
|
||||||
@@ -14,7 +14,7 @@ describe('ol.geom.GeometryCollection', function() {
|
|||||||
|
|
||||||
var line, multi, point, poly;
|
var line, multi, point, poly;
|
||||||
beforeEach(function() {
|
beforeEach(function() {
|
||||||
point = new _ol_geom_Point_([10, 20]);
|
point = new Point([10, 20]);
|
||||||
line = new _ol_geom_LineString_([[10, 20], [30, 40]]);
|
line = new _ol_geom_LineString_([[10, 20], [30, 40]]);
|
||||||
poly = new _ol_geom_Polygon_([outer, inner1, inner2]);
|
poly = new _ol_geom_Polygon_([outer, inner1, inner2]);
|
||||||
multi = new _ol_geom_GeometryCollection_([point, line, poly]);
|
multi = new _ol_geom_GeometryCollection_([point, line, poly]);
|
||||||
@@ -43,7 +43,7 @@ describe('ol.geom.GeometryCollection', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('register new components', function(done) {
|
it('register new components', function(done) {
|
||||||
var point2 = new _ol_geom_Point_([10, 20]);
|
var point2 = new Point([10, 20]);
|
||||||
multi.setGeometriesArray([point2]);
|
multi.setGeometriesArray([point2]);
|
||||||
multi.on('change', function() {
|
multi.on('change', function() {
|
||||||
done();
|
done();
|
||||||
@@ -56,7 +56,7 @@ describe('ol.geom.GeometryCollection', function() {
|
|||||||
describe('#getGeometries', function() {
|
describe('#getGeometries', function() {
|
||||||
|
|
||||||
it('returns a collection of geometries', function() {
|
it('returns a collection of geometries', function() {
|
||||||
var point = new _ol_geom_Point_([10, 20]);
|
var point = new Point([10, 20]);
|
||||||
var line = new _ol_geom_LineString_([[10, 20], [30, 40]]);
|
var line = new _ol_geom_LineString_([[10, 20], [30, 40]]);
|
||||||
var poly = new _ol_geom_Polygon_([outer, inner1, inner2]);
|
var poly = new _ol_geom_Polygon_([outer, inner1, inner2]);
|
||||||
var multi = new _ol_geom_GeometryCollection_([point, line, poly]);
|
var multi = new _ol_geom_GeometryCollection_([point, line, poly]);
|
||||||
@@ -64,7 +64,7 @@ describe('ol.geom.GeometryCollection', function() {
|
|||||||
var geometries = multi.getGeometries();
|
var geometries = multi.getGeometries();
|
||||||
expect(geometries).to.be.an(Array);
|
expect(geometries).to.be.an(Array);
|
||||||
expect(geometries).to.have.length(3);
|
expect(geometries).to.have.length(3);
|
||||||
expect(geometries[0]).to.be.a(_ol_geom_Point_);
|
expect(geometries[0]).to.be.a(Point);
|
||||||
expect(geometries[1]).to.be.a(_ol_geom_LineString_);
|
expect(geometries[1]).to.be.a(_ol_geom_LineString_);
|
||||||
expect(geometries[2]).to.be.a(_ol_geom_Polygon_);
|
expect(geometries[2]).to.be.a(_ol_geom_Polygon_);
|
||||||
});
|
});
|
||||||
@@ -74,7 +74,7 @@ describe('ol.geom.GeometryCollection', function() {
|
|||||||
describe('#clone()', function() {
|
describe('#clone()', function() {
|
||||||
|
|
||||||
it('has a working clone method', function() {
|
it('has a working clone method', function() {
|
||||||
var point = new _ol_geom_Point_([10, 20]);
|
var point = new Point([10, 20]);
|
||||||
var line = new _ol_geom_LineString_([[10, 20], [30, 40]]);
|
var line = new _ol_geom_LineString_([[10, 20], [30, 40]]);
|
||||||
var poly = new _ol_geom_Polygon_([outer, inner1, inner2]);
|
var poly = new _ol_geom_Polygon_([outer, inner1, inner2]);
|
||||||
var multi = new _ol_geom_GeometryCollection_([point, line, poly]);
|
var multi = new _ol_geom_GeometryCollection_([point, line, poly]);
|
||||||
@@ -87,7 +87,7 @@ describe('ol.geom.GeometryCollection', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('does a deep clone', function() {
|
it('does a deep clone', function() {
|
||||||
var point = new _ol_geom_Point_([30, 40]);
|
var point = new Point([30, 40]);
|
||||||
var originalGeometries = [point];
|
var originalGeometries = [point];
|
||||||
var multi = new _ol_geom_GeometryCollection_(originalGeometries);
|
var multi = new _ol_geom_GeometryCollection_(originalGeometries);
|
||||||
var clone = multi.clone();
|
var clone = multi.clone();
|
||||||
@@ -105,7 +105,7 @@ describe('ol.geom.GeometryCollection', function() {
|
|||||||
describe('#getExtent()', function() {
|
describe('#getExtent()', function() {
|
||||||
|
|
||||||
it('returns the bounding extent', function() {
|
it('returns the bounding extent', function() {
|
||||||
var point = new _ol_geom_Point_([10, 2]);
|
var point = new Point([10, 2]);
|
||||||
var line = new _ol_geom_LineString_([[1, 20], [30, 40]]);
|
var line = new _ol_geom_LineString_([[1, 20], [30, 40]]);
|
||||||
var multi = new _ol_geom_GeometryCollection_([point, line]);
|
var multi = new _ol_geom_GeometryCollection_([point, line]);
|
||||||
var extent = multi.getExtent();
|
var extent = multi.getExtent();
|
||||||
@@ -122,7 +122,7 @@ describe('ol.geom.GeometryCollection', function() {
|
|||||||
var point, line, poly, multi;
|
var point, line, poly, multi;
|
||||||
|
|
||||||
beforeEach(function() {
|
beforeEach(function() {
|
||||||
point = new _ol_geom_Point_([5, 20]);
|
point = new Point([5, 20]);
|
||||||
line = new _ol_geom_LineString_([[10, 20], [30, 40]]);
|
line = new _ol_geom_LineString_([[10, 20], [30, 40]]);
|
||||||
poly = new _ol_geom_Polygon_([outer, inner1, inner2]);
|
poly = new _ol_geom_Polygon_([outer, inner1, inner2]);
|
||||||
multi = new _ol_geom_GeometryCollection_([point, line, poly]);
|
multi = new _ol_geom_GeometryCollection_([point, line, poly]);
|
||||||
@@ -151,7 +151,7 @@ describe('ol.geom.GeometryCollection', function() {
|
|||||||
|
|
||||||
var line, multi, point, poly;
|
var line, multi, point, poly;
|
||||||
beforeEach(function() {
|
beforeEach(function() {
|
||||||
point = new _ol_geom_Point_([10, 20]);
|
point = new Point([10, 20]);
|
||||||
line = new _ol_geom_LineString_([[10, 20], [30, 40]]);
|
line = new _ol_geom_LineString_([[10, 20], [30, 40]]);
|
||||||
poly = new _ol_geom_Polygon_([outer, inner1, inner2]);
|
poly = new _ol_geom_Polygon_([outer, inner1, inner2]);
|
||||||
multi = new _ol_geom_GeometryCollection_([point, line, poly]);
|
multi = new _ol_geom_GeometryCollection_([point, line, poly]);
|
||||||
@@ -176,7 +176,7 @@ describe('ol.geom.GeometryCollection', function() {
|
|||||||
|
|
||||||
it('scales a collection', function() {
|
it('scales a collection', function() {
|
||||||
var geom = new _ol_geom_GeometryCollection_([
|
var geom = new _ol_geom_GeometryCollection_([
|
||||||
new _ol_geom_Point_([-1, -2]),
|
new Point([-1, -2]),
|
||||||
new _ol_geom_LineString_([[0, 0], [1, 2]])
|
new _ol_geom_LineString_([[0, 0], [1, 2]])
|
||||||
]);
|
]);
|
||||||
geom.scale(10);
|
geom.scale(10);
|
||||||
@@ -187,7 +187,7 @@ describe('ol.geom.GeometryCollection', function() {
|
|||||||
|
|
||||||
it('accepts sx and sy', function() {
|
it('accepts sx and sy', function() {
|
||||||
var geom = new _ol_geom_GeometryCollection_([
|
var geom = new _ol_geom_GeometryCollection_([
|
||||||
new _ol_geom_Point_([-1, -2]),
|
new Point([-1, -2]),
|
||||||
new _ol_geom_LineString_([[0, 0], [1, 2]])
|
new _ol_geom_LineString_([[0, 0], [1, 2]])
|
||||||
]);
|
]);
|
||||||
geom.scale(2, 3);
|
geom.scale(2, 3);
|
||||||
@@ -198,7 +198,7 @@ describe('ol.geom.GeometryCollection', function() {
|
|||||||
|
|
||||||
it('accepts an anchor', function() {
|
it('accepts an anchor', function() {
|
||||||
var geom = new _ol_geom_GeometryCollection_([
|
var geom = new _ol_geom_GeometryCollection_([
|
||||||
new _ol_geom_Point_([-1, -2]),
|
new Point([-1, -2]),
|
||||||
new _ol_geom_LineString_([[0, 0], [1, 2]])
|
new _ol_geom_LineString_([[0, 0], [1, 2]])
|
||||||
]);
|
]);
|
||||||
geom.scale(10, 15, [-1, -2]);
|
geom.scale(10, 15, [-1, -2]);
|
||||||
@@ -213,7 +213,7 @@ describe('ol.geom.GeometryCollection', function() {
|
|||||||
|
|
||||||
var line, multi, point;
|
var line, multi, point;
|
||||||
beforeEach(function() {
|
beforeEach(function() {
|
||||||
point = new _ol_geom_Point_([10, 20]);
|
point = new Point([10, 20]);
|
||||||
line = new _ol_geom_LineString_([[10, 20], [30, 40]]);
|
line = new _ol_geom_LineString_([[10, 20], [30, 40]]);
|
||||||
multi = new _ol_geom_GeometryCollection_([point, line]);
|
multi = new _ol_geom_GeometryCollection_([point, line]);
|
||||||
});
|
});
|
||||||
@@ -222,7 +222,7 @@ describe('ol.geom.GeometryCollection', function() {
|
|||||||
multi.transform('EPSG:4326', 'EPSG:3857');
|
multi.transform('EPSG:4326', 'EPSG:3857');
|
||||||
|
|
||||||
var geometries = multi.getGeometries();
|
var geometries = multi.getGeometries();
|
||||||
expect(geometries[0]).to.be.a(_ol_geom_Point_);
|
expect(geometries[0]).to.be.a(Point);
|
||||||
expect(geometries[1]).to.be.a(_ol_geom_LineString_);
|
expect(geometries[1]).to.be.a(_ol_geom_LineString_);
|
||||||
|
|
||||||
var coords = geometries[0].getCoordinates();
|
var coords = geometries[0].getCoordinates();
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import * as _ol_extent_ from '../../../../src/ol/extent.js';
|
import * as _ol_extent_ from '../../../../src/ol/extent.js';
|
||||||
import _ol_geom_MultiPoint_ from '../../../../src/ol/geom/MultiPoint.js';
|
import _ol_geom_MultiPoint_ from '../../../../src/ol/geom/MultiPoint.js';
|
||||||
import _ol_geom_Point_ from '../../../../src/ol/geom/Point.js';
|
import Point from '../../../../src/ol/geom/Point.js';
|
||||||
|
|
||||||
|
|
||||||
describe('ol.geom.MultiPoint', function() {
|
describe('ol.geom.MultiPoint', function() {
|
||||||
@@ -39,9 +39,9 @@ describe('ol.geom.MultiPoint', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('can append points', function() {
|
it('can append points', function() {
|
||||||
multiPoint.appendPoint(new _ol_geom_Point_([1, 2]));
|
multiPoint.appendPoint(new Point([1, 2]));
|
||||||
expect(multiPoint.getCoordinates()).to.eql([[1, 2]]);
|
expect(multiPoint.getCoordinates()).to.eql([[1, 2]]);
|
||||||
multiPoint.appendPoint(new _ol_geom_Point_([3, 4]));
|
multiPoint.appendPoint(new Point([3, 4]));
|
||||||
expect(multiPoint.getCoordinates()).to.eql([[1, 2], [3, 4]]);
|
expect(multiPoint.getCoordinates()).to.eql([[1, 2], [3, 4]]);
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -157,10 +157,10 @@ describe('ol.geom.MultiPoint', function() {
|
|||||||
it('can return all points', function() {
|
it('can return all points', function() {
|
||||||
var points = multiPoint.getPoints();
|
var points = multiPoint.getPoints();
|
||||||
expect(points).to.have.length(2);
|
expect(points).to.have.length(2);
|
||||||
expect(points[0]).to.be.an(_ol_geom_Point_);
|
expect(points[0]).to.be.an(Point);
|
||||||
expect(points[0].getLayout()).to.be('XYM');
|
expect(points[0].getLayout()).to.be('XYM');
|
||||||
expect(points[0].getCoordinates()).to.eql([1, 2, 3]);
|
expect(points[0].getCoordinates()).to.eql([1, 2, 3]);
|
||||||
expect(points[1]).to.be.an(_ol_geom_Point_);
|
expect(points[1]).to.be.an(Point);
|
||||||
expect(points[1].getLayout()).to.be('XYM');
|
expect(points[1].getLayout()).to.be('XYM');
|
||||||
expect(points[1].getCoordinates()).to.eql([4, 5, 6]);
|
expect(points[1].getCoordinates()).to.eql([4, 5, 6]);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
import _ol_geom_Point_ from '../../../../src/ol/geom/Point.js';
|
import Point from '../../../../src/ol/geom/Point.js';
|
||||||
|
|
||||||
|
|
||||||
describe('ol.geom.Point', function() {
|
describe('ol.geom.Point', function() {
|
||||||
|
|
||||||
it('can be constructed with a null geometry', function() {
|
it('can be constructed with a null geometry', function() {
|
||||||
expect(function() {
|
expect(function() {
|
||||||
return new _ol_geom_Point_(null);
|
return new Point(null);
|
||||||
}).not.to.throwException();
|
}).not.to.throwException();
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -13,7 +13,7 @@ describe('ol.geom.Point', function() {
|
|||||||
|
|
||||||
var point;
|
var point;
|
||||||
beforeEach(function() {
|
beforeEach(function() {
|
||||||
point = new _ol_geom_Point_([1, 2]);
|
point = new Point([1, 2]);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('has the expected layout', function() {
|
it('has the expected layout', function() {
|
||||||
@@ -50,7 +50,7 @@ describe('ol.geom.Point', function() {
|
|||||||
|
|
||||||
var point;
|
var point;
|
||||||
beforeEach(function() {
|
beforeEach(function() {
|
||||||
point = new _ol_geom_Point_([1, 2, 3], 'XYM');
|
point = new Point([1, 2, 3], 'XYM');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('has the expected layout', function() {
|
it('has the expected layout', function() {
|
||||||
@@ -87,7 +87,7 @@ describe('ol.geom.Point', function() {
|
|||||||
|
|
||||||
var point;
|
var point;
|
||||||
beforeEach(function() {
|
beforeEach(function() {
|
||||||
point = new _ol_geom_Point_([1, 2, 3, 4]);
|
point = new Point([1, 2, 3, 4]);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('has the expected layout', function() {
|
it('has the expected layout', function() {
|
||||||
@@ -132,21 +132,21 @@ describe('ol.geom.Point', function() {
|
|||||||
describe('#scale()', function() {
|
describe('#scale()', function() {
|
||||||
|
|
||||||
it('scales a point', function() {
|
it('scales a point', function() {
|
||||||
var geom = new _ol_geom_Point_([1, 2]);
|
var geom = new Point([1, 2]);
|
||||||
geom.scale(10e6);
|
geom.scale(10e6);
|
||||||
var coordinates = geom.getCoordinates();
|
var coordinates = geom.getCoordinates();
|
||||||
expect(coordinates).to.eql([1, 2]);
|
expect(coordinates).to.eql([1, 2]);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('accepts sx and sy', function() {
|
it('accepts sx and sy', function() {
|
||||||
var geom = new _ol_geom_Point_([1, 2]);
|
var geom = new Point([1, 2]);
|
||||||
geom.scale(1e6, -42);
|
geom.scale(1e6, -42);
|
||||||
var coordinates = geom.getCoordinates();
|
var coordinates = geom.getCoordinates();
|
||||||
expect(coordinates).to.eql([1, 2]);
|
expect(coordinates).to.eql([1, 2]);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('accepts an anchor', function() {
|
it('accepts an anchor', function() {
|
||||||
var geom = new _ol_geom_Point_([1, 2]);
|
var geom = new Point([1, 2]);
|
||||||
geom.scale(10, 15, [0, 0]);
|
geom.scale(10, 15, [0, 0]);
|
||||||
var coordinates = geom.getCoordinates();
|
var coordinates = geom.getCoordinates();
|
||||||
expect(coordinates).to.eql([10, 30]);
|
expect(coordinates).to.eql([10, 30]);
|
||||||
@@ -158,7 +158,7 @@ describe('ol.geom.Point', function() {
|
|||||||
|
|
||||||
var point, transform;
|
var point, transform;
|
||||||
beforeEach(function() {
|
beforeEach(function() {
|
||||||
point = new _ol_geom_Point_([1, 2]);
|
point = new Point([1, 2]);
|
||||||
transform = sinon.spy();
|
transform = sinon.spy();
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -193,10 +193,10 @@ describe('ol.geom.Point', function() {
|
|||||||
describe('#transform()', function() {
|
describe('#transform()', function() {
|
||||||
|
|
||||||
it('transforms a geometry given CRS identifiers', function() {
|
it('transforms a geometry given CRS identifiers', function() {
|
||||||
var point = new _ol_geom_Point_([-111, 45]).transform(
|
var point = new Point([-111, 45]).transform(
|
||||||
'EPSG:4326', 'EPSG:3857');
|
'EPSG:4326', 'EPSG:3857');
|
||||||
|
|
||||||
expect(point).to.be.a(_ol_geom_Point_);
|
expect(point).to.be.a(Point);
|
||||||
|
|
||||||
var coords = point.getCoordinates();
|
var coords = point.getCoordinates();
|
||||||
|
|
||||||
@@ -205,7 +205,7 @@ describe('ol.geom.Point', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('modifies the original', function() {
|
it('modifies the original', function() {
|
||||||
var point = new _ol_geom_Point_([-111, 45]);
|
var point = new Point([-111, 45]);
|
||||||
point.transform('EPSG:4326', 'EPSG:3857');
|
point.transform('EPSG:4326', 'EPSG:3857');
|
||||||
var coords = point.getCoordinates();
|
var coords = point.getCoordinates();
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import _ol_geom_LineString_ from '../../../../src/ol/geom/LineString.js';
|
|||||||
import _ol_geom_MultiLineString_ from '../../../../src/ol/geom/MultiLineString.js';
|
import _ol_geom_MultiLineString_ from '../../../../src/ol/geom/MultiLineString.js';
|
||||||
import _ol_geom_MultiPoint_ from '../../../../src/ol/geom/MultiPoint.js';
|
import _ol_geom_MultiPoint_ from '../../../../src/ol/geom/MultiPoint.js';
|
||||||
import _ol_geom_MultiPolygon_ from '../../../../src/ol/geom/MultiPolygon.js';
|
import _ol_geom_MultiPolygon_ from '../../../../src/ol/geom/MultiPolygon.js';
|
||||||
import _ol_geom_Point_ from '../../../../src/ol/geom/Point.js';
|
import Point from '../../../../src/ol/geom/Point.js';
|
||||||
import _ol_geom_Polygon_ from '../../../../src/ol/geom/Polygon.js';
|
import _ol_geom_Polygon_ from '../../../../src/ol/geom/Polygon.js';
|
||||||
import _ol_interaction_Draw_ from '../../../../src/ol/interaction/Draw.js';
|
import _ol_interaction_Draw_ from '../../../../src/ol/interaction/Draw.js';
|
||||||
import _ol_interaction_Interaction_ from '../../../../src/ol/interaction/Interaction.js';
|
import _ol_interaction_Interaction_ from '../../../../src/ol/interaction/Interaction.js';
|
||||||
@@ -123,7 +123,7 @@ describe('ol.interaction.Draw', function() {
|
|||||||
var features = source.getFeatures();
|
var features = source.getFeatures();
|
||||||
var geometry = features[0].getGeometry();
|
var geometry = features[0].getGeometry();
|
||||||
expect(features[0].getGeometryName()).to.equal('the_geom');
|
expect(features[0].getGeometryName()).to.equal('the_geom');
|
||||||
expect(geometry).to.be.a(_ol_geom_Point_);
|
expect(geometry).to.be.a(Point);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -172,7 +172,7 @@ describe('ol.interaction.Draw', function() {
|
|||||||
var features = source.getFeatures();
|
var features = source.getFeatures();
|
||||||
expect(features).to.have.length(1);
|
expect(features).to.have.length(1);
|
||||||
var geometry = features[0].getGeometry();
|
var geometry = features[0].getGeometry();
|
||||||
expect(geometry).to.be.a(_ol_geom_Point_);
|
expect(geometry).to.be.a(Point);
|
||||||
expect(geometry.getCoordinates()).to.eql([10, -20]);
|
expect(geometry.getCoordinates()).to.eql([10, -20]);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import _ol_events_ from '../../../../src/ol/events.js';
|
|||||||
import _ol_events_condition_ from '../../../../src/ol/events/condition.js';
|
import _ol_events_condition_ from '../../../../src/ol/events/condition.js';
|
||||||
import _ol_geom_Circle_ from '../../../../src/ol/geom/Circle.js';
|
import _ol_geom_Circle_ from '../../../../src/ol/geom/Circle.js';
|
||||||
import _ol_geom_LineString_ from '../../../../src/ol/geom/LineString.js';
|
import _ol_geom_LineString_ from '../../../../src/ol/geom/LineString.js';
|
||||||
import _ol_geom_Point_ from '../../../../src/ol/geom/Point.js';
|
import Point from '../../../../src/ol/geom/Point.js';
|
||||||
import _ol_geom_Polygon_ from '../../../../src/ol/geom/Polygon.js';
|
import _ol_geom_Polygon_ from '../../../../src/ol/geom/Polygon.js';
|
||||||
import _ol_interaction_Modify_ from '../../../../src/ol/interaction/Modify.js';
|
import _ol_interaction_Modify_ from '../../../../src/ol/interaction/Modify.js';
|
||||||
import _ol_layer_Vector_ from '../../../../src/ol/layer/Vector.js';
|
import _ol_layer_Vector_ from '../../../../src/ol/layer/Vector.js';
|
||||||
@@ -152,7 +152,7 @@ describe('ol.interaction.Modify', function() {
|
|||||||
describe('constructor', function() {
|
describe('constructor', function() {
|
||||||
it('adds features to the RTree', function() {
|
it('adds features to the RTree', function() {
|
||||||
var feature = new _ol_Feature_(
|
var feature = new _ol_Feature_(
|
||||||
new _ol_geom_Point_([0, 0]));
|
new Point([0, 0]));
|
||||||
var features = new _ol_Collection_([feature]);
|
var features = new _ol_Collection_([feature]);
|
||||||
var modify = new _ol_interaction_Modify_({
|
var modify = new _ol_interaction_Modify_({
|
||||||
features: features
|
features: features
|
||||||
@@ -171,7 +171,7 @@ describe('ol.interaction.Modify', function() {
|
|||||||
var rbushEntries = modify.rBush_.getAll();
|
var rbushEntries = modify.rBush_.getAll();
|
||||||
expect(rbushEntries.length).to.be(0);
|
expect(rbushEntries.length).to.be(0);
|
||||||
|
|
||||||
feature.setGeometry(new _ol_geom_Point_([0, 10]));
|
feature.setGeometry(new Point([0, 10]));
|
||||||
rbushEntries = modify.rBush_.getAll();
|
rbushEntries = modify.rBush_.getAll();
|
||||||
expect(rbushEntries.length).to.be(1);
|
expect(rbushEntries.length).to.be(1);
|
||||||
expect(rbushEntries[0].feature).to.be(feature);
|
expect(rbushEntries[0].feature).to.be(feature);
|
||||||
@@ -179,7 +179,7 @@ describe('ol.interaction.Modify', function() {
|
|||||||
|
|
||||||
it('accepts a source', function() {
|
it('accepts a source', function() {
|
||||||
var feature = new _ol_Feature_(
|
var feature = new _ol_Feature_(
|
||||||
new _ol_geom_Point_([0, 0]));
|
new Point([0, 0]));
|
||||||
var source = new _ol_source_Vector_({features: [feature]});
|
var source = new _ol_source_Vector_({features: [feature]});
|
||||||
var modify = new _ol_interaction_Modify_({source: source});
|
var modify = new _ol_interaction_Modify_({source: source});
|
||||||
var rbushEntries = modify.rBush_.getAll();
|
var rbushEntries = modify.rBush_.getAll();
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import _ol_Feature_ from '../../../../src/ol/Feature.js';
|
|||||||
import _ol_Map_ from '../../../../src/ol/Map.js';
|
import _ol_Map_ from '../../../../src/ol/Map.js';
|
||||||
import _ol_View_ from '../../../../src/ol/View.js';
|
import _ol_View_ from '../../../../src/ol/View.js';
|
||||||
import _ol_geom_Circle_ from '../../../../src/ol/geom/Circle.js';
|
import _ol_geom_Circle_ from '../../../../src/ol/geom/Circle.js';
|
||||||
import _ol_geom_Point_ from '../../../../src/ol/geom/Point.js';
|
import Point from '../../../../src/ol/geom/Point.js';
|
||||||
import _ol_geom_LineString_ from '../../../../src/ol/geom/LineString.js';
|
import _ol_geom_LineString_ from '../../../../src/ol/geom/LineString.js';
|
||||||
import _ol_interaction_Snap_ from '../../../../src/ol/interaction/Snap.js';
|
import _ol_interaction_Snap_ from '../../../../src/ol/interaction/Snap.js';
|
||||||
|
|
||||||
@@ -56,7 +56,7 @@ describe('ol.interaction.Snap', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('can handle XYZ coordinates', function() {
|
it('can handle XYZ coordinates', function() {
|
||||||
var point = new _ol_Feature_(new _ol_geom_Point_([0, 0, 123]));
|
var point = new _ol_Feature_(new Point([0, 0, 123]));
|
||||||
var snapInteraction = new _ol_interaction_Snap_({
|
var snapInteraction = new _ol_interaction_Snap_({
|
||||||
features: new _ol_Collection_([point])
|
features: new _ol_Collection_([point])
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import _ol_Feature_ from '../../../../src/ol/Feature.js';
|
|||||||
import _ol_Map_ from '../../../../src/ol/Map.js';
|
import _ol_Map_ from '../../../../src/ol/Map.js';
|
||||||
import _ol_MapBrowserPointerEvent_ from '../../../../src/ol/MapBrowserPointerEvent.js';
|
import _ol_MapBrowserPointerEvent_ from '../../../../src/ol/MapBrowserPointerEvent.js';
|
||||||
import _ol_View_ from '../../../../src/ol/View.js';
|
import _ol_View_ from '../../../../src/ol/View.js';
|
||||||
import _ol_geom_Point_ from '../../../../src/ol/geom/Point.js';
|
import Point from '../../../../src/ol/geom/Point.js';
|
||||||
import _ol_interaction_Translate_ from '../../../../src/ol/interaction/Translate.js';
|
import _ol_interaction_Translate_ from '../../../../src/ol/interaction/Translate.js';
|
||||||
import _ol_interaction_Interaction_ from '../../../../src/ol/interaction/Interaction.js';
|
import _ol_interaction_Interaction_ from '../../../../src/ol/interaction/Interaction.js';
|
||||||
import _ol_layer_Vector_ from '../../../../src/ol/layer/Vector.js';
|
import _ol_layer_Vector_ from '../../../../src/ol/layer/Vector.js';
|
||||||
@@ -28,9 +28,9 @@ describe('ol.interaction.Translate', function() {
|
|||||||
document.body.appendChild(target);
|
document.body.appendChild(target);
|
||||||
source = new _ol_source_Vector_();
|
source = new _ol_source_Vector_();
|
||||||
features = [new _ol_Feature_({
|
features = [new _ol_Feature_({
|
||||||
geometry: new _ol_geom_Point_([10, -20])
|
geometry: new Point([10, -20])
|
||||||
}), new _ol_Feature_({
|
}), new _ol_Feature_({
|
||||||
geometry: new _ol_geom_Point_([20, -30])
|
geometry: new Point([20, -30])
|
||||||
})];
|
})];
|
||||||
source.addFeatures(features);
|
source.addFeatures(features);
|
||||||
var layer = new _ol_layer_Vector_({source: source});
|
var layer = new _ol_layer_Vector_({source: source});
|
||||||
@@ -172,7 +172,7 @@ describe('ol.interaction.Translate', function() {
|
|||||||
simulateEvent('pointerdrag', 50, -40);
|
simulateEvent('pointerdrag', 50, -40);
|
||||||
simulateEvent('pointerup', 50, -40);
|
simulateEvent('pointerup', 50, -40);
|
||||||
var geometry = features[0].getGeometry();
|
var geometry = features[0].getGeometry();
|
||||||
expect(geometry).to.be.a(_ol_geom_Point_);
|
expect(geometry).to.be.a(Point);
|
||||||
expect(geometry.getCoordinates()).to.eql([50, 40]);
|
expect(geometry.getCoordinates()).to.eql([50, 40]);
|
||||||
|
|
||||||
validateEvents(events, [features[0]]);
|
validateEvents(events, [features[0]]);
|
||||||
@@ -186,7 +186,7 @@ describe('ol.interaction.Translate', function() {
|
|||||||
simulateEvent('pointerdrag', 50, -40);
|
simulateEvent('pointerdrag', 50, -40);
|
||||||
simulateEvent('pointerup', 50, -40);
|
simulateEvent('pointerup', 50, -40);
|
||||||
var geometry = features[1].getGeometry();
|
var geometry = features[1].getGeometry();
|
||||||
expect(geometry).to.be.a(_ol_geom_Point_);
|
expect(geometry).to.be.a(Point);
|
||||||
expect(geometry.getCoordinates()).to.eql([20, -30]);
|
expect(geometry.getCoordinates()).to.eql([20, -30]);
|
||||||
|
|
||||||
expect(events).to.be.empty();
|
expect(events).to.be.empty();
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import _ol_Map_ from '../../../src/ol/Map.js';
|
|||||||
import _ol_MapEvent_ from '../../../src/ol/MapEvent.js';
|
import _ol_MapEvent_ from '../../../src/ol/MapEvent.js';
|
||||||
import _ol_Overlay_ from '../../../src/ol/Overlay.js';
|
import _ol_Overlay_ from '../../../src/ol/Overlay.js';
|
||||||
import _ol_View_ from '../../../src/ol/View.js';
|
import _ol_View_ from '../../../src/ol/View.js';
|
||||||
import _ol_geom_Point_ from '../../../src/ol/geom/Point.js';
|
import Point from '../../../src/ol/geom/Point.js';
|
||||||
import _ol_has_ from '../../../src/ol/has.js';
|
import _ol_has_ from '../../../src/ol/has.js';
|
||||||
import _ol_interaction_ from '../../../src/ol/interaction.js';
|
import _ol_interaction_ from '../../../src/ol/interaction.js';
|
||||||
import _ol_interaction_DoubleClickZoom_ from '../../../src/ol/interaction/DoubleClickZoom.js';
|
import _ol_interaction_DoubleClickZoom_ from '../../../src/ol/interaction/DoubleClickZoom.js';
|
||||||
@@ -197,7 +197,7 @@ describe('ol.Map', function() {
|
|||||||
target: target,
|
target: target,
|
||||||
layers: [new _ol_layer_Vector_({
|
layers: [new _ol_layer_Vector_({
|
||||||
source: new _ol_source_Vector_({
|
source: new _ol_source_Vector_({
|
||||||
features: [new _ol_Feature_(new _ol_geom_Point_([0, 0]))]
|
features: [new _ol_Feature_(new Point([0, 0]))]
|
||||||
})
|
})
|
||||||
})],
|
})],
|
||||||
view: new _ol_View_({
|
view: new _ol_View_({
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import _ol_geom_LineString_ from '../../../../../src/ol/geom/LineString.js';
|
|||||||
import _ol_geom_MultiLineString_ from '../../../../../src/ol/geom/MultiLineString.js';
|
import _ol_geom_MultiLineString_ from '../../../../../src/ol/geom/MultiLineString.js';
|
||||||
import _ol_geom_MultiPoint_ from '../../../../../src/ol/geom/MultiPoint.js';
|
import _ol_geom_MultiPoint_ from '../../../../../src/ol/geom/MultiPoint.js';
|
||||||
import _ol_geom_MultiPolygon_ from '../../../../../src/ol/geom/MultiPolygon.js';
|
import _ol_geom_MultiPolygon_ from '../../../../../src/ol/geom/MultiPolygon.js';
|
||||||
import _ol_geom_Point_ from '../../../../../src/ol/geom/Point.js';
|
import Point from '../../../../../src/ol/geom/Point.js';
|
||||||
import _ol_geom_Polygon_ from '../../../../../src/ol/geom/Polygon.js';
|
import _ol_geom_Polygon_ from '../../../../../src/ol/geom/Polygon.js';
|
||||||
import _ol_render_VectorContext_ from '../../../../../src/ol/render/VectorContext.js';
|
import _ol_render_VectorContext_ from '../../../../../src/ol/render/VectorContext.js';
|
||||||
import _ol_render_canvas_Immediate_ from '../../../../../src/ol/render/canvas/Immediate.js';
|
import _ol_render_canvas_Immediate_ from '../../../../../src/ol/render/canvas/Immediate.js';
|
||||||
@@ -71,7 +71,7 @@ describe('ol.render.canvas.Immediate', function() {
|
|||||||
var context = new _ol_render_canvas_Immediate_(getMockContext(), 1, extent);
|
var context = new _ol_render_canvas_Immediate_(getMockContext(), 1, extent);
|
||||||
sinon.spy(context, 'drawPoint');
|
sinon.spy(context, 'drawPoint');
|
||||||
|
|
||||||
var geometry = new _ol_geom_Point_([1, 2]);
|
var geometry = new Point([1, 2]);
|
||||||
context.drawGeometry(geometry);
|
context.drawGeometry(geometry);
|
||||||
expect(context.drawPoint.calledOnce).to.be(true);
|
expect(context.drawPoint.calledOnce).to.be(true);
|
||||||
expect(context.drawPoint.firstCall.calledWithExactly(geometry)).to.be(true);
|
expect(context.drawPoint.firstCall.calledWithExactly(geometry)).to.be(true);
|
||||||
@@ -134,7 +134,7 @@ describe('ol.render.canvas.Immediate', function() {
|
|||||||
sinon.spy(context, 'drawLineString');
|
sinon.spy(context, 'drawLineString');
|
||||||
sinon.spy(context, 'drawPolygon');
|
sinon.spy(context, 'drawPolygon');
|
||||||
|
|
||||||
var point = new _ol_geom_Point_([1, 2]);
|
var point = new Point([1, 2]);
|
||||||
var linestring = new _ol_geom_LineString_([[1, 2], [3, 4]]);
|
var linestring = new _ol_geom_LineString_([[1, 2], [3, 4]]);
|
||||||
var polygon = new _ol_geom_Polygon_([[[1, 2], [3, 4], [5, 6], [1, 2]]]);
|
var polygon = new _ol_geom_Polygon_([[[1, 2], [3, 4], [5, 6], [1, 2]]]);
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import _ol_geom_MultiPoint_ from '../../../../../src/ol/geom/MultiPoint.js';
|
import _ol_geom_MultiPoint_ from '../../../../../src/ol/geom/MultiPoint.js';
|
||||||
import _ol_geom_Point_ from '../../../../../src/ol/geom/Point.js';
|
import Point from '../../../../../src/ol/geom/Point.js';
|
||||||
import _ol_render_webgl_ImageReplay_ from '../../../../../src/ol/render/webgl/ImageReplay.js';
|
import _ol_render_webgl_ImageReplay_ from '../../../../../src/ol/render/webgl/ImageReplay.js';
|
||||||
import _ol_style_Image_ from '../../../../../src/ol/style/Image.js';
|
import _ol_style_Image_ from '../../../../../src/ol/style/Image.js';
|
||||||
|
|
||||||
@@ -94,7 +94,7 @@ describe('ol.render.webgl.ImageReplay', function() {
|
|||||||
it('sets the buffer data', function() {
|
it('sets the buffer data', function() {
|
||||||
var point;
|
var point;
|
||||||
|
|
||||||
point = new _ol_geom_Point_([1000, 2000]);
|
point = new Point([1000, 2000]);
|
||||||
replay.drawPoint(point, null);
|
replay.drawPoint(point, null);
|
||||||
expect(replay.vertices).to.have.length(32);
|
expect(replay.vertices).to.have.length(32);
|
||||||
expect(replay.indices).to.have.length(6);
|
expect(replay.indices).to.have.length(6);
|
||||||
@@ -105,7 +105,7 @@ describe('ol.render.webgl.ImageReplay', function() {
|
|||||||
expect(replay.indices[4]).to.be(2);
|
expect(replay.indices[4]).to.be(2);
|
||||||
expect(replay.indices[5]).to.be(3);
|
expect(replay.indices[5]).to.be(3);
|
||||||
|
|
||||||
point = new _ol_geom_Point_([2000, 3000]);
|
point = new Point([2000, 3000]);
|
||||||
replay.drawPoint(point, null);
|
replay.drawPoint(point, null);
|
||||||
expect(replay.vertices).to.have.length(64);
|
expect(replay.vertices).to.have.length(64);
|
||||||
expect(replay.indices).to.have.length(12);
|
expect(replay.indices).to.have.length(12);
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import _ol_geom_LineString_ from '../../../../../src/ol/geom/LineString.js';
|
|||||||
import _ol_geom_MultiLineString_ from '../../../../../src/ol/geom/MultiLineString.js';
|
import _ol_geom_MultiLineString_ from '../../../../../src/ol/geom/MultiLineString.js';
|
||||||
import _ol_geom_MultiPoint_ from '../../../../../src/ol/geom/MultiPoint.js';
|
import _ol_geom_MultiPoint_ from '../../../../../src/ol/geom/MultiPoint.js';
|
||||||
import _ol_geom_MultiPolygon_ from '../../../../../src/ol/geom/MultiPolygon.js';
|
import _ol_geom_MultiPolygon_ from '../../../../../src/ol/geom/MultiPolygon.js';
|
||||||
import _ol_geom_Point_ from '../../../../../src/ol/geom/Point.js';
|
import Point from '../../../../../src/ol/geom/Point.js';
|
||||||
import _ol_geom_Polygon_ from '../../../../../src/ol/geom/Polygon.js';
|
import _ol_geom_Polygon_ from '../../../../../src/ol/geom/Polygon.js';
|
||||||
import _ol_render_webgl_CircleReplay_ from '../../../../../src/ol/render/webgl/CircleReplay.js';
|
import _ol_render_webgl_CircleReplay_ from '../../../../../src/ol/render/webgl/CircleReplay.js';
|
||||||
import _ol_render_webgl_ImageReplay_ from '../../../../../src/ol/render/webgl/ImageReplay.js';
|
import _ol_render_webgl_ImageReplay_ from '../../../../../src/ol/render/webgl/ImageReplay.js';
|
||||||
@@ -29,7 +29,7 @@ describe('ol.render.webgl.Immediate', function() {
|
|||||||
circle = new _ol_geom_Circle_([0, 0], 5);
|
circle = new _ol_geom_Circle_([0, 0], 5);
|
||||||
line = new _ol_geom_LineString_([[0, 0], [5, 5]]);
|
line = new _ol_geom_LineString_([[0, 0], [5, 5]]);
|
||||||
multiLine = new _ol_geom_MultiLineString_([[[0, 0], [5, 5]]]);
|
multiLine = new _ol_geom_MultiLineString_([[[0, 0], [5, 5]]]);
|
||||||
point = new _ol_geom_Point_([0, 0]);
|
point = new Point([0, 0]);
|
||||||
multiPoint = new _ol_geom_MultiPoint_([[0, 0]]);
|
multiPoint = new _ol_geom_MultiPoint_([[0, 0]]);
|
||||||
polygon = new _ol_geom_Polygon_([[[0, 0], [5, 5], [5, 0], [0, 0]]]);
|
polygon = new _ol_geom_Polygon_([[[0, 0], [5, 5], [5, 0], [0, 0]]]);
|
||||||
multiPolygon = new _ol_geom_MultiPolygon_([[[[0, 0], [5, 5], [5, 0], [0, 0]]]]);
|
multiPolygon = new _ol_geom_MultiPolygon_([[[[0, 0], [5, 5], [5, 0], [0, 0]]]]);
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import {createCanvasContext2D} from '../../../../../src/ol/dom.js';
|
import {createCanvasContext2D} from '../../../../../src/ol/dom.js';
|
||||||
import _ol_geom_Point_ from '../../../../../src/ol/geom/Point.js';
|
import Point from '../../../../../src/ol/geom/Point.js';
|
||||||
import _ol_render_webgl_TextReplay_ from '../../../../../src/ol/render/webgl/TextReplay.js';
|
import _ol_render_webgl_TextReplay_ from '../../../../../src/ol/render/webgl/TextReplay.js';
|
||||||
import _ol_style_Fill_ from '../../../../../src/ol/style/Fill.js';
|
import _ol_style_Fill_ from '../../../../../src/ol/style/Fill.js';
|
||||||
import _ol_style_Stroke_ from '../../../../../src/ol/style/Stroke.js';
|
import _ol_style_Stroke_ from '../../../../../src/ol/style/Stroke.js';
|
||||||
@@ -126,19 +126,19 @@ describe('ol.render.webgl.TextReplay', function() {
|
|||||||
var point;
|
var point;
|
||||||
|
|
||||||
point = [1000, 2000];
|
point = [1000, 2000];
|
||||||
replay.drawText(new _ol_geom_Point_(point), null);
|
replay.drawText(new Point(point), null);
|
||||||
expect(replay.vertices).to.have.length(256);
|
expect(replay.vertices).to.have.length(256);
|
||||||
expect(replay.indices).to.have.length(48);
|
expect(replay.indices).to.have.length(48);
|
||||||
|
|
||||||
point = [2000, 3000];
|
point = [2000, 3000];
|
||||||
replay.drawText(new _ol_geom_Point_(point), null);
|
replay.drawText(new Point(point), null);
|
||||||
expect(replay.vertices).to.have.length(512);
|
expect(replay.vertices).to.have.length(512);
|
||||||
expect(replay.indices).to.have.length(96);
|
expect(replay.indices).to.have.length(96);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('sets part of its state during drawing', function() {
|
it('sets part of its state during drawing', function() {
|
||||||
var point = [1000, 2000];
|
var point = [1000, 2000];
|
||||||
replay.drawText(new _ol_geom_Point_(point), null);
|
replay.drawText(new Point(point), null);
|
||||||
|
|
||||||
var height = replay.currAtlas_.height;
|
var height = replay.currAtlas_.height;
|
||||||
var widths = replay.currAtlas_.width;
|
var widths = replay.currAtlas_.width;
|
||||||
@@ -162,7 +162,7 @@ describe('ol.render.webgl.TextReplay', function() {
|
|||||||
var point;
|
var point;
|
||||||
|
|
||||||
point = [1000, 2000];
|
point = [1000, 2000];
|
||||||
replay.drawText(new _ol_geom_Point_(point), null);
|
replay.drawText(new Point(point), null);
|
||||||
expect(replay.vertices).to.have.length(0);
|
expect(replay.vertices).to.have.length(0);
|
||||||
expect(replay.indices).to.have.length(0);
|
expect(replay.indices).to.have.length(0);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import {getUid} from '../../../../../src/ol/index.js';
|
|||||||
import _ol_Feature_ from '../../../../../src/ol/Feature.js';
|
import _ol_Feature_ from '../../../../../src/ol/Feature.js';
|
||||||
import _ol_Map_ from '../../../../../src/ol/Map.js';
|
import _ol_Map_ from '../../../../../src/ol/Map.js';
|
||||||
import _ol_View_ from '../../../../../src/ol/View.js';
|
import _ol_View_ from '../../../../../src/ol/View.js';
|
||||||
import _ol_geom_Point_ from '../../../../../src/ol/geom/Point.js';
|
import Point from '../../../../../src/ol/geom/Point.js';
|
||||||
import _ol_layer_Tile_ from '../../../../../src/ol/layer/Tile.js';
|
import _ol_layer_Tile_ from '../../../../../src/ol/layer/Tile.js';
|
||||||
import _ol_layer_Vector_ from '../../../../../src/ol/layer/Vector.js';
|
import _ol_layer_Vector_ from '../../../../../src/ol/layer/Vector.js';
|
||||||
import _ol_renderer_canvas_Layer_ from '../../../../../src/ol/renderer/canvas/Layer.js';
|
import _ol_renderer_canvas_Layer_ from '../../../../../src/ol/renderer/canvas/Layer.js';
|
||||||
@@ -54,7 +54,7 @@ describe('ol.renderer.canvas.Map', function() {
|
|||||||
source: new _ol_source_Vector_({
|
source: new _ol_source_Vector_({
|
||||||
features: [
|
features: [
|
||||||
new _ol_Feature_({
|
new _ol_Feature_({
|
||||||
geometry: new _ol_geom_Point_([0, 0])
|
geometry: new Point([0, 0])
|
||||||
})
|
})
|
||||||
]
|
]
|
||||||
}),
|
}),
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import _ol_geom_LineString_ from '../../../../../src/ol/geom/LineString.js';
|
|||||||
import _ol_geom_MultiLineString_ from '../../../../../src/ol/geom/MultiLineString.js';
|
import _ol_geom_MultiLineString_ from '../../../../../src/ol/geom/MultiLineString.js';
|
||||||
import _ol_geom_MultiPoint_ from '../../../../../src/ol/geom/MultiPoint.js';
|
import _ol_geom_MultiPoint_ from '../../../../../src/ol/geom/MultiPoint.js';
|
||||||
import _ol_geom_MultiPolygon_ from '../../../../../src/ol/geom/MultiPolygon.js';
|
import _ol_geom_MultiPolygon_ from '../../../../../src/ol/geom/MultiPolygon.js';
|
||||||
import _ol_geom_Point_ from '../../../../../src/ol/geom/Point.js';
|
import Point from '../../../../../src/ol/geom/Point.js';
|
||||||
import _ol_geom_Polygon_ from '../../../../../src/ol/geom/Polygon.js';
|
import _ol_geom_Polygon_ from '../../../../../src/ol/geom/Polygon.js';
|
||||||
import _ol_render_canvas_LineStringReplay_ from '../../../../../src/ol/render/canvas/LineStringReplay.js';
|
import _ol_render_canvas_LineStringReplay_ from '../../../../../src/ol/render/canvas/LineStringReplay.js';
|
||||||
import _ol_render_canvas_PolygonReplay_ from '../../../../../src/ol/render/canvas/PolygonReplay.js';
|
import _ol_render_canvas_PolygonReplay_ from '../../../../../src/ol/render/canvas/PolygonReplay.js';
|
||||||
@@ -229,7 +229,7 @@ describe('ol.render.canvas.ReplayGroup', function() {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
var point = new _ol_Feature_(new _ol_geom_Point_([45, 90]));
|
var point = new _ol_Feature_(new Point([45, 90]));
|
||||||
var multipoint = new _ol_Feature_(new _ol_geom_MultiPoint_(
|
var multipoint = new _ol_Feature_(new _ol_geom_MultiPoint_(
|
||||||
[[45, 90], [90, 45]]));
|
[[45, 90], [90, 45]]));
|
||||||
var linestring = new _ol_Feature_(new _ol_geom_LineString_(
|
var linestring = new _ol_Feature_(new _ol_geom_LineString_(
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import _ol_Feature_ from '../../../../../src/ol/Feature.js';
|
|||||||
import _ol_Map_ from '../../../../../src/ol/Map.js';
|
import _ol_Map_ from '../../../../../src/ol/Map.js';
|
||||||
import _ol_View_ from '../../../../../src/ol/View.js';
|
import _ol_View_ from '../../../../../src/ol/View.js';
|
||||||
import * as _ol_extent_ from '../../../../../src/ol/extent.js';
|
import * as _ol_extent_ from '../../../../../src/ol/extent.js';
|
||||||
import _ol_geom_Point_ from '../../../../../src/ol/geom/Point.js';
|
import Point from '../../../../../src/ol/geom/Point.js';
|
||||||
import _ol_layer_Vector_ from '../../../../../src/ol/layer/Vector.js';
|
import _ol_layer_Vector_ from '../../../../../src/ol/layer/Vector.js';
|
||||||
import _ol_obj_ from '../../../../../src/ol/obj.js';
|
import _ol_obj_ from '../../../../../src/ol/obj.js';
|
||||||
import {get as getProjection} from '../../../../../src/ol/proj.js';
|
import {get as getProjection} from '../../../../../src/ol/proj.js';
|
||||||
@@ -66,8 +66,8 @@ describe('ol.renderer.canvas.VectorLayer', function() {
|
|||||||
text: 'feature'
|
text: 'feature'
|
||||||
})
|
})
|
||||||
})];
|
})];
|
||||||
var feature1 = new _ol_Feature_(new _ol_geom_Point_([0, 0]));
|
var feature1 = new _ol_Feature_(new Point([0, 0]));
|
||||||
var feature2 = new _ol_Feature_(new _ol_geom_Point_([0, 0]));
|
var feature2 = new _ol_Feature_(new Point([0, 0]));
|
||||||
feature2.setStyle(featureStyle);
|
feature2.setStyle(featureStyle);
|
||||||
var layer = new _ol_layer_Vector_({
|
var layer = new _ol_layer_Vector_({
|
||||||
source: new _ol_source_Vector_({
|
source: new _ol_source_Vector_({
|
||||||
@@ -100,7 +100,7 @@ describe('ol.renderer.canvas.VectorLayer', function() {
|
|||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
var feature = new _ol_Feature_(new _ol_geom_Point_([0, 0]));
|
var feature = new _ol_Feature_(new Point([0, 0]));
|
||||||
var layer = new _ol_layer_Vector_({
|
var layer = new _ol_layer_Vector_({
|
||||||
source: new _ol_source_Vector_({
|
source: new _ol_source_Vector_({
|
||||||
features: [feature]
|
features: [feature]
|
||||||
@@ -131,7 +131,7 @@ describe('ol.renderer.canvas.VectorLayer', function() {
|
|||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
var feature = new _ol_Feature_(new _ol_geom_Point_([0, 0]));
|
var feature = new _ol_Feature_(new Point([0, 0]));
|
||||||
var layer = new _ol_layer_Vector_({
|
var layer = new _ol_layer_Vector_({
|
||||||
source: new _ol_source_Vector_({
|
source: new _ol_source_Vector_({
|
||||||
features: [feature]
|
features: [feature]
|
||||||
@@ -163,7 +163,7 @@ describe('ol.renderer.canvas.VectorLayer', function() {
|
|||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
var feature = new _ol_Feature_(new _ol_geom_Point_([0, 0]));
|
var feature = new _ol_Feature_(new Point([0, 0]));
|
||||||
var layer = new _ol_layer_Vector_({
|
var layer = new _ol_layer_Vector_({
|
||||||
source: new _ol_source_Vector_({
|
source: new _ol_source_Vector_({
|
||||||
features: [feature]
|
features: [feature]
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import _ol_VectorTile_ from '../../../../../src/ol/VectorTile.js';
|
|||||||
import _ol_View_ from '../../../../../src/ol/View.js';
|
import _ol_View_ from '../../../../../src/ol/View.js';
|
||||||
import * as _ol_extent_ from '../../../../../src/ol/extent.js';
|
import * as _ol_extent_ from '../../../../../src/ol/extent.js';
|
||||||
import _ol_format_MVT_ from '../../../../../src/ol/format/MVT.js';
|
import _ol_format_MVT_ from '../../../../../src/ol/format/MVT.js';
|
||||||
import _ol_geom_Point_ from '../../../../../src/ol/geom/Point.js';
|
import Point from '../../../../../src/ol/geom/Point.js';
|
||||||
import _ol_layer_VectorTile_ from '../../../../../src/ol/layer/VectorTile.js';
|
import _ol_layer_VectorTile_ from '../../../../../src/ol/layer/VectorTile.js';
|
||||||
import {get as getProjection, fromLonLat} from '../../../../../src/ol/proj.js';
|
import {get as getProjection, fromLonLat} from '../../../../../src/ol/proj.js';
|
||||||
import _ol_proj_Projection_ from '../../../../../src/ol/proj/Projection.js';
|
import _ol_proj_Projection_ from '../../../../../src/ol/proj/Projection.js';
|
||||||
@@ -55,8 +55,8 @@ describe('ol.renderer.canvas.VectorTileLayer', function() {
|
|||||||
text: 'feature'
|
text: 'feature'
|
||||||
})
|
})
|
||||||
})];
|
})];
|
||||||
feature1 = new _ol_Feature_(new _ol_geom_Point_([1, -1]));
|
feature1 = new _ol_Feature_(new Point([1, -1]));
|
||||||
feature2 = new _ol_Feature_(new _ol_geom_Point_([0, 0]));
|
feature2 = new _ol_Feature_(new Point([0, 0]));
|
||||||
feature3 = new _ol_render_Feature_('Point', [1, -1], []);
|
feature3 = new _ol_render_Feature_('Point', [1, -1], []);
|
||||||
feature2.setStyle(featureStyle);
|
feature2.setStyle(featureStyle);
|
||||||
var TileClass = function() {
|
var TileClass = function() {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import {nullFunction} from '../../../../src/ol/index.js';
|
import {nullFunction} from '../../../../src/ol/index.js';
|
||||||
import _ol_events_ from '../../../../src/ol/events.js';
|
import _ol_events_ from '../../../../src/ol/events.js';
|
||||||
import _ol_geom_LineString_ from '../../../../src/ol/geom/LineString.js';
|
import _ol_geom_LineString_ from '../../../../src/ol/geom/LineString.js';
|
||||||
import _ol_geom_Point_ from '../../../../src/ol/geom/Point.js';
|
import Point from '../../../../src/ol/geom/Point.js';
|
||||||
import _ol_geom_Polygon_ from '../../../../src/ol/geom/Polygon.js';
|
import _ol_geom_Polygon_ from '../../../../src/ol/geom/Polygon.js';
|
||||||
import _ol_geom_MultiLineString_ from '../../../../src/ol/geom/MultiLineString.js';
|
import _ol_geom_MultiLineString_ from '../../../../src/ol/geom/MultiLineString.js';
|
||||||
import _ol_geom_MultiPoint_ from '../../../../src/ol/geom/MultiPoint.js';
|
import _ol_geom_MultiPoint_ from '../../../../src/ol/geom/MultiPoint.js';
|
||||||
@@ -73,7 +73,7 @@ describe('ol.renderer.vector', function() {
|
|||||||
describe('call renderFeature with a loading icon', function() {
|
describe('call renderFeature with a loading icon', function() {
|
||||||
|
|
||||||
it('does not render the point', function() {
|
it('does not render the point', function() {
|
||||||
feature.setGeometry(new _ol_geom_Point_([0, 0]));
|
feature.setGeometry(new Point([0, 0]));
|
||||||
var imageReplay = replayGroup.getReplay(
|
var imageReplay = replayGroup.getReplay(
|
||||||
style.getZIndex(), 'Image');
|
style.getZIndex(), 'Image');
|
||||||
var setImageStyleSpy = sinon.spy(imageReplay, 'setImageStyle');
|
var setImageStyleSpy = sinon.spy(imageReplay, 'setImageStyle');
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import _ol_Feature_ from '../../../../src/ol/Feature.js';
|
import _ol_Feature_ from '../../../../src/ol/Feature.js';
|
||||||
import _ol_geom_LineString_ from '../../../../src/ol/geom/LineString.js';
|
import _ol_geom_LineString_ from '../../../../src/ol/geom/LineString.js';
|
||||||
import _ol_geom_Point_ from '../../../../src/ol/geom/Point.js';
|
import Point from '../../../../src/ol/geom/Point.js';
|
||||||
import _ol_geom_Polygon_ from '../../../../src/ol/geom/Polygon.js';
|
import _ol_geom_Polygon_ from '../../../../src/ol/geom/Polygon.js';
|
||||||
import {get as getProjection} from '../../../../src/ol/proj.js';
|
import {get as getProjection} from '../../../../src/ol/proj.js';
|
||||||
import _ol_source_Cluster_ from '../../../../src/ol/source/Cluster.js';
|
import _ol_source_Cluster_ from '../../../../src/ol/source/Cluster.js';
|
||||||
@@ -28,8 +28,8 @@ describe('ol.source.Cluster', function() {
|
|||||||
var source = new _ol_source_Cluster_({
|
var source = new _ol_source_Cluster_({
|
||||||
source: new _ol_source_Vector_({
|
source: new _ol_source_Vector_({
|
||||||
features: [
|
features: [
|
||||||
new _ol_Feature_(new _ol_geom_Point_([0, 0])),
|
new _ol_Feature_(new Point([0, 0])),
|
||||||
new _ol_Feature_(new _ol_geom_Point_([0, 0]))
|
new _ol_Feature_(new Point([0, 0]))
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
@@ -50,7 +50,7 @@ describe('ol.source.Cluster', function() {
|
|||||||
},
|
},
|
||||||
source: new _ol_source_Vector_({
|
source: new _ol_source_Vector_({
|
||||||
features: [
|
features: [
|
||||||
new _ol_Feature_(new _ol_geom_Point_([0, 0])),
|
new _ol_Feature_(new Point([0, 0])),
|
||||||
new _ol_Feature_(new _ol_geom_LineString_([[0, 0], [1, 1]])),
|
new _ol_Feature_(new _ol_geom_LineString_([[0, 0], [1, 1]])),
|
||||||
new _ol_Feature_(new _ol_geom_Polygon_(
|
new _ol_Feature_(new _ol_geom_Polygon_(
|
||||||
[[[-1, -1], [-1, 1], [1, 1], [1, -1], [-1, -1]]]))
|
[[[-1, -1], [-1, 1], [1, 1], [1, -1], [-1, -1]]]))
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import _ol_Collection_ from '../../../../src/ol/Collection.js';
|
|||||||
import _ol_Feature_ from '../../../../src/ol/Feature.js';
|
import _ol_Feature_ from '../../../../src/ol/Feature.js';
|
||||||
import _ol_Map_ from '../../../../src/ol/Map.js';
|
import _ol_Map_ from '../../../../src/ol/Map.js';
|
||||||
import _ol_View_ from '../../../../src/ol/View.js';
|
import _ol_View_ from '../../../../src/ol/View.js';
|
||||||
import _ol_geom_Point_ from '../../../../src/ol/geom/Point.js';
|
import Point from '../../../../src/ol/geom/Point.js';
|
||||||
import _ol_geom_LineString_ from '../../../../src/ol/geom/LineString.js';
|
import _ol_geom_LineString_ from '../../../../src/ol/geom/LineString.js';
|
||||||
import _ol_layer_Vector_ from '../../../../src/ol/layer/Vector.js';
|
import _ol_layer_Vector_ from '../../../../src/ol/layer/Vector.js';
|
||||||
import _ol_loadingstrategy_ from '../../../../src/ol/loadingstrategy.js';
|
import _ol_loadingstrategy_ from '../../../../src/ol/loadingstrategy.js';
|
||||||
@@ -16,7 +16,7 @@ describe('ol.source.Vector', function() {
|
|||||||
var pointFeature;
|
var pointFeature;
|
||||||
var infiniteExtent;
|
var infiniteExtent;
|
||||||
beforeEach(function() {
|
beforeEach(function() {
|
||||||
pointFeature = new _ol_Feature_(new _ol_geom_Point_([0, 0]));
|
pointFeature = new _ol_Feature_(new Point([0, 0]));
|
||||||
infiniteExtent = [-Infinity, -Infinity, Infinity, Infinity];
|
infiniteExtent = [-Infinity, -Infinity, Infinity, Infinity];
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -93,8 +93,8 @@ describe('ol.source.Vector', function() {
|
|||||||
var vectorSource;
|
var vectorSource;
|
||||||
beforeEach(function() {
|
beforeEach(function() {
|
||||||
features.push(new _ol_Feature_(new _ol_geom_LineString_([[0, 0], [10, 10]])));
|
features.push(new _ol_Feature_(new _ol_geom_LineString_([[0, 0], [10, 10]])));
|
||||||
features.push(new _ol_Feature_(new _ol_geom_Point_([0, 10])));
|
features.push(new _ol_Feature_(new Point([0, 10])));
|
||||||
features.push(new _ol_Feature_(new _ol_geom_Point_([10, 5])));
|
features.push(new _ol_Feature_(new Point([10, 5])));
|
||||||
vectorSource = new _ol_source_Vector_({
|
vectorSource = new _ol_source_Vector_({
|
||||||
features: features
|
features: features
|
||||||
});
|
});
|
||||||
@@ -127,7 +127,7 @@ describe('ol.source.Vector', function() {
|
|||||||
var i;
|
var i;
|
||||||
for (i = 0; i < 10; ++i) {
|
for (i = 0; i < 10; ++i) {
|
||||||
features[i] =
|
features[i] =
|
||||||
new _ol_Feature_(new _ol_geom_Point_([Math.random(), Math.random()]));
|
new _ol_Feature_(new Point([Math.random(), Math.random()]));
|
||||||
}
|
}
|
||||||
features.push(new _ol_Feature_(null));
|
features.push(new _ol_Feature_(null));
|
||||||
vectorSource = new _ol_source_Vector_({
|
vectorSource = new _ol_source_Vector_({
|
||||||
@@ -252,7 +252,7 @@ describe('ol.source.Vector', function() {
|
|||||||
it('keeps the R-Tree index up to date', function() {
|
it('keeps the R-Tree index up to date', function() {
|
||||||
expect(vectorSource.getFeaturesInExtent([0, 0, 1, 1])).
|
expect(vectorSource.getFeaturesInExtent([0, 0, 1, 1])).
|
||||||
to.have.length(10);
|
to.have.length(10);
|
||||||
features[0].setGeometry(new _ol_geom_Point_([100, 100]));
|
features[0].setGeometry(new Point([100, 100]));
|
||||||
expect(vectorSource.getFeaturesInExtent([0, 0, 1, 1])).
|
expect(vectorSource.getFeaturesInExtent([0, 0, 1, 1])).
|
||||||
to.have.length(9);
|
to.have.length(9);
|
||||||
});
|
});
|
||||||
@@ -269,7 +269,7 @@ describe('ol.source.Vector', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('keeps its index up-to-date', function() {
|
it('keeps its index up-to-date', function() {
|
||||||
var feature = new _ol_Feature_(new _ol_geom_Point_([1, 1]));
|
var feature = new _ol_Feature_(new Point([1, 1]));
|
||||||
vectorSource.addFeature(feature);
|
vectorSource.addFeature(feature);
|
||||||
expect(vectorSource.getFeaturesInExtent([0, 0, 2, 2])).
|
expect(vectorSource.getFeaturesInExtent([0, 0, 2, 2])).
|
||||||
to.eql([feature]);
|
to.eql([feature]);
|
||||||
@@ -290,14 +290,14 @@ describe('ol.source.Vector', function() {
|
|||||||
var feature = new _ol_Feature_(null);
|
var feature = new _ol_Feature_(null);
|
||||||
vectorSource.addFeature(feature);
|
vectorSource.addFeature(feature);
|
||||||
expect(vectorSource.getFeatures()).to.eql([feature]);
|
expect(vectorSource.getFeatures()).to.eql([feature]);
|
||||||
feature.setGeometry(new _ol_geom_Point_([1, 1]));
|
feature.setGeometry(new Point([1, 1]));
|
||||||
expect(vectorSource.getFeaturesInExtent([0, 0, 2, 2])).
|
expect(vectorSource.getFeaturesInExtent([0, 0, 2, 2])).
|
||||||
to.eql([feature]);
|
to.eql([feature]);
|
||||||
expect(vectorSource.getFeatures()).to.eql([feature]);
|
expect(vectorSource.getFeatures()).to.eql([feature]);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('handles features with geometries changing to null', function() {
|
it('handles features with geometries changing to null', function() {
|
||||||
var feature = new _ol_Feature_(new _ol_geom_Point_([1, 1]));
|
var feature = new _ol_Feature_(new Point([1, 1]));
|
||||||
vectorSource.addFeature(feature);
|
vectorSource.addFeature(feature);
|
||||||
expect(vectorSource.getFeatures()).to.eql([feature]);
|
expect(vectorSource.getFeatures()).to.eql([feature]);
|
||||||
expect(vectorSource.getFeaturesInExtent([0, 0, 2, 2])).
|
expect(vectorSource.getFeaturesInExtent([0, 0, 2, 2])).
|
||||||
@@ -308,7 +308,7 @@ describe('ol.source.Vector', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('fires a change event when setting a feature\'s property', function() {
|
it('fires a change event when setting a feature\'s property', function() {
|
||||||
var feature = new _ol_Feature_(new _ol_geom_Point_([1, 1]));
|
var feature = new _ol_Feature_(new Point([1, 1]));
|
||||||
vectorSource.addFeature(feature);
|
vectorSource.addFeature(feature);
|
||||||
var listener = sinon.spy();
|
var listener = sinon.spy();
|
||||||
_ol_events_.listen(vectorSource, 'change', listener);
|
_ol_events_.listen(vectorSource, 'change', listener);
|
||||||
@@ -317,7 +317,7 @@ describe('ol.source.Vector', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('fires a changefeature event when updating a feature', function() {
|
it('fires a changefeature event when updating a feature', function() {
|
||||||
var feature = new _ol_Feature_(new _ol_geom_Point_([1, 1]));
|
var feature = new _ol_Feature_(new Point([1, 1]));
|
||||||
vectorSource.addFeature(feature);
|
vectorSource.addFeature(feature);
|
||||||
var listener = sinon.spy(function(event) {
|
var listener = sinon.spy(function(event) {
|
||||||
expect(event.feature).to.be(feature);
|
expect(event.feature).to.be(feature);
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import _ol_geom_GeometryCollection_ from '../../../src/ol/geom/GeometryCollectio
|
|||||||
import _ol_geom_LineString_ from '../../../src/ol/geom/LineString.js';
|
import _ol_geom_LineString_ from '../../../src/ol/geom/LineString.js';
|
||||||
import _ol_geom_MultiLineString_ from '../../../src/ol/geom/MultiLineString.js';
|
import _ol_geom_MultiLineString_ from '../../../src/ol/geom/MultiLineString.js';
|
||||||
import _ol_geom_MultiPoint_ from '../../../src/ol/geom/MultiPoint.js';
|
import _ol_geom_MultiPoint_ from '../../../src/ol/geom/MultiPoint.js';
|
||||||
import _ol_geom_Point_ from '../../../src/ol/geom/Point.js';
|
import Point from '../../../src/ol/geom/Point.js';
|
||||||
import _ol_proj_EPSG4326_ from '../../../src/ol/proj/EPSG4326.js';
|
import _ol_proj_EPSG4326_ from '../../../src/ol/proj/EPSG4326.js';
|
||||||
|
|
||||||
|
|
||||||
@@ -115,7 +115,7 @@ describe('ol.Sphere', function() {
|
|||||||
|
|
||||||
describe('ol.Sphere.getLength()', function() {
|
describe('ol.Sphere.getLength()', function() {
|
||||||
var cases = [{
|
var cases = [{
|
||||||
geometry: new _ol_geom_Point_([0, 0]),
|
geometry: new Point([0, 0]),
|
||||||
length: 0
|
length: 0
|
||||||
}, {
|
}, {
|
||||||
geometry: new _ol_geom_MultiPoint_([[0, 0], [1, 1]]),
|
geometry: new _ol_geom_MultiPoint_([[0, 0], [1, 1]]),
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import _ol_Feature_ from '../../../../src/ol/Feature.js';
|
import _ol_Feature_ from '../../../../src/ol/Feature.js';
|
||||||
import _ol_geom_Point_ from '../../../../src/ol/geom/Point.js';
|
import Point from '../../../../src/ol/geom/Point.js';
|
||||||
import _ol_style_Style_ from '../../../../src/ol/style/Style.js';
|
import _ol_style_Style_ from '../../../../src/ol/style/Style.js';
|
||||||
import _ol_style_Fill_ from '../../../../src/ol/style/Fill.js';
|
import _ol_style_Fill_ from '../../../../src/ol/style/Fill.js';
|
||||||
import _ol_style_Circle_ from '../../../../src/ol/style/Circle.js';
|
import _ol_style_Circle_ from '../../../../src/ol/style/Circle.js';
|
||||||
@@ -44,7 +44,7 @@ describe('ol.style.Style', function() {
|
|||||||
|
|
||||||
it('copies all values', function() {
|
it('copies all values', function() {
|
||||||
var original = new _ol_style_Style_({
|
var original = new _ol_style_Style_({
|
||||||
geometry: new _ol_geom_Point_([0, 0, 0]),
|
geometry: new Point([0, 0, 0]),
|
||||||
fill: new _ol_style_Fill_({
|
fill: new _ol_style_Fill_({
|
||||||
color: '#319FD3'
|
color: '#319FD3'
|
||||||
}),
|
}),
|
||||||
@@ -70,7 +70,7 @@ describe('ol.style.Style', function() {
|
|||||||
|
|
||||||
it('the clone does not reference the same objects as the original', function() {
|
it('the clone does not reference the same objects as the original', function() {
|
||||||
var original = new _ol_style_Style_({
|
var original = new _ol_style_Style_({
|
||||||
geometry: new _ol_geom_Point_([0, 0, 0]),
|
geometry: new Point([0, 0, 0]),
|
||||||
fill: new _ol_style_Fill_({
|
fill: new _ol_style_Fill_({
|
||||||
color: '#319FD3'
|
color: '#319FD3'
|
||||||
}),
|
}),
|
||||||
@@ -195,21 +195,21 @@ describe('ol.style.Style', function() {
|
|||||||
|
|
||||||
it('creates a geometry function from a string', function() {
|
it('creates a geometry function from a string', function() {
|
||||||
var feature = new _ol_Feature_();
|
var feature = new _ol_Feature_();
|
||||||
feature.set('myGeom', new _ol_geom_Point_([0, 0]));
|
feature.set('myGeom', new Point([0, 0]));
|
||||||
style.setGeometry('myGeom');
|
style.setGeometry('myGeom');
|
||||||
expect(style.getGeometryFunction()(feature))
|
expect(style.getGeometryFunction()(feature))
|
||||||
.to.eql(feature.get('myGeom'));
|
.to.eql(feature.get('myGeom'));
|
||||||
});
|
});
|
||||||
|
|
||||||
it('creates a geometry function from a geometry', function() {
|
it('creates a geometry function from a geometry', function() {
|
||||||
var geom = new _ol_geom_Point_([0, 0]);
|
var geom = new Point([0, 0]);
|
||||||
style.setGeometry(geom);
|
style.setGeometry(geom);
|
||||||
expect(style.getGeometryFunction()())
|
expect(style.getGeometryFunction()())
|
||||||
.to.eql(geom);
|
.to.eql(geom);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('returns the configured geometry function', function() {
|
it('returns the configured geometry function', function() {
|
||||||
var geom = new _ol_geom_Point_([0, 0]);
|
var geom = new Point([0, 0]);
|
||||||
style.setGeometry(function() {
|
style.setGeometry(function() {
|
||||||
return geom;
|
return geom;
|
||||||
});
|
});
|
||||||
@@ -224,7 +224,7 @@ describe('ol.style.Style', function() {
|
|||||||
var style = new _ol_style_Style_();
|
var style = new _ol_style_Style_();
|
||||||
style.setGeometry('foo');
|
style.setGeometry('foo');
|
||||||
expect(style.getGeometry()).to.eql('foo');
|
expect(style.getGeometry()).to.eql('foo');
|
||||||
var geom = new _ol_geom_Point_([1, 2]);
|
var geom = new Point([1, 2]);
|
||||||
style.setGeometry(geom);
|
style.setGeometry(geom);
|
||||||
expect(style.getGeometry()).to.eql(geom);
|
expect(style.getGeometry()).to.eql(geom);
|
||||||
var fn = function() {
|
var fn = function() {
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import _ol_ViewHint_ from '../../../src/ol/ViewHint.js';
|
|||||||
import * as _ol_extent_ from '../../../src/ol/extent.js';
|
import * as _ol_extent_ from '../../../src/ol/extent.js';
|
||||||
import _ol_geom_Circle_ from '../../../src/ol/geom/Circle.js';
|
import _ol_geom_Circle_ from '../../../src/ol/geom/Circle.js';
|
||||||
import _ol_geom_LineString_ from '../../../src/ol/geom/LineString.js';
|
import _ol_geom_LineString_ from '../../../src/ol/geom/LineString.js';
|
||||||
import _ol_geom_Point_ from '../../../src/ol/geom/Point.js';
|
import Point from '../../../src/ol/geom/Point.js';
|
||||||
|
|
||||||
describe('ol.View', function() {
|
describe('ol.View', function() {
|
||||||
|
|
||||||
@@ -1273,14 +1273,14 @@ describe('ol.View', function() {
|
|||||||
expect(view.getCenter()[1]).to.be(47050);
|
expect(view.getCenter()[1]).to.be(47050);
|
||||||
|
|
||||||
view.fit(
|
view.fit(
|
||||||
new _ol_geom_Point_([6000, 46000]),
|
new Point([6000, 46000]),
|
||||||
{size: [200, 200], padding: [100, 0, 0, 100], minResolution: 2});
|
{size: [200, 200], padding: [100, 0, 0, 100], minResolution: 2});
|
||||||
expect(view.getResolution()).to.be(2);
|
expect(view.getResolution()).to.be(2);
|
||||||
expect(view.getCenter()[0]).to.be(5900);
|
expect(view.getCenter()[0]).to.be(5900);
|
||||||
expect(view.getCenter()[1]).to.be(46100);
|
expect(view.getCenter()[1]).to.be(46100);
|
||||||
|
|
||||||
view.fit(
|
view.fit(
|
||||||
new _ol_geom_Point_([6000, 46000]),
|
new Point([6000, 46000]),
|
||||||
{size: [200, 200], padding: [100, 0, 0, 100], maxZoom: 6});
|
{size: [200, 200], padding: [100, 0, 0, 100], maxZoom: 6});
|
||||||
expect(view.getResolution()).to.be(2);
|
expect(view.getResolution()).to.be(2);
|
||||||
expect(view.getZoom()).to.be(6);
|
expect(view.getZoom()).to.be(6);
|
||||||
|
|||||||
Reference in New Issue
Block a user