@@ -4,10 +4,10 @@ import View from '../src/ol/View.js';
|
||||
import Point from '../src/ol/geom/Point.js';
|
||||
import VectorLayer from '../src/ol/layer/Vector.js';
|
||||
import VectorSource from '../src/ol/source/Vector.js';
|
||||
import _ol_style_Circle_ from '../src/ol/style/Circle.js';
|
||||
import _ol_style_Fill_ from '../src/ol/style/Fill.js';
|
||||
import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
|
||||
import _ol_style_Style_ from '../src/ol/style/Style.js';
|
||||
import CircleStyle from '../src/ol/style/Circle.js';
|
||||
import Fill from '../src/ol/style/Fill.js';
|
||||
import Stroke from '../src/ol/style/Stroke.js';
|
||||
import Style from '../src/ol/style/Style.js';
|
||||
|
||||
|
||||
// Create separate layers for red, green an blue circles.
|
||||
@@ -18,12 +18,12 @@ var redLayer = new VectorLayer({
|
||||
source: new VectorSource({
|
||||
features: [new Feature(new Point([0, 0]))]
|
||||
}),
|
||||
style: new _ol_style_Style_({
|
||||
image: new _ol_style_Circle_({
|
||||
fill: new _ol_style_Fill_({
|
||||
style: new Style({
|
||||
image: new CircleStyle({
|
||||
fill: new Fill({
|
||||
color: 'rgba(255,0,0,0.8)'
|
||||
}),
|
||||
stroke: new _ol_style_Stroke_({
|
||||
stroke: new Stroke({
|
||||
color: 'rgb(255,0,0)',
|
||||
width: 15
|
||||
}),
|
||||
@@ -36,12 +36,12 @@ var greenLayer = new VectorLayer({
|
||||
// 433.013 is roughly 250 * Math.sqrt(3)
|
||||
features: [new Feature(new Point([250, 433.013]))]
|
||||
}),
|
||||
style: new _ol_style_Style_({
|
||||
image: new _ol_style_Circle_({
|
||||
fill: new _ol_style_Fill_({
|
||||
style: new Style({
|
||||
image: new CircleStyle({
|
||||
fill: new Fill({
|
||||
color: 'rgba(0,255,0,0.8)'
|
||||
}),
|
||||
stroke: new _ol_style_Stroke_({
|
||||
stroke: new Stroke({
|
||||
color: 'rgb(0,255,0)',
|
||||
width: 15
|
||||
}),
|
||||
@@ -53,12 +53,12 @@ var blueLayer = new VectorLayer({
|
||||
source: new VectorSource({
|
||||
features: [new Feature(new Point([500, 0]))]
|
||||
}),
|
||||
style: new _ol_style_Style_({
|
||||
image: new _ol_style_Circle_({
|
||||
fill: new _ol_style_Fill_({
|
||||
style: new Style({
|
||||
image: new CircleStyle({
|
||||
fill: new Fill({
|
||||
color: 'rgba(0,0,255,0.8)'
|
||||
}),
|
||||
stroke: new _ol_style_Stroke_({
|
||||
stroke: new Stroke({
|
||||
color: 'rgb(0,0,255)',
|
||||
width: 15
|
||||
}),
|
||||
|
||||
@@ -3,7 +3,7 @@ import View from '../src/ol/View.js';
|
||||
import _ol_events_condition_ from '../src/ol/events/condition.js';
|
||||
import GeoJSON from '../src/ol/format/GeoJSON.js';
|
||||
import DragBox from '../src/ol/interaction/DragBox.js';
|
||||
import _ol_interaction_Select_ from '../src/ol/interaction/Select.js';
|
||||
import Select from '../src/ol/interaction/Select.js';
|
||||
import TileLayer from '../src/ol/layer/Tile.js';
|
||||
import VectorLayer from '../src/ol/layer/Vector.js';
|
||||
import OSM from '../src/ol/source/OSM.js';
|
||||
@@ -33,7 +33,7 @@ var map = new Map({
|
||||
});
|
||||
|
||||
// a normal select interaction to handle click
|
||||
var select = new _ol_interaction_Select_();
|
||||
var select = new Select();
|
||||
map.addInteraction(select);
|
||||
|
||||
var selectedFeatures = select.getFeatures();
|
||||
|
||||
@@ -6,9 +6,9 @@ import _ol_has_ from '../src/ol/has.js';
|
||||
import VectorLayer from '../src/ol/layer/Vector.js';
|
||||
import {fromLonLat} from '../src/ol/proj.js';
|
||||
import VectorSource from '../src/ol/source/Vector.js';
|
||||
import _ol_style_Fill_ from '../src/ol/style/Fill.js';
|
||||
import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
|
||||
import _ol_style_Style_ from '../src/ol/style/Style.js';
|
||||
import Fill from '../src/ol/style/Fill.js';
|
||||
import Stroke from '../src/ol/style/Stroke.js';
|
||||
import Style from '../src/ol/style/Style.js';
|
||||
|
||||
var canvas = document.createElement('canvas');
|
||||
var context = canvas.getContext('2d');
|
||||
@@ -57,10 +57,10 @@ var pattern = (function() {
|
||||
}());
|
||||
|
||||
// Generate style for gradient or pattern fill
|
||||
var fill = new _ol_style_Fill_();
|
||||
var style = new _ol_style_Style_({
|
||||
var fill = new Fill();
|
||||
var style = new Style({
|
||||
fill: fill,
|
||||
stroke: new _ol_style_Stroke_({
|
||||
stroke: new Stroke({
|
||||
color: '#333',
|
||||
width: 2
|
||||
})
|
||||
|
||||
@@ -6,29 +6,29 @@ import TileLayer from '../src/ol/layer/Tile.js';
|
||||
import VectorLayer from '../src/ol/layer/Vector.js';
|
||||
import OSM from '../src/ol/source/OSM.js';
|
||||
import VectorSource from '../src/ol/source/Vector.js';
|
||||
import _ol_style_Circle_ from '../src/ol/style/Circle.js';
|
||||
import _ol_style_Fill_ from '../src/ol/style/Fill.js';
|
||||
import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
|
||||
import _ol_style_Style_ from '../src/ol/style/Style.js';
|
||||
import CircleStyle from '../src/ol/style/Circle.js';
|
||||
import Fill from '../src/ol/style/Fill.js';
|
||||
import Stroke from '../src/ol/style/Stroke.js';
|
||||
import Style from '../src/ol/style/Style.js';
|
||||
|
||||
var source = new VectorSource({
|
||||
url: 'data/geojson/switzerland.geojson',
|
||||
format: new GeoJSON()
|
||||
});
|
||||
var style = new _ol_style_Style_({
|
||||
fill: new _ol_style_Fill_({
|
||||
var style = new Style({
|
||||
fill: new Fill({
|
||||
color: 'rgba(255, 255, 255, 0.6)'
|
||||
}),
|
||||
stroke: new _ol_style_Stroke_({
|
||||
stroke: new Stroke({
|
||||
color: '#319FD3',
|
||||
width: 1
|
||||
}),
|
||||
image: new _ol_style_Circle_({
|
||||
image: new CircleStyle({
|
||||
radius: 5,
|
||||
fill: new _ol_style_Fill_({
|
||||
fill: new Fill({
|
||||
color: 'rgba(255, 255, 255, 0.6)'
|
||||
}),
|
||||
stroke: new _ol_style_Stroke_({
|
||||
stroke: new Stroke({
|
||||
color: '#319FD3',
|
||||
width: 1
|
||||
})
|
||||
|
||||
@@ -7,11 +7,11 @@ import VectorLayer from '../src/ol/layer/Vector.js';
|
||||
import Cluster from '../src/ol/source/Cluster.js';
|
||||
import OSM from '../src/ol/source/OSM.js';
|
||||
import VectorSource from '../src/ol/source/Vector.js';
|
||||
import _ol_style_Circle_ from '../src/ol/style/Circle.js';
|
||||
import _ol_style_Fill_ from '../src/ol/style/Fill.js';
|
||||
import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
|
||||
import _ol_style_Style_ from '../src/ol/style/Style.js';
|
||||
import _ol_style_Text_ from '../src/ol/style/Text.js';
|
||||
import CircleStyle from '../src/ol/style/Circle.js';
|
||||
import Fill from '../src/ol/style/Fill.js';
|
||||
import Stroke from '../src/ol/style/Stroke.js';
|
||||
import Style from '../src/ol/style/Style.js';
|
||||
import Text from '../src/ol/style/Text.js';
|
||||
|
||||
|
||||
var distance = document.getElementById('distance');
|
||||
@@ -40,19 +40,19 @@ var clusters = new VectorLayer({
|
||||
var size = feature.get('features').length;
|
||||
var style = styleCache[size];
|
||||
if (!style) {
|
||||
style = new _ol_style_Style_({
|
||||
image: new _ol_style_Circle_({
|
||||
style = new Style({
|
||||
image: new CircleStyle({
|
||||
radius: 10,
|
||||
stroke: new _ol_style_Stroke_({
|
||||
stroke: new Stroke({
|
||||
color: '#fff'
|
||||
}),
|
||||
fill: new _ol_style_Fill_({
|
||||
fill: new Fill({
|
||||
color: '#3399CC'
|
||||
})
|
||||
}),
|
||||
text: new _ol_style_Text_({
|
||||
text: new Text({
|
||||
text: size.toString(),
|
||||
fill: new _ol_style_Fill_({
|
||||
fill: new Fill({
|
||||
color: '#fff'
|
||||
})
|
||||
})
|
||||
|
||||
@@ -6,15 +6,15 @@ import LineString from '../src/ol/geom/LineString.js';
|
||||
import Point from '../src/ol/geom/Point.js';
|
||||
import Polygon from '../src/ol/geom/Polygon.js';
|
||||
import {defaults as defaultInteractions} from '../src/ol/interaction.js';
|
||||
import _ol_interaction_Pointer_ from '../src/ol/interaction/Pointer.js';
|
||||
import PointerInteraction from '../src/ol/interaction/Pointer.js';
|
||||
import TileLayer from '../src/ol/layer/Tile.js';
|
||||
import VectorLayer from '../src/ol/layer/Vector.js';
|
||||
import TileJSON from '../src/ol/source/TileJSON.js';
|
||||
import VectorSource from '../src/ol/source/Vector.js';
|
||||
import _ol_style_Fill_ from '../src/ol/style/Fill.js';
|
||||
import _ol_style_Icon_ from '../src/ol/style/Icon.js';
|
||||
import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
|
||||
import _ol_style_Style_ from '../src/ol/style/Style.js';
|
||||
import Fill from '../src/ol/style/Fill.js';
|
||||
import Icon from '../src/ol/style/Icon.js';
|
||||
import Stroke from '../src/ol/style/Stroke.js';
|
||||
import Style from '../src/ol/style/Style.js';
|
||||
|
||||
|
||||
/**
|
||||
@@ -29,7 +29,7 @@ var app = {};
|
||||
*/
|
||||
app.Drag = function() {
|
||||
|
||||
_ol_interaction_Pointer_.call(this, {
|
||||
PointerInteraction.call(this, {
|
||||
handleDownEvent: app.Drag.prototype.handleDownEvent,
|
||||
handleDragEvent: app.Drag.prototype.handleDragEvent,
|
||||
handleMoveEvent: app.Drag.prototype.handleMoveEvent,
|
||||
@@ -61,7 +61,7 @@ app.Drag = function() {
|
||||
this.previousCursor_ = undefined;
|
||||
|
||||
};
|
||||
inherits(app.Drag, _ol_interaction_Pointer_);
|
||||
inherits(app.Drag, PointerInteraction);
|
||||
|
||||
|
||||
/**
|
||||
@@ -156,19 +156,19 @@ var map = new Map({
|
||||
source: new VectorSource({
|
||||
features: [pointFeature, lineFeature, polygonFeature]
|
||||
}),
|
||||
style: new _ol_style_Style_({
|
||||
image: new _ol_style_Icon_(/** @type {olx.style.IconOptions} */ ({
|
||||
style: new Style({
|
||||
image: new Icon(/** @type {olx.style.IconOptions} */ ({
|
||||
anchor: [0.5, 46],
|
||||
anchorXUnits: 'fraction',
|
||||
anchorYUnits: 'pixels',
|
||||
opacity: 0.95,
|
||||
src: 'data/icon.png'
|
||||
})),
|
||||
stroke: new _ol_style_Stroke_({
|
||||
stroke: new Stroke({
|
||||
width: 3,
|
||||
color: [255, 0, 0, 1]
|
||||
}),
|
||||
fill: new _ol_style_Fill_({
|
||||
fill: new Fill({
|
||||
color: [0, 0, 255, 0.6]
|
||||
})
|
||||
})
|
||||
|
||||
@@ -11,63 +11,63 @@ import VectorLayer from '../src/ol/layer/Vector.js';
|
||||
import TileLayer from '../src/ol/layer/Tile.js';
|
||||
import BingMaps from '../src/ol/source/BingMaps.js';
|
||||
import VectorSource from '../src/ol/source/Vector.js';
|
||||
import _ol_style_Circle_ from '../src/ol/style/Circle.js';
|
||||
import _ol_style_Fill_ from '../src/ol/style/Fill.js';
|
||||
import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
|
||||
import _ol_style_Style_ from '../src/ol/style/Style.js';
|
||||
import CircleStyle from '../src/ol/style/Circle.js';
|
||||
import Fill from '../src/ol/style/Fill.js';
|
||||
import Stroke from '../src/ol/style/Stroke.js';
|
||||
import Style from '../src/ol/style/Style.js';
|
||||
|
||||
|
||||
var defaultStyle = {
|
||||
'Point': new _ol_style_Style_({
|
||||
image: new _ol_style_Circle_({
|
||||
fill: new _ol_style_Fill_({
|
||||
'Point': new Style({
|
||||
image: new CircleStyle({
|
||||
fill: new Fill({
|
||||
color: 'rgba(255,255,0,0.5)'
|
||||
}),
|
||||
radius: 5,
|
||||
stroke: new _ol_style_Stroke_({
|
||||
stroke: new Stroke({
|
||||
color: '#ff0',
|
||||
width: 1
|
||||
})
|
||||
})
|
||||
}),
|
||||
'LineString': new _ol_style_Style_({
|
||||
stroke: new _ol_style_Stroke_({
|
||||
'LineString': new Style({
|
||||
stroke: new Stroke({
|
||||
color: '#f00',
|
||||
width: 3
|
||||
})
|
||||
}),
|
||||
'Polygon': new _ol_style_Style_({
|
||||
fill: new _ol_style_Fill_({
|
||||
'Polygon': new Style({
|
||||
fill: new Fill({
|
||||
color: 'rgba(0,255,255,0.5)'
|
||||
}),
|
||||
stroke: new _ol_style_Stroke_({
|
||||
stroke: new Stroke({
|
||||
color: '#0ff',
|
||||
width: 1
|
||||
})
|
||||
}),
|
||||
'MultiPoint': new _ol_style_Style_({
|
||||
image: new _ol_style_Circle_({
|
||||
fill: new _ol_style_Fill_({
|
||||
'MultiPoint': new Style({
|
||||
image: new CircleStyle({
|
||||
fill: new Fill({
|
||||
color: 'rgba(255,0,255,0.5)'
|
||||
}),
|
||||
radius: 5,
|
||||
stroke: new _ol_style_Stroke_({
|
||||
stroke: new Stroke({
|
||||
color: '#f0f',
|
||||
width: 1
|
||||
})
|
||||
})
|
||||
}),
|
||||
'MultiLineString': new _ol_style_Style_({
|
||||
stroke: new _ol_style_Stroke_({
|
||||
'MultiLineString': new Style({
|
||||
stroke: new Stroke({
|
||||
color: '#0f0',
|
||||
width: 3
|
||||
})
|
||||
}),
|
||||
'MultiPolygon': new _ol_style_Style_({
|
||||
fill: new _ol_style_Fill_({
|
||||
'MultiPolygon': new Style({
|
||||
fill: new Fill({
|
||||
color: 'rgba(0,0,255,0.5)'
|
||||
}),
|
||||
stroke: new _ol_style_Stroke_({
|
||||
stroke: new Stroke({
|
||||
color: '#00f',
|
||||
width: 1
|
||||
})
|
||||
|
||||
@@ -11,63 +11,63 @@ import TileLayer from '../src/ol/layer/Tile.js';
|
||||
import VectorLayer from '../src/ol/layer/Vector.js';
|
||||
import BingMaps from '../src/ol/source/BingMaps.js';
|
||||
import VectorSource from '../src/ol/source/Vector.js';
|
||||
import _ol_style_Circle_ from '../src/ol/style/Circle.js';
|
||||
import _ol_style_Fill_ from '../src/ol/style/Fill.js';
|
||||
import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
|
||||
import _ol_style_Style_ from '../src/ol/style/Style.js';
|
||||
import CircleStyle from '../src/ol/style/Circle.js';
|
||||
import Fill from '../src/ol/style/Fill.js';
|
||||
import Stroke from '../src/ol/style/Stroke.js';
|
||||
import Style from '../src/ol/style/Style.js';
|
||||
|
||||
|
||||
var defaultStyle = {
|
||||
'Point': new _ol_style_Style_({
|
||||
image: new _ol_style_Circle_({
|
||||
fill: new _ol_style_Fill_({
|
||||
'Point': new Style({
|
||||
image: new CircleStyle({
|
||||
fill: new Fill({
|
||||
color: 'rgba(255,255,0,0.5)'
|
||||
}),
|
||||
radius: 5,
|
||||
stroke: new _ol_style_Stroke_({
|
||||
stroke: new Stroke({
|
||||
color: '#ff0',
|
||||
width: 1
|
||||
})
|
||||
})
|
||||
}),
|
||||
'LineString': new _ol_style_Style_({
|
||||
stroke: new _ol_style_Stroke_({
|
||||
'LineString': new Style({
|
||||
stroke: new Stroke({
|
||||
color: '#f00',
|
||||
width: 3
|
||||
})
|
||||
}),
|
||||
'Polygon': new _ol_style_Style_({
|
||||
fill: new _ol_style_Fill_({
|
||||
'Polygon': new Style({
|
||||
fill: new Fill({
|
||||
color: 'rgba(0,255,255,0.5)'
|
||||
}),
|
||||
stroke: new _ol_style_Stroke_({
|
||||
stroke: new Stroke({
|
||||
color: '#0ff',
|
||||
width: 1
|
||||
})
|
||||
}),
|
||||
'MultiPoint': new _ol_style_Style_({
|
||||
image: new _ol_style_Circle_({
|
||||
fill: new _ol_style_Fill_({
|
||||
'MultiPoint': new Style({
|
||||
image: new CircleStyle({
|
||||
fill: new Fill({
|
||||
color: 'rgba(255,0,255,0.5)'
|
||||
}),
|
||||
radius: 5,
|
||||
stroke: new _ol_style_Stroke_({
|
||||
stroke: new Stroke({
|
||||
color: '#f0f',
|
||||
width: 1
|
||||
})
|
||||
})
|
||||
}),
|
||||
'MultiLineString': new _ol_style_Style_({
|
||||
stroke: new _ol_style_Stroke_({
|
||||
'MultiLineString': new Style({
|
||||
stroke: new Stroke({
|
||||
color: '#0f0',
|
||||
width: 3
|
||||
})
|
||||
}),
|
||||
'MultiPolygon': new _ol_style_Style_({
|
||||
fill: new _ol_style_Fill_({
|
||||
'MultiPolygon': new Style({
|
||||
fill: new Fill({
|
||||
color: 'rgba(0,0,255,0.5)'
|
||||
}),
|
||||
stroke: new _ol_style_Stroke_({
|
||||
stroke: new Stroke({
|
||||
color: '#00f',
|
||||
width: 1
|
||||
})
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
import Map from '../src/ol/Map.js';
|
||||
import View from '../src/ol/View.js';
|
||||
import Draw from '../src/ol/interaction/Draw.js';
|
||||
import _ol_interaction_Modify_ from '../src/ol/interaction/Modify.js';
|
||||
import _ol_interaction_Snap_ from '../src/ol/interaction/Snap.js';
|
||||
import Modify from '../src/ol/interaction/Modify.js';
|
||||
import Snap from '../src/ol/interaction/Snap.js';
|
||||
import TileLayer from '../src/ol/layer/Tile.js';
|
||||
import VectorLayer from '../src/ol/layer/Vector.js';
|
||||
import OSM from '../src/ol/source/OSM.js';
|
||||
import VectorSource from '../src/ol/source/Vector.js';
|
||||
import _ol_style_Circle_ from '../src/ol/style/Circle.js';
|
||||
import _ol_style_Fill_ from '../src/ol/style/Fill.js';
|
||||
import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
|
||||
import _ol_style_Style_ from '../src/ol/style/Style.js';
|
||||
import CircleStyle from '../src/ol/style/Circle.js';
|
||||
import Fill from '../src/ol/style/Fill.js';
|
||||
import Stroke from '../src/ol/style/Stroke.js';
|
||||
import Style from '../src/ol/style/Style.js';
|
||||
|
||||
var raster = new TileLayer({
|
||||
source: new OSM()
|
||||
@@ -19,17 +19,17 @@ var raster = new TileLayer({
|
||||
var source = new VectorSource();
|
||||
var vector = new VectorLayer({
|
||||
source: source,
|
||||
style: new _ol_style_Style_({
|
||||
fill: new _ol_style_Fill_({
|
||||
style: new Style({
|
||||
fill: new Fill({
|
||||
color: 'rgba(255, 255, 255, 0.2)'
|
||||
}),
|
||||
stroke: new _ol_style_Stroke_({
|
||||
stroke: new Stroke({
|
||||
color: '#ffcc33',
|
||||
width: 2
|
||||
}),
|
||||
image: new _ol_style_Circle_({
|
||||
image: new CircleStyle({
|
||||
radius: 7,
|
||||
fill: new _ol_style_Fill_({
|
||||
fill: new Fill({
|
||||
color: '#ffcc33'
|
||||
})
|
||||
})
|
||||
@@ -45,7 +45,7 @@ var map = new Map({
|
||||
})
|
||||
});
|
||||
|
||||
var modify = new _ol_interaction_Modify_({source: source});
|
||||
var modify = new Modify({source: source});
|
||||
map.addInteraction(modify);
|
||||
|
||||
var draw, snap; // global so we can remove them later
|
||||
@@ -57,7 +57,7 @@ function addInteractions() {
|
||||
type: typeSelect.value
|
||||
});
|
||||
map.addInteraction(draw);
|
||||
snap = new _ol_interaction_Snap_({source: source});
|
||||
snap = new Snap({source: source});
|
||||
map.addInteraction(snap);
|
||||
|
||||
}
|
||||
|
||||
@@ -4,10 +4,10 @@ import MultiPoint from '../src/ol/geom/MultiPoint.js';
|
||||
import Point from '../src/ol/geom/Point.js';
|
||||
import TileLayer from '../src/ol/layer/Tile.js';
|
||||
import OSM from '../src/ol/source/OSM.js';
|
||||
import _ol_style_Circle_ from '../src/ol/style/Circle.js';
|
||||
import _ol_style_Fill_ from '../src/ol/style/Fill.js';
|
||||
import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
|
||||
import _ol_style_Style_ from '../src/ol/style/Style.js';
|
||||
import CircleStyle from '../src/ol/style/Circle.js';
|
||||
import Fill from '../src/ol/style/Fill.js';
|
||||
import Stroke from '../src/ol/style/Stroke.js';
|
||||
import Style from '../src/ol/style/Style.js';
|
||||
|
||||
|
||||
var map = new Map({
|
||||
@@ -23,28 +23,28 @@ var map = new Map({
|
||||
})
|
||||
});
|
||||
|
||||
var imageStyle = new _ol_style_Style_({
|
||||
image: new _ol_style_Circle_({
|
||||
var imageStyle = new Style({
|
||||
image: new CircleStyle({
|
||||
radius: 5,
|
||||
snapToPixel: false,
|
||||
fill: new _ol_style_Fill_({color: 'yellow'}),
|
||||
stroke: new _ol_style_Stroke_({color: 'red', width: 1})
|
||||
fill: new Fill({color: 'yellow'}),
|
||||
stroke: new Stroke({color: 'red', width: 1})
|
||||
})
|
||||
});
|
||||
|
||||
var headInnerImageStyle = new _ol_style_Style_({
|
||||
image: new _ol_style_Circle_({
|
||||
var headInnerImageStyle = new Style({
|
||||
image: new CircleStyle({
|
||||
radius: 2,
|
||||
snapToPixel: false,
|
||||
fill: new _ol_style_Fill_({color: 'blue'})
|
||||
fill: new Fill({color: 'blue'})
|
||||
})
|
||||
});
|
||||
|
||||
var headOuterImageStyle = new _ol_style_Style_({
|
||||
image: new _ol_style_Circle_({
|
||||
var headOuterImageStyle = new Style({
|
||||
image: new CircleStyle({
|
||||
radius: 5,
|
||||
snapToPixel: false,
|
||||
fill: new _ol_style_Fill_({color: 'black'})
|
||||
fill: new Fill({color: 'black'})
|
||||
})
|
||||
});
|
||||
|
||||
|
||||
@@ -3,35 +3,35 @@ import View from '../src/ol/View.js';
|
||||
import * as _ol_extent_ from '../src/ol/extent.js';
|
||||
import KML from '../src/ol/format/KML.js';
|
||||
import {defaults as defaultInteractions} from '../src/ol/interaction.js';
|
||||
import _ol_interaction_Select_ from '../src/ol/interaction/Select.js';
|
||||
import Select from '../src/ol/interaction/Select.js';
|
||||
import TileLayer from '../src/ol/layer/Tile.js';
|
||||
import VectorLayer from '../src/ol/layer/Vector.js';
|
||||
import Cluster from '../src/ol/source/Cluster.js';
|
||||
import Stamen from '../src/ol/source/Stamen.js';
|
||||
import VectorSource from '../src/ol/source/Vector.js';
|
||||
import _ol_style_Circle_ from '../src/ol/style/Circle.js';
|
||||
import _ol_style_Fill_ from '../src/ol/style/Fill.js';
|
||||
import _ol_style_RegularShape_ from '../src/ol/style/RegularShape.js';
|
||||
import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
|
||||
import _ol_style_Style_ from '../src/ol/style/Style.js';
|
||||
import _ol_style_Text_ from '../src/ol/style/Text.js';
|
||||
import CircleStyle from '../src/ol/style/Circle.js';
|
||||
import Fill from '../src/ol/style/Fill.js';
|
||||
import RegularShape from '../src/ol/style/RegularShape.js';
|
||||
import Stroke from '../src/ol/style/Stroke.js';
|
||||
import Style from '../src/ol/style/Style.js';
|
||||
import Text from '../src/ol/style/Text.js';
|
||||
|
||||
|
||||
var earthquakeFill = new _ol_style_Fill_({
|
||||
var earthquakeFill = new Fill({
|
||||
color: 'rgba(255, 153, 0, 0.8)'
|
||||
});
|
||||
var earthquakeStroke = new _ol_style_Stroke_({
|
||||
var earthquakeStroke = new Stroke({
|
||||
color: 'rgba(255, 204, 0, 0.2)',
|
||||
width: 1
|
||||
});
|
||||
var textFill = new _ol_style_Fill_({
|
||||
var textFill = new Fill({
|
||||
color: '#fff'
|
||||
});
|
||||
var textStroke = new _ol_style_Stroke_({
|
||||
var textStroke = new Stroke({
|
||||
color: 'rgba(0, 0, 0, 0.6)',
|
||||
width: 3
|
||||
});
|
||||
var invisibleFill = new _ol_style_Fill_({
|
||||
var invisibleFill = new Fill({
|
||||
color: 'rgba(255, 255, 255, 0.01)'
|
||||
});
|
||||
|
||||
@@ -43,9 +43,9 @@ function createEarthquakeStyle(feature) {
|
||||
var magnitude = parseFloat(name.substr(2));
|
||||
var radius = 5 + 20 * (magnitude - 5);
|
||||
|
||||
return new _ol_style_Style_({
|
||||
return new Style({
|
||||
geometry: feature.getGeometry(),
|
||||
image: new _ol_style_RegularShape_({
|
||||
image: new RegularShape({
|
||||
radius1: radius,
|
||||
radius2: 3,
|
||||
points: 5,
|
||||
@@ -85,14 +85,14 @@ function styleFunction(feature, resolution) {
|
||||
var style;
|
||||
var size = feature.get('features').length;
|
||||
if (size > 1) {
|
||||
style = new _ol_style_Style_({
|
||||
image: new _ol_style_Circle_({
|
||||
style = new Style({
|
||||
image: new CircleStyle({
|
||||
radius: feature.get('radius'),
|
||||
fill: new _ol_style_Fill_({
|
||||
fill: new Fill({
|
||||
color: [255, 153, 0, Math.min(0.8, 0.4 + (size / maxFeatureCount))]
|
||||
})
|
||||
}),
|
||||
text: new _ol_style_Text_({
|
||||
text: new Text({
|
||||
text: size.toString(),
|
||||
fill: textFill,
|
||||
stroke: textStroke
|
||||
@@ -106,8 +106,8 @@ function styleFunction(feature, resolution) {
|
||||
}
|
||||
|
||||
function selectStyleFunction(feature) {
|
||||
var styles = [new _ol_style_Style_({
|
||||
image: new _ol_style_Circle_({
|
||||
var styles = [new Style({
|
||||
image: new CircleStyle({
|
||||
radius: feature.get('radius'),
|
||||
fill: invisibleFill
|
||||
})
|
||||
@@ -142,7 +142,7 @@ var raster = new TileLayer({
|
||||
|
||||
var map = new Map({
|
||||
layers: [raster, vector],
|
||||
interactions: defaultInteractions().extend([new _ol_interaction_Select_({
|
||||
interactions: defaultInteractions().extend([new Select({
|
||||
condition: function(evt) {
|
||||
return evt.type == 'pointermove' ||
|
||||
evt.type == 'singleclick';
|
||||
|
||||
@@ -7,10 +7,10 @@ import VectorLayer from '../src/ol/layer/Vector.js';
|
||||
import _ol_render_ from '../src/ol/render.js';
|
||||
import Stamen from '../src/ol/source/Stamen.js';
|
||||
import VectorSource from '../src/ol/source/Vector.js';
|
||||
import _ol_style_Fill_ from '../src/ol/style/Fill.js';
|
||||
import _ol_style_Icon_ from '../src/ol/style/Icon.js';
|
||||
import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
|
||||
import _ol_style_Style_ from '../src/ol/style/Style.js';
|
||||
import Fill from '../src/ol/style/Fill.js';
|
||||
import Icon from '../src/ol/style/Icon.js';
|
||||
import Stroke from '../src/ol/style/Stroke.js';
|
||||
import Style from '../src/ol/style/Style.js';
|
||||
|
||||
|
||||
var symbol = [[0, 0], [4, 2], [6, 0], [10, 5], [6, 3], [4, 5], [0, 0]];
|
||||
@@ -35,13 +35,13 @@ var styleFunction = function(feature) {
|
||||
var vectorContext = _ol_render_.toContext(
|
||||
/** @type {CanvasRenderingContext2D} */ (canvas.getContext('2d')),
|
||||
{size: [size, size], pixelRatio: 1});
|
||||
vectorContext.setStyle(new _ol_style_Style_({
|
||||
fill: new _ol_style_Fill_({color: 'rgba(255, 153, 0, 0.4)'}),
|
||||
stroke: new _ol_style_Stroke_({color: 'rgba(255, 204, 0, 0.2)', width: 2})
|
||||
vectorContext.setStyle(new Style({
|
||||
fill: new Fill({color: 'rgba(255, 153, 0, 0.4)'}),
|
||||
stroke: new Stroke({color: 'rgba(255, 204, 0, 0.2)', width: 2})
|
||||
}));
|
||||
vectorContext.drawGeometry(new Polygon([symbol.map(scaleFunction)]));
|
||||
style = new _ol_style_Style_({
|
||||
image: new _ol_style_Icon_({
|
||||
style = new Style({
|
||||
image: new Icon({
|
||||
img: canvas,
|
||||
imgSize: [size, size],
|
||||
rotation: 1.2
|
||||
|
||||
@@ -2,7 +2,7 @@ import Map from '../src/ol/Map.js';
|
||||
import View from '../src/ol/View.js';
|
||||
import _ol_events_condition_ from '../src/ol/events/condition.js';
|
||||
import GeoJSON from '../src/ol/format/GeoJSON.js';
|
||||
import _ol_interaction_Extent_ from '../src/ol/interaction/Extent.js';
|
||||
import ExtentInteraction from '../src/ol/interaction/Extent.js';
|
||||
import TileLayer from '../src/ol/layer/Tile.js';
|
||||
import VectorLayer from '../src/ol/layer/Vector.js';
|
||||
import OSM from '../src/ol/source/OSM.js';
|
||||
@@ -29,7 +29,7 @@ var map = new Map({
|
||||
})
|
||||
});
|
||||
|
||||
var extent = new _ol_interaction_Extent_({
|
||||
var extent = new ExtentInteraction({
|
||||
condition: _ol_events_condition_.platformModifierKeyOnly
|
||||
});
|
||||
map.addInteraction(extent);
|
||||
|
||||
@@ -10,9 +10,9 @@ import VectorLayer from '../src/ol/layer/Vector.js';
|
||||
import {fromLonLat} from '../src/ol/proj.js';
|
||||
import OSM from '../src/ol/source/OSM.js';
|
||||
import VectorSource from '../src/ol/source/Vector.js';
|
||||
import _ol_style_Circle_ from '../src/ol/style/Circle.js';
|
||||
import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
|
||||
import _ol_style_Style_ from '../src/ol/style/Style.js';
|
||||
import CircleStyle from '../src/ol/style/Circle.js';
|
||||
import Stroke from '../src/ol/style/Stroke.js';
|
||||
import Style from '../src/ol/style/Style.js';
|
||||
|
||||
|
||||
var map = new Map({
|
||||
@@ -66,11 +66,11 @@ function flash(feature) {
|
||||
var radius = easeOut(elapsedRatio) * 25 + 5;
|
||||
var opacity = easeOut(1 - elapsedRatio);
|
||||
|
||||
var style = new _ol_style_Style_({
|
||||
image: new _ol_style_Circle_({
|
||||
var style = new Style({
|
||||
image: new CircleStyle({
|
||||
radius: radius,
|
||||
snapToPixel: false,
|
||||
stroke: new _ol_style_Stroke_({
|
||||
stroke: new Stroke({
|
||||
color: 'rgba(255, 0, 0, ' + opacity + ')',
|
||||
width: 0.25 + opacity
|
||||
})
|
||||
|
||||
@@ -7,11 +7,11 @@ import TileLayer from '../src/ol/layer/Tile.js';
|
||||
import VectorLayer from '../src/ol/layer/Vector.js';
|
||||
import BingMaps from '../src/ol/source/BingMaps.js';
|
||||
import VectorSource from '../src/ol/source/Vector.js';
|
||||
import _ol_style_Circle_ from '../src/ol/style/Circle.js';
|
||||
import _ol_style_Fill_ from '../src/ol/style/Fill.js';
|
||||
import _ol_style_Icon_ from '../src/ol/style/Icon.js';
|
||||
import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
|
||||
import _ol_style_Style_ from '../src/ol/style/Style.js';
|
||||
import CircleStyle from '../src/ol/style/Circle.js';
|
||||
import Fill from '../src/ol/style/Fill.js';
|
||||
import Icon from '../src/ol/style/Icon.js';
|
||||
import Stroke from '../src/ol/style/Stroke.js';
|
||||
import Style from '../src/ol/style/Style.js';
|
||||
|
||||
// This long string is placed here due to jsFiddle limitations.
|
||||
// It is usually loaded with AJAX.
|
||||
@@ -85,23 +85,23 @@ var endMarker = new Feature({
|
||||
});
|
||||
|
||||
var styles = {
|
||||
'route': new _ol_style_Style_({
|
||||
stroke: new _ol_style_Stroke_({
|
||||
'route': new Style({
|
||||
stroke: new Stroke({
|
||||
width: 6, color: [237, 212, 0, 0.8]
|
||||
})
|
||||
}),
|
||||
'icon': new _ol_style_Style_({
|
||||
image: new _ol_style_Icon_({
|
||||
'icon': new Style({
|
||||
image: new Icon({
|
||||
anchor: [0.5, 1],
|
||||
src: 'data/icon.png'
|
||||
})
|
||||
}),
|
||||
'geoMarker': new _ol_style_Style_({
|
||||
image: new _ol_style_Circle_({
|
||||
'geoMarker': new Style({
|
||||
image: new CircleStyle({
|
||||
radius: 7,
|
||||
snapToPixel: false,
|
||||
fill: new _ol_style_Fill_({color: 'black'}),
|
||||
stroke: new _ol_style_Stroke_({
|
||||
fill: new Fill({color: 'black'}),
|
||||
stroke: new Stroke({
|
||||
color: 'white', width: 2
|
||||
})
|
||||
})
|
||||
|
||||
@@ -7,8 +7,8 @@ import TileLayer from '../src/ol/layer/Tile.js';
|
||||
import VectorLayer from '../src/ol/layer/Vector.js';
|
||||
import Stamen from '../src/ol/source/Stamen.js';
|
||||
import VectorSource from '../src/ol/source/Vector.js';
|
||||
import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
|
||||
import _ol_style_Style_ from '../src/ol/style/Style.js';
|
||||
import Stroke from '../src/ol/style/Stroke.js';
|
||||
import Style from '../src/ol/style/Style.js';
|
||||
|
||||
var map = new Map({
|
||||
layers: [
|
||||
@@ -25,8 +25,8 @@ var map = new Map({
|
||||
})
|
||||
});
|
||||
|
||||
var style = new _ol_style_Style_({
|
||||
stroke: new _ol_style_Stroke_({
|
||||
var style = new Style({
|
||||
stroke: new Stroke({
|
||||
color: '#EAE911',
|
||||
width: 2
|
||||
})
|
||||
|
||||
@@ -5,8 +5,8 @@ import GeoJSON from '../src/ol/format/GeoJSON.js';
|
||||
import OSM from '../src/ol/source/OSM.js';
|
||||
import VectorTileSource from '../src/ol/source/VectorTile.js';
|
||||
import TileLayer from '../src/ol/layer/Tile.js';
|
||||
import _ol_layer_VectorTile_ from '../src/ol/layer/VectorTile.js';
|
||||
import _ol_proj_Projection_ from '../src/ol/proj/Projection.js';
|
||||
import VectorTileLayer from '../src/ol/layer/VectorTile.js';
|
||||
import Projection from '../src/ol/proj/Projection.js';
|
||||
|
||||
|
||||
var replacer = function(key, value) {
|
||||
@@ -48,7 +48,7 @@ var replacer = function(key, value) {
|
||||
}
|
||||
};
|
||||
|
||||
var tilePixels = new _ol_proj_Projection_({
|
||||
var tilePixels = new Projection({
|
||||
code: 'TILE_PIXELS',
|
||||
units: 'tile-pixels'
|
||||
});
|
||||
@@ -93,7 +93,7 @@ fetch(url).then(function(response) {
|
||||
},
|
||||
url: 'data:' // arbitrary url, we don't use it in the tileLoadFunction
|
||||
});
|
||||
var vectorLayer = new _ol_layer_VectorTile_({
|
||||
var vectorLayer = new VectorTileLayer({
|
||||
source: vectorSource
|
||||
});
|
||||
map.addLayer(vectorLayer);
|
||||
|
||||
@@ -8,78 +8,78 @@ import TileLayer from '../src/ol/layer/Tile.js';
|
||||
import VectorLayer from '../src/ol/layer/Vector.js';
|
||||
import OSM from '../src/ol/source/OSM.js';
|
||||
import VectorSource from '../src/ol/source/Vector.js';
|
||||
import _ol_style_Circle_ from '../src/ol/style/Circle.js';
|
||||
import _ol_style_Fill_ from '../src/ol/style/Fill.js';
|
||||
import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
|
||||
import _ol_style_Style_ from '../src/ol/style/Style.js';
|
||||
import CircleStyle from '../src/ol/style/Circle.js';
|
||||
import Fill from '../src/ol/style/Fill.js';
|
||||
import Stroke from '../src/ol/style/Stroke.js';
|
||||
import Style from '../src/ol/style/Style.js';
|
||||
|
||||
|
||||
var image = new _ol_style_Circle_({
|
||||
var image = new CircleStyle({
|
||||
radius: 5,
|
||||
fill: null,
|
||||
stroke: new _ol_style_Stroke_({color: 'red', width: 1})
|
||||
stroke: new Stroke({color: 'red', width: 1})
|
||||
});
|
||||
|
||||
var styles = {
|
||||
'Point': new _ol_style_Style_({
|
||||
'Point': new Style({
|
||||
image: image
|
||||
}),
|
||||
'LineString': new _ol_style_Style_({
|
||||
stroke: new _ol_style_Stroke_({
|
||||
'LineString': new Style({
|
||||
stroke: new Stroke({
|
||||
color: 'green',
|
||||
width: 1
|
||||
})
|
||||
}),
|
||||
'MultiLineString': new _ol_style_Style_({
|
||||
stroke: new _ol_style_Stroke_({
|
||||
'MultiLineString': new Style({
|
||||
stroke: new Stroke({
|
||||
color: 'green',
|
||||
width: 1
|
||||
})
|
||||
}),
|
||||
'MultiPoint': new _ol_style_Style_({
|
||||
'MultiPoint': new Style({
|
||||
image: image
|
||||
}),
|
||||
'MultiPolygon': new _ol_style_Style_({
|
||||
stroke: new _ol_style_Stroke_({
|
||||
'MultiPolygon': new Style({
|
||||
stroke: new Stroke({
|
||||
color: 'yellow',
|
||||
width: 1
|
||||
}),
|
||||
fill: new _ol_style_Fill_({
|
||||
fill: new Fill({
|
||||
color: 'rgba(255, 255, 0, 0.1)'
|
||||
})
|
||||
}),
|
||||
'Polygon': new _ol_style_Style_({
|
||||
stroke: new _ol_style_Stroke_({
|
||||
'Polygon': new Style({
|
||||
stroke: new Stroke({
|
||||
color: 'blue',
|
||||
lineDash: [4],
|
||||
width: 3
|
||||
}),
|
||||
fill: new _ol_style_Fill_({
|
||||
fill: new Fill({
|
||||
color: 'rgba(0, 0, 255, 0.1)'
|
||||
})
|
||||
}),
|
||||
'GeometryCollection': new _ol_style_Style_({
|
||||
stroke: new _ol_style_Stroke_({
|
||||
'GeometryCollection': new Style({
|
||||
stroke: new Stroke({
|
||||
color: 'magenta',
|
||||
width: 2
|
||||
}),
|
||||
fill: new _ol_style_Fill_({
|
||||
fill: new Fill({
|
||||
color: 'magenta'
|
||||
}),
|
||||
image: new _ol_style_Circle_({
|
||||
image: new CircleStyle({
|
||||
radius: 10,
|
||||
fill: null,
|
||||
stroke: new _ol_style_Stroke_({
|
||||
stroke: new Stroke({
|
||||
color: 'magenta'
|
||||
})
|
||||
})
|
||||
}),
|
||||
'Circle': new _ol_style_Style_({
|
||||
stroke: new _ol_style_Stroke_({
|
||||
'Circle': new Style({
|
||||
stroke: new Stroke({
|
||||
color: 'red',
|
||||
width: 2
|
||||
}),
|
||||
fill: new _ol_style_Fill_({
|
||||
fill: new Fill({
|
||||
color: 'rgba(255,0,0,0.2)'
|
||||
})
|
||||
})
|
||||
|
||||
@@ -8,10 +8,10 @@ import TileLayer from '../src/ol/layer/Tile.js';
|
||||
import VectorLayer from '../src/ol/layer/Vector.js';
|
||||
import OSM from '../src/ol/source/OSM.js';
|
||||
import VectorSource from '../src/ol/source/Vector.js';
|
||||
import _ol_style_Circle_ from '../src/ol/style/Circle.js';
|
||||
import _ol_style_Fill_ from '../src/ol/style/Fill.js';
|
||||
import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
|
||||
import _ol_style_Style_ from '../src/ol/style/Style.js';
|
||||
import CircleStyle from '../src/ol/style/Circle.js';
|
||||
import Fill from '../src/ol/style/Fill.js';
|
||||
import Stroke from '../src/ol/style/Stroke.js';
|
||||
import Style from '../src/ol/style/Style.js';
|
||||
|
||||
var view = new View({
|
||||
center: [0, 0],
|
||||
@@ -67,13 +67,13 @@ geolocation.on('change:accuracyGeometry', function() {
|
||||
});
|
||||
|
||||
var positionFeature = new Feature();
|
||||
positionFeature.setStyle(new _ol_style_Style_({
|
||||
image: new _ol_style_Circle_({
|
||||
positionFeature.setStyle(new Style({
|
||||
image: new CircleStyle({
|
||||
radius: 6,
|
||||
fill: new _ol_style_Fill_({
|
||||
fill: new Fill({
|
||||
color: '#3399CC'
|
||||
}),
|
||||
stroke: new _ol_style_Stroke_({
|
||||
stroke: new Stroke({
|
||||
color: '#fff',
|
||||
width: 2
|
||||
})
|
||||
|
||||
@@ -5,10 +5,10 @@ import TileLayer from '../src/ol/layer/Tile.js';
|
||||
import VectorLayer from '../src/ol/layer/Vector.js';
|
||||
import BingMaps from '../src/ol/source/BingMaps.js';
|
||||
import VectorSource from '../src/ol/source/Vector.js';
|
||||
import _ol_style_Circle_ from '../src/ol/style/Circle.js';
|
||||
import _ol_style_Fill_ from '../src/ol/style/Fill.js';
|
||||
import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
|
||||
import _ol_style_Style_ from '../src/ol/style/Style.js';
|
||||
import CircleStyle from '../src/ol/style/Circle.js';
|
||||
import Fill from '../src/ol/style/Fill.js';
|
||||
import Stroke from '../src/ol/style/Stroke.js';
|
||||
import Style from '../src/ol/style/Style.js';
|
||||
|
||||
var raster = new TileLayer({
|
||||
source: new BingMaps({
|
||||
@@ -18,26 +18,26 @@ var raster = new TileLayer({
|
||||
});
|
||||
|
||||
var style = {
|
||||
'Point': new _ol_style_Style_({
|
||||
image: new _ol_style_Circle_({
|
||||
fill: new _ol_style_Fill_({
|
||||
'Point': new Style({
|
||||
image: new CircleStyle({
|
||||
fill: new Fill({
|
||||
color: 'rgba(255,255,0,0.4)'
|
||||
}),
|
||||
radius: 5,
|
||||
stroke: new _ol_style_Stroke_({
|
||||
stroke: new Stroke({
|
||||
color: '#ff0',
|
||||
width: 1
|
||||
})
|
||||
})
|
||||
}),
|
||||
'LineString': new _ol_style_Style_({
|
||||
stroke: new _ol_style_Stroke_({
|
||||
'LineString': new Style({
|
||||
stroke: new Stroke({
|
||||
color: '#f00',
|
||||
width: 3
|
||||
})
|
||||
}),
|
||||
'MultiLineString': new _ol_style_Style_({
|
||||
stroke: new _ol_style_Stroke_({
|
||||
'MultiLineString': new Style({
|
||||
stroke: new Stroke({
|
||||
color: '#0f0',
|
||||
width: 3
|
||||
})
|
||||
|
||||
@@ -4,7 +4,7 @@ import View from '../src/ol/View.js';
|
||||
import TileLayer from '../src/ol/layer/Tile.js';
|
||||
import {fromLonLat} from '../src/ol/proj.js';
|
||||
import OSM from '../src/ol/source/OSM.js';
|
||||
import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
|
||||
import Stroke from '../src/ol/style/Stroke.js';
|
||||
|
||||
|
||||
var map = new Map({
|
||||
@@ -25,7 +25,7 @@ var map = new Map({
|
||||
// Create the graticule component
|
||||
var graticule = new Graticule({
|
||||
// the style to use for the lines, optional.
|
||||
strokeStyle: new _ol_style_Stroke_({
|
||||
strokeStyle: new Stroke({
|
||||
color: 'rgba(255,120,0,0.9)',
|
||||
width: 2,
|
||||
lineDash: [0.5, 4]
|
||||
|
||||
@@ -6,15 +6,15 @@ import OSM from '../src/ol/source/OSM.js';
|
||||
import VectorSource from '../src/ol/source/Vector.js';
|
||||
import Feature from '../src/ol/Feature.js';
|
||||
import LineString from '../src/ol/geom/LineString.js';
|
||||
import _ol_style_Style_ from '../src/ol/style/Style.js';
|
||||
import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
|
||||
import Style from '../src/ol/style/Style.js';
|
||||
import Stroke from '../src/ol/style/Stroke.js';
|
||||
|
||||
var raster = new TileLayer({
|
||||
source: new OSM()
|
||||
});
|
||||
|
||||
var style = new _ol_style_Style_({
|
||||
stroke: new _ol_style_Stroke_({
|
||||
var style = new Style({
|
||||
stroke: new Stroke({
|
||||
color: 'black',
|
||||
width: 1
|
||||
})
|
||||
|
||||
@@ -7,8 +7,8 @@ import VectorLayer from '../src/ol/layer/Vector.js';
|
||||
import {fromLonLat} from '../src/ol/proj.js';
|
||||
import TileJSON from '../src/ol/source/TileJSON.js';
|
||||
import VectorSource from '../src/ol/source/Vector.js';
|
||||
import _ol_style_Icon_ from '../src/ol/style/Icon.js';
|
||||
import _ol_style_Style_ from '../src/ol/style/Style.js';
|
||||
import Icon from '../src/ol/style/Icon.js';
|
||||
import Style from '../src/ol/style/Style.js';
|
||||
|
||||
|
||||
var rome = new Feature({
|
||||
@@ -23,24 +23,24 @@ var madrid = new Feature({
|
||||
geometry: new Point(fromLonLat([-3.683333, 40.4]))
|
||||
});
|
||||
|
||||
rome.setStyle(new _ol_style_Style_({
|
||||
image: new _ol_style_Icon_(/** @type {olx.style.IconOptions} */ ({
|
||||
rome.setStyle(new Style({
|
||||
image: new Icon(/** @type {olx.style.IconOptions} */ ({
|
||||
color: '#8959A8',
|
||||
crossOrigin: 'anonymous',
|
||||
src: 'data/dot.png'
|
||||
}))
|
||||
}));
|
||||
|
||||
london.setStyle(new _ol_style_Style_({
|
||||
image: new _ol_style_Icon_(/** @type {olx.style.IconOptions} */ ({
|
||||
london.setStyle(new Style({
|
||||
image: new Icon(/** @type {olx.style.IconOptions} */ ({
|
||||
color: '#4271AE',
|
||||
crossOrigin: 'anonymous',
|
||||
src: 'data/dot.png'
|
||||
}))
|
||||
}));
|
||||
|
||||
madrid.setStyle(new _ol_style_Style_({
|
||||
image: new _ol_style_Icon_(/** @type {olx.style.IconOptions} */ ({
|
||||
madrid.setStyle(new Style({
|
||||
image: new Icon(/** @type {olx.style.IconOptions} */ ({
|
||||
color: [113, 140, 0],
|
||||
crossOrigin: 'anonymous',
|
||||
src: 'data/dot.png'
|
||||
|
||||
@@ -2,18 +2,18 @@ import Feature from '../src/ol/Feature.js';
|
||||
import Map from '../src/ol/Map.js';
|
||||
import View from '../src/ol/View.js';
|
||||
import Point from '../src/ol/geom/Point.js';
|
||||
import _ol_interaction_Select_ from '../src/ol/interaction/Select.js';
|
||||
import Select from '../src/ol/interaction/Select.js';
|
||||
import TileLayer from '../src/ol/layer/Tile.js';
|
||||
import VectorLayer from '../src/ol/layer/Vector.js';
|
||||
import Stamen from '../src/ol/source/Stamen.js';
|
||||
import VectorSource from '../src/ol/source/Vector.js';
|
||||
import _ol_style_Icon_ from '../src/ol/style/Icon.js';
|
||||
import _ol_style_Style_ from '../src/ol/style/Style.js';
|
||||
import Icon from '../src/ol/style/Icon.js';
|
||||
import Style from '../src/ol/style/Style.js';
|
||||
|
||||
|
||||
function createStyle(src, img) {
|
||||
return new _ol_style_Style_({
|
||||
image: new _ol_style_Icon_(/** @type {olx.style.IconOptions} */ ({
|
||||
return new Style({
|
||||
image: new Icon(/** @type {olx.style.IconOptions} */ ({
|
||||
anchor: [0.5, 0.96],
|
||||
crossOrigin: 'anonymous',
|
||||
src: src,
|
||||
@@ -46,7 +46,7 @@ var map = new Map({
|
||||
});
|
||||
|
||||
var selectStyle = {};
|
||||
var select = new _ol_interaction_Select_({
|
||||
var select = new Select({
|
||||
style: function(feature) {
|
||||
var image = feature.get('style').getImage().getImage();
|
||||
if (!selectStyle[image.src]) {
|
||||
|
||||
@@ -4,8 +4,8 @@ import View from '../src/ol/View.js';
|
||||
import Point from '../src/ol/geom/Point.js';
|
||||
import VectorLayer from '../src/ol/layer/Vector.js';
|
||||
import VectorSource from '../src/ol/source/Vector.js';
|
||||
import _ol_style_Icon_ from '../src/ol/style/Icon.js';
|
||||
import _ol_style_Style_ from '../src/ol/style/Style.js';
|
||||
import Icon from '../src/ol/style/Icon.js';
|
||||
import Style from '../src/ol/style/Style.js';
|
||||
|
||||
|
||||
var iconInfo = [{
|
||||
@@ -44,7 +44,7 @@ var iconCount = iconInfo.length;
|
||||
var icons = new Array(iconCount);
|
||||
for (i = 0; i < iconCount; ++i) {
|
||||
var info = iconInfo[i];
|
||||
icons[i] = new _ol_style_Icon_({
|
||||
icons[i] = new Icon({
|
||||
offset: info.offset,
|
||||
opacity: info.opacity,
|
||||
rotateWithView: info.rotateWithView,
|
||||
@@ -65,7 +65,7 @@ for (i = 0; i < featureCount; ++i) {
|
||||
[2 * e * Math.random() - e, 2 * e * Math.random() - e]);
|
||||
feature = new Feature(geometry);
|
||||
feature.setStyle(
|
||||
new _ol_style_Style_({
|
||||
new Style({
|
||||
image: icons[i % (iconCount - 1)]
|
||||
})
|
||||
);
|
||||
@@ -101,7 +101,7 @@ new VectorLayer({
|
||||
source: new VectorSource({
|
||||
features: overlayFeatures
|
||||
}),
|
||||
style: new _ol_style_Style_({
|
||||
style: new Style({
|
||||
image: icons[iconCount - 1]
|
||||
})
|
||||
});
|
||||
|
||||
@@ -7,8 +7,8 @@ import TileLayer from '../src/ol/layer/Tile.js';
|
||||
import VectorLayer from '../src/ol/layer/Vector.js';
|
||||
import TileJSON from '../src/ol/source/TileJSON.js';
|
||||
import VectorSource from '../src/ol/source/Vector.js';
|
||||
import _ol_style_Icon_ from '../src/ol/style/Icon.js';
|
||||
import _ol_style_Style_ from '../src/ol/style/Style.js';
|
||||
import Icon from '../src/ol/style/Icon.js';
|
||||
import Style from '../src/ol/style/Style.js';
|
||||
|
||||
|
||||
var iconFeature = new Feature({
|
||||
@@ -18,8 +18,8 @@ var iconFeature = new Feature({
|
||||
rainfall: 500
|
||||
});
|
||||
|
||||
var iconStyle = new _ol_style_Style_({
|
||||
image: new _ol_style_Icon_(/** @type {olx.style.IconOptions} */ ({
|
||||
var iconStyle = new Style({
|
||||
image: new Icon(/** @type {olx.style.IconOptions} */ ({
|
||||
anchor: [0.5, 46],
|
||||
anchorXUnits: 'fraction',
|
||||
anchorYUnits: 'pixels',
|
||||
|
||||
@@ -9,10 +9,10 @@ import TileLayer from '../src/ol/layer/Tile.js';
|
||||
import VectorLayer from '../src/ol/layer/Vector.js';
|
||||
import OSM from '../src/ol/source/OSM.js';
|
||||
import VectorSource from '../src/ol/source/Vector.js';
|
||||
import _ol_style_Circle_ from '../src/ol/style/Circle.js';
|
||||
import _ol_style_Fill_ from '../src/ol/style/Fill.js';
|
||||
import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
|
||||
import _ol_style_Style_ from '../src/ol/style/Style.js';
|
||||
import CircleStyle from '../src/ol/style/Circle.js';
|
||||
import Fill from '../src/ol/style/Fill.js';
|
||||
import Stroke from '../src/ol/style/Stroke.js';
|
||||
import Style from '../src/ol/style/Style.js';
|
||||
|
||||
|
||||
var colors = {
|
||||
@@ -28,8 +28,8 @@ var styleFunction = function(feature) {
|
||||
var color = colors[feature.get('PLT')];
|
||||
var style = styleCache[color];
|
||||
if (!style) {
|
||||
style = new _ol_style_Style_({
|
||||
stroke: new _ol_style_Stroke_({
|
||||
style = new Style({
|
||||
stroke: new Stroke({
|
||||
color: color,
|
||||
width: 3
|
||||
})
|
||||
@@ -152,13 +152,13 @@ map.on('click', function(evt) {
|
||||
displaySnap(evt.coordinate);
|
||||
});
|
||||
|
||||
var stroke = new _ol_style_Stroke_({
|
||||
var stroke = new Stroke({
|
||||
color: 'rgba(255,0,0,0.9)',
|
||||
width: 1
|
||||
});
|
||||
var style = new _ol_style_Style_({
|
||||
var style = new Style({
|
||||
stroke: stroke,
|
||||
image: new _ol_style_Circle_({
|
||||
image: new CircleStyle({
|
||||
radius: 5,
|
||||
fill: null,
|
||||
stroke: stroke
|
||||
@@ -178,10 +178,10 @@ map.on('postcompose', function(evt) {
|
||||
var featureOverlay = new VectorLayer({
|
||||
source: new VectorSource(),
|
||||
map: map,
|
||||
style: new _ol_style_Style_({
|
||||
image: new _ol_style_Circle_({
|
||||
style: new Style({
|
||||
image: new CircleStyle({
|
||||
radius: 5,
|
||||
fill: new _ol_style_Fill_({
|
||||
fill: new Fill({
|
||||
color: 'rgba(255,0,0,0.9)'
|
||||
})
|
||||
})
|
||||
|
||||
@@ -3,21 +3,21 @@ import View from '../src/ol/View.js';
|
||||
import GeoJSON from '../src/ol/format/GeoJSON.js';
|
||||
import VectorLayer from '../src/ol/layer/Vector.js';
|
||||
import VectorSource from '../src/ol/source/Vector.js';
|
||||
import _ol_style_Fill_ from '../src/ol/style/Fill.js';
|
||||
import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
|
||||
import _ol_style_Style_ from '../src/ol/style/Style.js';
|
||||
import _ol_style_Text_ from '../src/ol/style/Text.js';
|
||||
import Fill from '../src/ol/style/Fill.js';
|
||||
import Stroke from '../src/ol/style/Stroke.js';
|
||||
import Style from '../src/ol/style/Style.js';
|
||||
import Text from '../src/ol/style/Text.js';
|
||||
|
||||
|
||||
var style = new _ol_style_Style_({
|
||||
fill: new _ol_style_Fill_({
|
||||
var style = new Style({
|
||||
fill: new Fill({
|
||||
color: 'rgba(255, 255, 255, 0.6)'
|
||||
}),
|
||||
stroke: new _ol_style_Stroke_({
|
||||
stroke: new Stroke({
|
||||
color: '#319FD3',
|
||||
width: 1
|
||||
}),
|
||||
text: new _ol_style_Text_()
|
||||
text: new Text()
|
||||
});
|
||||
|
||||
var map = new Map({
|
||||
@@ -44,12 +44,12 @@ var map = new Map({
|
||||
var featureOverlay = new VectorLayer({
|
||||
source: new VectorSource(),
|
||||
map: map,
|
||||
style: new _ol_style_Style_({
|
||||
stroke: new _ol_style_Stroke_({
|
||||
style: new Style({
|
||||
stroke: new Stroke({
|
||||
color: '#f00',
|
||||
width: 1
|
||||
}),
|
||||
fill: new _ol_style_Fill_({
|
||||
fill: new Fill({
|
||||
color: 'rgba(255,0,0,0.1)'
|
||||
})
|
||||
})
|
||||
|
||||
@@ -5,10 +5,10 @@ import TileLayer from '../src/ol/layer/Tile.js';
|
||||
import VectorLayer from '../src/ol/layer/Vector.js';
|
||||
import Stamen from '../src/ol/source/Stamen.js';
|
||||
import VectorSource from '../src/ol/source/Vector.js';
|
||||
import _ol_style_Circle_ from '../src/ol/style/Circle.js';
|
||||
import _ol_style_Fill_ from '../src/ol/style/Fill.js';
|
||||
import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
|
||||
import _ol_style_Style_ from '../src/ol/style/Style.js';
|
||||
import CircleStyle from '../src/ol/style/Circle.js';
|
||||
import Fill from '../src/ol/style/Fill.js';
|
||||
import Stroke from '../src/ol/style/Stroke.js';
|
||||
import Style from '../src/ol/style/Style.js';
|
||||
|
||||
|
||||
var styleCache = {};
|
||||
@@ -21,13 +21,13 @@ var styleFunction = function(feature) {
|
||||
var radius = 5 + 20 * (magnitude - 5);
|
||||
var style = styleCache[radius];
|
||||
if (!style) {
|
||||
style = new _ol_style_Style_({
|
||||
image: new _ol_style_Circle_({
|
||||
style = new Style({
|
||||
image: new CircleStyle({
|
||||
radius: radius,
|
||||
fill: new _ol_style_Fill_({
|
||||
fill: new Fill({
|
||||
color: 'rgba(255, 153, 0, 0.4)'
|
||||
}),
|
||||
stroke: new _ol_style_Stroke_({
|
||||
stroke: new Stroke({
|
||||
color: 'rgba(255, 204, 0, 0.2)',
|
||||
width: 1
|
||||
})
|
||||
|
||||
@@ -5,9 +5,9 @@ import TileLayer from '../src/ol/layer/Tile.js';
|
||||
import VectorLayer from '../src/ol/layer/Vector.js';
|
||||
import Stamen from '../src/ol/source/Stamen.js';
|
||||
import VectorSource from '../src/ol/source/Vector.js';
|
||||
import _ol_style_Fill_ from '../src/ol/style/Fill.js';
|
||||
import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
|
||||
import _ol_style_Style_ from '../src/ol/style/Style.js';
|
||||
import Fill from '../src/ol/style/Fill.js';
|
||||
import Stroke from '../src/ol/style/Stroke.js';
|
||||
import Style from '../src/ol/style/Style.js';
|
||||
|
||||
|
||||
/*
|
||||
@@ -35,11 +35,11 @@ var styleFunction = function(feature) {
|
||||
delta = 24 - delta;
|
||||
}
|
||||
var opacity = 0.75 * (1 - delta / 12);
|
||||
return new _ol_style_Style_({
|
||||
fill: new _ol_style_Fill_({
|
||||
return new Style({
|
||||
fill: new Fill({
|
||||
color: [0xff, 0xff, 0x33, opacity]
|
||||
}),
|
||||
stroke: new _ol_style_Stroke_({
|
||||
stroke: new Stroke({
|
||||
color: '#ffffff'
|
||||
})
|
||||
});
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import Map from '../src/ol/Map.js';
|
||||
import View from '../src/ol/View.js';
|
||||
import _ol_layer_Group_ from '../src/ol/layer/Group.js';
|
||||
import LayerGroup from '../src/ol/layer/Group.js';
|
||||
import TileLayer from '../src/ol/layer/Tile.js';
|
||||
import {fromLonLat} from '../src/ol/proj.js';
|
||||
import OSM from '../src/ol/source/OSM.js';
|
||||
@@ -10,7 +10,7 @@ var map = new Map({
|
||||
layers: [
|
||||
new TileLayer({
|
||||
source: new OSM()
|
||||
}), new _ol_layer_Group_({
|
||||
}), new LayerGroup({
|
||||
layers: [
|
||||
new TileLayer({
|
||||
source: new TileJSON({
|
||||
@@ -49,7 +49,7 @@ function bindInputs(layerid, layer) {
|
||||
}
|
||||
map.getLayers().forEach(function(layer, i) {
|
||||
bindInputs('#layer' + i, layer);
|
||||
if (layer instanceof _ol_layer_Group_) {
|
||||
if (layer instanceof LayerGroup) {
|
||||
layer.getLayers().forEach(function(sublayer, j) {
|
||||
bindInputs('#layer' + i + j, sublayer);
|
||||
});
|
||||
|
||||
@@ -4,27 +4,27 @@ import View from '../src/ol/View.js';
|
||||
import Point from '../src/ol/geom/Point.js';
|
||||
import VectorLayer from '../src/ol/layer/Vector.js';
|
||||
import VectorSource from '../src/ol/source/Vector.js';
|
||||
import _ol_style_Fill_ from '../src/ol/style/Fill.js';
|
||||
import _ol_style_RegularShape_ from '../src/ol/style/RegularShape.js';
|
||||
import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
|
||||
import _ol_style_Style_ from '../src/ol/style/Style.js';
|
||||
import Fill from '../src/ol/style/Fill.js';
|
||||
import RegularShape from '../src/ol/style/RegularShape.js';
|
||||
import Stroke from '../src/ol/style/Stroke.js';
|
||||
import Style from '../src/ol/style/Style.js';
|
||||
|
||||
|
||||
var stroke = new _ol_style_Stroke_({color: 'black', width: 1});
|
||||
var stroke = new Stroke({color: 'black', width: 1});
|
||||
|
||||
var styles = {
|
||||
'square': new _ol_style_Style_({
|
||||
image: new _ol_style_RegularShape_({
|
||||
fill: new _ol_style_Fill_({color: 'blue'}),
|
||||
'square': new Style({
|
||||
image: new RegularShape({
|
||||
fill: new Fill({color: 'blue'}),
|
||||
stroke: stroke,
|
||||
points: 4,
|
||||
radius: 80,
|
||||
angle: Math.PI / 4
|
||||
})
|
||||
}),
|
||||
'triangle': new _ol_style_Style_({
|
||||
image: new _ol_style_RegularShape_({
|
||||
fill: new _ol_style_Fill_({color: 'red'}),
|
||||
'triangle': new Style({
|
||||
image: new RegularShape({
|
||||
fill: new Fill({color: 'red'}),
|
||||
stroke: stroke,
|
||||
points: 3,
|
||||
radius: 80,
|
||||
@@ -32,9 +32,9 @@ var styles = {
|
||||
angle: 0
|
||||
})
|
||||
}),
|
||||
'star': new _ol_style_Style_({
|
||||
image: new _ol_style_RegularShape_({
|
||||
fill: new _ol_style_Fill_({color: 'green'}),
|
||||
'star': new Style({
|
||||
image: new RegularShape({
|
||||
fill: new Fill({color: 'green'}),
|
||||
stroke: stroke,
|
||||
points: 5,
|
||||
radius: 80,
|
||||
|
||||
@@ -6,9 +6,9 @@ import TileLayer from '../src/ol/layer/Tile.js';
|
||||
import VectorLayer from '../src/ol/layer/Vector.js';
|
||||
import OSM from '../src/ol/source/OSM.js';
|
||||
import VectorSource from '../src/ol/source/Vector.js';
|
||||
import _ol_style_Icon_ from '../src/ol/style/Icon.js';
|
||||
import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
|
||||
import _ol_style_Style_ from '../src/ol/style/Style.js';
|
||||
import Icon from '../src/ol/style/Icon.js';
|
||||
import Stroke from '../src/ol/style/Stroke.js';
|
||||
import Style from '../src/ol/style/Style.js';
|
||||
|
||||
var raster = new TileLayer({
|
||||
source: new OSM()
|
||||
@@ -20,8 +20,8 @@ var styleFunction = function(feature) {
|
||||
var geometry = feature.getGeometry();
|
||||
var styles = [
|
||||
// linestring
|
||||
new _ol_style_Style_({
|
||||
stroke: new _ol_style_Stroke_({
|
||||
new Style({
|
||||
stroke: new Stroke({
|
||||
color: '#ffcc33',
|
||||
width: 2
|
||||
})
|
||||
@@ -33,9 +33,9 @@ var styleFunction = function(feature) {
|
||||
var dy = end[1] - start[1];
|
||||
var rotation = Math.atan2(dy, dx);
|
||||
// arrows
|
||||
styles.push(new _ol_style_Style_({
|
||||
styles.push(new Style({
|
||||
geometry: new Point(end),
|
||||
image: new _ol_style_Icon_({
|
||||
image: new Icon({
|
||||
src: 'data/arrow.png',
|
||||
anchor: [0.75, 0.5],
|
||||
rotateWithView: true,
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
import Map from '../src/ol/Map.js';
|
||||
import View from '../src/ol/View.js';
|
||||
import MVT from '../src/ol/format/MVT.js';
|
||||
import _ol_layer_VectorTile_ from '../src/ol/layer/VectorTile.js';
|
||||
import VectorTileLayer from '../src/ol/layer/VectorTile.js';
|
||||
import {get as getProjection} from '../src/ol/proj.js';
|
||||
import VectorTileSource from '../src/ol/source/VectorTile.js';
|
||||
import _ol_style_Fill_ from '../src/ol/style/Fill.js';
|
||||
import _ol_style_Icon_ from '../src/ol/style/Icon.js';
|
||||
import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
|
||||
import _ol_style_Style_ from '../src/ol/style/Style.js';
|
||||
import _ol_style_Text_ from '../src/ol/style/Text.js';
|
||||
import Fill from '../src/ol/style/Fill.js';
|
||||
import Icon from '../src/ol/style/Icon.js';
|
||||
import Stroke from '../src/ol/style/Stroke.js';
|
||||
import Style from '../src/ol/style/Style.js';
|
||||
import Text from '../src/ol/style/Text.js';
|
||||
import TileGrid from '../src/ol/tilegrid/TileGrid.js';
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ function tileUrlFunction(tileCoord) {
|
||||
|
||||
var map = new Map({
|
||||
layers: [
|
||||
new _ol_layer_VectorTile_({
|
||||
new VectorTileLayer({
|
||||
source: new VectorTileSource({
|
||||
attributions: '© <a href="https://www.mapbox.com/map-feedback/">Mapbox</a> ' +
|
||||
'© <a href="https://www.openstreetmap.org/copyright">' +
|
||||
@@ -45,7 +45,7 @@ var map = new Map({
|
||||
}),
|
||||
tileUrlFunction: tileUrlFunction
|
||||
}),
|
||||
style: createMapboxStreetsV6Style(_ol_style_Style_, _ol_style_Fill_, _ol_style_Stroke_, _ol_style_Icon_, _ol_style_Text_)
|
||||
style: createMapboxStreetsV6Style(Style, Fill, Stroke, Icon, Text)
|
||||
})
|
||||
],
|
||||
target: 'map',
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
import Map from '../src/ol/Map.js';
|
||||
import View from '../src/ol/View.js';
|
||||
import MVT from '../src/ol/format/MVT.js';
|
||||
import _ol_layer_VectorTile_ from '../src/ol/layer/VectorTile.js';
|
||||
import VectorTileLayer from '../src/ol/layer/VectorTile.js';
|
||||
import VectorTileSource from '../src/ol/source/VectorTile.js';
|
||||
import _ol_style_Fill_ from '../src/ol/style/Fill.js';
|
||||
import _ol_style_Icon_ from '../src/ol/style/Icon.js';
|
||||
import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
|
||||
import _ol_style_Style_ from '../src/ol/style/Style.js';
|
||||
import _ol_style_Text_ from '../src/ol/style/Text.js';
|
||||
import Fill from '../src/ol/style/Fill.js';
|
||||
import Icon from '../src/ol/style/Icon.js';
|
||||
import Stroke from '../src/ol/style/Stroke.js';
|
||||
import Style from '../src/ol/style/Style.js';
|
||||
import Text from '../src/ol/style/Text.js';
|
||||
|
||||
|
||||
var key = 'pk.eyJ1IjoiYWhvY2V2YXIiLCJhIjoiRk1kMWZaSSJ9.E5BkluenyWQMsBLsuByrmg';
|
||||
|
||||
var map = new Map({
|
||||
layers: [
|
||||
new _ol_layer_VectorTile_({
|
||||
new VectorTileLayer({
|
||||
declutter: true,
|
||||
source: new VectorTileSource({
|
||||
attributions: '© <a href="https://www.mapbox.com/map-feedback/">Mapbox</a> ' +
|
||||
@@ -24,7 +24,7 @@ var map = new Map({
|
||||
url: 'https://{a-d}.tiles.mapbox.com/v4/mapbox.mapbox-streets-v6/' +
|
||||
'{z}/{x}/{y}.vector.pbf?access_token=' + key
|
||||
}),
|
||||
style: createMapboxStreetsV6Style(_ol_style_Style_, _ol_style_Fill_, _ol_style_Stroke_, _ol_style_Icon_, _ol_style_Text_)
|
||||
style: createMapboxStreetsV6Style(Style, Fill, Stroke, Icon, Text)
|
||||
})
|
||||
],
|
||||
target: 'map',
|
||||
|
||||
@@ -10,10 +10,10 @@ import TileLayer from '../src/ol/layer/Tile.js';
|
||||
import VectorLayer from '../src/ol/layer/Vector.js';
|
||||
import OSM from '../src/ol/source/OSM.js';
|
||||
import VectorSource from '../src/ol/source/Vector.js';
|
||||
import _ol_style_Circle_ from '../src/ol/style/Circle.js';
|
||||
import _ol_style_Fill_ from '../src/ol/style/Fill.js';
|
||||
import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
|
||||
import _ol_style_Style_ from '../src/ol/style/Style.js';
|
||||
import CircleStyle from '../src/ol/style/Circle.js';
|
||||
import Fill from '../src/ol/style/Fill.js';
|
||||
import Stroke from '../src/ol/style/Stroke.js';
|
||||
import Style from '../src/ol/style/Style.js';
|
||||
|
||||
|
||||
var raster = new TileLayer({
|
||||
@@ -24,17 +24,17 @@ var source = new VectorSource();
|
||||
|
||||
var vector = new VectorLayer({
|
||||
source: source,
|
||||
style: new _ol_style_Style_({
|
||||
fill: new _ol_style_Fill_({
|
||||
style: new Style({
|
||||
fill: new Fill({
|
||||
color: 'rgba(255, 255, 255, 0.2)'
|
||||
}),
|
||||
stroke: new _ol_style_Stroke_({
|
||||
stroke: new Stroke({
|
||||
color: '#ffcc33',
|
||||
width: 2
|
||||
}),
|
||||
image: new _ol_style_Circle_({
|
||||
image: new CircleStyle({
|
||||
radius: 7,
|
||||
fill: new _ol_style_Fill_({
|
||||
fill: new Fill({
|
||||
color: '#ffcc33'
|
||||
})
|
||||
})
|
||||
@@ -180,21 +180,21 @@ function addInteraction() {
|
||||
draw = new Draw({
|
||||
source: source,
|
||||
type: type,
|
||||
style: new _ol_style_Style_({
|
||||
fill: new _ol_style_Fill_({
|
||||
style: new Style({
|
||||
fill: new Fill({
|
||||
color: 'rgba(255, 255, 255, 0.2)'
|
||||
}),
|
||||
stroke: new _ol_style_Stroke_({
|
||||
stroke: new Stroke({
|
||||
color: 'rgba(0, 0, 0, 0.5)',
|
||||
lineDash: [10, 10],
|
||||
width: 2
|
||||
}),
|
||||
image: new _ol_style_Circle_({
|
||||
image: new CircleStyle({
|
||||
radius: 5,
|
||||
stroke: new _ol_style_Stroke_({
|
||||
stroke: new Stroke({
|
||||
color: 'rgba(0, 0, 0, 0.7)'
|
||||
}),
|
||||
fill: new _ol_style_Fill_({
|
||||
fill: new Fill({
|
||||
color: 'rgba(255, 255, 255, 0.2)'
|
||||
})
|
||||
})
|
||||
|
||||
@@ -2,8 +2,8 @@ import Map from '../src/ol/Map.js';
|
||||
import View from '../src/ol/View.js';
|
||||
import GeoJSON from '../src/ol/format/GeoJSON.js';
|
||||
import {defaults as defaultInteractions} from '../src/ol/interaction.js';
|
||||
import _ol_interaction_Modify_ from '../src/ol/interaction/Modify.js';
|
||||
import _ol_interaction_Select_ from '../src/ol/interaction/Select.js';
|
||||
import Modify from '../src/ol/interaction/Modify.js';
|
||||
import Select from '../src/ol/interaction/Select.js';
|
||||
import TileLayer from '../src/ol/layer/Tile.js';
|
||||
import VectorLayer from '../src/ol/layer/Vector.js';
|
||||
import OSM from '../src/ol/source/OSM.js';
|
||||
@@ -22,11 +22,11 @@ var vector = new VectorLayer({
|
||||
})
|
||||
});
|
||||
|
||||
var select = new _ol_interaction_Select_({
|
||||
var select = new Select({
|
||||
wrapX: false
|
||||
});
|
||||
|
||||
var modify = new _ol_interaction_Modify_({
|
||||
var modify = new Modify({
|
||||
features: select.getFeatures()
|
||||
});
|
||||
|
||||
|
||||
@@ -2,54 +2,54 @@ import Map from '../src/ol/Map.js';
|
||||
import View from '../src/ol/View.js';
|
||||
import GeoJSON from '../src/ol/format/GeoJSON.js';
|
||||
import {defaults as defaultInteractions} from '../src/ol/interaction.js';
|
||||
import _ol_interaction_Modify_ from '../src/ol/interaction/Modify.js';
|
||||
import _ol_interaction_Select_ from '../src/ol/interaction/Select.js';
|
||||
import Modify from '../src/ol/interaction/Modify.js';
|
||||
import Select from '../src/ol/interaction/Select.js';
|
||||
import VectorLayer from '../src/ol/layer/Vector.js';
|
||||
import VectorSource from '../src/ol/source/Vector.js';
|
||||
import _ol_style_Circle_ from '../src/ol/style/Circle.js';
|
||||
import _ol_style_Fill_ from '../src/ol/style/Fill.js';
|
||||
import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
|
||||
import _ol_style_Style_ from '../src/ol/style/Style.js';
|
||||
import CircleStyle from '../src/ol/style/Circle.js';
|
||||
import Fill from '../src/ol/style/Fill.js';
|
||||
import Stroke from '../src/ol/style/Stroke.js';
|
||||
import Style from '../src/ol/style/Style.js';
|
||||
|
||||
|
||||
var styleFunction = (function() {
|
||||
var styles = {};
|
||||
var image = new _ol_style_Circle_({
|
||||
var image = new CircleStyle({
|
||||
radius: 5,
|
||||
fill: null,
|
||||
stroke: new _ol_style_Stroke_({color: 'orange', width: 2})
|
||||
stroke: new Stroke({color: 'orange', width: 2})
|
||||
});
|
||||
styles['Point'] = new _ol_style_Style_({image: image});
|
||||
styles['Polygon'] = new _ol_style_Style_({
|
||||
stroke: new _ol_style_Stroke_({
|
||||
styles['Point'] = new Style({image: image});
|
||||
styles['Polygon'] = new Style({
|
||||
stroke: new Stroke({
|
||||
color: 'blue',
|
||||
width: 3
|
||||
}),
|
||||
fill: new _ol_style_Fill_({
|
||||
fill: new Fill({
|
||||
color: 'rgba(0, 0, 255, 0.1)'
|
||||
})
|
||||
});
|
||||
styles['MultiLineString'] = new _ol_style_Style_({
|
||||
stroke: new _ol_style_Stroke_({
|
||||
styles['MultiLineString'] = new Style({
|
||||
stroke: new Stroke({
|
||||
color: 'green',
|
||||
width: 3
|
||||
})
|
||||
});
|
||||
styles['MultiPolygon'] = new _ol_style_Style_({
|
||||
stroke: new _ol_style_Stroke_({
|
||||
styles['MultiPolygon'] = new Style({
|
||||
stroke: new Stroke({
|
||||
color: 'yellow',
|
||||
width: 1
|
||||
}),
|
||||
fill: new _ol_style_Fill_({
|
||||
fill: new Fill({
|
||||
color: 'rgba(255, 255, 0, 0.1)'
|
||||
})
|
||||
});
|
||||
styles['default'] = new _ol_style_Style_({
|
||||
stroke: new _ol_style_Stroke_({
|
||||
styles['default'] = new Style({
|
||||
stroke: new Stroke({
|
||||
color: 'red',
|
||||
width: 3
|
||||
}),
|
||||
fill: new _ol_style_Fill_({
|
||||
fill: new Fill({
|
||||
color: 'rgba(255, 0, 0, 0.1)'
|
||||
}),
|
||||
image: image
|
||||
@@ -156,19 +156,19 @@ var layer = new VectorLayer({
|
||||
var overlayStyle = (function() {
|
||||
var styles = {};
|
||||
styles['Polygon'] = [
|
||||
new _ol_style_Style_({
|
||||
fill: new _ol_style_Fill_({
|
||||
new Style({
|
||||
fill: new Fill({
|
||||
color: [255, 255, 255, 0.5]
|
||||
})
|
||||
}),
|
||||
new _ol_style_Style_({
|
||||
stroke: new _ol_style_Stroke_({
|
||||
new Style({
|
||||
stroke: new Stroke({
|
||||
color: [255, 255, 255, 1],
|
||||
width: 5
|
||||
})
|
||||
}),
|
||||
new _ol_style_Style_({
|
||||
stroke: new _ol_style_Stroke_({
|
||||
new Style({
|
||||
stroke: new Stroke({
|
||||
color: [0, 153, 255, 1],
|
||||
width: 3
|
||||
})
|
||||
@@ -177,14 +177,14 @@ var overlayStyle = (function() {
|
||||
styles['MultiPolygon'] = styles['Polygon'];
|
||||
|
||||
styles['LineString'] = [
|
||||
new _ol_style_Style_({
|
||||
stroke: new _ol_style_Stroke_({
|
||||
new Style({
|
||||
stroke: new Stroke({
|
||||
color: [255, 255, 255, 1],
|
||||
width: 5
|
||||
})
|
||||
}),
|
||||
new _ol_style_Style_({
|
||||
stroke: new _ol_style_Stroke_({
|
||||
new Style({
|
||||
stroke: new Stroke({
|
||||
color: [0, 153, 255, 1],
|
||||
width: 3
|
||||
})
|
||||
@@ -193,13 +193,13 @@ var overlayStyle = (function() {
|
||||
styles['MultiLineString'] = styles['LineString'];
|
||||
|
||||
styles['Point'] = [
|
||||
new _ol_style_Style_({
|
||||
image: new _ol_style_Circle_({
|
||||
new Style({
|
||||
image: new CircleStyle({
|
||||
radius: 7,
|
||||
fill: new _ol_style_Fill_({
|
||||
fill: new Fill({
|
||||
color: [0, 153, 255, 1]
|
||||
}),
|
||||
stroke: new _ol_style_Stroke_({
|
||||
stroke: new Stroke({
|
||||
color: [255, 255, 255, 0.75],
|
||||
width: 1.5
|
||||
})
|
||||
@@ -216,11 +216,11 @@ var overlayStyle = (function() {
|
||||
};
|
||||
})();
|
||||
|
||||
var select = new _ol_interaction_Select_({
|
||||
var select = new Select({
|
||||
style: overlayStyle
|
||||
});
|
||||
|
||||
var modify = new _ol_interaction_Modify_({
|
||||
var modify = new Modify({
|
||||
features: select.getFeatures(),
|
||||
style: overlayStyle,
|
||||
insertVertexCondition: function() {
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import Map from '../src/ol/Map.js';
|
||||
import View from '../src/ol/View.js';
|
||||
import TopoJSON from '../src/ol/format/TopoJSON.js';
|
||||
import _ol_layer_VectorTile_ from '../src/ol/layer/VectorTile.js';
|
||||
import VectorTileLayer from '../src/ol/layer/VectorTile.js';
|
||||
import {fromLonLat} from '../src/ol/proj.js';
|
||||
import VectorTileSource from '../src/ol/source/VectorTile.js';
|
||||
import _ol_style_Fill_ from '../src/ol/style/Fill.js';
|
||||
import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
|
||||
import _ol_style_Style_ from '../src/ol/style/Style.js';
|
||||
import Fill from '../src/ol/style/Fill.js';
|
||||
import Stroke from '../src/ol/style/Stroke.js';
|
||||
import Style from '../src/ol/style/Style.js';
|
||||
|
||||
var key = 'vector-tiles-5eJz6JX';
|
||||
|
||||
@@ -16,18 +16,18 @@ var roadColor = {
|
||||
'minor_road': '#ccb',
|
||||
'highway': '#f39'
|
||||
};
|
||||
var buildingStyle = new _ol_style_Style_({
|
||||
fill: new _ol_style_Fill_({
|
||||
var buildingStyle = new Style({
|
||||
fill: new Fill({
|
||||
color: '#666',
|
||||
opacity: 0.4
|
||||
}),
|
||||
stroke: new _ol_style_Stroke_({
|
||||
stroke: new Stroke({
|
||||
color: '#444',
|
||||
width: 1
|
||||
})
|
||||
});
|
||||
var waterStyle = new _ol_style_Style_({
|
||||
fill: new _ol_style_Fill_({
|
||||
var waterStyle = new Style({
|
||||
fill: new Fill({
|
||||
color: '#9db9e8'
|
||||
})
|
||||
});
|
||||
@@ -46,8 +46,8 @@ var roadStyle = function(feature) {
|
||||
color = roadColor[kind];
|
||||
width = kind == 'highway' ? 1.5 : 1;
|
||||
}
|
||||
style = new _ol_style_Style_({
|
||||
stroke: new _ol_style_Stroke_({
|
||||
style = new Style({
|
||||
stroke: new Stroke({
|
||||
color: color,
|
||||
width: width
|
||||
}),
|
||||
@@ -60,7 +60,7 @@ var roadStyle = function(feature) {
|
||||
|
||||
var map = new Map({
|
||||
layers: [
|
||||
new _ol_layer_VectorTile_({
|
||||
new VectorTileLayer({
|
||||
source: new VectorTileSource({
|
||||
attributions: '© OpenStreetMap contributors, Who’s On First, ' +
|
||||
'Natural Earth, and openstreetmapdata.com',
|
||||
|
||||
@@ -4,10 +4,10 @@ import GeoJSON from '../src/ol/format/GeoJSON.js';
|
||||
import MultiPoint from '../src/ol/geom/MultiPoint.js';
|
||||
import VectorLayer from '../src/ol/layer/Vector.js';
|
||||
import VectorSource from '../src/ol/source/Vector.js';
|
||||
import _ol_style_Circle_ from '../src/ol/style/Circle.js';
|
||||
import _ol_style_Fill_ from '../src/ol/style/Fill.js';
|
||||
import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
|
||||
import _ol_style_Style_ from '../src/ol/style/Style.js';
|
||||
import CircleStyle from '../src/ol/style/Circle.js';
|
||||
import Fill from '../src/ol/style/Fill.js';
|
||||
import Stroke from '../src/ol/style/Stroke.js';
|
||||
import Style from '../src/ol/style/Style.js';
|
||||
|
||||
var styles = [
|
||||
/* We are using two different styles for the polygons:
|
||||
@@ -17,19 +17,19 @@ var styles = [
|
||||
* returned as `MultiPoint` geometry, which will be used to render
|
||||
* the style.
|
||||
*/
|
||||
new _ol_style_Style_({
|
||||
stroke: new _ol_style_Stroke_({
|
||||
new Style({
|
||||
stroke: new Stroke({
|
||||
color: 'blue',
|
||||
width: 3
|
||||
}),
|
||||
fill: new _ol_style_Fill_({
|
||||
fill: new Fill({
|
||||
color: 'rgba(0, 0, 255, 0.1)'
|
||||
})
|
||||
}),
|
||||
new _ol_style_Style_({
|
||||
image: new _ol_style_Circle_({
|
||||
new Style({
|
||||
image: new CircleStyle({
|
||||
radius: 5,
|
||||
fill: new _ol_style_Fill_({
|
||||
fill: new Fill({
|
||||
color: 'orange'
|
||||
})
|
||||
}),
|
||||
|
||||
@@ -4,18 +4,18 @@ import View from '../src/ol/View.js';
|
||||
import Point from '../src/ol/geom/Point.js';
|
||||
import VectorLayer from '../src/ol/layer/Vector.js';
|
||||
import VectorSource from '../src/ol/source/Vector.js';
|
||||
import _ol_style_Fill_ from '../src/ol/style/Fill.js';
|
||||
import _ol_style_RegularShape_ from '../src/ol/style/RegularShape.js';
|
||||
import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
|
||||
import _ol_style_Style_ from '../src/ol/style/Style.js';
|
||||
import Fill from '../src/ol/style/Fill.js';
|
||||
import RegularShape from '../src/ol/style/RegularShape.js';
|
||||
import Stroke from '../src/ol/style/Stroke.js';
|
||||
import Style from '../src/ol/style/Style.js';
|
||||
|
||||
|
||||
var stroke = new _ol_style_Stroke_({color: 'black', width: 2});
|
||||
var fill = new _ol_style_Fill_({color: 'red'});
|
||||
var stroke = new Stroke({color: 'black', width: 2});
|
||||
var fill = new Fill({color: 'red'});
|
||||
|
||||
var styles = {
|
||||
'square': new _ol_style_Style_({
|
||||
image: new _ol_style_RegularShape_({
|
||||
'square': new Style({
|
||||
image: new RegularShape({
|
||||
fill: fill,
|
||||
stroke: stroke,
|
||||
points: 4,
|
||||
@@ -23,8 +23,8 @@ var styles = {
|
||||
angle: Math.PI / 4
|
||||
})
|
||||
}),
|
||||
'triangle': new _ol_style_Style_({
|
||||
image: new _ol_style_RegularShape_({
|
||||
'triangle': new Style({
|
||||
image: new RegularShape({
|
||||
fill: fill,
|
||||
stroke: stroke,
|
||||
points: 3,
|
||||
@@ -33,8 +33,8 @@ var styles = {
|
||||
angle: 0
|
||||
})
|
||||
}),
|
||||
'star': new _ol_style_Style_({
|
||||
image: new _ol_style_RegularShape_({
|
||||
'star': new Style({
|
||||
image: new RegularShape({
|
||||
fill: fill,
|
||||
stroke: stroke,
|
||||
points: 5,
|
||||
@@ -43,8 +43,8 @@ var styles = {
|
||||
angle: 0
|
||||
})
|
||||
}),
|
||||
'cross': new _ol_style_Style_({
|
||||
image: new _ol_style_RegularShape_({
|
||||
'cross': new Style({
|
||||
image: new RegularShape({
|
||||
fill: fill,
|
||||
stroke: stroke,
|
||||
points: 4,
|
||||
@@ -53,8 +53,8 @@ var styles = {
|
||||
angle: 0
|
||||
})
|
||||
}),
|
||||
'x': new _ol_style_Style_({
|
||||
image: new _ol_style_RegularShape_({
|
||||
'x': new Style({
|
||||
image: new RegularShape({
|
||||
fill: fill,
|
||||
stroke: stroke,
|
||||
points: 4,
|
||||
|
||||
@@ -2,21 +2,21 @@ import LineString from '../src/ol/geom/LineString.js';
|
||||
import Point from '../src/ol/geom/Point.js';
|
||||
import Polygon from '../src/ol/geom/Polygon.js';
|
||||
import _ol_render_ from '../src/ol/render.js';
|
||||
import _ol_style_Circle_ from '../src/ol/style/Circle.js';
|
||||
import _ol_style_Fill_ from '../src/ol/style/Fill.js';
|
||||
import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
|
||||
import _ol_style_Style_ from '../src/ol/style/Style.js';
|
||||
import CircleStyle from '../src/ol/style/Circle.js';
|
||||
import Fill from '../src/ol/style/Fill.js';
|
||||
import Stroke from '../src/ol/style/Stroke.js';
|
||||
import Style from '../src/ol/style/Style.js';
|
||||
|
||||
|
||||
var canvas = document.getElementById('canvas');
|
||||
var vectorContext = _ol_render_.toContext(canvas.getContext('2d'), {size: [100, 100]});
|
||||
|
||||
var fill = new _ol_style_Fill_({color: 'blue'});
|
||||
var stroke = new _ol_style_Stroke_({color: 'black'});
|
||||
var style = new _ol_style_Style_({
|
||||
var fill = new Fill({color: 'blue'});
|
||||
var stroke = new Stroke({color: 'black'});
|
||||
var style = new Style({
|
||||
fill: fill,
|
||||
stroke: stroke,
|
||||
image: new _ol_style_Circle_({
|
||||
image: new CircleStyle({
|
||||
radius: 10,
|
||||
fill: fill,
|
||||
stroke: stroke
|
||||
|
||||
@@ -2,7 +2,7 @@ import Map from '../src/ol/Map.js';
|
||||
import View from '../src/ol/View.js';
|
||||
import _ol_events_condition_ from '../src/ol/events/condition.js';
|
||||
import GeoJSON from '../src/ol/format/GeoJSON.js';
|
||||
import _ol_interaction_Select_ from '../src/ol/interaction/Select.js';
|
||||
import Select from '../src/ol/interaction/Select.js';
|
||||
import TileLayer from '../src/ol/layer/Tile.js';
|
||||
import VectorLayer from '../src/ol/layer/Vector.js';
|
||||
import OSM from '../src/ol/source/OSM.js';
|
||||
@@ -31,19 +31,19 @@ var map = new Map({
|
||||
var select = null; // ref to currently selected interaction
|
||||
|
||||
// select interaction working on "singleclick"
|
||||
var selectSingleClick = new _ol_interaction_Select_();
|
||||
var selectSingleClick = new Select();
|
||||
|
||||
// select interaction working on "click"
|
||||
var selectClick = new _ol_interaction_Select_({
|
||||
var selectClick = new Select({
|
||||
condition: _ol_events_condition_.click
|
||||
});
|
||||
|
||||
// select interaction working on "pointermove"
|
||||
var selectPointerMove = new _ol_interaction_Select_({
|
||||
var selectPointerMove = new Select({
|
||||
condition: _ol_events_condition_.pointerMove
|
||||
});
|
||||
|
||||
var selectAltClick = new _ol_interaction_Select_({
|
||||
var selectAltClick = new Select({
|
||||
condition: function(mapBrowserEvent) {
|
||||
return _ol_events_condition_.click(mapBrowserEvent) &&
|
||||
_ol_events_condition_.altKeyOnly(mapBrowserEvent);
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
import Map from '../src/ol/Map.js';
|
||||
import View from '../src/ol/View.js';
|
||||
import Draw from '../src/ol/interaction/Draw.js';
|
||||
import _ol_interaction_Modify_ from '../src/ol/interaction/Modify.js';
|
||||
import _ol_interaction_Select_ from '../src/ol/interaction/Select.js';
|
||||
import _ol_interaction_Snap_ from '../src/ol/interaction/Snap.js';
|
||||
import Modify from '../src/ol/interaction/Modify.js';
|
||||
import Select from '../src/ol/interaction/Select.js';
|
||||
import Snap from '../src/ol/interaction/Snap.js';
|
||||
import TileLayer from '../src/ol/layer/Tile.js';
|
||||
import VectorLayer from '../src/ol/layer/Vector.js';
|
||||
import OSM from '../src/ol/source/OSM.js';
|
||||
import VectorSource from '../src/ol/source/Vector.js';
|
||||
import _ol_style_Circle_ from '../src/ol/style/Circle.js';
|
||||
import _ol_style_Fill_ from '../src/ol/style/Fill.js';
|
||||
import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
|
||||
import _ol_style_Style_ from '../src/ol/style/Style.js';
|
||||
import CircleStyle from '../src/ol/style/Circle.js';
|
||||
import Fill from '../src/ol/style/Fill.js';
|
||||
import Stroke from '../src/ol/style/Stroke.js';
|
||||
import Style from '../src/ol/style/Style.js';
|
||||
|
||||
var raster = new TileLayer({
|
||||
source: new OSM()
|
||||
@@ -19,17 +19,17 @@ var raster = new TileLayer({
|
||||
|
||||
var vector = new VectorLayer({
|
||||
source: new VectorSource(),
|
||||
style: new _ol_style_Style_({
|
||||
fill: new _ol_style_Fill_({
|
||||
style: new Style({
|
||||
fill: new Fill({
|
||||
color: 'rgba(255, 255, 255, 0.2)'
|
||||
}),
|
||||
stroke: new _ol_style_Stroke_({
|
||||
stroke: new Stroke({
|
||||
color: '#ffcc33',
|
||||
width: 2
|
||||
}),
|
||||
image: new _ol_style_Circle_({
|
||||
image: new CircleStyle({
|
||||
radius: 7,
|
||||
fill: new _ol_style_Fill_({
|
||||
fill: new Fill({
|
||||
color: '#ffcc33'
|
||||
})
|
||||
})
|
||||
@@ -45,12 +45,12 @@ var map = new Map({
|
||||
})
|
||||
});
|
||||
|
||||
var Modify = {
|
||||
var ExampleModify = {
|
||||
init: function() {
|
||||
this.select = new _ol_interaction_Select_();
|
||||
this.select = new Select();
|
||||
map.addInteraction(this.select);
|
||||
|
||||
this.modify = new _ol_interaction_Modify_({
|
||||
this.modify = new Modify({
|
||||
features: this.select.getFeatures()
|
||||
});
|
||||
map.addInteraction(this.modify);
|
||||
@@ -69,7 +69,7 @@ var Modify = {
|
||||
this.modify.setActive(active);
|
||||
}
|
||||
};
|
||||
Modify.init();
|
||||
ExampleModify.init();
|
||||
|
||||
var optionsForm = document.getElementById('options-form');
|
||||
|
||||
@@ -126,25 +126,25 @@ optionsForm.onchange = function(e) {
|
||||
var type = e.target.getAttribute('name');
|
||||
var value = e.target.value;
|
||||
if (type == 'draw-type') {
|
||||
Draw.getActive() && Draw.setActive(true);
|
||||
ExampleDraw.getActive() && ExampleDraw.setActive(true);
|
||||
} else if (type == 'interaction') {
|
||||
if (value == 'modify') {
|
||||
Draw.setActive(false);
|
||||
Modify.setActive(true);
|
||||
ExampleDraw.setActive(false);
|
||||
ExampleModify.setActive(true);
|
||||
} else if (value == 'draw') {
|
||||
Draw.setActive(true);
|
||||
Modify.setActive(false);
|
||||
ExampleDraw.setActive(true);
|
||||
ExampleModify.setActive(false);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Draw.setActive(true);
|
||||
Modify.setActive(false);
|
||||
ExampleDraw.setActive(true);
|
||||
ExampleModify.setActive(false);
|
||||
|
||||
// The snap interaction must be added after the Modify and Draw interactions
|
||||
// in order for its map browser event handlers to be fired first. Its handlers
|
||||
// are responsible of doing the snapping.
|
||||
var snap = new _ol_interaction_Snap_({
|
||||
var snap = new Snap({
|
||||
source: vector.getSource()
|
||||
});
|
||||
map.addInteraction(snap);
|
||||
|
||||
@@ -3,7 +3,7 @@ import Map from '../src/ol/Map.js';
|
||||
import View from '../src/ol/View.js';
|
||||
import GeoJSON from '../src/ol/format/GeoJSON.js';
|
||||
import VectorLayer from '../src/ol/layer/Vector.js';
|
||||
import _ol_proj_Projection_ from '../src/ol/proj/Projection.js';
|
||||
import Projection from '../src/ol/proj/Projection.js';
|
||||
import VectorSource from '../src/ol/source/Vector.js';
|
||||
import {register} from '../src/ol/proj/proj4.js';
|
||||
import proj4 from 'proj4';
|
||||
@@ -15,7 +15,7 @@ register(proj4);
|
||||
|
||||
// Configure the Sphere Mollweide projection object with an extent,
|
||||
// and a world extent. These are required for the Graticule.
|
||||
var sphereMollweideProjection = new _ol_proj_Projection_({
|
||||
var sphereMollweideProjection = new Projection({
|
||||
code: 'ESRI:53009',
|
||||
extent: [-9009954.605703328, -9009954.605703328,
|
||||
9009954.605703328, 9009954.605703328],
|
||||
|
||||
@@ -2,7 +2,7 @@ import Map from '../src/ol/Map.js';
|
||||
import View from '../src/ol/View.js';
|
||||
import * as _ol_extent_ from '../src/ol/extent.js';
|
||||
import ImageLayer from '../src/ol/layer/Image.js';
|
||||
import _ol_proj_Projection_ from '../src/ol/proj/Projection.js';
|
||||
import Projection from '../src/ol/proj/Projection.js';
|
||||
import Static from '../src/ol/source/ImageStatic.js';
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ import Static from '../src/ol/source/ImageStatic.js';
|
||||
// coordinates directly to map coordinates, so we create a projection that uses
|
||||
// the image extent in pixels.
|
||||
var extent = [0, 0, 1024, 968];
|
||||
var projection = new _ol_proj_Projection_({
|
||||
var projection = new Projection({
|
||||
code: 'xkcd-image',
|
||||
units: 'pixels',
|
||||
extent: extent
|
||||
|
||||
@@ -6,15 +6,15 @@ import TileLayer from '../src/ol/layer/Tile.js';
|
||||
import VectorLayer from '../src/ol/layer/Vector.js';
|
||||
import BingMaps from '../src/ol/source/BingMaps.js';
|
||||
import VectorSource from '../src/ol/source/Vector.js';
|
||||
import _ol_style_Fill_ from '../src/ol/style/Fill.js';
|
||||
import _ol_style_Style_ from '../src/ol/style/Style.js';
|
||||
import _ol_style_Text_ from '../src/ol/style/Text.js';
|
||||
import Fill from '../src/ol/style/Fill.js';
|
||||
import Style from '../src/ol/style/Style.js';
|
||||
import Text from '../src/ol/style/Text.js';
|
||||
|
||||
var style = new _ol_style_Style_({
|
||||
text: new _ol_style_Text_({
|
||||
var style = new Style({
|
||||
text: new Text({
|
||||
font: 'bold 11px "Open Sans", "Arial Unicode MS", "sans-serif"',
|
||||
placement: 'line',
|
||||
fill: new _ol_style_Fill_({
|
||||
fill: new Fill({
|
||||
color: 'white'
|
||||
})
|
||||
})
|
||||
|
||||
@@ -4,14 +4,14 @@ import View from '../src/ol/View.js';
|
||||
import Point from '../src/ol/geom/Point.js';
|
||||
import VectorLayer from '../src/ol/layer/Vector.js';
|
||||
import VectorSource from '../src/ol/source/Vector.js';
|
||||
import _ol_style_AtlasManager_ from '../src/ol/style/AtlasManager.js';
|
||||
import _ol_style_Circle_ from '../src/ol/style/Circle.js';
|
||||
import _ol_style_Fill_ from '../src/ol/style/Fill.js';
|
||||
import _ol_style_RegularShape_ from '../src/ol/style/RegularShape.js';
|
||||
import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
|
||||
import _ol_style_Style_ from '../src/ol/style/Style.js';
|
||||
import AtlasManager from '../src/ol/style/AtlasManager.js';
|
||||
import CircleStyle from '../src/ol/style/Circle.js';
|
||||
import Fill from '../src/ol/style/Fill.js';
|
||||
import RegularShape from '../src/ol/style/RegularShape.js';
|
||||
import Stroke from '../src/ol/style/Stroke.js';
|
||||
import Style from '../src/ol/style/Style.js';
|
||||
|
||||
var atlasManager = new _ol_style_AtlasManager_({
|
||||
var atlasManager = new AtlasManager({
|
||||
// we increase the initial size so that all symbols fit into
|
||||
// a single atlas image
|
||||
initialSize: 512
|
||||
@@ -47,14 +47,14 @@ for (i = 0; i < symbolInfo.length; ++i) {
|
||||
var info = symbolInfo[i];
|
||||
for (j = 0; j < radiuses.length; ++j) {
|
||||
// circle symbol
|
||||
symbols.push(new _ol_style_Circle_({
|
||||
symbols.push(new CircleStyle({
|
||||
opacity: info.opacity,
|
||||
scale: info.scale,
|
||||
radius: radiuses[j],
|
||||
fill: new _ol_style_Fill_({
|
||||
fill: new Fill({
|
||||
color: info.fillColor
|
||||
}),
|
||||
stroke: new _ol_style_Stroke_({
|
||||
stroke: new Stroke({
|
||||
color: info.strokeColor,
|
||||
width: 1
|
||||
}),
|
||||
@@ -64,17 +64,17 @@ for (i = 0; i < symbolInfo.length; ++i) {
|
||||
}));
|
||||
|
||||
// star symbol
|
||||
symbols.push(new _ol_style_RegularShape_({
|
||||
symbols.push(new RegularShape({
|
||||
points: 8,
|
||||
opacity: info.opacity,
|
||||
scale: info.scale,
|
||||
radius: radiuses[j],
|
||||
radius2: radiuses[j] * 0.7,
|
||||
angle: 1.4,
|
||||
fill: new _ol_style_Fill_({
|
||||
fill: new Fill({
|
||||
color: info.fillColor
|
||||
}),
|
||||
stroke: new _ol_style_Stroke_({
|
||||
stroke: new Stroke({
|
||||
color: info.strokeColor,
|
||||
width: 1
|
||||
}),
|
||||
@@ -92,7 +92,7 @@ for (i = 0; i < featureCount; ++i) {
|
||||
[2 * e * Math.random() - e, 2 * e * Math.random() - e]);
|
||||
feature = new Feature(geometry);
|
||||
feature.setStyle(
|
||||
new _ol_style_Style_({
|
||||
new Style({
|
||||
image: symbols[i % symbolCount]
|
||||
})
|
||||
);
|
||||
|
||||
@@ -4,8 +4,8 @@ import View from '../src/ol/View.js';
|
||||
import LineString from '../src/ol/geom/LineString.js';
|
||||
import VectorLayer from '../src/ol/layer/Vector.js';
|
||||
import VectorSource from '../src/ol/source/Vector.js';
|
||||
import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
|
||||
import _ol_style_Style_ from '../src/ol/style/Style.js';
|
||||
import Stroke from '../src/ol/style/Stroke.js';
|
||||
import Style from '../src/ol/style/Style.js';
|
||||
|
||||
|
||||
var count = 10000;
|
||||
@@ -41,8 +41,8 @@ var vector = new VectorLayer({
|
||||
features: features,
|
||||
wrapX: false
|
||||
}),
|
||||
style: new _ol_style_Style_({
|
||||
stroke: new _ol_style_Stroke_({
|
||||
style: new Style({
|
||||
stroke: new Stroke({
|
||||
color: '#666666',
|
||||
width: 1
|
||||
})
|
||||
|
||||
@@ -5,10 +5,10 @@ import LineString from '../src/ol/geom/LineString.js';
|
||||
import Point from '../src/ol/geom/Point.js';
|
||||
import VectorLayer from '../src/ol/layer/Vector.js';
|
||||
import VectorSource from '../src/ol/source/Vector.js';
|
||||
import _ol_style_Circle_ from '../src/ol/style/Circle.js';
|
||||
import _ol_style_Fill_ from '../src/ol/style/Fill.js';
|
||||
import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
|
||||
import _ol_style_Style_ from '../src/ol/style/Style.js';
|
||||
import CircleStyle from '../src/ol/style/Circle.js';
|
||||
import Fill from '../src/ol/style/Fill.js';
|
||||
import Stroke from '../src/ol/style/Stroke.js';
|
||||
import Style from '../src/ol/style/Style.js';
|
||||
|
||||
|
||||
var count = 20000;
|
||||
@@ -24,18 +24,18 @@ for (var i = 0; i < count; ++i) {
|
||||
}
|
||||
|
||||
var styles = {
|
||||
'10': new _ol_style_Style_({
|
||||
image: new _ol_style_Circle_({
|
||||
'10': new Style({
|
||||
image: new CircleStyle({
|
||||
radius: 5,
|
||||
fill: new _ol_style_Fill_({color: '#666666'}),
|
||||
stroke: new _ol_style_Stroke_({color: '#bada55', width: 1})
|
||||
fill: new Fill({color: '#666666'}),
|
||||
stroke: new Stroke({color: '#bada55', width: 1})
|
||||
})
|
||||
}),
|
||||
'20': new _ol_style_Style_({
|
||||
image: new _ol_style_Circle_({
|
||||
'20': new Style({
|
||||
image: new CircleStyle({
|
||||
radius: 10,
|
||||
fill: new _ol_style_Fill_({color: '#666666'}),
|
||||
stroke: new _ol_style_Stroke_({color: '#bada55', width: 1})
|
||||
fill: new Fill({color: '#666666'}),
|
||||
stroke: new Stroke({color: '#bada55', width: 1})
|
||||
})
|
||||
})
|
||||
};
|
||||
@@ -96,13 +96,13 @@ map.on('click', function(evt) {
|
||||
displaySnap(evt.coordinate);
|
||||
});
|
||||
|
||||
var stroke = new _ol_style_Stroke_({
|
||||
var stroke = new Stroke({
|
||||
color: 'rgba(255,255,0,0.9)',
|
||||
width: 3
|
||||
});
|
||||
var style = new _ol_style_Style_({
|
||||
var style = new Style({
|
||||
stroke: stroke,
|
||||
image: new _ol_style_Circle_({
|
||||
image: new CircleStyle({
|
||||
radius: 10,
|
||||
stroke: stroke
|
||||
})
|
||||
|
||||
@@ -5,9 +5,9 @@ import TileLayer from '../src/ol/layer/Tile.js';
|
||||
import VectorLayer from '../src/ol/layer/Vector.js';
|
||||
import TileJSON from '../src/ol/source/TileJSON.js';
|
||||
import VectorSource from '../src/ol/source/Vector.js';
|
||||
import _ol_style_Fill_ from '../src/ol/style/Fill.js';
|
||||
import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
|
||||
import _ol_style_Style_ from '../src/ol/style/Style.js';
|
||||
import Fill from '../src/ol/style/Fill.js';
|
||||
import Stroke from '../src/ol/style/Stroke.js';
|
||||
import Style from '../src/ol/style/Style.js';
|
||||
|
||||
|
||||
var raster = new TileLayer({
|
||||
@@ -16,11 +16,11 @@ var raster = new TileLayer({
|
||||
})
|
||||
});
|
||||
|
||||
var style = new _ol_style_Style_({
|
||||
fill: new _ol_style_Fill_({
|
||||
var style = new Style({
|
||||
fill: new Fill({
|
||||
color: 'rgba(255, 255, 255, 0.6)'
|
||||
}),
|
||||
stroke: new _ol_style_Stroke_({
|
||||
stroke: new Stroke({
|
||||
color: '#319FD3',
|
||||
width: 1
|
||||
})
|
||||
|
||||
@@ -8,16 +8,16 @@ import Point from '../src/ol/geom/Point.js';
|
||||
import LineString from '../src/ol/geom/LineString.js';
|
||||
import Polygon from '../src/ol/geom/Polygon.js';
|
||||
import Draw from '../src/ol/interaction/Draw.js';
|
||||
import _ol_interaction_Snap_ from '../src/ol/interaction/Snap.js';
|
||||
import Snap from '../src/ol/interaction/Snap.js';
|
||||
import TileLayer from '../src/ol/layer/Tile.js';
|
||||
import VectorLayer from '../src/ol/layer/Vector.js';
|
||||
import OSM from '../src/ol/source/OSM.js';
|
||||
import VectorSource from '../src/ol/source/Vector.js';
|
||||
import _ol_style_Style_ from '../src/ol/style/Style.js';
|
||||
import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
|
||||
import _ol_style_Fill_ from '../src/ol/style/Fill.js';
|
||||
import _ol_style_Circle_ from '../src/ol/style/Circle.js';
|
||||
import _ol_style_Text_ from '../src/ol/style/Text.js';
|
||||
import Style from '../src/ol/style/Style.js';
|
||||
import Stroke from '../src/ol/style/Stroke.js';
|
||||
import Fill from '../src/ol/style/Fill.js';
|
||||
import CircleStyle from '../src/ol/style/Circle.js';
|
||||
import Text from '../src/ol/style/Text.js';
|
||||
import MousePosition from '../src/ol/control/MousePosition.js';
|
||||
|
||||
var raster = new TileLayer({
|
||||
@@ -28,16 +28,16 @@ var nodes = new VectorSource({wrapX: false});
|
||||
var nodesLayer = new VectorLayer({
|
||||
source: nodes,
|
||||
style: function(f) {
|
||||
var style = new _ol_style_Style_({
|
||||
image: new _ol_style_Circle_({
|
||||
var style = new Style({
|
||||
image: new CircleStyle({
|
||||
radius: 8,
|
||||
fill: new _ol_style_Fill_({color: 'rgba(255, 0, 0, 0.2)'}),
|
||||
stroke: new _ol_style_Stroke_({color: 'red', width: 1})
|
||||
fill: new Fill({color: 'rgba(255, 0, 0, 0.2)'}),
|
||||
stroke: new Stroke({color: 'red', width: 1})
|
||||
}),
|
||||
text: new _ol_style_Text_({
|
||||
text: new Text({
|
||||
text: f.get('node').id.toString(),
|
||||
fill: new _ol_style_Fill_({color: 'red'}),
|
||||
stroke: new _ol_style_Stroke_({
|
||||
fill: new Fill({color: 'red'}),
|
||||
stroke: new Stroke({
|
||||
color: 'white',
|
||||
width: 3
|
||||
})
|
||||
@@ -51,15 +51,15 @@ var edges = new VectorSource({wrapX: false});
|
||||
var edgesLayer = new VectorLayer({
|
||||
source: edges,
|
||||
style: function(f) {
|
||||
var style = new _ol_style_Style_({
|
||||
stroke: new _ol_style_Stroke_({
|
||||
var style = new Style({
|
||||
stroke: new Stroke({
|
||||
color: 'blue',
|
||||
width: 1
|
||||
}),
|
||||
text: new _ol_style_Text_({
|
||||
text: new Text({
|
||||
text: f.get('edge').id.toString(),
|
||||
fill: new _ol_style_Fill_({color: 'blue'}),
|
||||
stroke: new _ol_style_Stroke_({
|
||||
fill: new Fill({color: 'blue'}),
|
||||
stroke: new Stroke({
|
||||
color: 'white',
|
||||
width: 2
|
||||
})
|
||||
@@ -73,19 +73,19 @@ var faces = new VectorSource({wrapX: false});
|
||||
var facesLayer = new VectorLayer({
|
||||
source: faces,
|
||||
style: function(f) {
|
||||
var style = new _ol_style_Style_({
|
||||
stroke: new _ol_style_Stroke_({
|
||||
var style = new Style({
|
||||
stroke: new Stroke({
|
||||
color: 'black',
|
||||
width: 1
|
||||
}),
|
||||
fill: new _ol_style_Fill_({
|
||||
fill: new Fill({
|
||||
color: 'rgba(0, 255, 0, 0.2)'
|
||||
}),
|
||||
text: new _ol_style_Text_({
|
||||
text: new Text({
|
||||
font: 'bold 12px sans-serif',
|
||||
text: f.get('face').id.toString(),
|
||||
fill: new _ol_style_Fill_({color: 'green'}),
|
||||
stroke: new _ol_style_Stroke_({
|
||||
fill: new Fill({color: 'green'}),
|
||||
stroke: new Stroke({
|
||||
color: 'white',
|
||||
width: 2
|
||||
})
|
||||
@@ -209,7 +209,7 @@ var draw = new Draw({
|
||||
});
|
||||
draw.on('drawend', onDrawend);
|
||||
map.addInteraction(draw);
|
||||
var snap = new _ol_interaction_Snap_({
|
||||
var snap = new Snap({
|
||||
source: edges
|
||||
});
|
||||
map.addInteraction(snap);
|
||||
|
||||
@@ -2,7 +2,7 @@ import Map from '../src/ol/Map.js';
|
||||
import View from '../src/ol/View.js';
|
||||
import GeoJSON from '../src/ol/format/GeoJSON.js';
|
||||
import {defaults as defaultInteractions} from '../src/ol/interaction.js';
|
||||
import _ol_interaction_Select_ from '../src/ol/interaction/Select.js';
|
||||
import Select from '../src/ol/interaction/Select.js';
|
||||
import _ol_interaction_Translate_ from '../src/ol/interaction/Translate.js';
|
||||
import TileLayer from '../src/ol/layer/Tile.js';
|
||||
import VectorLayer from '../src/ol/layer/Vector.js';
|
||||
@@ -21,7 +21,7 @@ var vector = new VectorLayer({
|
||||
})
|
||||
});
|
||||
|
||||
var select = new _ol_interaction_Select_();
|
||||
var select = new Select();
|
||||
|
||||
var translate = new _ol_interaction_Translate_({
|
||||
features: select.getFeatures()
|
||||
|
||||
@@ -3,8 +3,8 @@ import View from '../src/ol/View.js';
|
||||
import EsriJSON from '../src/ol/format/EsriJSON.js';
|
||||
import {defaults as defaultInteractions} from '../src/ol/interaction.js';
|
||||
import Draw from '../src/ol/interaction/Draw.js';
|
||||
import _ol_interaction_Modify_ from '../src/ol/interaction/Modify.js';
|
||||
import _ol_interaction_Select_ from '../src/ol/interaction/Select.js';
|
||||
import Modify from '../src/ol/interaction/Modify.js';
|
||||
import Select from '../src/ol/interaction/Select.js';
|
||||
import TileLayer from '../src/ol/layer/Tile.js';
|
||||
import VectorLayer from '../src/ol/layer/Vector.js';
|
||||
import _ol_loadingstrategy_ from '../src/ol/loadingstrategy.js';
|
||||
@@ -67,11 +67,11 @@ var draw = new Draw({
|
||||
type: 'Polygon'
|
||||
});
|
||||
|
||||
var select = new _ol_interaction_Select_();
|
||||
var select = new Select();
|
||||
select.setActive(false);
|
||||
var selected = select.getFeatures();
|
||||
|
||||
var modify = new _ol_interaction_Modify_({
|
||||
var modify = new Modify({
|
||||
features: selected
|
||||
});
|
||||
modify.setActive(false);
|
||||
|
||||
@@ -7,9 +7,9 @@ import _ol_loadingstrategy_ from '../src/ol/loadingstrategy.js';
|
||||
import {fromLonLat} from '../src/ol/proj.js';
|
||||
import VectorSource from '../src/ol/source/Vector.js';
|
||||
import XYZ from '../src/ol/source/XYZ.js';
|
||||
import _ol_style_Fill_ from '../src/ol/style/Fill.js';
|
||||
import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
|
||||
import _ol_style_Style_ from '../src/ol/style/Style.js';
|
||||
import Fill from '../src/ol/style/Fill.js';
|
||||
import Stroke from '../src/ol/style/Stroke.js';
|
||||
import Style from '../src/ol/style/Style.js';
|
||||
import _ol_tilegrid_ from '../src/ol/tilegrid.js';
|
||||
|
||||
|
||||
@@ -20,38 +20,38 @@ var layer = '0';
|
||||
var esrijsonFormat = new EsriJSON();
|
||||
|
||||
var styleCache = {
|
||||
'ABANDONED': new _ol_style_Style_({
|
||||
fill: new _ol_style_Fill_({
|
||||
'ABANDONED': new Style({
|
||||
fill: new Fill({
|
||||
color: 'rgba(225, 225, 225, 255)'
|
||||
}),
|
||||
stroke: new _ol_style_Stroke_({
|
||||
stroke: new Stroke({
|
||||
color: 'rgba(0, 0, 0, 255)',
|
||||
width: 0.4
|
||||
})
|
||||
}),
|
||||
'GAS': new _ol_style_Style_({
|
||||
fill: new _ol_style_Fill_({
|
||||
'GAS': new Style({
|
||||
fill: new Fill({
|
||||
color: 'rgba(255, 0, 0, 255)'
|
||||
}),
|
||||
stroke: new _ol_style_Stroke_({
|
||||
stroke: new Stroke({
|
||||
color: 'rgba(110, 110, 110, 255)',
|
||||
width: 0.4
|
||||
})
|
||||
}),
|
||||
'OIL': new _ol_style_Style_({
|
||||
fill: new _ol_style_Fill_({
|
||||
'OIL': new Style({
|
||||
fill: new Fill({
|
||||
color: 'rgba(56, 168, 0, 255)'
|
||||
}),
|
||||
stroke: new _ol_style_Stroke_({
|
||||
stroke: new Stroke({
|
||||
color: 'rgba(110, 110, 110, 255)',
|
||||
width: 0
|
||||
})
|
||||
}),
|
||||
'OILGAS': new _ol_style_Style_({
|
||||
fill: new _ol_style_Fill_({
|
||||
'OILGAS': new Style({
|
||||
fill: new Fill({
|
||||
color: 'rgba(168, 112, 0, 255)'
|
||||
}),
|
||||
stroke: new _ol_style_Stroke_({
|
||||
stroke: new Stroke({
|
||||
color: 'rgba(110, 110, 110, 255)',
|
||||
width: 0.4
|
||||
})
|
||||
|
||||
@@ -4,10 +4,10 @@ import * as _ol_extent_ from '../src/ol/extent.js';
|
||||
import GeoJSON from '../src/ol/format/GeoJSON.js';
|
||||
import VectorLayer from '../src/ol/layer/Vector.js';
|
||||
import VectorSource from '../src/ol/source/Vector.js';
|
||||
import _ol_style_Fill_ from '../src/ol/style/Fill.js';
|
||||
import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
|
||||
import _ol_style_Style_ from '../src/ol/style/Style.js';
|
||||
import _ol_style_Text_ from '../src/ol/style/Text.js';
|
||||
import Fill from '../src/ol/style/Fill.js';
|
||||
import Stroke from '../src/ol/style/Stroke.js';
|
||||
import Style from '../src/ol/style/Style.js';
|
||||
import Text from '../src/ol/style/Text.js';
|
||||
|
||||
var map = new Map({
|
||||
target: 'map',
|
||||
@@ -17,7 +17,7 @@ var map = new Map({
|
||||
})
|
||||
});
|
||||
|
||||
var labelStyle = new _ol_style_Style_({
|
||||
var labelStyle = new Style({
|
||||
geometry: function(feature) {
|
||||
var geometry = feature.getGeometry();
|
||||
if (geometry.getType() == 'MultiPolygon') {
|
||||
@@ -35,23 +35,23 @@ var labelStyle = new _ol_style_Style_({
|
||||
}
|
||||
return geometry;
|
||||
},
|
||||
text: new _ol_style_Text_({
|
||||
text: new Text({
|
||||
font: '12px Calibri,sans-serif',
|
||||
overflow: true,
|
||||
fill: new _ol_style_Fill_({
|
||||
fill: new Fill({
|
||||
color: '#000'
|
||||
}),
|
||||
stroke: new _ol_style_Stroke_({
|
||||
stroke: new Stroke({
|
||||
color: '#fff',
|
||||
width: 3
|
||||
})
|
||||
})
|
||||
});
|
||||
var countryStyle = new _ol_style_Style_({
|
||||
fill: new _ol_style_Fill_({
|
||||
var countryStyle = new Style({
|
||||
fill: new Fill({
|
||||
color: 'rgba(255, 255, 255, 0.6)'
|
||||
}),
|
||||
stroke: new _ol_style_Stroke_({
|
||||
stroke: new Stroke({
|
||||
color: '#319FD3',
|
||||
width: 1
|
||||
})
|
||||
|
||||
@@ -5,11 +5,11 @@ import TileLayer from '../src/ol/layer/Tile.js';
|
||||
import VectorLayer from '../src/ol/layer/Vector.js';
|
||||
import OSM from '../src/ol/source/OSM.js';
|
||||
import VectorSource from '../src/ol/source/Vector.js';
|
||||
import _ol_style_Circle_ from '../src/ol/style/Circle.js';
|
||||
import _ol_style_Fill_ from '../src/ol/style/Fill.js';
|
||||
import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
|
||||
import _ol_style_Style_ from '../src/ol/style/Style.js';
|
||||
import _ol_style_Text_ from '../src/ol/style/Text.js';
|
||||
import CircleStyle from '../src/ol/style/Circle.js';
|
||||
import Fill from '../src/ol/style/Fill.js';
|
||||
import Stroke from '../src/ol/style/Stroke.js';
|
||||
import Style from '../src/ol/style/Style.js';
|
||||
import Text from '../src/ol/style/Text.js';
|
||||
|
||||
var openSansAdded = false;
|
||||
|
||||
@@ -109,13 +109,13 @@ var createTextStyle = function(feature, resolution, dom) {
|
||||
var outlineColor = dom.outline.value;
|
||||
var outlineWidth = parseInt(dom.outlineWidth.value, 10);
|
||||
|
||||
return new _ol_style_Text_({
|
||||
return new Text({
|
||||
textAlign: align == '' ? undefined : align,
|
||||
textBaseline: baseline,
|
||||
font: font,
|
||||
text: getText(feature, resolution, dom),
|
||||
fill: new _ol_style_Fill_({color: fillColor}),
|
||||
stroke: new _ol_style_Stroke_({color: outlineColor, width: outlineWidth}),
|
||||
fill: new Fill({color: fillColor}),
|
||||
stroke: new Stroke({color: outlineColor, width: outlineWidth}),
|
||||
offsetX: offsetX,
|
||||
offsetY: offsetY,
|
||||
placement: placement,
|
||||
@@ -128,12 +128,12 @@ var createTextStyle = function(feature, resolution, dom) {
|
||||
|
||||
// Polygons
|
||||
function polygonStyleFunction(feature, resolution) {
|
||||
return new _ol_style_Style_({
|
||||
stroke: new _ol_style_Stroke_({
|
||||
return new Style({
|
||||
stroke: new Stroke({
|
||||
color: 'blue',
|
||||
width: 1
|
||||
}),
|
||||
fill: new _ol_style_Fill_({
|
||||
fill: new Fill({
|
||||
color: 'rgba(0, 0, 255, 0.1)'
|
||||
}),
|
||||
text: createTextStyle(feature, resolution, myDom.polygons)
|
||||
@@ -151,8 +151,8 @@ var vectorPolygons = new VectorLayer({
|
||||
|
||||
// Lines
|
||||
function lineStyleFunction(feature, resolution) {
|
||||
return new _ol_style_Style_({
|
||||
stroke: new _ol_style_Stroke_({
|
||||
return new Style({
|
||||
stroke: new Stroke({
|
||||
color: 'green',
|
||||
width: 2
|
||||
}),
|
||||
@@ -171,11 +171,11 @@ var vectorLines = new VectorLayer({
|
||||
|
||||
// Points
|
||||
function pointStyleFunction(feature, resolution) {
|
||||
return new _ol_style_Style_({
|
||||
image: new _ol_style_Circle_({
|
||||
return new Style({
|
||||
image: new CircleStyle({
|
||||
radius: 10,
|
||||
fill: new _ol_style_Fill_({color: 'rgba(255, 0, 0, 0.1)'}),
|
||||
stroke: new _ol_style_Stroke_({color: 'red', width: 1})
|
||||
fill: new Fill({color: 'rgba(255, 0, 0, 0.1)'}),
|
||||
stroke: new Stroke({color: 'red', width: 1})
|
||||
}),
|
||||
text: createTextStyle(feature, resolution, myDom.points)
|
||||
});
|
||||
|
||||
@@ -3,26 +3,26 @@ import View from '../src/ol/View.js';
|
||||
import GeoJSON from '../src/ol/format/GeoJSON.js';
|
||||
import VectorLayer from '../src/ol/layer/Vector.js';
|
||||
import VectorSource from '../src/ol/source/Vector.js';
|
||||
import _ol_style_Fill_ from '../src/ol/style/Fill.js';
|
||||
import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
|
||||
import _ol_style_Style_ from '../src/ol/style/Style.js';
|
||||
import _ol_style_Text_ from '../src/ol/style/Text.js';
|
||||
import Fill from '../src/ol/style/Fill.js';
|
||||
import Stroke from '../src/ol/style/Stroke.js';
|
||||
import Style from '../src/ol/style/Style.js';
|
||||
import Text from '../src/ol/style/Text.js';
|
||||
|
||||
|
||||
var style = new _ol_style_Style_({
|
||||
fill: new _ol_style_Fill_({
|
||||
var style = new Style({
|
||||
fill: new Fill({
|
||||
color: 'rgba(255, 255, 255, 0.6)'
|
||||
}),
|
||||
stroke: new _ol_style_Stroke_({
|
||||
stroke: new Stroke({
|
||||
color: '#319FD3',
|
||||
width: 1
|
||||
}),
|
||||
text: new _ol_style_Text_({
|
||||
text: new Text({
|
||||
font: '12px Calibri,sans-serif',
|
||||
fill: new _ol_style_Fill_({
|
||||
fill: new Fill({
|
||||
color: '#000'
|
||||
}),
|
||||
stroke: new _ol_style_Stroke_({
|
||||
stroke: new Stroke({
|
||||
color: '#fff',
|
||||
width: 3
|
||||
})
|
||||
@@ -49,20 +49,20 @@ var map = new Map({
|
||||
})
|
||||
});
|
||||
|
||||
var highlightStyle = new _ol_style_Style_({
|
||||
stroke: new _ol_style_Stroke_({
|
||||
var highlightStyle = new Style({
|
||||
stroke: new Stroke({
|
||||
color: '#f00',
|
||||
width: 1
|
||||
}),
|
||||
fill: new _ol_style_Fill_({
|
||||
fill: new Fill({
|
||||
color: 'rgba(255,0,0,0.1)'
|
||||
}),
|
||||
text: new _ol_style_Text_({
|
||||
text: new Text({
|
||||
font: '12px Calibri,sans-serif',
|
||||
fill: new _ol_style_Fill_({
|
||||
fill: new Fill({
|
||||
color: '#000'
|
||||
}),
|
||||
stroke: new _ol_style_Stroke_({
|
||||
stroke: new Stroke({
|
||||
color: '#f00',
|
||||
width: 3
|
||||
})
|
||||
|
||||
@@ -8,67 +8,67 @@ import _ol_loadingstrategy_ from '../src/ol/loadingstrategy.js';
|
||||
import {transformExtent} from '../src/ol/proj.js';
|
||||
import BingMaps from '../src/ol/source/BingMaps.js';
|
||||
import VectorSource from '../src/ol/source/Vector.js';
|
||||
import _ol_style_Circle_ from '../src/ol/style/Circle.js';
|
||||
import _ol_style_Fill_ from '../src/ol/style/Fill.js';
|
||||
import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
|
||||
import _ol_style_Style_ from '../src/ol/style/Style.js';
|
||||
import CircleStyle from '../src/ol/style/Circle.js';
|
||||
import Fill from '../src/ol/style/Fill.js';
|
||||
import Stroke from '../src/ol/style/Stroke.js';
|
||||
import Style from '../src/ol/style/Style.js';
|
||||
|
||||
var map;
|
||||
|
||||
var styles = {
|
||||
'amenity': {
|
||||
'parking': new _ol_style_Style_({
|
||||
stroke: new _ol_style_Stroke_({
|
||||
'parking': new Style({
|
||||
stroke: new Stroke({
|
||||
color: 'rgba(170, 170, 170, 1.0)',
|
||||
width: 1
|
||||
}),
|
||||
fill: new _ol_style_Fill_({
|
||||
fill: new Fill({
|
||||
color: 'rgba(170, 170, 170, 0.3)'
|
||||
})
|
||||
})
|
||||
},
|
||||
'building': {
|
||||
'.*': new _ol_style_Style_({
|
||||
'.*': new Style({
|
||||
zIndex: 100,
|
||||
stroke: new _ol_style_Stroke_({
|
||||
stroke: new Stroke({
|
||||
color: 'rgba(246, 99, 79, 1.0)',
|
||||
width: 1
|
||||
}),
|
||||
fill: new _ol_style_Fill_({
|
||||
fill: new Fill({
|
||||
color: 'rgba(246, 99, 79, 0.3)'
|
||||
})
|
||||
})
|
||||
},
|
||||
'highway': {
|
||||
'service': new _ol_style_Style_({
|
||||
stroke: new _ol_style_Stroke_({
|
||||
'service': new Style({
|
||||
stroke: new Stroke({
|
||||
color: 'rgba(255, 255, 255, 1.0)',
|
||||
width: 2
|
||||
})
|
||||
}),
|
||||
'.*': new _ol_style_Style_({
|
||||
stroke: new _ol_style_Stroke_({
|
||||
'.*': new Style({
|
||||
stroke: new Stroke({
|
||||
color: 'rgba(255, 255, 255, 1.0)',
|
||||
width: 3
|
||||
})
|
||||
})
|
||||
},
|
||||
'landuse': {
|
||||
'forest|grass|allotments': new _ol_style_Style_({
|
||||
stroke: new _ol_style_Stroke_({
|
||||
'forest|grass|allotments': new Style({
|
||||
stroke: new Stroke({
|
||||
color: 'rgba(140, 208, 95, 1.0)',
|
||||
width: 1
|
||||
}),
|
||||
fill: new _ol_style_Fill_({
|
||||
fill: new Fill({
|
||||
color: 'rgba(140, 208, 95, 0.3)'
|
||||
})
|
||||
})
|
||||
},
|
||||
'natural': {
|
||||
'tree': new _ol_style_Style_({
|
||||
image: new _ol_style_Circle_({
|
||||
'tree': new Style({
|
||||
image: new CircleStyle({
|
||||
radius: 2,
|
||||
fill: new _ol_style_Fill_({
|
||||
fill: new Fill({
|
||||
color: 'rgba(140, 208, 95, 1.0)'
|
||||
}),
|
||||
stroke: null
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import Map from '../src/ol/Map.js';
|
||||
import View from '../src/ol/View.js';
|
||||
import MVT from '../src/ol/format/MVT.js';
|
||||
import _ol_layer_VectorTile_ from '../src/ol/layer/VectorTile.js';
|
||||
import VectorTileLayer from '../src/ol/layer/VectorTile.js';
|
||||
import VectorTileSource from '../src/ol/source/VectorTile.js';
|
||||
|
||||
var map = new Map({
|
||||
@@ -10,7 +10,7 @@ var map = new Map({
|
||||
center: [0, 0],
|
||||
zoom: 2
|
||||
}),
|
||||
layers: [new _ol_layer_VectorTile_({
|
||||
layers: [new VectorTileLayer({
|
||||
source: new VectorTileSource({
|
||||
format: new MVT(),
|
||||
url: 'https://basemaps.arcgis.com/v1/arcgis/rest/services/World_Basemap/VectorTileServer/tile/{z}/{y}/{x}.pbf'
|
||||
|
||||
@@ -7,15 +7,15 @@ import TileLayer from '../src/ol/layer/Tile.js';
|
||||
import VectorLayer from '../src/ol/layer/Vector.js';
|
||||
import BingMaps from '../src/ol/source/BingMaps.js';
|
||||
import VectorSource from '../src/ol/source/Vector.js';
|
||||
import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
|
||||
import _ol_style_Style_ from '../src/ol/style/Style.js';
|
||||
import Stroke from '../src/ol/style/Stroke.js';
|
||||
import Style from '../src/ol/style/Style.js';
|
||||
|
||||
|
||||
var vectorSource = new VectorSource();
|
||||
var vector = new VectorLayer({
|
||||
source: vectorSource,
|
||||
style: new _ol_style_Style_({
|
||||
stroke: new _ol_style_Stroke_({
|
||||
style: new Style({
|
||||
stroke: new Stroke({
|
||||
color: 'rgba(0, 0, 255, 1.0)',
|
||||
width: 2
|
||||
})
|
||||
|
||||
@@ -6,8 +6,8 @@ import VectorLayer from '../src/ol/layer/Vector.js';
|
||||
import _ol_loadingstrategy_ from '../src/ol/loadingstrategy.js';
|
||||
import BingMaps from '../src/ol/source/BingMaps.js';
|
||||
import VectorSource from '../src/ol/source/Vector.js';
|
||||
import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
|
||||
import _ol_style_Style_ from '../src/ol/style/Style.js';
|
||||
import Stroke from '../src/ol/style/Stroke.js';
|
||||
import Style from '../src/ol/style/Style.js';
|
||||
|
||||
|
||||
var vectorSource = new VectorSource({
|
||||
@@ -24,8 +24,8 @@ var vectorSource = new VectorSource({
|
||||
|
||||
var vector = new VectorLayer({
|
||||
source: vectorSource,
|
||||
style: new _ol_style_Style_({
|
||||
stroke: new _ol_style_Stroke_({
|
||||
style: new Style({
|
||||
stroke: new Stroke({
|
||||
color: 'rgba(0, 0, 255, 1.0)',
|
||||
width: 2
|
||||
})
|
||||
|
||||
@@ -4,7 +4,7 @@ import {defaults as defaultControls} from '../src/ol/control.js';
|
||||
import ScaleLine from '../src/ol/control/ScaleLine.js';
|
||||
import TileLayer from '../src/ol/layer/Tile.js';
|
||||
import {addProjection, addCoordinateTransforms, transform} from '../src/ol/proj.js';
|
||||
import _ol_proj_Projection_ from '../src/ol/proj/Projection.js';
|
||||
import Projection from '../src/ol/proj/Projection.js';
|
||||
import TileWMS from '../src/ol/source/TileWMS.js';
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ import TileWMS from '../src/ol/source/TileWMS.js';
|
||||
// ol.proj.addProjection to make it available to the library for lookup by its
|
||||
// code.
|
||||
|
||||
var projection = new _ol_proj_Projection_({
|
||||
var projection = new Projection({
|
||||
code: 'EPSG:21781',
|
||||
// The extent is used to determine zoom level 0. Recommended values for a
|
||||
// projection's validity extent can be found at https://epsg.io/.
|
||||
|
||||
@@ -4,7 +4,7 @@ import {defaults as defaultControls} from '../src/ol/control.js';
|
||||
import ScaleLine from '../src/ol/control/ScaleLine.js';
|
||||
import ImageLayer from '../src/ol/layer/Image.js';
|
||||
import {fromLonLat} from '../src/ol/proj.js';
|
||||
import _ol_proj_Projection_ from '../src/ol/proj/Projection.js';
|
||||
import Projection from '../src/ol/proj/Projection.js';
|
||||
import ImageWMS from '../src/ol/source/ImageWMS.js';
|
||||
import {register} from '../src/ol/proj/proj4.js';
|
||||
import proj4 from 'proj4';
|
||||
@@ -29,7 +29,7 @@ proj4.defs('EPSG:21781',
|
||||
'+towgs84=660.077,13.551,369.344,2.484,1.783,2.939,5.66 +units=m +no_defs');
|
||||
register(proj4);
|
||||
|
||||
var projection = new _ol_proj_Projection_({
|
||||
var projection = new Projection({
|
||||
code: 'EPSG:21781',
|
||||
extent: [485869.5728, 76443.1884, 837076.5648, 299941.7864]
|
||||
});
|
||||
|
||||
@@ -2,7 +2,7 @@ import Map from '../src/ol/Map.js';
|
||||
import View from '../src/ol/View.js';
|
||||
import ImageLayer from '../src/ol/layer/Image.js';
|
||||
import TileLayer from '../src/ol/layer/Tile.js';
|
||||
import _ol_proj_Projection_ from '../src/ol/proj/Projection.js';
|
||||
import Projection from '../src/ol/proj/Projection.js';
|
||||
import ImageWMS from '../src/ol/source/ImageWMS.js';
|
||||
import TileWMS from '../src/ol/source/TileWMS.js';
|
||||
|
||||
@@ -37,7 +37,7 @@ var layers = [
|
||||
// projection object. Requesting tiles only needs the code together with a
|
||||
// tile grid of Cartesian coordinates; it does not matter how those
|
||||
// coordinates relate to latitude or longitude.
|
||||
var projection = new _ol_proj_Projection_({
|
||||
var projection = new Projection({
|
||||
code: 'EPSG:21781',
|
||||
units: 'm'
|
||||
});
|
||||
|
||||
@@ -41,7 +41,7 @@ export var CollectionOptions;
|
||||
* @template T
|
||||
* @api
|
||||
*/
|
||||
var _ol_Collection_ = function(opt_array, opt_options) {
|
||||
var Collection = function(opt_array, opt_options) {
|
||||
|
||||
BaseObject.call(this);
|
||||
|
||||
@@ -69,14 +69,14 @@ var _ol_Collection_ = function(opt_array, opt_options) {
|
||||
|
||||
};
|
||||
|
||||
inherits(_ol_Collection_, BaseObject);
|
||||
inherits(Collection, BaseObject);
|
||||
|
||||
|
||||
/**
|
||||
* Remove all elements from the collection.
|
||||
* @api
|
||||
*/
|
||||
_ol_Collection_.prototype.clear = function() {
|
||||
Collection.prototype.clear = function() {
|
||||
while (this.getLength() > 0) {
|
||||
this.pop();
|
||||
}
|
||||
@@ -90,7 +90,7 @@ _ol_Collection_.prototype.clear = function() {
|
||||
* @return {ol.Collection.<T>} This collection.
|
||||
* @api
|
||||
*/
|
||||
_ol_Collection_.prototype.extend = function(arr) {
|
||||
Collection.prototype.extend = function(arr) {
|
||||
var i, ii;
|
||||
for (i = 0, ii = arr.length; i < ii; ++i) {
|
||||
this.push(arr[i]);
|
||||
@@ -106,7 +106,7 @@ _ol_Collection_.prototype.extend = function(arr) {
|
||||
* index and the array). The return value is ignored.
|
||||
* @api
|
||||
*/
|
||||
_ol_Collection_.prototype.forEach = function(f) {
|
||||
Collection.prototype.forEach = function(f) {
|
||||
var array = this.array_;
|
||||
for (var i = 0, ii = array.length; i < ii; ++i) {
|
||||
f(array[i], i, array);
|
||||
@@ -122,7 +122,7 @@ _ol_Collection_.prototype.forEach = function(f) {
|
||||
* @return {!Array.<T>} Array.
|
||||
* @api
|
||||
*/
|
||||
_ol_Collection_.prototype.getArray = function() {
|
||||
Collection.prototype.getArray = function() {
|
||||
return this.array_;
|
||||
};
|
||||
|
||||
@@ -133,7 +133,7 @@ _ol_Collection_.prototype.getArray = function() {
|
||||
* @return {T} Element.
|
||||
* @api
|
||||
*/
|
||||
_ol_Collection_.prototype.item = function(index) {
|
||||
Collection.prototype.item = function(index) {
|
||||
return this.array_[index];
|
||||
};
|
||||
|
||||
@@ -144,7 +144,7 @@ _ol_Collection_.prototype.item = function(index) {
|
||||
* @observable
|
||||
* @api
|
||||
*/
|
||||
_ol_Collection_.prototype.getLength = function() {
|
||||
Collection.prototype.getLength = function() {
|
||||
return (/** @type {number} */ this.get(Property.LENGTH));
|
||||
};
|
||||
|
||||
@@ -155,14 +155,14 @@ _ol_Collection_.prototype.getLength = function() {
|
||||
* @param {T} elem Element.
|
||||
* @api
|
||||
*/
|
||||
_ol_Collection_.prototype.insertAt = function(index, elem) {
|
||||
Collection.prototype.insertAt = function(index, elem) {
|
||||
if (this.unique_) {
|
||||
this.assertUnique_(elem);
|
||||
}
|
||||
this.array_.splice(index, 0, elem);
|
||||
this.updateLength_();
|
||||
this.dispatchEvent(
|
||||
new _ol_Collection_.Event(CollectionEventType.ADD, elem));
|
||||
new Collection.Event(CollectionEventType.ADD, elem));
|
||||
};
|
||||
|
||||
|
||||
@@ -172,7 +172,7 @@ _ol_Collection_.prototype.insertAt = function(index, elem) {
|
||||
* @return {T|undefined} Element.
|
||||
* @api
|
||||
*/
|
||||
_ol_Collection_.prototype.pop = function() {
|
||||
Collection.prototype.pop = function() {
|
||||
return this.removeAt(this.getLength() - 1);
|
||||
};
|
||||
|
||||
@@ -183,7 +183,7 @@ _ol_Collection_.prototype.pop = function() {
|
||||
* @return {number} New length of the collection.
|
||||
* @api
|
||||
*/
|
||||
_ol_Collection_.prototype.push = function(elem) {
|
||||
Collection.prototype.push = function(elem) {
|
||||
if (this.unique_) {
|
||||
this.assertUnique_(elem);
|
||||
}
|
||||
@@ -199,7 +199,7 @@ _ol_Collection_.prototype.push = function(elem) {
|
||||
* @return {T|undefined} The removed element or undefined if none found.
|
||||
* @api
|
||||
*/
|
||||
_ol_Collection_.prototype.remove = function(elem) {
|
||||
Collection.prototype.remove = function(elem) {
|
||||
var arr = this.array_;
|
||||
var i, ii;
|
||||
for (i = 0, ii = arr.length; i < ii; ++i) {
|
||||
@@ -218,12 +218,12 @@ _ol_Collection_.prototype.remove = function(elem) {
|
||||
* @return {T|undefined} Value.
|
||||
* @api
|
||||
*/
|
||||
_ol_Collection_.prototype.removeAt = function(index) {
|
||||
Collection.prototype.removeAt = function(index) {
|
||||
var prev = this.array_[index];
|
||||
this.array_.splice(index, 1);
|
||||
this.updateLength_();
|
||||
this.dispatchEvent(
|
||||
new _ol_Collection_.Event(CollectionEventType.REMOVE, prev));
|
||||
new Collection.Event(CollectionEventType.REMOVE, prev));
|
||||
return prev;
|
||||
};
|
||||
|
||||
@@ -234,7 +234,7 @@ _ol_Collection_.prototype.removeAt = function(index) {
|
||||
* @param {T} elem Element.
|
||||
* @api
|
||||
*/
|
||||
_ol_Collection_.prototype.setAt = function(index, elem) {
|
||||
Collection.prototype.setAt = function(index, elem) {
|
||||
var n = this.getLength();
|
||||
if (index < n) {
|
||||
if (this.unique_) {
|
||||
@@ -243,9 +243,9 @@ _ol_Collection_.prototype.setAt = function(index, elem) {
|
||||
var prev = this.array_[index];
|
||||
this.array_[index] = elem;
|
||||
this.dispatchEvent(
|
||||
new _ol_Collection_.Event(CollectionEventType.REMOVE, prev));
|
||||
new Collection.Event(CollectionEventType.REMOVE, prev));
|
||||
this.dispatchEvent(
|
||||
new _ol_Collection_.Event(CollectionEventType.ADD, elem));
|
||||
new Collection.Event(CollectionEventType.ADD, elem));
|
||||
} else {
|
||||
var j;
|
||||
for (j = n; j < index; ++j) {
|
||||
@@ -259,7 +259,7 @@ _ol_Collection_.prototype.setAt = function(index, elem) {
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
_ol_Collection_.prototype.updateLength_ = function() {
|
||||
Collection.prototype.updateLength_ = function() {
|
||||
this.set(Property.LENGTH, this.array_.length);
|
||||
};
|
||||
|
||||
@@ -269,7 +269,7 @@ _ol_Collection_.prototype.updateLength_ = function() {
|
||||
* @param {T} elem Element.
|
||||
* @param {number=} opt_except Optional index to ignore.
|
||||
*/
|
||||
_ol_Collection_.prototype.assertUnique_ = function(elem, opt_except) {
|
||||
Collection.prototype.assertUnique_ = function(elem, opt_except) {
|
||||
for (var i = 0, ii = this.array_.length; i < ii; ++i) {
|
||||
if (this.array_[i] === elem && i !== opt_except) {
|
||||
throw new AssertionError(58);
|
||||
@@ -288,7 +288,7 @@ _ol_Collection_.prototype.assertUnique_ = function(elem, opt_except) {
|
||||
* @param {ol.CollectionEventType} type Type.
|
||||
* @param {*=} opt_element Element.
|
||||
*/
|
||||
_ol_Collection_.Event = function(type, opt_element) {
|
||||
Collection.Event = function(type, opt_element) {
|
||||
|
||||
Event.call(this, type);
|
||||
|
||||
@@ -300,6 +300,6 @@ _ol_Collection_.Event = function(type, opt_element) {
|
||||
this.element = opt_element;
|
||||
|
||||
};
|
||||
inherits(_ol_Collection_.Event, Event);
|
||||
inherits(Collection.Event, Event);
|
||||
|
||||
export default _ol_Collection_;
|
||||
export default Collection;
|
||||
|
||||
@@ -7,7 +7,7 @@ import EventType from './events/EventType.js';
|
||||
import {inherits} from './index.js';
|
||||
import BaseObject from './Object.js';
|
||||
import Geometry from './geom/Geometry.js';
|
||||
import _ol_style_Style_ from './style/Style.js';
|
||||
import Style from './style/Style.js';
|
||||
|
||||
/**
|
||||
* @classdesc
|
||||
@@ -307,7 +307,7 @@ Feature.createStyleFunction = function(obj) {
|
||||
if (Array.isArray(obj)) {
|
||||
styles = obj;
|
||||
} else {
|
||||
assert(obj instanceof _ol_style_Style_,
|
||||
assert(obj instanceof Style,
|
||||
41); // Expected an `ol.style.Style` or an array of `ol.style.Style`
|
||||
styles = [obj];
|
||||
}
|
||||
|
||||
@@ -10,9 +10,9 @@ import _ol_geom_flat_geodesic_ from './geom/flat/geodesic.js';
|
||||
import {clamp} from './math.js';
|
||||
import {get as getProjection, equivalent as equivalentProjection, getTransform, transformExtent} from './proj.js';
|
||||
import RenderEventType from './render/EventType.js';
|
||||
import _ol_style_Fill_ from './style/Fill.js';
|
||||
import _ol_style_Stroke_ from './style/Stroke.js';
|
||||
import _ol_style_Text_ from './style/Text.js';
|
||||
import Fill from './style/Fill.js';
|
||||
import Stroke from './style/Stroke.js';
|
||||
import Text from './style/Text.js';
|
||||
|
||||
|
||||
/**
|
||||
@@ -20,7 +20,7 @@ import _ol_style_Text_ from './style/Text.js';
|
||||
* @private
|
||||
* @const
|
||||
*/
|
||||
var DEFAULT_STROKE_STYLE = new _ol_style_Stroke_({
|
||||
var DEFAULT_STROKE_STYLE = new Stroke({
|
||||
color: 'rgba(0,0,0,0.2)'
|
||||
});
|
||||
|
||||
@@ -283,13 +283,13 @@ var Graticule = function(opt_options) {
|
||||
* @private
|
||||
*/
|
||||
this.lonLabelStyle_ = options.lonLabelStyle !== undefined ? options.lonLabelStyle :
|
||||
new _ol_style_Text_({
|
||||
new Text({
|
||||
font: '12px Calibri,sans-serif',
|
||||
textBaseline: 'bottom',
|
||||
fill: new _ol_style_Fill_({
|
||||
fill: new Fill({
|
||||
color: 'rgba(0,0,0,1)'
|
||||
}),
|
||||
stroke: new _ol_style_Stroke_({
|
||||
stroke: new Stroke({
|
||||
color: 'rgba(255,255,255,1)',
|
||||
width: 3
|
||||
})
|
||||
@@ -300,13 +300,13 @@ var Graticule = function(opt_options) {
|
||||
* @private
|
||||
*/
|
||||
this.latLabelStyle_ = options.latLabelStyle !== undefined ? options.latLabelStyle :
|
||||
new _ol_style_Text_({
|
||||
new Text({
|
||||
font: '12px Calibri,sans-serif',
|
||||
textAlign: 'end',
|
||||
fill: new _ol_style_Fill_({
|
||||
fill: new Fill({
|
||||
color: 'rgba(0,0,0,1)'
|
||||
}),
|
||||
stroke: new _ol_style_Stroke_({
|
||||
stroke: new Stroke({
|
||||
color: 'rgba(255,255,255,1)',
|
||||
width: 3
|
||||
})
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @module ol/ImageTile
|
||||
*/
|
||||
import {inherits} from './index.js';
|
||||
import _ol_Tile_ from './Tile.js';
|
||||
import Tile from './Tile.js';
|
||||
import TileState from './TileState.js';
|
||||
import {createCanvasContext2D} from './dom.js';
|
||||
import _ol_events_ from './events.js';
|
||||
@@ -20,7 +20,7 @@ import EventType from './events/EventType.js';
|
||||
*/
|
||||
var ImageTile = function(tileCoord, state, src, crossOrigin, tileLoadFunction, opt_options) {
|
||||
|
||||
_ol_Tile_.call(this, tileCoord, state, opt_options);
|
||||
Tile.call(this, tileCoord, state, opt_options);
|
||||
|
||||
/**
|
||||
* @private
|
||||
@@ -59,7 +59,7 @@ var ImageTile = function(tileCoord, state, src, crossOrigin, tileLoadFunction, o
|
||||
|
||||
};
|
||||
|
||||
inherits(ImageTile, _ol_Tile_);
|
||||
inherits(ImageTile, Tile);
|
||||
|
||||
|
||||
/**
|
||||
@@ -75,7 +75,7 @@ ImageTile.prototype.disposeInternal = function() {
|
||||
}
|
||||
this.state = TileState.ABORT;
|
||||
this.changed();
|
||||
_ol_Tile_.prototype.disposeInternal.call(this);
|
||||
Tile.prototype.disposeInternal.call(this);
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ import MapBrowserPointerEvent from './MapBrowserPointerEvent.js';
|
||||
import _ol_events_ from './events.js';
|
||||
import EventTarget from './events/EventTarget.js';
|
||||
import PointerEventType from './pointer/EventType.js';
|
||||
import _ol_pointer_PointerEventHandler_ from './pointer/PointerEventHandler.js';
|
||||
import PointerEventHandler from './pointer/PointerEventHandler.js';
|
||||
|
||||
/**
|
||||
* @param {ol.PluggableMap} map The map with the viewport to listen to events on.
|
||||
@@ -81,7 +81,7 @@ var MapBrowserEventHandler = function(map, moveTolerance) {
|
||||
* @type {ol.pointer.PointerEventHandler}
|
||||
* @private
|
||||
*/
|
||||
this.pointerEventHandler_ = new _ol_pointer_PointerEventHandler_(element);
|
||||
this.pointerEventHandler_ = new PointerEventHandler(element);
|
||||
|
||||
/**
|
||||
* Event handler which generates pointer events for
|
||||
@@ -218,7 +218,7 @@ MapBrowserEventHandler.prototype.handlePointerDown_ = function(pointerEvent) {
|
||||
* the viewport when dragging.
|
||||
*/
|
||||
this.documentPointerEventHandler_ =
|
||||
new _ol_pointer_PointerEventHandler_(document);
|
||||
new PointerEventHandler(document);
|
||||
|
||||
this.dragListenerKeys_.push(
|
||||
_ol_events_.listen(this.documentPointerEventHandler_,
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @module ol/PluggableMap
|
||||
*/
|
||||
import {getUid, inherits} from './index.js';
|
||||
import _ol_Collection_ from './Collection.js';
|
||||
import Collection from './Collection.js';
|
||||
import CollectionEventType from './CollectionEventType.js';
|
||||
import MapBrowserEvent from './MapBrowserEvent.js';
|
||||
import MapBrowserEventHandler from './MapBrowserEventHandler.js';
|
||||
@@ -23,7 +23,7 @@ import EventType from './events/EventType.js';
|
||||
import {createEmpty, clone, createOrUpdateEmpty, equals, getForViewAndSize, isEmpty} from './extent.js';
|
||||
import {TRUE} from './functions.js';
|
||||
import _ol_has_ from './has.js';
|
||||
import _ol_layer_Group_ from './layer/Group.js';
|
||||
import LayerGroup from './layer/Group.js';
|
||||
import {getMapRendererPlugins} from './plugins.js';
|
||||
import RendererType from './renderer/Type.js';
|
||||
import _ol_size_ from './size.js';
|
||||
@@ -276,13 +276,13 @@ var PluggableMap = function(options) {
|
||||
* @type {ol.Collection.<ol.control.Control>}
|
||||
* @protected
|
||||
*/
|
||||
this.controls = optionsInternal.controls || new _ol_Collection_();
|
||||
this.controls = optionsInternal.controls || new Collection();
|
||||
|
||||
/**
|
||||
* @type {ol.Collection.<ol.interaction.Interaction>}
|
||||
* @protected
|
||||
*/
|
||||
this.interactions = optionsInternal.interactions || new _ol_Collection_();
|
||||
this.interactions = optionsInternal.interactions || new Collection();
|
||||
|
||||
/**
|
||||
* @type {ol.Collection.<ol.Overlay>}
|
||||
@@ -1404,8 +1404,8 @@ function createOptionsInternal(options) {
|
||||
*/
|
||||
var values = {};
|
||||
|
||||
var layerGroup = (options.layers instanceof _ol_layer_Group_) ?
|
||||
options.layers : new _ol_layer_Group_({layers: options.layers});
|
||||
var layerGroup = (options.layers instanceof LayerGroup) ?
|
||||
options.layers : new LayerGroup({layers: options.layers});
|
||||
values[MapProperty.LAYERGROUP] = layerGroup;
|
||||
|
||||
values[MapProperty.TARGET] = options.target;
|
||||
@@ -1457,9 +1457,9 @@ function createOptionsInternal(options) {
|
||||
var controls;
|
||||
if (options.controls !== undefined) {
|
||||
if (Array.isArray(options.controls)) {
|
||||
controls = new _ol_Collection_(options.controls.slice());
|
||||
controls = new Collection(options.controls.slice());
|
||||
} else {
|
||||
assert(options.controls instanceof _ol_Collection_,
|
||||
assert(options.controls instanceof Collection,
|
||||
47); // Expected `controls` to be an array or an `ol.Collection`
|
||||
controls = options.controls;
|
||||
}
|
||||
@@ -1468,9 +1468,9 @@ function createOptionsInternal(options) {
|
||||
var interactions;
|
||||
if (options.interactions !== undefined) {
|
||||
if (Array.isArray(options.interactions)) {
|
||||
interactions = new _ol_Collection_(options.interactions.slice());
|
||||
interactions = new Collection(options.interactions.slice());
|
||||
} else {
|
||||
assert(options.interactions instanceof _ol_Collection_,
|
||||
assert(options.interactions instanceof Collection,
|
||||
48); // Expected `interactions` to be an array or an `ol.Collection`
|
||||
interactions = options.interactions;
|
||||
}
|
||||
@@ -1479,14 +1479,14 @@ function createOptionsInternal(options) {
|
||||
var overlays;
|
||||
if (options.overlays !== undefined) {
|
||||
if (Array.isArray(options.overlays)) {
|
||||
overlays = new _ol_Collection_(options.overlays.slice());
|
||||
overlays = new Collection(options.overlays.slice());
|
||||
} else {
|
||||
assert(options.overlays instanceof _ol_Collection_,
|
||||
assert(options.overlays instanceof Collection,
|
||||
49); // Expected `overlays` to be an array or an `ol.Collection`
|
||||
overlays = options.overlays;
|
||||
}
|
||||
} else {
|
||||
overlays = new _ol_Collection_();
|
||||
overlays = new Collection();
|
||||
}
|
||||
|
||||
return {
|
||||
|
||||
@@ -18,7 +18,7 @@ import EventType from './events/EventType.js';
|
||||
* @param {ol.TileState} state State.
|
||||
* @param {olx.TileOptions=} opt_options Tile options.
|
||||
*/
|
||||
var _ol_Tile_ = function(tileCoord, state, opt_options) {
|
||||
var Tile = function(tileCoord, state, opt_options) {
|
||||
EventTarget.call(this);
|
||||
|
||||
var options = opt_options ? opt_options : {};
|
||||
@@ -66,13 +66,13 @@ var _ol_Tile_ = function(tileCoord, state, opt_options) {
|
||||
|
||||
};
|
||||
|
||||
inherits(_ol_Tile_, EventTarget);
|
||||
inherits(Tile, EventTarget);
|
||||
|
||||
|
||||
/**
|
||||
* @protected
|
||||
*/
|
||||
_ol_Tile_.prototype.changed = function() {
|
||||
Tile.prototype.changed = function() {
|
||||
this.dispatchEvent(EventType.CHANGE);
|
||||
};
|
||||
|
||||
@@ -80,7 +80,7 @@ _ol_Tile_.prototype.changed = function() {
|
||||
/**
|
||||
* @return {string} Key.
|
||||
*/
|
||||
_ol_Tile_.prototype.getKey = function() {
|
||||
Tile.prototype.getKey = function() {
|
||||
return this.key + '/' + this.tileCoord;
|
||||
};
|
||||
|
||||
@@ -90,7 +90,7 @@ _ol_Tile_.prototype.getKey = function() {
|
||||
* such tile exists, the original tile is returned.
|
||||
* @return {!ol.Tile} Best tile for rendering.
|
||||
*/
|
||||
_ol_Tile_.prototype.getInterimTile = function() {
|
||||
Tile.prototype.getInterimTile = function() {
|
||||
if (!this.interimTile) {
|
||||
//empty chain
|
||||
return this;
|
||||
@@ -116,7 +116,7 @@ _ol_Tile_.prototype.getInterimTile = function() {
|
||||
* Goes through the chain of interim tiles and discards sections of the chain
|
||||
* that are no longer relevant.
|
||||
*/
|
||||
_ol_Tile_.prototype.refreshInterimChain = function() {
|
||||
Tile.prototype.refreshInterimChain = function() {
|
||||
if (!this.interimTile) {
|
||||
return;
|
||||
}
|
||||
@@ -151,7 +151,7 @@ _ol_Tile_.prototype.refreshInterimChain = function() {
|
||||
* @return {ol.TileCoord} The tile coordinate.
|
||||
* @api
|
||||
*/
|
||||
_ol_Tile_.prototype.getTileCoord = function() {
|
||||
Tile.prototype.getTileCoord = function() {
|
||||
return this.tileCoord;
|
||||
};
|
||||
|
||||
@@ -159,14 +159,14 @@ _ol_Tile_.prototype.getTileCoord = function() {
|
||||
/**
|
||||
* @return {ol.TileState} State.
|
||||
*/
|
||||
_ol_Tile_.prototype.getState = function() {
|
||||
Tile.prototype.getState = function() {
|
||||
return this.state;
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {ol.TileState} state State.
|
||||
*/
|
||||
_ol_Tile_.prototype.setState = function(state) {
|
||||
Tile.prototype.setState = function(state) {
|
||||
this.state = state;
|
||||
this.changed();
|
||||
};
|
||||
@@ -178,7 +178,7 @@ _ol_Tile_.prototype.setState = function(state) {
|
||||
* @abstract
|
||||
* @api
|
||||
*/
|
||||
_ol_Tile_.prototype.load = function() {};
|
||||
Tile.prototype.load = function() {};
|
||||
|
||||
/**
|
||||
* Get the alpha value for rendering.
|
||||
@@ -186,7 +186,7 @@ _ol_Tile_.prototype.load = function() {};
|
||||
* @param {number} time The render frame time.
|
||||
* @return {number} A number between 0 and 1.
|
||||
*/
|
||||
_ol_Tile_.prototype.getAlpha = function(id, time) {
|
||||
Tile.prototype.getAlpha = function(id, time) {
|
||||
if (!this.transition_) {
|
||||
return 1;
|
||||
}
|
||||
@@ -213,7 +213,7 @@ _ol_Tile_.prototype.getAlpha = function(id, time) {
|
||||
* @param {number} id An id for the renderer.
|
||||
* @return {boolean} The tile is in transition.
|
||||
*/
|
||||
_ol_Tile_.prototype.inTransition = function(id) {
|
||||
Tile.prototype.inTransition = function(id) {
|
||||
if (!this.transition_) {
|
||||
return false;
|
||||
}
|
||||
@@ -224,9 +224,9 @@ _ol_Tile_.prototype.inTransition = function(id) {
|
||||
* Mark a transition as complete.
|
||||
* @param {number} id An id for the renderer.
|
||||
*/
|
||||
_ol_Tile_.prototype.endTransition = function(id) {
|
||||
Tile.prototype.endTransition = function(id) {
|
||||
if (this.transition_) {
|
||||
this.transitionStarts_[id] = -1;
|
||||
}
|
||||
};
|
||||
export default _ol_Tile_;
|
||||
export default Tile;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @module ol/VectorImageTile
|
||||
*/
|
||||
import {getUid, inherits} from './index.js';
|
||||
import _ol_Tile_ from './Tile.js';
|
||||
import Tile from './Tile.js';
|
||||
import TileState from './TileState.js';
|
||||
import {createCanvasContext2D} from './dom.js';
|
||||
import _ol_events_ from './events.js';
|
||||
@@ -36,7 +36,7 @@ var VectorImageTile = function(tileCoord, state, sourceRevision, format,
|
||||
tileLoadFunction, urlTileCoord, tileUrlFunction, sourceTileGrid, tileGrid,
|
||||
sourceTiles, pixelRatio, projection, tileClass, handleTileChange, opt_options) {
|
||||
|
||||
_ol_Tile_.call(this, tileCoord, state, opt_options);
|
||||
Tile.call(this, tileCoord, state, opt_options);
|
||||
|
||||
/**
|
||||
* @private
|
||||
@@ -121,7 +121,7 @@ var VectorImageTile = function(tileCoord, state, sourceRevision, format,
|
||||
|
||||
};
|
||||
|
||||
inherits(VectorImageTile, _ol_Tile_);
|
||||
inherits(VectorImageTile, Tile);
|
||||
|
||||
|
||||
/**
|
||||
@@ -149,7 +149,7 @@ VectorImageTile.prototype.disposeInternal = function() {
|
||||
this.loadListenerKeys_.length = 0;
|
||||
this.sourceTileListenerKeys_.forEach(_ol_events_.unlistenByKey);
|
||||
this.sourceTileListenerKeys_.length = 0;
|
||||
_ol_Tile_.prototype.disposeInternal.call(this);
|
||||
Tile.prototype.disposeInternal.call(this);
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @module ol/VectorTile
|
||||
*/
|
||||
import {getUid, inherits} from './index.js';
|
||||
import _ol_Tile_ from './Tile.js';
|
||||
import Tile from './Tile.js';
|
||||
import TileState from './TileState.js';
|
||||
|
||||
/**
|
||||
@@ -17,7 +17,7 @@ import TileState from './TileState.js';
|
||||
*/
|
||||
var VectorTile = function(tileCoord, state, src, format, tileLoadFunction, opt_options) {
|
||||
|
||||
_ol_Tile_.call(this, tileCoord, state, opt_options);
|
||||
Tile.call(this, tileCoord, state, opt_options);
|
||||
|
||||
/**
|
||||
* @type {number}
|
||||
@@ -75,7 +75,7 @@ var VectorTile = function(tileCoord, state, src, format, tileLoadFunction, opt_o
|
||||
|
||||
};
|
||||
|
||||
inherits(VectorTile, _ol_Tile_);
|
||||
inherits(VectorTile, Tile);
|
||||
|
||||
/**
|
||||
* @const
|
||||
@@ -92,7 +92,7 @@ VectorTile.prototype.disposeInternal = function() {
|
||||
this.replayGroups_ = {};
|
||||
this.state = TileState.ABORT;
|
||||
this.changed();
|
||||
_ol_Tile_.prototype.disposeInternal.call(this);
|
||||
Tile.prototype.disposeInternal.call(this);
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* @module ol/control
|
||||
*/
|
||||
import _ol_Collection_ from './Collection.js';
|
||||
import Collection from './Collection.js';
|
||||
import Attribution from './control/Attribution.js';
|
||||
import Rotate from './control/Rotate.js';
|
||||
import Zoom from './control/Zoom.js';
|
||||
@@ -23,7 +23,7 @@ export function defaults(opt_options) {
|
||||
|
||||
var options = opt_options ? opt_options : {};
|
||||
|
||||
var controls = new _ol_Collection_();
|
||||
var controls = new Collection();
|
||||
|
||||
var zoomControl = options.zoom !== undefined ? options.zoom : true;
|
||||
if (zoomControl) {
|
||||
|
||||
@@ -8,7 +8,7 @@ import {CLASS_CONTROL, CLASS_UNSELECTABLE} from '../css.js';
|
||||
import {removeChildren, replaceNode} from '../dom.js';
|
||||
import _ol_events_ from '../events.js';
|
||||
import EventType from '../events/EventType.js';
|
||||
import _ol_layer_Layer_ from '../layer/Layer.js';
|
||||
import Layer from '../layer/Layer.js';
|
||||
|
||||
/**
|
||||
* @classdesc
|
||||
@@ -146,7 +146,7 @@ Attribution.prototype.getSourceAttributions_ = function(frameState) {
|
||||
var resolution = frameState.viewState.resolution;
|
||||
for (var i = 0, ii = layerStatesArray.length; i < ii; ++i) {
|
||||
var layerState = layerStatesArray[i];
|
||||
if (!_ol_layer_Layer_.visibleAtResolution(layerState, resolution)) {
|
||||
if (!Layer.visibleAtResolution(layerState, resolution)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @module ol/control/OverviewMap
|
||||
*/
|
||||
import {inherits} from '../index.js';
|
||||
import _ol_Collection_ from '../Collection.js';
|
||||
import Collection from '../Collection.js';
|
||||
import PluggableMap from '../PluggableMap.js';
|
||||
import MapEventType from '../MapEventType.js';
|
||||
import MapProperty from '../MapProperty.js';
|
||||
@@ -116,8 +116,8 @@ var OverviewMap = function(opt_options) {
|
||||
* @private
|
||||
*/
|
||||
this.ovmap_ = new PluggableMap({
|
||||
controls: new _ol_Collection_(),
|
||||
interactions: new _ol_Collection_(),
|
||||
controls: new Collection(),
|
||||
interactions: new Collection(),
|
||||
view: options.view
|
||||
});
|
||||
var ovmap = this.ovmap_;
|
||||
|
||||
@@ -13,7 +13,7 @@ import Event from '../events/Event.js';
|
||||
import EventType from '../events/EventType.js';
|
||||
import {clamp} from '../math.js';
|
||||
import PointerEventType from '../pointer/EventType.js';
|
||||
import _ol_pointer_PointerEventHandler_ from '../pointer/PointerEventHandler.js';
|
||||
import PointerEventHandler from '../pointer/PointerEventHandler.js';
|
||||
|
||||
/**
|
||||
* @classdesc
|
||||
@@ -111,7 +111,7 @@ var ZoomSlider = function(opt_options) {
|
||||
* @type {ol.pointer.PointerEventHandler}
|
||||
* @private
|
||||
*/
|
||||
this.dragger_ = new _ol_pointer_PointerEventHandler_(containerElement);
|
||||
this.dragger_ = new PointerEventHandler(containerElement);
|
||||
|
||||
_ol_events_.listen(this.dragger_, PointerEventType.POINTERDOWN,
|
||||
this.handleDraggerStart_, this);
|
||||
|
||||
@@ -20,13 +20,13 @@ import Point from '../geom/Point.js';
|
||||
import Polygon from '../geom/Polygon.js';
|
||||
import {toRadians} from '../math.js';
|
||||
import {get as getProjection} from '../proj.js';
|
||||
import _ol_style_Fill_ from '../style/Fill.js';
|
||||
import _ol_style_Icon_ from '../style/Icon.js';
|
||||
import Fill from '../style/Fill.js';
|
||||
import Icon from '../style/Icon.js';
|
||||
import IconAnchorUnits from '../style/IconAnchorUnits.js';
|
||||
import IconOrigin from '../style/IconOrigin.js';
|
||||
import _ol_style_Stroke_ from '../style/Stroke.js';
|
||||
import _ol_style_Style_ from '../style/Style.js';
|
||||
import _ol_style_Text_ from '../style/Text.js';
|
||||
import Stroke from '../style/Stroke.js';
|
||||
import Style from '../style/Style.js';
|
||||
import Text from '../style/Text.js';
|
||||
import _ol_xml_ from '../xml.js';
|
||||
|
||||
/**
|
||||
@@ -145,7 +145,7 @@ KML.createStyleDefaults_ = function() {
|
||||
* @type {ol.style.Fill}
|
||||
* @private
|
||||
*/
|
||||
KML.DEFAULT_FILL_STYLE_ = new _ol_style_Fill_({
|
||||
KML.DEFAULT_FILL_STYLE_ = new Fill({
|
||||
color: KML.DEFAULT_COLOR_
|
||||
});
|
||||
|
||||
@@ -197,7 +197,7 @@ KML.createStyleDefaults_ = function() {
|
||||
* @type {ol.style.Image}
|
||||
* @private
|
||||
*/
|
||||
KML.DEFAULT_IMAGE_STYLE_ = new _ol_style_Icon_({
|
||||
KML.DEFAULT_IMAGE_STYLE_ = new Icon({
|
||||
anchor: KML.DEFAULT_IMAGE_STYLE_ANCHOR_,
|
||||
anchorOrigin: IconOrigin.BOTTOM_LEFT,
|
||||
anchorXUnits: KML.DEFAULT_IMAGE_STYLE_ANCHOR_X_UNITS_,
|
||||
@@ -221,7 +221,7 @@ KML.createStyleDefaults_ = function() {
|
||||
* @type {ol.style.Stroke}
|
||||
* @private
|
||||
*/
|
||||
KML.DEFAULT_STROKE_STYLE_ = new _ol_style_Stroke_({
|
||||
KML.DEFAULT_STROKE_STYLE_ = new Stroke({
|
||||
color: KML.DEFAULT_COLOR_,
|
||||
width: 1
|
||||
});
|
||||
@@ -231,7 +231,7 @@ KML.createStyleDefaults_ = function() {
|
||||
* @type {ol.style.Stroke}
|
||||
* @private
|
||||
*/
|
||||
KML.DEFAULT_TEXT_STROKE_STYLE_ = new _ol_style_Stroke_({
|
||||
KML.DEFAULT_TEXT_STROKE_STYLE_ = new Stroke({
|
||||
color: [51, 51, 51, 1],
|
||||
width: 2
|
||||
});
|
||||
@@ -241,7 +241,7 @@ KML.createStyleDefaults_ = function() {
|
||||
* @type {ol.style.Text}
|
||||
* @private
|
||||
*/
|
||||
KML.DEFAULT_TEXT_STYLE_ = new _ol_style_Text_({
|
||||
KML.DEFAULT_TEXT_STYLE_ = new Text({
|
||||
font: 'bold 16px Helvetica',
|
||||
fill: KML.DEFAULT_FILL_STYLE_,
|
||||
stroke: KML.DEFAULT_TEXT_STROKE_STYLE_,
|
||||
@@ -253,7 +253,7 @@ KML.createStyleDefaults_ = function() {
|
||||
* @type {ol.style.Style}
|
||||
* @private
|
||||
*/
|
||||
KML.DEFAULT_STYLE_ = new _ol_style_Style_({
|
||||
KML.DEFAULT_STYLE_ = new Style({
|
||||
fill: KML.DEFAULT_FILL_STYLE_,
|
||||
image: KML.DEFAULT_IMAGE_STYLE_,
|
||||
text: KML.DEFAULT_TEXT_STYLE_,
|
||||
@@ -325,7 +325,7 @@ KML.createNameStyleFunction_ = function(foundStyle, name) {
|
||||
textStyle.setOffsetY(textOffset[1]);
|
||||
textStyle.setTextAlign(textAlign);
|
||||
|
||||
var nameStyle = new _ol_style_Style_({
|
||||
var nameStyle = new Style({
|
||||
text: textStyle
|
||||
});
|
||||
return nameStyle;
|
||||
@@ -631,7 +631,7 @@ KML.IconStyleParser_ = function(node, objectStack) {
|
||||
}
|
||||
}
|
||||
|
||||
var imageStyle = new _ol_style_Icon_({
|
||||
var imageStyle = new Icon({
|
||||
anchor: anchor,
|
||||
anchorOrigin: anchorOrigin,
|
||||
anchorXUnits: anchorXUnits,
|
||||
@@ -665,8 +665,8 @@ KML.LabelStyleParser_ = function(node, objectStack) {
|
||||
return;
|
||||
}
|
||||
var styleObject = objectStack[objectStack.length - 1];
|
||||
var textStyle = new _ol_style_Text_({
|
||||
fill: new _ol_style_Fill_({
|
||||
var textStyle = new Text({
|
||||
fill: new Fill({
|
||||
color: /** @type {ol.Color} */
|
||||
('color' in object ? object['color'] : KML.DEFAULT_COLOR_)
|
||||
}),
|
||||
@@ -694,7 +694,7 @@ KML.LineStyleParser_ = function(node, objectStack) {
|
||||
return;
|
||||
}
|
||||
var styleObject = objectStack[objectStack.length - 1];
|
||||
var strokeStyle = new _ol_style_Stroke_({
|
||||
var strokeStyle = new Stroke({
|
||||
color: /** @type {ol.Color} */
|
||||
('color' in object ? object['color'] : KML.DEFAULT_COLOR_),
|
||||
width: /** @type {number} */ ('width' in object ? object['width'] : 1)
|
||||
@@ -716,7 +716,7 @@ KML.PolyStyleParser_ = function(node, objectStack) {
|
||||
return;
|
||||
}
|
||||
var styleObject = objectStack[objectStack.length - 1];
|
||||
var fillStyle = new _ol_style_Fill_({
|
||||
var fillStyle = new Fill({
|
||||
color: /** @type {ol.Color} */
|
||||
('color' in object ? object['color'] : KML.DEFAULT_COLOR_)
|
||||
});
|
||||
@@ -1042,7 +1042,7 @@ KML.readStyle_ = function(node, objectStack) {
|
||||
if (outline !== undefined && !outline) {
|
||||
strokeStyle = null;
|
||||
}
|
||||
return [new _ol_style_Style_({
|
||||
return [new Style({
|
||||
fill: fillStyle,
|
||||
image: imageStyle,
|
||||
stroke: strokeStyle,
|
||||
@@ -2555,7 +2555,7 @@ KML.writeStyle_ = function(node, style, objectStack) {
|
||||
var strokeStyle = style.getStroke();
|
||||
var imageStyle = style.getImage();
|
||||
var textStyle = style.getText();
|
||||
if (imageStyle instanceof _ol_style_Icon_) {
|
||||
if (imageStyle instanceof Icon) {
|
||||
properties['IconStyle'] = imageStyle;
|
||||
}
|
||||
if (textStyle) {
|
||||
|
||||
@@ -17,9 +17,9 @@ import MultiPolygon from '../geom/MultiPolygon.js';
|
||||
import Point from '../geom/Point.js';
|
||||
import Polygon from '../geom/Polygon.js';
|
||||
import _ol_geom_flat_orient_ from '../geom/flat/orient.js';
|
||||
import _ol_proj_Projection_ from '../proj/Projection.js';
|
||||
import Projection from '../proj/Projection.js';
|
||||
import Units from '../proj/Units.js';
|
||||
import _ol_render_Feature_ from '../render/Feature.js';
|
||||
import RenderFeature from '../render/Feature.js';
|
||||
|
||||
/**
|
||||
* @classdesc
|
||||
@@ -39,7 +39,7 @@ var MVT = function(opt_options) {
|
||||
/**
|
||||
* @type {ol.proj.Projection}
|
||||
*/
|
||||
this.defaultDataProjection = new _ol_proj_Projection_({
|
||||
this.defaultDataProjection = new Projection({
|
||||
code: '',
|
||||
units: Units.TILE_PIXELS
|
||||
});
|
||||
@@ -51,7 +51,7 @@ var MVT = function(opt_options) {
|
||||
* (Array.<number>|Array.<Array.<number>>),Object.<string,*>,number)}
|
||||
*/
|
||||
this.featureClass_ = options.featureClass ?
|
||||
options.featureClass : _ol_render_Feature_;
|
||||
options.featureClass : RenderFeature;
|
||||
|
||||
/**
|
||||
* @private
|
||||
@@ -287,7 +287,7 @@ MVT.prototype.createFeature_ = function(pbf, rawFeature, opt_options) {
|
||||
|
||||
var geometryType = MVT.getGeometryType_(type, ends.length);
|
||||
|
||||
if (this.featureClass_ === _ol_render_Feature_) {
|
||||
if (this.featureClass_ === RenderFeature) {
|
||||
feature = new this.featureClass_(geometryType, flatCoordinates, ends, values, id);
|
||||
} else {
|
||||
var geom;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* @module ol/interaction
|
||||
*/
|
||||
import _ol_Collection_ from './Collection.js';
|
||||
import Collection from './Collection.js';
|
||||
import Kinetic from './Kinetic.js';
|
||||
import DoubleClickZoom from './interaction/DoubleClickZoom.js';
|
||||
import DragPan from './interaction/DragPan.js';
|
||||
@@ -41,7 +41,7 @@ export function defaults(opt_options) {
|
||||
|
||||
var options = opt_options ? opt_options : {};
|
||||
|
||||
var interactions = new _ol_Collection_();
|
||||
var interactions = new Collection();
|
||||
|
||||
var kinetic = new Kinetic(-0.005, 0.05, 100);
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
import Event from '../events/Event.js';
|
||||
import {inherits, nullFunction} from '../index.js';
|
||||
import _ol_events_condition_ from '../events/condition.js';
|
||||
import _ol_interaction_Pointer_ from '../interaction/Pointer.js';
|
||||
import PointerInteraction from '../interaction/Pointer.js';
|
||||
import _ol_render_Box_ from '../render/Box.js';
|
||||
|
||||
/**
|
||||
@@ -27,7 +27,7 @@ import _ol_render_Box_ from '../render/Box.js';
|
||||
*/
|
||||
var DragBox = function(opt_options) {
|
||||
|
||||
_ol_interaction_Pointer_.call(this, {
|
||||
PointerInteraction.call(this, {
|
||||
handleDownEvent: DragBox.handleDownEvent_,
|
||||
handleDragEvent: DragBox.handleDragEvent_,
|
||||
handleUpEvent: DragBox.handleUpEvent_
|
||||
@@ -68,7 +68,7 @@ var DragBox = function(opt_options) {
|
||||
options.boxEndCondition : DragBox.defaultBoxEndCondition;
|
||||
};
|
||||
|
||||
inherits(DragBox, _ol_interaction_Pointer_);
|
||||
inherits(DragBox, PointerInteraction);
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -7,7 +7,7 @@ import _ol_coordinate_ from '../coordinate.js';
|
||||
import {easeOut} from '../easing.js';
|
||||
import _ol_events_condition_ from '../events/condition.js';
|
||||
import {FALSE} from '../functions.js';
|
||||
import _ol_interaction_Pointer_ from '../interaction/Pointer.js';
|
||||
import PointerInteraction from '../interaction/Pointer.js';
|
||||
|
||||
/**
|
||||
* @classdesc
|
||||
@@ -20,7 +20,7 @@ import _ol_interaction_Pointer_ from '../interaction/Pointer.js';
|
||||
*/
|
||||
var DragPan = function(opt_options) {
|
||||
|
||||
_ol_interaction_Pointer_.call(this, {
|
||||
PointerInteraction.call(this, {
|
||||
handleDownEvent: DragPan.handleDownEvent_,
|
||||
handleDragEvent: DragPan.handleDragEvent_,
|
||||
handleUpEvent: DragPan.handleUpEvent_
|
||||
@@ -59,7 +59,7 @@ var DragPan = function(opt_options) {
|
||||
|
||||
};
|
||||
|
||||
inherits(DragPan, _ol_interaction_Pointer_);
|
||||
inherits(DragPan, PointerInteraction);
|
||||
|
||||
|
||||
/**
|
||||
@@ -70,7 +70,7 @@ inherits(DragPan, _ol_interaction_Pointer_);
|
||||
DragPan.handleDragEvent_ = function(mapBrowserEvent) {
|
||||
var targetPointers = this.targetPointers;
|
||||
var centroid =
|
||||
_ol_interaction_Pointer_.centroid(targetPointers);
|
||||
PointerInteraction.centroid(targetPointers);
|
||||
if (targetPointers.length == this.lastPointersCount_) {
|
||||
if (this.kinetic_) {
|
||||
this.kinetic_.update(centroid[0], centroid[1]);
|
||||
|
||||
@@ -7,7 +7,7 @@ import ViewHint from '../ViewHint.js';
|
||||
import _ol_events_condition_ from '../events/condition.js';
|
||||
import {FALSE} from '../functions.js';
|
||||
import Interaction from '../interaction/Interaction.js';
|
||||
import _ol_interaction_Pointer_ from '../interaction/Pointer.js';
|
||||
import PointerInteraction from '../interaction/Pointer.js';
|
||||
|
||||
/**
|
||||
* @classdesc
|
||||
@@ -26,7 +26,7 @@ var DragRotate = function(opt_options) {
|
||||
|
||||
var options = opt_options ? opt_options : {};
|
||||
|
||||
_ol_interaction_Pointer_.call(this, {
|
||||
PointerInteraction.call(this, {
|
||||
handleDownEvent: DragRotate.handleDownEvent_,
|
||||
handleDragEvent: DragRotate.handleDragEvent_,
|
||||
handleUpEvent: DragRotate.handleUpEvent_
|
||||
@@ -52,7 +52,7 @@ var DragRotate = function(opt_options) {
|
||||
this.duration_ = options.duration !== undefined ? options.duration : 250;
|
||||
};
|
||||
|
||||
inherits(DragRotate, _ol_interaction_Pointer_);
|
||||
inherits(DragRotate, PointerInteraction);
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -6,7 +6,7 @@ import RotationConstraint from '../RotationConstraint.js';
|
||||
import ViewHint from '../ViewHint.js';
|
||||
import _ol_events_condition_ from '../events/condition.js';
|
||||
import Interaction from '../interaction/Interaction.js';
|
||||
import _ol_interaction_Pointer_ from '../interaction/Pointer.js';
|
||||
import PointerInteraction from '../interaction/Pointer.js';
|
||||
|
||||
/**
|
||||
* @classdesc
|
||||
@@ -27,7 +27,7 @@ var DragRotateAndZoom = function(opt_options) {
|
||||
|
||||
var options = opt_options ? opt_options : {};
|
||||
|
||||
_ol_interaction_Pointer_.call(this, {
|
||||
PointerInteraction.call(this, {
|
||||
handleDownEvent: DragRotateAndZoom.handleDownEvent_,
|
||||
handleDragEvent: DragRotateAndZoom.handleDragEvent_,
|
||||
handleUpEvent: DragRotateAndZoom.handleUpEvent_
|
||||
@@ -66,7 +66,7 @@ var DragRotateAndZoom = function(opt_options) {
|
||||
|
||||
};
|
||||
|
||||
inherits(DragRotateAndZoom, _ol_interaction_Pointer_);
|
||||
inherits(DragRotateAndZoom, PointerInteraction);
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -20,11 +20,11 @@ import MultiPolygon from '../geom/MultiPolygon.js';
|
||||
import Point from '../geom/Point.js';
|
||||
import Polygon, {fromCircle, makeRegular} from '../geom/Polygon.js';
|
||||
import DrawEventType from '../interaction/DrawEventType.js';
|
||||
import _ol_interaction_Pointer_ from '../interaction/Pointer.js';
|
||||
import PointerInteraction from '../interaction/Pointer.js';
|
||||
import InteractionProperty from '../interaction/Property.js';
|
||||
import VectorLayer from '../layer/Vector.js';
|
||||
import VectorSource from '../source/Vector.js';
|
||||
import _ol_style_Style_ from '../style/Style.js';
|
||||
import Style from '../style/Style.js';
|
||||
|
||||
/**
|
||||
* @classdesc
|
||||
@@ -38,7 +38,7 @@ import _ol_style_Style_ from '../style/Style.js';
|
||||
*/
|
||||
var Draw = function(options) {
|
||||
|
||||
_ol_interaction_Pointer_.call(this, {
|
||||
PointerInteraction.call(this, {
|
||||
handleDownEvent: Draw.handleDownEvent_,
|
||||
handleEvent: Draw.handleEvent,
|
||||
handleUpEvent: Draw.handleUpEvent_
|
||||
@@ -290,14 +290,14 @@ var Draw = function(options) {
|
||||
|
||||
};
|
||||
|
||||
inherits(Draw, _ol_interaction_Pointer_);
|
||||
inherits(Draw, PointerInteraction);
|
||||
|
||||
|
||||
/**
|
||||
* @return {ol.StyleFunction} Styles.
|
||||
*/
|
||||
Draw.getDefaultStyleFunction = function() {
|
||||
var styles = _ol_style_Style_.createDefaultEditing();
|
||||
var styles = Style.createDefaultEditing();
|
||||
return function(feature, resolution) {
|
||||
return styles[feature.getGeometry().getType()];
|
||||
};
|
||||
@@ -308,7 +308,7 @@ Draw.getDefaultStyleFunction = function() {
|
||||
* @inheritDoc
|
||||
*/
|
||||
Draw.prototype.setMap = function(map) {
|
||||
_ol_interaction_Pointer_.prototype.setMap.call(this, map);
|
||||
PointerInteraction.prototype.setMap.call(this, map);
|
||||
this.updateState_();
|
||||
};
|
||||
|
||||
@@ -337,7 +337,7 @@ Draw.handleEvent = function(event) {
|
||||
} else if (event.type === MapBrowserEventType.DBLCLICK) {
|
||||
pass = false;
|
||||
}
|
||||
return _ol_interaction_Pointer_.handleEvent.call(this, event) && pass;
|
||||
return PointerInteraction.handleEvent.call(this, event) && pass;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -12,10 +12,10 @@ import GeometryType from '../geom/GeometryType.js';
|
||||
import Point from '../geom/Point.js';
|
||||
import {fromExtent as polygonFromExtent} from '../geom/Polygon.js';
|
||||
import _ol_interaction_ExtentEventType_ from '../interaction/ExtentEventType.js';
|
||||
import _ol_interaction_Pointer_ from '../interaction/Pointer.js';
|
||||
import PointerInteraction from '../interaction/Pointer.js';
|
||||
import VectorLayer from '../layer/Vector.js';
|
||||
import VectorSource from '../source/Vector.js';
|
||||
import _ol_style_Style_ from '../style/Style.js';
|
||||
import Style from '../style/Style.js';
|
||||
|
||||
/**
|
||||
* @classdesc
|
||||
@@ -29,7 +29,7 @@ import _ol_style_Style_ from '../style/Style.js';
|
||||
* @param {olx.interaction.ExtentOptions=} opt_options Options.
|
||||
* @api
|
||||
*/
|
||||
var _ol_interaction_Extent_ = function(opt_options) {
|
||||
var ExtentInteraction = function(opt_options) {
|
||||
|
||||
var options = opt_options || {};
|
||||
|
||||
@@ -81,11 +81,11 @@ var _ol_interaction_Extent_ = function(opt_options) {
|
||||
}
|
||||
|
||||
/* Inherit ol.interaction.Pointer */
|
||||
_ol_interaction_Pointer_.call(this, {
|
||||
handleDownEvent: _ol_interaction_Extent_.handleDownEvent_,
|
||||
handleDragEvent: _ol_interaction_Extent_.handleDragEvent_,
|
||||
handleEvent: _ol_interaction_Extent_.handleEvent_,
|
||||
handleUpEvent: _ol_interaction_Extent_.handleUpEvent_
|
||||
PointerInteraction.call(this, {
|
||||
handleDownEvent: ExtentInteraction.handleDownEvent_,
|
||||
handleDragEvent: ExtentInteraction.handleDragEvent_,
|
||||
handleEvent: ExtentInteraction.handleEvent_,
|
||||
handleUpEvent: ExtentInteraction.handleUpEvent_
|
||||
});
|
||||
|
||||
/**
|
||||
@@ -98,7 +98,7 @@ var _ol_interaction_Extent_ = function(opt_options) {
|
||||
useSpatialIndex: false,
|
||||
wrapX: !!opt_options.wrapX
|
||||
}),
|
||||
style: opt_options.boxStyle ? opt_options.boxStyle : _ol_interaction_Extent_.getDefaultExtentStyleFunction_(),
|
||||
style: opt_options.boxStyle ? opt_options.boxStyle : ExtentInteraction.getDefaultExtentStyleFunction_(),
|
||||
updateWhileAnimating: true,
|
||||
updateWhileInteracting: true
|
||||
});
|
||||
@@ -113,7 +113,7 @@ var _ol_interaction_Extent_ = function(opt_options) {
|
||||
useSpatialIndex: false,
|
||||
wrapX: !!opt_options.wrapX
|
||||
}),
|
||||
style: opt_options.pointerStyle ? opt_options.pointerStyle : _ol_interaction_Extent_.getDefaultPointerStyleFunction_(),
|
||||
style: opt_options.pointerStyle ? opt_options.pointerStyle : ExtentInteraction.getDefaultPointerStyleFunction_(),
|
||||
updateWhileAnimating: true,
|
||||
updateWhileInteracting: true
|
||||
});
|
||||
@@ -123,7 +123,7 @@ var _ol_interaction_Extent_ = function(opt_options) {
|
||||
}
|
||||
};
|
||||
|
||||
inherits(_ol_interaction_Extent_, _ol_interaction_Pointer_);
|
||||
inherits(ExtentInteraction, PointerInteraction);
|
||||
|
||||
/**
|
||||
* @param {ol.MapBrowserEvent} mapBrowserEvent Event.
|
||||
@@ -131,7 +131,7 @@ inherits(_ol_interaction_Extent_, _ol_interaction_Pointer_);
|
||||
* @this {ol.interaction.Extent}
|
||||
* @private
|
||||
*/
|
||||
_ol_interaction_Extent_.handleEvent_ = function(mapBrowserEvent) {
|
||||
ExtentInteraction.handleEvent_ = function(mapBrowserEvent) {
|
||||
if (!(mapBrowserEvent instanceof MapBrowserPointerEvent)) {
|
||||
return true;
|
||||
}
|
||||
@@ -140,7 +140,7 @@ _ol_interaction_Extent_.handleEvent_ = function(mapBrowserEvent) {
|
||||
this.handlePointerMove_(mapBrowserEvent);
|
||||
}
|
||||
//call pointer to determine up/down/drag
|
||||
_ol_interaction_Pointer_.handleEvent.call(this, mapBrowserEvent);
|
||||
PointerInteraction.handleEvent.call(this, mapBrowserEvent);
|
||||
//return false to stop propagation
|
||||
return false;
|
||||
};
|
||||
@@ -151,7 +151,7 @@ _ol_interaction_Extent_.handleEvent_ = function(mapBrowserEvent) {
|
||||
* @this {ol.interaction.Extent}
|
||||
* @private
|
||||
*/
|
||||
_ol_interaction_Extent_.handleDownEvent_ = function(mapBrowserEvent) {
|
||||
ExtentInteraction.handleDownEvent_ = function(mapBrowserEvent) {
|
||||
var pixel = mapBrowserEvent.pixel;
|
||||
var map = mapBrowserEvent.map;
|
||||
|
||||
@@ -183,15 +183,15 @@ _ol_interaction_Extent_.handleDownEvent_ = function(mapBrowserEvent) {
|
||||
|
||||
//snap to point
|
||||
if (x !== null && y !== null) {
|
||||
this.pointerHandler_ = _ol_interaction_Extent_.getPointHandler_(getOpposingPoint(vertex));
|
||||
this.pointerHandler_ = ExtentInteraction.getPointHandler_(getOpposingPoint(vertex));
|
||||
//snap to edge
|
||||
} else if (x !== null) {
|
||||
this.pointerHandler_ = _ol_interaction_Extent_.getEdgeHandler_(
|
||||
this.pointerHandler_ = ExtentInteraction.getEdgeHandler_(
|
||||
getOpposingPoint([x, extent[1]]),
|
||||
getOpposingPoint([x, extent[3]])
|
||||
);
|
||||
} else if (y !== null) {
|
||||
this.pointerHandler_ = _ol_interaction_Extent_.getEdgeHandler_(
|
||||
this.pointerHandler_ = ExtentInteraction.getEdgeHandler_(
|
||||
getOpposingPoint([extent[0], y]),
|
||||
getOpposingPoint([extent[2], y])
|
||||
);
|
||||
@@ -200,7 +200,7 @@ _ol_interaction_Extent_.handleDownEvent_ = function(mapBrowserEvent) {
|
||||
} else {
|
||||
vertex = map.getCoordinateFromPixel(pixel);
|
||||
this.setExtent([vertex[0], vertex[1], vertex[0], vertex[1]]);
|
||||
this.pointerHandler_ = _ol_interaction_Extent_.getPointHandler_(vertex);
|
||||
this.pointerHandler_ = ExtentInteraction.getPointHandler_(vertex);
|
||||
}
|
||||
return true; //event handled; start downup sequence
|
||||
};
|
||||
@@ -211,7 +211,7 @@ _ol_interaction_Extent_.handleDownEvent_ = function(mapBrowserEvent) {
|
||||
* @this {ol.interaction.Extent}
|
||||
* @private
|
||||
*/
|
||||
_ol_interaction_Extent_.handleDragEvent_ = function(mapBrowserEvent) {
|
||||
ExtentInteraction.handleDragEvent_ = function(mapBrowserEvent) {
|
||||
if (this.pointerHandler_) {
|
||||
var pixelCoordinate = mapBrowserEvent.coordinate;
|
||||
this.setExtent(this.pointerHandler_(pixelCoordinate));
|
||||
@@ -226,7 +226,7 @@ _ol_interaction_Extent_.handleDragEvent_ = function(mapBrowserEvent) {
|
||||
* @this {ol.interaction.Extent}
|
||||
* @private
|
||||
*/
|
||||
_ol_interaction_Extent_.handleUpEvent_ = function(mapBrowserEvent) {
|
||||
ExtentInteraction.handleUpEvent_ = function(mapBrowserEvent) {
|
||||
this.pointerHandler_ = null;
|
||||
//If bbox is zero area, set to null;
|
||||
var extent = this.getExtent();
|
||||
@@ -242,8 +242,8 @@ _ol_interaction_Extent_.handleUpEvent_ = function(mapBrowserEvent) {
|
||||
* @return {ol.StyleFunction} Default Extent style
|
||||
* @private
|
||||
*/
|
||||
_ol_interaction_Extent_.getDefaultExtentStyleFunction_ = function() {
|
||||
var style = _ol_style_Style_.createDefaultEditing();
|
||||
ExtentInteraction.getDefaultExtentStyleFunction_ = function() {
|
||||
var style = Style.createDefaultEditing();
|
||||
return function(feature, resolution) {
|
||||
return style[GeometryType.POLYGON];
|
||||
};
|
||||
@@ -255,8 +255,8 @@ _ol_interaction_Extent_.getDefaultExtentStyleFunction_ = function() {
|
||||
* @return {ol.StyleFunction} Default pointer style
|
||||
* @private
|
||||
*/
|
||||
_ol_interaction_Extent_.getDefaultPointerStyleFunction_ = function() {
|
||||
var style = _ol_style_Style_.createDefaultEditing();
|
||||
ExtentInteraction.getDefaultPointerStyleFunction_ = function() {
|
||||
var style = Style.createDefaultEditing();
|
||||
return function(feature, resolution) {
|
||||
return style[GeometryType.POINT];
|
||||
};
|
||||
@@ -267,7 +267,7 @@ _ol_interaction_Extent_.getDefaultPointerStyleFunction_ = function() {
|
||||
* @returns {function (ol.Coordinate): ol.Extent} event handler
|
||||
* @private
|
||||
*/
|
||||
_ol_interaction_Extent_.getPointHandler_ = function(fixedPoint) {
|
||||
ExtentInteraction.getPointHandler_ = function(fixedPoint) {
|
||||
return function(point) {
|
||||
return boundingExtent([fixedPoint, point]);
|
||||
};
|
||||
@@ -279,7 +279,7 @@ _ol_interaction_Extent_.getPointHandler_ = function(fixedPoint) {
|
||||
* @returns {function (ol.Coordinate): ol.Extent|null} event handler
|
||||
* @private
|
||||
*/
|
||||
_ol_interaction_Extent_.getEdgeHandler_ = function(fixedP1, fixedP2) {
|
||||
ExtentInteraction.getEdgeHandler_ = function(fixedP1, fixedP2) {
|
||||
if (fixedP1[0] == fixedP2[0]) {
|
||||
return function(point) {
|
||||
return boundingExtent([fixedP1, [point[0], fixedP2[1]]]);
|
||||
@@ -298,7 +298,7 @@ _ol_interaction_Extent_.getEdgeHandler_ = function(fixedP1, fixedP2) {
|
||||
* @returns {Array<Array<ol.Coordinate>>} extent line segments
|
||||
* @private
|
||||
*/
|
||||
_ol_interaction_Extent_.getSegments_ = function(extent) {
|
||||
ExtentInteraction.getSegments_ = function(extent) {
|
||||
return [
|
||||
[[extent[0], extent[1]], [extent[0], extent[3]]],
|
||||
[[extent[0], extent[3]], [extent[2], extent[3]]],
|
||||
@@ -313,7 +313,7 @@ _ol_interaction_Extent_.getSegments_ = function(extent) {
|
||||
* @returns {ol.Coordinate|null} snapped vertex on extent
|
||||
* @private
|
||||
*/
|
||||
_ol_interaction_Extent_.prototype.snapToVertex_ = function(pixel, map) {
|
||||
ExtentInteraction.prototype.snapToVertex_ = function(pixel, map) {
|
||||
var pixelCoordinate = map.getCoordinateFromPixel(pixel);
|
||||
var sortByDistance = function(a, b) {
|
||||
return _ol_coordinate_.squaredDistanceToSegment(pixelCoordinate, a) -
|
||||
@@ -322,7 +322,7 @@ _ol_interaction_Extent_.prototype.snapToVertex_ = function(pixel, map) {
|
||||
var extent = this.getExtent();
|
||||
if (extent) {
|
||||
//convert extents to line segments and find the segment closest to pixelCoordinate
|
||||
var segments = _ol_interaction_Extent_.getSegments_(extent);
|
||||
var segments = ExtentInteraction.getSegments_(extent);
|
||||
segments.sort(sortByDistance);
|
||||
var closestSegment = segments[0];
|
||||
|
||||
@@ -353,7 +353,7 @@ _ol_interaction_Extent_.prototype.snapToVertex_ = function(pixel, map) {
|
||||
* @param {ol.MapBrowserEvent} mapBrowserEvent pointer move event
|
||||
* @private
|
||||
*/
|
||||
_ol_interaction_Extent_.prototype.handlePointerMove_ = function(mapBrowserEvent) {
|
||||
ExtentInteraction.prototype.handlePointerMove_ = function(mapBrowserEvent) {
|
||||
var pixel = mapBrowserEvent.pixel;
|
||||
var map = mapBrowserEvent.map;
|
||||
|
||||
@@ -369,7 +369,7 @@ _ol_interaction_Extent_.prototype.handlePointerMove_ = function(mapBrowserEvent)
|
||||
* @returns {ol.Feature} extent as featrue
|
||||
* @private
|
||||
*/
|
||||
_ol_interaction_Extent_.prototype.createOrUpdateExtentFeature_ = function(extent) {
|
||||
ExtentInteraction.prototype.createOrUpdateExtentFeature_ = function(extent) {
|
||||
var extentFeature = this.extentFeature_;
|
||||
|
||||
if (!extentFeature) {
|
||||
@@ -396,7 +396,7 @@ _ol_interaction_Extent_.prototype.createOrUpdateExtentFeature_ = function(extent
|
||||
* @returns {ol.Feature} vertex as feature
|
||||
* @private
|
||||
*/
|
||||
_ol_interaction_Extent_.prototype.createOrUpdatePointerFeature_ = function(vertex) {
|
||||
ExtentInteraction.prototype.createOrUpdatePointerFeature_ = function(vertex) {
|
||||
var vertexFeature = this.vertexFeature_;
|
||||
if (!vertexFeature) {
|
||||
vertexFeature = new Feature(new Point(vertex));
|
||||
@@ -413,10 +413,10 @@ _ol_interaction_Extent_.prototype.createOrUpdatePointerFeature_ = function(verte
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
_ol_interaction_Extent_.prototype.setMap = function(map) {
|
||||
ExtentInteraction.prototype.setMap = function(map) {
|
||||
this.extentOverlay_.setMap(map);
|
||||
this.vertexOverlay_.setMap(map);
|
||||
_ol_interaction_Pointer_.prototype.setMap.call(this, map);
|
||||
PointerInteraction.prototype.setMap.call(this, map);
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -425,7 +425,7 @@ _ol_interaction_Extent_.prototype.setMap = function(map) {
|
||||
* @return {ol.Extent} Drawn extent in the view projection.
|
||||
* @api
|
||||
*/
|
||||
_ol_interaction_Extent_.prototype.getExtent = function() {
|
||||
ExtentInteraction.prototype.getExtent = function() {
|
||||
return this.extent_;
|
||||
};
|
||||
|
||||
@@ -435,11 +435,11 @@ _ol_interaction_Extent_.prototype.getExtent = function() {
|
||||
* @param {ol.Extent} extent Extent
|
||||
* @api
|
||||
*/
|
||||
_ol_interaction_Extent_.prototype.setExtent = function(extent) {
|
||||
ExtentInteraction.prototype.setExtent = function(extent) {
|
||||
//Null extent means no bbox
|
||||
this.extent_ = extent ? extent : null;
|
||||
this.createOrUpdateExtentFeature_(extent);
|
||||
this.dispatchEvent(new _ol_interaction_Extent_.Event(this.extent_));
|
||||
this.dispatchEvent(new ExtentInteraction.Event(this.extent_));
|
||||
};
|
||||
|
||||
|
||||
@@ -453,7 +453,7 @@ _ol_interaction_Extent_.prototype.setExtent = function(extent) {
|
||||
* @param {ol.Extent} extent the new extent
|
||||
* @extends {ol.events.Event}
|
||||
*/
|
||||
_ol_interaction_Extent_.Event = function(extent) {
|
||||
ExtentInteraction.Event = function(extent) {
|
||||
Event.call(this, _ol_interaction_ExtentEventType_.EXTENTCHANGED);
|
||||
|
||||
/**
|
||||
@@ -464,5 +464,5 @@ _ol_interaction_Extent_.Event = function(extent) {
|
||||
this.extent = extent;
|
||||
|
||||
};
|
||||
inherits(_ol_interaction_Extent_.Event, Event);
|
||||
export default _ol_interaction_Extent_;
|
||||
inherits(ExtentInteraction.Event, Event);
|
||||
export default ExtentInteraction;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @module ol/interaction/Modify
|
||||
*/
|
||||
import {getUid, inherits} from '../index.js';
|
||||
import _ol_Collection_ from '../Collection.js';
|
||||
import Collection from '../Collection.js';
|
||||
import CollectionEventType from '../CollectionEventType.js';
|
||||
import Feature from '../Feature.js';
|
||||
import MapBrowserEventType from '../MapBrowserEventType.js';
|
||||
@@ -16,13 +16,13 @@ import _ol_events_condition_ from '../events/condition.js';
|
||||
import {boundingExtent, buffer, createOrUpdateFromCoordinate} from '../extent.js';
|
||||
import GeometryType from '../geom/GeometryType.js';
|
||||
import Point from '../geom/Point.js';
|
||||
import _ol_interaction_ModifyEventType_ from '../interaction/ModifyEventType.js';
|
||||
import _ol_interaction_Pointer_ from '../interaction/Pointer.js';
|
||||
import ModifyEventType from '../interaction/ModifyEventType.js';
|
||||
import PointerInteraction from '../interaction/Pointer.js';
|
||||
import VectorLayer from '../layer/Vector.js';
|
||||
import VectorSource from '../source/Vector.js';
|
||||
import VectorEventType from '../source/VectorEventType.js';
|
||||
import RBush from '../structs/RBush.js';
|
||||
import _ol_style_Style_ from '../style/Style.js';
|
||||
import Style from '../style/Style.js';
|
||||
|
||||
/**
|
||||
* @classdesc
|
||||
@@ -43,13 +43,13 @@ import _ol_style_Style_ from '../style/Style.js';
|
||||
* @fires ol.interaction.Modify.Event
|
||||
* @api
|
||||
*/
|
||||
var _ol_interaction_Modify_ = function(options) {
|
||||
var Modify = function(options) {
|
||||
|
||||
_ol_interaction_Pointer_.call(this, {
|
||||
handleDownEvent: _ol_interaction_Modify_.handleDownEvent_,
|
||||
handleDragEvent: _ol_interaction_Modify_.handleDragEvent_,
|
||||
handleEvent: _ol_interaction_Modify_.handleEvent,
|
||||
handleUpEvent: _ol_interaction_Modify_.handleUpEvent_
|
||||
PointerInteraction.call(this, {
|
||||
handleDownEvent: Modify.handleDownEvent_,
|
||||
handleDragEvent: Modify.handleDragEvent_,
|
||||
handleEvent: Modify.handleEvent,
|
||||
handleUpEvent: Modify.handleUpEvent_
|
||||
});
|
||||
|
||||
/**
|
||||
@@ -163,7 +163,7 @@ var _ol_interaction_Modify_ = function(options) {
|
||||
wrapX: !!options.wrapX
|
||||
}),
|
||||
style: options.style ? options.style :
|
||||
_ol_interaction_Modify_.getDefaultStyleFunction(),
|
||||
Modify.getDefaultStyleFunction(),
|
||||
updateWhileAnimating: true,
|
||||
updateWhileInteracting: true
|
||||
});
|
||||
@@ -195,7 +195,7 @@ var _ol_interaction_Modify_ = function(options) {
|
||||
var features;
|
||||
if (options.source) {
|
||||
this.source_ = options.source;
|
||||
features = new _ol_Collection_(this.source_.getFeatures());
|
||||
features = new Collection(this.source_.getFeatures());
|
||||
_ol_events_.listen(this.source_, VectorEventType.ADDFEATURE,
|
||||
this.handleSourceAdd_, this);
|
||||
_ol_events_.listen(this.source_, VectorEventType.REMOVEFEATURE,
|
||||
@@ -227,27 +227,27 @@ var _ol_interaction_Modify_ = function(options) {
|
||||
|
||||
};
|
||||
|
||||
inherits(_ol_interaction_Modify_, _ol_interaction_Pointer_);
|
||||
inherits(Modify, PointerInteraction);
|
||||
|
||||
|
||||
/**
|
||||
* @define {number} The segment index assigned to a circle's center when
|
||||
* breaking up a cicrle into ModifySegmentDataType segments.
|
||||
*/
|
||||
_ol_interaction_Modify_.MODIFY_SEGMENT_CIRCLE_CENTER_INDEX = 0;
|
||||
Modify.MODIFY_SEGMENT_CIRCLE_CENTER_INDEX = 0;
|
||||
|
||||
/**
|
||||
* @define {number} The segment index assigned to a circle's circumference when
|
||||
* breaking up a circle into ModifySegmentDataType segments.
|
||||
*/
|
||||
_ol_interaction_Modify_.MODIFY_SEGMENT_CIRCLE_CIRCUMFERENCE_INDEX = 1;
|
||||
Modify.MODIFY_SEGMENT_CIRCLE_CIRCUMFERENCE_INDEX = 1;
|
||||
|
||||
|
||||
/**
|
||||
* @param {ol.Feature} feature Feature.
|
||||
* @private
|
||||
*/
|
||||
_ol_interaction_Modify_.prototype.addFeature_ = function(feature) {
|
||||
Modify.prototype.addFeature_ = function(feature) {
|
||||
var geometry = feature.getGeometry();
|
||||
if (geometry && geometry.getType() in this.SEGMENT_WRITERS_) {
|
||||
this.SEGMENT_WRITERS_[geometry.getType()].call(this, feature, geometry);
|
||||
@@ -265,11 +265,11 @@ _ol_interaction_Modify_.prototype.addFeature_ = function(feature) {
|
||||
* @param {ol.MapBrowserPointerEvent} evt Map browser event
|
||||
* @private
|
||||
*/
|
||||
_ol_interaction_Modify_.prototype.willModifyFeatures_ = function(evt) {
|
||||
Modify.prototype.willModifyFeatures_ = function(evt) {
|
||||
if (!this.modified_) {
|
||||
this.modified_ = true;
|
||||
this.dispatchEvent(new _ol_interaction_Modify_.Event(
|
||||
_ol_interaction_ModifyEventType_.MODIFYSTART, this.features_, evt));
|
||||
this.dispatchEvent(new Modify.Event(
|
||||
ModifyEventType.MODIFYSTART, this.features_, evt));
|
||||
}
|
||||
};
|
||||
|
||||
@@ -278,7 +278,7 @@ _ol_interaction_Modify_.prototype.willModifyFeatures_ = function(evt) {
|
||||
* @param {ol.Feature} feature Feature.
|
||||
* @private
|
||||
*/
|
||||
_ol_interaction_Modify_.prototype.removeFeature_ = function(feature) {
|
||||
Modify.prototype.removeFeature_ = function(feature) {
|
||||
this.removeFeatureSegmentData_(feature);
|
||||
// Remove the vertex feature if the collection of canditate features
|
||||
// is empty.
|
||||
@@ -295,7 +295,7 @@ _ol_interaction_Modify_.prototype.removeFeature_ = function(feature) {
|
||||
* @param {ol.Feature} feature Feature.
|
||||
* @private
|
||||
*/
|
||||
_ol_interaction_Modify_.prototype.removeFeatureSegmentData_ = function(feature) {
|
||||
Modify.prototype.removeFeatureSegmentData_ = function(feature) {
|
||||
var rBush = this.rBush_;
|
||||
var /** @type {Array.<ol.ModifySegmentDataType>} */ nodesToRemove = [];
|
||||
rBush.forEach(
|
||||
@@ -316,21 +316,21 @@ _ol_interaction_Modify_.prototype.removeFeatureSegmentData_ = function(feature)
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
_ol_interaction_Modify_.prototype.setActive = function(active) {
|
||||
Modify.prototype.setActive = function(active) {
|
||||
if (this.vertexFeature_ && !active) {
|
||||
this.overlay_.getSource().removeFeature(this.vertexFeature_);
|
||||
this.vertexFeature_ = null;
|
||||
}
|
||||
_ol_interaction_Pointer_.prototype.setActive.call(this, active);
|
||||
PointerInteraction.prototype.setActive.call(this, active);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
_ol_interaction_Modify_.prototype.setMap = function(map) {
|
||||
Modify.prototype.setMap = function(map) {
|
||||
this.overlay_.setMap(map);
|
||||
_ol_interaction_Pointer_.prototype.setMap.call(this, map);
|
||||
PointerInteraction.prototype.setMap.call(this, map);
|
||||
};
|
||||
|
||||
|
||||
@@ -338,7 +338,7 @@ _ol_interaction_Modify_.prototype.setMap = function(map) {
|
||||
* @param {ol.source.Vector.Event} event Event.
|
||||
* @private
|
||||
*/
|
||||
_ol_interaction_Modify_.prototype.handleSourceAdd_ = function(event) {
|
||||
Modify.prototype.handleSourceAdd_ = function(event) {
|
||||
if (event.feature) {
|
||||
this.features_.push(event.feature);
|
||||
}
|
||||
@@ -349,7 +349,7 @@ _ol_interaction_Modify_.prototype.handleSourceAdd_ = function(event) {
|
||||
* @param {ol.source.Vector.Event} event Event.
|
||||
* @private
|
||||
*/
|
||||
_ol_interaction_Modify_.prototype.handleSourceRemove_ = function(event) {
|
||||
Modify.prototype.handleSourceRemove_ = function(event) {
|
||||
if (event.feature) {
|
||||
this.features_.remove(event.feature);
|
||||
}
|
||||
@@ -360,7 +360,7 @@ _ol_interaction_Modify_.prototype.handleSourceRemove_ = function(event) {
|
||||
* @param {ol.Collection.Event} evt Event.
|
||||
* @private
|
||||
*/
|
||||
_ol_interaction_Modify_.prototype.handleFeatureAdd_ = function(evt) {
|
||||
Modify.prototype.handleFeatureAdd_ = function(evt) {
|
||||
this.addFeature_(/** @type {ol.Feature} */ (evt.element));
|
||||
};
|
||||
|
||||
@@ -369,7 +369,7 @@ _ol_interaction_Modify_.prototype.handleFeatureAdd_ = function(evt) {
|
||||
* @param {ol.events.Event} evt Event.
|
||||
* @private
|
||||
*/
|
||||
_ol_interaction_Modify_.prototype.handleFeatureChange_ = function(evt) {
|
||||
Modify.prototype.handleFeatureChange_ = function(evt) {
|
||||
if (!this.changingFeature_) {
|
||||
var feature = /** @type {ol.Feature} */ (evt.target);
|
||||
this.removeFeature_(feature);
|
||||
@@ -382,7 +382,7 @@ _ol_interaction_Modify_.prototype.handleFeatureChange_ = function(evt) {
|
||||
* @param {ol.Collection.Event} evt Event.
|
||||
* @private
|
||||
*/
|
||||
_ol_interaction_Modify_.prototype.handleFeatureRemove_ = function(evt) {
|
||||
Modify.prototype.handleFeatureRemove_ = function(evt) {
|
||||
var feature = /** @type {ol.Feature} */ (evt.element);
|
||||
this.removeFeature_(feature);
|
||||
};
|
||||
@@ -393,7 +393,7 @@ _ol_interaction_Modify_.prototype.handleFeatureRemove_ = function(evt) {
|
||||
* @param {ol.geom.Point} geometry Geometry.
|
||||
* @private
|
||||
*/
|
||||
_ol_interaction_Modify_.prototype.writePointGeometry_ = function(feature, geometry) {
|
||||
Modify.prototype.writePointGeometry_ = function(feature, geometry) {
|
||||
var coordinates = geometry.getCoordinates();
|
||||
var segmentData = /** @type {ol.ModifySegmentDataType} */ ({
|
||||
feature: feature,
|
||||
@@ -409,7 +409,7 @@ _ol_interaction_Modify_.prototype.writePointGeometry_ = function(feature, geomet
|
||||
* @param {ol.geom.MultiPoint} geometry Geometry.
|
||||
* @private
|
||||
*/
|
||||
_ol_interaction_Modify_.prototype.writeMultiPointGeometry_ = function(feature, geometry) {
|
||||
Modify.prototype.writeMultiPointGeometry_ = function(feature, geometry) {
|
||||
var points = geometry.getCoordinates();
|
||||
var coordinates, i, ii, segmentData;
|
||||
for (i = 0, ii = points.length; i < ii; ++i) {
|
||||
@@ -431,7 +431,7 @@ _ol_interaction_Modify_.prototype.writeMultiPointGeometry_ = function(feature, g
|
||||
* @param {ol.geom.LineString} geometry Geometry.
|
||||
* @private
|
||||
*/
|
||||
_ol_interaction_Modify_.prototype.writeLineStringGeometry_ = function(feature, geometry) {
|
||||
Modify.prototype.writeLineStringGeometry_ = function(feature, geometry) {
|
||||
var coordinates = geometry.getCoordinates();
|
||||
var i, ii, segment, segmentData;
|
||||
for (i = 0, ii = coordinates.length - 1; i < ii; ++i) {
|
||||
@@ -452,7 +452,7 @@ _ol_interaction_Modify_.prototype.writeLineStringGeometry_ = function(feature, g
|
||||
* @param {ol.geom.MultiLineString} geometry Geometry.
|
||||
* @private
|
||||
*/
|
||||
_ol_interaction_Modify_.prototype.writeMultiLineStringGeometry_ = function(feature, geometry) {
|
||||
Modify.prototype.writeMultiLineStringGeometry_ = function(feature, geometry) {
|
||||
var lines = geometry.getCoordinates();
|
||||
var coordinates, i, ii, j, jj, segment, segmentData;
|
||||
for (j = 0, jj = lines.length; j < jj; ++j) {
|
||||
@@ -477,7 +477,7 @@ _ol_interaction_Modify_.prototype.writeMultiLineStringGeometry_ = function(featu
|
||||
* @param {ol.geom.Polygon} geometry Geometry.
|
||||
* @private
|
||||
*/
|
||||
_ol_interaction_Modify_.prototype.writePolygonGeometry_ = function(feature, geometry) {
|
||||
Modify.prototype.writePolygonGeometry_ = function(feature, geometry) {
|
||||
var rings = geometry.getCoordinates();
|
||||
var coordinates, i, ii, j, jj, segment, segmentData;
|
||||
for (j = 0, jj = rings.length; j < jj; ++j) {
|
||||
@@ -502,7 +502,7 @@ _ol_interaction_Modify_.prototype.writePolygonGeometry_ = function(feature, geom
|
||||
* @param {ol.geom.MultiPolygon} geometry Geometry.
|
||||
* @private
|
||||
*/
|
||||
_ol_interaction_Modify_.prototype.writeMultiPolygonGeometry_ = function(feature, geometry) {
|
||||
Modify.prototype.writeMultiPolygonGeometry_ = function(feature, geometry) {
|
||||
var polygons = geometry.getCoordinates();
|
||||
var coordinates, i, ii, j, jj, k, kk, rings, segment, segmentData;
|
||||
for (k = 0, kk = polygons.length; k < kk; ++k) {
|
||||
@@ -536,18 +536,18 @@ _ol_interaction_Modify_.prototype.writeMultiPolygonGeometry_ = function(feature,
|
||||
* @param {ol.geom.Circle} geometry Geometry.
|
||||
* @private
|
||||
*/
|
||||
_ol_interaction_Modify_.prototype.writeCircleGeometry_ = function(feature, geometry) {
|
||||
Modify.prototype.writeCircleGeometry_ = function(feature, geometry) {
|
||||
var coordinates = geometry.getCenter();
|
||||
var centerSegmentData = /** @type {ol.ModifySegmentDataType} */ ({
|
||||
feature: feature,
|
||||
geometry: geometry,
|
||||
index: _ol_interaction_Modify_.MODIFY_SEGMENT_CIRCLE_CENTER_INDEX,
|
||||
index: Modify.MODIFY_SEGMENT_CIRCLE_CENTER_INDEX,
|
||||
segment: [coordinates, coordinates]
|
||||
});
|
||||
var circumferenceSegmentData = /** @type {ol.ModifySegmentDataType} */ ({
|
||||
feature: feature,
|
||||
geometry: geometry,
|
||||
index: _ol_interaction_Modify_.MODIFY_SEGMENT_CIRCLE_CIRCUMFERENCE_INDEX,
|
||||
index: Modify.MODIFY_SEGMENT_CIRCLE_CIRCUMFERENCE_INDEX,
|
||||
segment: [coordinates, coordinates]
|
||||
});
|
||||
var featureSegments = [centerSegmentData, circumferenceSegmentData];
|
||||
@@ -562,7 +562,7 @@ _ol_interaction_Modify_.prototype.writeCircleGeometry_ = function(feature, geome
|
||||
* @param {ol.geom.GeometryCollection} geometry Geometry.
|
||||
* @private
|
||||
*/
|
||||
_ol_interaction_Modify_.prototype.writeGeometryCollectionGeometry_ = function(feature, geometry) {
|
||||
Modify.prototype.writeGeometryCollectionGeometry_ = function(feature, geometry) {
|
||||
var i, geometries = geometry.getGeometriesArray();
|
||||
for (i = 0; i < geometries.length; ++i) {
|
||||
this.SEGMENT_WRITERS_[geometries[i].getType()].call(
|
||||
@@ -576,7 +576,7 @@ _ol_interaction_Modify_.prototype.writeGeometryCollectionGeometry_ = function(fe
|
||||
* @return {ol.Feature} Vertex feature.
|
||||
* @private
|
||||
*/
|
||||
_ol_interaction_Modify_.prototype.createOrUpdateVertexFeature_ = function(coordinates) {
|
||||
Modify.prototype.createOrUpdateVertexFeature_ = function(coordinates) {
|
||||
var vertexFeature = this.vertexFeature_;
|
||||
if (!vertexFeature) {
|
||||
vertexFeature = new Feature(new Point(coordinates));
|
||||
@@ -596,7 +596,7 @@ _ol_interaction_Modify_.prototype.createOrUpdateVertexFeature_ = function(coordi
|
||||
* @return {number} The difference in indexes.
|
||||
* @private
|
||||
*/
|
||||
_ol_interaction_Modify_.compareIndexes_ = function(a, b) {
|
||||
Modify.compareIndexes_ = function(a, b) {
|
||||
return a.index - b.index;
|
||||
};
|
||||
|
||||
@@ -607,7 +607,7 @@ _ol_interaction_Modify_.compareIndexes_ = function(a, b) {
|
||||
* @this {ol.interaction.Modify}
|
||||
* @private
|
||||
*/
|
||||
_ol_interaction_Modify_.handleDownEvent_ = function(evt) {
|
||||
Modify.handleDownEvent_ = function(evt) {
|
||||
if (!this.condition_(evt)) {
|
||||
return false;
|
||||
}
|
||||
@@ -623,7 +623,7 @@ _ol_interaction_Modify_.handleDownEvent_ = function(evt) {
|
||||
var vertexExtent = boundingExtent([vertex]);
|
||||
var segmentDataMatches = this.rBush_.getInExtent(vertexExtent);
|
||||
var componentSegments = {};
|
||||
segmentDataMatches.sort(_ol_interaction_Modify_.compareIndexes_);
|
||||
segmentDataMatches.sort(Modify.compareIndexes_);
|
||||
for (var i = 0, ii = segmentDataMatches.length; i < ii; ++i) {
|
||||
var segmentDataMatch = segmentDataMatches[i];
|
||||
var segment = segmentDataMatch.segment;
|
||||
@@ -636,9 +636,9 @@ _ol_interaction_Modify_.handleDownEvent_ = function(evt) {
|
||||
componentSegments[uid] = new Array(2);
|
||||
}
|
||||
if (segmentDataMatch.geometry.getType() === GeometryType.CIRCLE &&
|
||||
segmentDataMatch.index === _ol_interaction_Modify_.MODIFY_SEGMENT_CIRCLE_CIRCUMFERENCE_INDEX) {
|
||||
segmentDataMatch.index === Modify.MODIFY_SEGMENT_CIRCLE_CIRCUMFERENCE_INDEX) {
|
||||
|
||||
var closestVertex = _ol_interaction_Modify_.closestOnSegmentData_(pixelCoordinate, segmentDataMatch);
|
||||
var closestVertex = Modify.closestOnSegmentData_(pixelCoordinate, segmentDataMatch);
|
||||
if (_ol_coordinate_.equals(closestVertex, vertex) && !componentSegments[uid][0]) {
|
||||
this.dragSegments_.push([segmentDataMatch, 0]);
|
||||
componentSegments[uid][0] = segmentDataMatch;
|
||||
@@ -683,7 +683,7 @@ _ol_interaction_Modify_.handleDownEvent_ = function(evt) {
|
||||
* @this {ol.interaction.Modify}
|
||||
* @private
|
||||
*/
|
||||
_ol_interaction_Modify_.handleDragEvent_ = function(evt) {
|
||||
Modify.handleDragEvent_ = function(evt) {
|
||||
this.ignoreNextSingleClick_ = false;
|
||||
this.willModifyFeatures_(evt);
|
||||
|
||||
@@ -733,7 +733,7 @@ _ol_interaction_Modify_.handleDragEvent_ = function(evt) {
|
||||
break;
|
||||
case GeometryType.CIRCLE:
|
||||
segment[0] = segment[1] = vertex;
|
||||
if (segmentData.index === _ol_interaction_Modify_.MODIFY_SEGMENT_CIRCLE_CENTER_INDEX) {
|
||||
if (segmentData.index === Modify.MODIFY_SEGMENT_CIRCLE_CENTER_INDEX) {
|
||||
this.changingFeature_ = true;
|
||||
geometry.setCenter(vertex);
|
||||
this.changingFeature_ = false;
|
||||
@@ -761,7 +761,7 @@ _ol_interaction_Modify_.handleDragEvent_ = function(evt) {
|
||||
* @this {ol.interaction.Modify}
|
||||
* @private
|
||||
*/
|
||||
_ol_interaction_Modify_.handleUpEvent_ = function(evt) {
|
||||
Modify.handleUpEvent_ = function(evt) {
|
||||
var segmentData;
|
||||
var geometry;
|
||||
for (var i = this.dragSegments_.length - 1; i >= 0; --i) {
|
||||
@@ -782,8 +782,8 @@ _ol_interaction_Modify_.handleUpEvent_ = function(evt) {
|
||||
}
|
||||
}
|
||||
if (this.modified_) {
|
||||
this.dispatchEvent(new _ol_interaction_Modify_.Event(
|
||||
_ol_interaction_ModifyEventType_.MODIFYEND, this.features_, evt));
|
||||
this.dispatchEvent(new Modify.Event(
|
||||
ModifyEventType.MODIFYEND, this.features_, evt));
|
||||
this.modified_ = false;
|
||||
}
|
||||
return false;
|
||||
@@ -798,7 +798,7 @@ _ol_interaction_Modify_.handleUpEvent_ = function(evt) {
|
||||
* @this {ol.interaction.Modify}
|
||||
* @api
|
||||
*/
|
||||
_ol_interaction_Modify_.handleEvent = function(mapBrowserEvent) {
|
||||
Modify.handleEvent = function(mapBrowserEvent) {
|
||||
if (!(mapBrowserEvent instanceof MapBrowserPointerEvent)) {
|
||||
return true;
|
||||
}
|
||||
@@ -823,7 +823,7 @@ _ol_interaction_Modify_.handleEvent = function(mapBrowserEvent) {
|
||||
this.ignoreNextSingleClick_ = false;
|
||||
}
|
||||
|
||||
return _ol_interaction_Pointer_.handleEvent.call(this, mapBrowserEvent) &&
|
||||
return PointerInteraction.handleEvent.call(this, mapBrowserEvent) &&
|
||||
!handled;
|
||||
};
|
||||
|
||||
@@ -832,7 +832,7 @@ _ol_interaction_Modify_.handleEvent = function(mapBrowserEvent) {
|
||||
* @param {ol.MapBrowserEvent} evt Event.
|
||||
* @private
|
||||
*/
|
||||
_ol_interaction_Modify_.prototype.handlePointerMove_ = function(evt) {
|
||||
Modify.prototype.handlePointerMove_ = function(evt) {
|
||||
this.lastPixel_ = evt.pixel;
|
||||
this.handlePointerAtPixel_(evt.pixel, evt.map);
|
||||
};
|
||||
@@ -843,11 +843,11 @@ _ol_interaction_Modify_.prototype.handlePointerMove_ = function(evt) {
|
||||
* @param {ol.PluggableMap} map Map.
|
||||
* @private
|
||||
*/
|
||||
_ol_interaction_Modify_.prototype.handlePointerAtPixel_ = function(pixel, map) {
|
||||
Modify.prototype.handlePointerAtPixel_ = function(pixel, map) {
|
||||
var pixelCoordinate = map.getCoordinateFromPixel(pixel);
|
||||
var sortByDistance = function(a, b) {
|
||||
return _ol_interaction_Modify_.pointDistanceToSegmentDataSquared_(pixelCoordinate, a) -
|
||||
_ol_interaction_Modify_.pointDistanceToSegmentDataSquared_(pixelCoordinate, b);
|
||||
return Modify.pointDistanceToSegmentDataSquared_(pixelCoordinate, a) -
|
||||
Modify.pointDistanceToSegmentDataSquared_(pixelCoordinate, b);
|
||||
};
|
||||
|
||||
var box = buffer(createOrUpdateFromCoordinate(pixelCoordinate),
|
||||
@@ -859,14 +859,14 @@ _ol_interaction_Modify_.prototype.handlePointerAtPixel_ = function(pixel, map) {
|
||||
nodes.sort(sortByDistance);
|
||||
var node = nodes[0];
|
||||
var closestSegment = node.segment;
|
||||
var vertex = _ol_interaction_Modify_.closestOnSegmentData_(pixelCoordinate, node);
|
||||
var vertex = Modify.closestOnSegmentData_(pixelCoordinate, node);
|
||||
var vertexPixel = map.getPixelFromCoordinate(vertex);
|
||||
var dist = _ol_coordinate_.distance(pixel, vertexPixel);
|
||||
if (dist <= this.pixelTolerance_) {
|
||||
var vertexSegments = {};
|
||||
|
||||
if (node.geometry.getType() === GeometryType.CIRCLE &&
|
||||
node.index === _ol_interaction_Modify_.MODIFY_SEGMENT_CIRCLE_CIRCUMFERENCE_INDEX) {
|
||||
node.index === Modify.MODIFY_SEGMENT_CIRCLE_CIRCUMFERENCE_INDEX) {
|
||||
|
||||
this.snappedToVertex_ = true;
|
||||
this.createOrUpdateVertexFeature_(vertex);
|
||||
@@ -917,13 +917,13 @@ _ol_interaction_Modify_.prototype.handlePointerAtPixel_ = function(pixel, map) {
|
||||
* segment we are calculating the distance to.
|
||||
* @return {number} The square of the distance between a point and a line segment.
|
||||
*/
|
||||
_ol_interaction_Modify_.pointDistanceToSegmentDataSquared_ = function(pointCoordinates, segmentData) {
|
||||
Modify.pointDistanceToSegmentDataSquared_ = function(pointCoordinates, segmentData) {
|
||||
var geometry = segmentData.geometry;
|
||||
|
||||
if (geometry.getType() === GeometryType.CIRCLE) {
|
||||
var circleGeometry = /** @type {ol.geom.Circle} */ (geometry);
|
||||
|
||||
if (segmentData.index === _ol_interaction_Modify_.MODIFY_SEGMENT_CIRCLE_CIRCUMFERENCE_INDEX) {
|
||||
if (segmentData.index === Modify.MODIFY_SEGMENT_CIRCLE_CIRCUMFERENCE_INDEX) {
|
||||
var distanceToCenterSquared =
|
||||
_ol_coordinate_.squaredDistance(circleGeometry.getCenter(), pointCoordinates);
|
||||
var distanceToCircumference =
|
||||
@@ -943,11 +943,11 @@ _ol_interaction_Modify_.pointDistanceToSegmentDataSquared_ = function(pointCoord
|
||||
* segment which should contain the closest point.
|
||||
* @return {ol.Coordinate} The point closest to the specified line segment.
|
||||
*/
|
||||
_ol_interaction_Modify_.closestOnSegmentData_ = function(pointCoordinates, segmentData) {
|
||||
Modify.closestOnSegmentData_ = function(pointCoordinates, segmentData) {
|
||||
var geometry = segmentData.geometry;
|
||||
|
||||
if (geometry.getType() === GeometryType.CIRCLE &&
|
||||
segmentData.index === _ol_interaction_Modify_.MODIFY_SEGMENT_CIRCLE_CIRCUMFERENCE_INDEX) {
|
||||
segmentData.index === Modify.MODIFY_SEGMENT_CIRCLE_CIRCUMFERENCE_INDEX) {
|
||||
return geometry.getClosestPoint(pointCoordinates);
|
||||
}
|
||||
return _ol_coordinate_.closestOnSegment(pointCoordinates, segmentData.segment);
|
||||
@@ -959,7 +959,7 @@ _ol_interaction_Modify_.closestOnSegmentData_ = function(pointCoordinates, segme
|
||||
* @param {ol.Coordinate} vertex Vertex.
|
||||
* @private
|
||||
*/
|
||||
_ol_interaction_Modify_.prototype.insertVertex_ = function(segmentData, vertex) {
|
||||
Modify.prototype.insertVertex_ = function(segmentData, vertex) {
|
||||
var segment = segmentData.segment;
|
||||
var feature = segmentData.feature;
|
||||
var geometry = segmentData.geometry;
|
||||
@@ -1025,13 +1025,13 @@ _ol_interaction_Modify_.prototype.insertVertex_ = function(segmentData, vertex)
|
||||
* @return {boolean} True when a vertex was removed.
|
||||
* @api
|
||||
*/
|
||||
_ol_interaction_Modify_.prototype.removePoint = function() {
|
||||
Modify.prototype.removePoint = function() {
|
||||
if (this.lastPointerEvent_ && this.lastPointerEvent_.type != MapBrowserEventType.POINTERDRAG) {
|
||||
var evt = this.lastPointerEvent_;
|
||||
this.willModifyFeatures_(evt);
|
||||
this.removeVertex_();
|
||||
this.dispatchEvent(new _ol_interaction_Modify_.Event(
|
||||
_ol_interaction_ModifyEventType_.MODIFYEND, this.features_, evt));
|
||||
this.dispatchEvent(new Modify.Event(
|
||||
ModifyEventType.MODIFYEND, this.features_, evt));
|
||||
this.modified_ = false;
|
||||
return true;
|
||||
}
|
||||
@@ -1043,7 +1043,7 @@ _ol_interaction_Modify_.prototype.removePoint = function() {
|
||||
* @return {boolean} True when a vertex was removed.
|
||||
* @private
|
||||
*/
|
||||
_ol_interaction_Modify_.prototype.removeVertex_ = function() {
|
||||
Modify.prototype.removeVertex_ = function() {
|
||||
var dragSegments = this.dragSegments_;
|
||||
var segmentsByFeature = {};
|
||||
var deleted = false;
|
||||
@@ -1162,7 +1162,7 @@ _ol_interaction_Modify_.prototype.removeVertex_ = function() {
|
||||
* @param {Array} coordinates Coordinates.
|
||||
* @private
|
||||
*/
|
||||
_ol_interaction_Modify_.prototype.setGeometryCoordinates_ = function(geometry, coordinates) {
|
||||
Modify.prototype.setGeometryCoordinates_ = function(geometry, coordinates) {
|
||||
this.changingFeature_ = true;
|
||||
geometry.setCoordinates(coordinates);
|
||||
this.changingFeature_ = false;
|
||||
@@ -1176,7 +1176,7 @@ _ol_interaction_Modify_.prototype.setGeometryCoordinates_ = function(geometry, c
|
||||
* @param {number} delta Delta (1 or -1).
|
||||
* @private
|
||||
*/
|
||||
_ol_interaction_Modify_.prototype.updateSegmentIndices_ = function(
|
||||
Modify.prototype.updateSegmentIndices_ = function(
|
||||
geometry, index, depth, delta) {
|
||||
this.rBush_.forEachInExtent(geometry.getExtent(), function(segmentDataMatch) {
|
||||
if (segmentDataMatch.geometry === geometry &&
|
||||
@@ -1192,8 +1192,8 @@ _ol_interaction_Modify_.prototype.updateSegmentIndices_ = function(
|
||||
/**
|
||||
* @return {ol.StyleFunction} Styles.
|
||||
*/
|
||||
_ol_interaction_Modify_.getDefaultStyleFunction = function() {
|
||||
var style = _ol_style_Style_.createDefaultEditing();
|
||||
Modify.getDefaultStyleFunction = function() {
|
||||
var style = Style.createDefaultEditing();
|
||||
return function(feature, resolution) {
|
||||
return style[GeometryType.POINT];
|
||||
};
|
||||
@@ -1213,7 +1213,7 @@ _ol_interaction_Modify_.getDefaultStyleFunction = function() {
|
||||
* @param {ol.MapBrowserPointerEvent} mapBrowserPointerEvent Associated
|
||||
* {@link ol.MapBrowserPointerEvent}.
|
||||
*/
|
||||
_ol_interaction_Modify_.Event = function(type, features, mapBrowserPointerEvent) {
|
||||
Modify.Event = function(type, features, mapBrowserPointerEvent) {
|
||||
|
||||
Event.call(this, type);
|
||||
|
||||
@@ -1231,5 +1231,5 @@ _ol_interaction_Modify_.Event = function(type, features, mapBrowserPointerEvent)
|
||||
*/
|
||||
this.mapBrowserEvent = mapBrowserPointerEvent;
|
||||
};
|
||||
inherits(_ol_interaction_Modify_.Event, Event);
|
||||
export default _ol_interaction_Modify_;
|
||||
inherits(Modify.Event, Event);
|
||||
export default Modify;
|
||||
|
||||
@@ -5,7 +5,7 @@ import {inherits} from '../index.js';
|
||||
import ViewHint from '../ViewHint.js';
|
||||
import {FALSE} from '../functions.js';
|
||||
import Interaction from '../interaction/Interaction.js';
|
||||
import _ol_interaction_Pointer_ from '../interaction/Pointer.js';
|
||||
import PointerInteraction from '../interaction/Pointer.js';
|
||||
import RotationConstraint from '../RotationConstraint.js';
|
||||
|
||||
/**
|
||||
@@ -20,7 +20,7 @@ import RotationConstraint from '../RotationConstraint.js';
|
||||
*/
|
||||
var PinchRotate = function(opt_options) {
|
||||
|
||||
_ol_interaction_Pointer_.call(this, {
|
||||
PointerInteraction.call(this, {
|
||||
handleDownEvent: PinchRotate.handleDownEvent_,
|
||||
handleDragEvent: PinchRotate.handleDragEvent_,
|
||||
handleUpEvent: PinchRotate.handleUpEvent_
|
||||
@@ -66,7 +66,7 @@ var PinchRotate = function(opt_options) {
|
||||
|
||||
};
|
||||
|
||||
inherits(PinchRotate, _ol_interaction_Pointer_);
|
||||
inherits(PinchRotate, PointerInteraction);
|
||||
|
||||
|
||||
/**
|
||||
@@ -106,7 +106,7 @@ PinchRotate.handleDragEvent_ = function(mapBrowserEvent) {
|
||||
// FIXME: should be the intersection point between the lines:
|
||||
// touch0,touch1 and previousTouch0,previousTouch1
|
||||
var viewportPosition = map.getViewport().getBoundingClientRect();
|
||||
var centroid = _ol_interaction_Pointer_.centroid(this.targetPointers);
|
||||
var centroid = PointerInteraction.centroid(this.targetPointers);
|
||||
centroid[0] -= viewportPosition.left;
|
||||
centroid[1] -= viewportPosition.top;
|
||||
this.anchor_ = map.getCoordinateFromPixel(centroid);
|
||||
|
||||
@@ -5,7 +5,7 @@ import {inherits} from '../index.js';
|
||||
import ViewHint from '../ViewHint.js';
|
||||
import {FALSE} from '../functions.js';
|
||||
import Interaction from '../interaction/Interaction.js';
|
||||
import _ol_interaction_Pointer_ from '../interaction/Pointer.js';
|
||||
import PointerInteraction from '../interaction/Pointer.js';
|
||||
|
||||
/**
|
||||
* @classdesc
|
||||
@@ -19,7 +19,7 @@ import _ol_interaction_Pointer_ from '../interaction/Pointer.js';
|
||||
*/
|
||||
var PinchZoom = function(opt_options) {
|
||||
|
||||
_ol_interaction_Pointer_.call(this, {
|
||||
PointerInteraction.call(this, {
|
||||
handleDownEvent: PinchZoom.handleDownEvent_,
|
||||
handleDragEvent: PinchZoom.handleDragEvent_,
|
||||
handleUpEvent: PinchZoom.handleUpEvent_
|
||||
@@ -59,7 +59,7 @@ var PinchZoom = function(opt_options) {
|
||||
|
||||
};
|
||||
|
||||
inherits(PinchZoom, _ol_interaction_Pointer_);
|
||||
inherits(PinchZoom, PointerInteraction);
|
||||
|
||||
|
||||
/**
|
||||
@@ -104,7 +104,7 @@ PinchZoom.handleDragEvent_ = function(mapBrowserEvent) {
|
||||
|
||||
// scale anchor point.
|
||||
var viewportPosition = map.getViewport().getBoundingClientRect();
|
||||
var centroid = _ol_interaction_Pointer_.centroid(this.targetPointers);
|
||||
var centroid = PointerInteraction.centroid(this.targetPointers);
|
||||
centroid[0] -= viewportPosition.left;
|
||||
centroid[1] -= viewportPosition.top;
|
||||
this.anchor_ = map.getCoordinateFromPixel(centroid);
|
||||
|
||||
@@ -23,12 +23,12 @@ import _ol_obj_ from '../obj.js';
|
||||
* @extends {ol.interaction.Interaction}
|
||||
* @api
|
||||
*/
|
||||
var _ol_interaction_Pointer_ = function(opt_options) {
|
||||
var PointerInteraction = function(opt_options) {
|
||||
|
||||
var options = opt_options ? opt_options : {};
|
||||
|
||||
var handleEvent = options.handleEvent ?
|
||||
options.handleEvent : _ol_interaction_Pointer_.handleEvent;
|
||||
options.handleEvent : PointerInteraction.handleEvent;
|
||||
|
||||
Interaction.call(this, {
|
||||
handleEvent: handleEvent
|
||||
@@ -39,28 +39,28 @@ var _ol_interaction_Pointer_ = function(opt_options) {
|
||||
* @private
|
||||
*/
|
||||
this.handleDownEvent_ = options.handleDownEvent ?
|
||||
options.handleDownEvent : _ol_interaction_Pointer_.handleDownEvent;
|
||||
options.handleDownEvent : PointerInteraction.handleDownEvent;
|
||||
|
||||
/**
|
||||
* @type {function(ol.MapBrowserPointerEvent)}
|
||||
* @private
|
||||
*/
|
||||
this.handleDragEvent_ = options.handleDragEvent ?
|
||||
options.handleDragEvent : _ol_interaction_Pointer_.handleDragEvent;
|
||||
options.handleDragEvent : PointerInteraction.handleDragEvent;
|
||||
|
||||
/**
|
||||
* @type {function(ol.MapBrowserPointerEvent)}
|
||||
* @private
|
||||
*/
|
||||
this.handleMoveEvent_ = options.handleMoveEvent ?
|
||||
options.handleMoveEvent : _ol_interaction_Pointer_.handleMoveEvent;
|
||||
options.handleMoveEvent : PointerInteraction.handleMoveEvent;
|
||||
|
||||
/**
|
||||
* @type {function(ol.MapBrowserPointerEvent):boolean}
|
||||
* @private
|
||||
*/
|
||||
this.handleUpEvent_ = options.handleUpEvent ?
|
||||
options.handleUpEvent : _ol_interaction_Pointer_.handleUpEvent;
|
||||
options.handleUpEvent : PointerInteraction.handleUpEvent;
|
||||
|
||||
/**
|
||||
* @type {boolean}
|
||||
@@ -82,14 +82,14 @@ var _ol_interaction_Pointer_ = function(opt_options) {
|
||||
|
||||
};
|
||||
|
||||
inherits(_ol_interaction_Pointer_, Interaction);
|
||||
inherits(PointerInteraction, Interaction);
|
||||
|
||||
|
||||
/**
|
||||
* @param {Array.<ol.pointer.PointerEvent>} pointerEvents List of events.
|
||||
* @return {ol.Pixel} Centroid pixel.
|
||||
*/
|
||||
_ol_interaction_Pointer_.centroid = function(pointerEvents) {
|
||||
PointerInteraction.centroid = function(pointerEvents) {
|
||||
var length = pointerEvents.length;
|
||||
var clientX = 0;
|
||||
var clientY = 0;
|
||||
@@ -107,7 +107,7 @@ _ol_interaction_Pointer_.centroid = function(pointerEvents) {
|
||||
* or pointerup event.
|
||||
* @private
|
||||
*/
|
||||
_ol_interaction_Pointer_.prototype.isPointerDraggingEvent_ = function(mapBrowserEvent) {
|
||||
PointerInteraction.prototype.isPointerDraggingEvent_ = function(mapBrowserEvent) {
|
||||
var type = mapBrowserEvent.type;
|
||||
return type === MapBrowserEventType.POINTERDOWN ||
|
||||
type === MapBrowserEventType.POINTERDRAG ||
|
||||
@@ -119,7 +119,7 @@ _ol_interaction_Pointer_.prototype.isPointerDraggingEvent_ = function(mapBrowser
|
||||
* @param {ol.MapBrowserPointerEvent} mapBrowserEvent Event.
|
||||
* @private
|
||||
*/
|
||||
_ol_interaction_Pointer_.prototype.updateTrackedPointers_ = function(mapBrowserEvent) {
|
||||
PointerInteraction.prototype.updateTrackedPointers_ = function(mapBrowserEvent) {
|
||||
if (this.isPointerDraggingEvent_(mapBrowserEvent)) {
|
||||
var event = mapBrowserEvent.pointerEvent;
|
||||
|
||||
@@ -142,7 +142,7 @@ _ol_interaction_Pointer_.prototype.updateTrackedPointers_ = function(mapBrowserE
|
||||
* @param {ol.MapBrowserPointerEvent} mapBrowserEvent Event.
|
||||
* @this {ol.interaction.Pointer}
|
||||
*/
|
||||
_ol_interaction_Pointer_.handleDragEvent = nullFunction;
|
||||
PointerInteraction.handleDragEvent = nullFunction;
|
||||
|
||||
|
||||
/**
|
||||
@@ -150,7 +150,7 @@ _ol_interaction_Pointer_.handleDragEvent = nullFunction;
|
||||
* @return {boolean} Capture dragging.
|
||||
* @this {ol.interaction.Pointer}
|
||||
*/
|
||||
_ol_interaction_Pointer_.handleUpEvent = FALSE;
|
||||
PointerInteraction.handleUpEvent = FALSE;
|
||||
|
||||
|
||||
/**
|
||||
@@ -158,14 +158,14 @@ _ol_interaction_Pointer_.handleUpEvent = FALSE;
|
||||
* @return {boolean} Capture dragging.
|
||||
* @this {ol.interaction.Pointer}
|
||||
*/
|
||||
_ol_interaction_Pointer_.handleDownEvent = FALSE;
|
||||
PointerInteraction.handleDownEvent = FALSE;
|
||||
|
||||
|
||||
/**
|
||||
* @param {ol.MapBrowserPointerEvent} mapBrowserEvent Event.
|
||||
* @this {ol.interaction.Pointer}
|
||||
*/
|
||||
_ol_interaction_Pointer_.handleMoveEvent = nullFunction;
|
||||
PointerInteraction.handleMoveEvent = nullFunction;
|
||||
|
||||
|
||||
/**
|
||||
@@ -177,7 +177,7 @@ _ol_interaction_Pointer_.handleMoveEvent = nullFunction;
|
||||
* @this {ol.interaction.Pointer}
|
||||
* @api
|
||||
*/
|
||||
_ol_interaction_Pointer_.handleEvent = function(mapBrowserEvent) {
|
||||
PointerInteraction.handleEvent = function(mapBrowserEvent) {
|
||||
if (!(mapBrowserEvent instanceof MapBrowserPointerEvent)) {
|
||||
return true;
|
||||
}
|
||||
@@ -217,8 +217,8 @@ _ol_interaction_Pointer_.handleEvent = function(mapBrowserEvent) {
|
||||
* @return {boolean} Should the event be stopped?
|
||||
* @protected
|
||||
*/
|
||||
_ol_interaction_Pointer_.prototype.shouldStopEvent = function(handled) {
|
||||
PointerInteraction.prototype.shouldStopEvent = function(handled) {
|
||||
return handled;
|
||||
};
|
||||
|
||||
export default _ol_interaction_Pointer_;
|
||||
export default PointerInteraction;
|
||||
|
||||
@@ -13,7 +13,7 @@ import Interaction from '../interaction/Interaction.js';
|
||||
import VectorLayer from '../layer/Vector.js';
|
||||
import _ol_obj_ from '../obj.js';
|
||||
import VectorSource from '../source/Vector.js';
|
||||
import _ol_style_Style_ from '../style/Style.js';
|
||||
import Style from '../style/Style.js';
|
||||
|
||||
/**
|
||||
* @classdesc
|
||||
@@ -33,10 +33,10 @@ import _ol_style_Style_ from '../style/Style.js';
|
||||
* @fires ol.interaction.Select.Event
|
||||
* @api
|
||||
*/
|
||||
var _ol_interaction_Select_ = function(opt_options) {
|
||||
var Select = function(opt_options) {
|
||||
|
||||
Interaction.call(this, {
|
||||
handleEvent: _ol_interaction_Select_.handleEvent
|
||||
handleEvent: Select.handleEvent
|
||||
});
|
||||
|
||||
var options = opt_options ? opt_options : {};
|
||||
@@ -94,7 +94,7 @@ var _ol_interaction_Select_ = function(opt_options) {
|
||||
wrapX: options.wrapX
|
||||
}),
|
||||
style: options.style ? options.style :
|
||||
_ol_interaction_Select_.getDefaultStyleFunction(),
|
||||
Select.getDefaultStyleFunction(),
|
||||
updateWhileAnimating: true,
|
||||
updateWhileInteracting: true
|
||||
});
|
||||
@@ -142,7 +142,7 @@ var _ol_interaction_Select_ = function(opt_options) {
|
||||
|
||||
};
|
||||
|
||||
inherits(_ol_interaction_Select_, Interaction);
|
||||
inherits(Select, Interaction);
|
||||
|
||||
|
||||
/**
|
||||
@@ -150,7 +150,7 @@ inherits(_ol_interaction_Select_, Interaction);
|
||||
* @param {ol.layer.Layer} layer Layer.
|
||||
* @private
|
||||
*/
|
||||
_ol_interaction_Select_.prototype.addFeatureLayerAssociation_ = function(feature, layer) {
|
||||
Select.prototype.addFeatureLayerAssociation_ = function(feature, layer) {
|
||||
var key = getUid(feature);
|
||||
this.featureLayerAssociation_[key] = layer;
|
||||
};
|
||||
@@ -161,7 +161,7 @@ _ol_interaction_Select_.prototype.addFeatureLayerAssociation_ = function(feature
|
||||
* @return {ol.Collection.<ol.Feature>} Features collection.
|
||||
* @api
|
||||
*/
|
||||
_ol_interaction_Select_.prototype.getFeatures = function() {
|
||||
Select.prototype.getFeatures = function() {
|
||||
return this.featureOverlay_.getSource().getFeaturesCollection();
|
||||
};
|
||||
|
||||
@@ -171,7 +171,7 @@ _ol_interaction_Select_.prototype.getFeatures = function() {
|
||||
* @returns {number} Hit tolerance in pixels.
|
||||
* @api
|
||||
*/
|
||||
_ol_interaction_Select_.prototype.getHitTolerance = function() {
|
||||
Select.prototype.getHitTolerance = function() {
|
||||
return this.hitTolerance_;
|
||||
};
|
||||
|
||||
@@ -185,7 +185,7 @@ _ol_interaction_Select_.prototype.getHitTolerance = function() {
|
||||
* @return {ol.layer.Vector} Layer.
|
||||
* @api
|
||||
*/
|
||||
_ol_interaction_Select_.prototype.getLayer = function(feature) {
|
||||
Select.prototype.getLayer = function(feature) {
|
||||
var key = getUid(feature);
|
||||
return /** @type {ol.layer.Vector} */ (this.featureLayerAssociation_[key]);
|
||||
};
|
||||
@@ -199,7 +199,7 @@ _ol_interaction_Select_.prototype.getLayer = function(feature) {
|
||||
* @this {ol.interaction.Select}
|
||||
* @api
|
||||
*/
|
||||
_ol_interaction_Select_.handleEvent = function(mapBrowserEvent) {
|
||||
Select.handleEvent = function(mapBrowserEvent) {
|
||||
if (!this.condition_(mapBrowserEvent)) {
|
||||
return true;
|
||||
}
|
||||
@@ -280,7 +280,7 @@ _ol_interaction_Select_.handleEvent = function(mapBrowserEvent) {
|
||||
}
|
||||
if (selected.length > 0 || deselected.length > 0) {
|
||||
this.dispatchEvent(
|
||||
new _ol_interaction_Select_.Event(_ol_interaction_Select_.EventType_.SELECT,
|
||||
new Select.Event(Select.EventType_.SELECT,
|
||||
selected, deselected, mapBrowserEvent));
|
||||
}
|
||||
return _ol_events_condition_.pointerMove(mapBrowserEvent);
|
||||
@@ -294,7 +294,7 @@ _ol_interaction_Select_.handleEvent = function(mapBrowserEvent) {
|
||||
* @param {number} hitTolerance Hit tolerance in pixels.
|
||||
* @api
|
||||
*/
|
||||
_ol_interaction_Select_.prototype.setHitTolerance = function(hitTolerance) {
|
||||
Select.prototype.setHitTolerance = function(hitTolerance) {
|
||||
this.hitTolerance_ = hitTolerance;
|
||||
};
|
||||
|
||||
@@ -306,7 +306,7 @@ _ol_interaction_Select_.prototype.setHitTolerance = function(hitTolerance) {
|
||||
* @override
|
||||
* @api
|
||||
*/
|
||||
_ol_interaction_Select_.prototype.setMap = function(map) {
|
||||
Select.prototype.setMap = function(map) {
|
||||
var currentMap = this.getMap();
|
||||
var selectedFeatures =
|
||||
this.featureOverlay_.getSource().getFeaturesCollection();
|
||||
@@ -324,8 +324,8 @@ _ol_interaction_Select_.prototype.setMap = function(map) {
|
||||
/**
|
||||
* @return {ol.StyleFunction} Styles.
|
||||
*/
|
||||
_ol_interaction_Select_.getDefaultStyleFunction = function() {
|
||||
var styles = _ol_style_Style_.createDefaultEditing();
|
||||
Select.getDefaultStyleFunction = function() {
|
||||
var styles = Style.createDefaultEditing();
|
||||
extend(styles[GeometryType.POLYGON], styles[GeometryType.LINE_STRING]);
|
||||
extend(styles[GeometryType.GEOMETRY_COLLECTION], styles[GeometryType.LINE_STRING]);
|
||||
|
||||
@@ -342,7 +342,7 @@ _ol_interaction_Select_.getDefaultStyleFunction = function() {
|
||||
* @param {ol.Collection.Event} evt Event.
|
||||
* @private
|
||||
*/
|
||||
_ol_interaction_Select_.prototype.addFeature_ = function(evt) {
|
||||
Select.prototype.addFeature_ = function(evt) {
|
||||
var map = this.getMap();
|
||||
if (map) {
|
||||
map.skipFeature(/** @type {ol.Feature} */ (evt.element));
|
||||
@@ -354,7 +354,7 @@ _ol_interaction_Select_.prototype.addFeature_ = function(evt) {
|
||||
* @param {ol.Collection.Event} evt Event.
|
||||
* @private
|
||||
*/
|
||||
_ol_interaction_Select_.prototype.removeFeature_ = function(evt) {
|
||||
Select.prototype.removeFeature_ = function(evt) {
|
||||
var map = this.getMap();
|
||||
if (map) {
|
||||
map.unskipFeature(/** @type {ol.Feature} */ (evt.element));
|
||||
@@ -366,7 +366,7 @@ _ol_interaction_Select_.prototype.removeFeature_ = function(evt) {
|
||||
* @param {ol.Feature|ol.render.Feature} feature Feature.
|
||||
* @private
|
||||
*/
|
||||
_ol_interaction_Select_.prototype.removeFeatureLayerAssociation_ = function(feature) {
|
||||
Select.prototype.removeFeatureLayerAssociation_ = function(feature) {
|
||||
var key = getUid(feature);
|
||||
delete this.featureLayerAssociation_[key];
|
||||
};
|
||||
@@ -386,7 +386,7 @@ _ol_interaction_Select_.prototype.removeFeatureLayerAssociation_ = function(feat
|
||||
* @extends {ol.events.Event}
|
||||
* @constructor
|
||||
*/
|
||||
_ol_interaction_Select_.Event = function(type, selected, deselected, mapBrowserEvent) {
|
||||
Select.Event = function(type, selected, deselected, mapBrowserEvent) {
|
||||
Event.call(this, type);
|
||||
|
||||
/**
|
||||
@@ -410,14 +410,14 @@ _ol_interaction_Select_.Event = function(type, selected, deselected, mapBrowserE
|
||||
*/
|
||||
this.mapBrowserEvent = mapBrowserEvent;
|
||||
};
|
||||
inherits(_ol_interaction_Select_.Event, Event);
|
||||
inherits(Select.Event, Event);
|
||||
|
||||
|
||||
/**
|
||||
* @enum {string}
|
||||
* @private
|
||||
*/
|
||||
_ol_interaction_Select_.EventType_ = {
|
||||
Select.EventType_ = {
|
||||
/**
|
||||
* Triggered when feature(s) has been (de)selected.
|
||||
* @event ol.interaction.Select.Event#select
|
||||
@@ -425,4 +425,4 @@ _ol_interaction_Select_.EventType_ = {
|
||||
*/
|
||||
SELECT: 'select'
|
||||
};
|
||||
export default _ol_interaction_Select_;
|
||||
export default Select;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @module ol/interaction/Snap
|
||||
*/
|
||||
import {getUid, inherits} from '../index.js';
|
||||
import _ol_Collection_ from '../Collection.js';
|
||||
import Collection from '../Collection.js';
|
||||
import CollectionEventType from '../CollectionEventType.js';
|
||||
import _ol_coordinate_ from '../coordinate.js';
|
||||
import _ol_events_ from '../events.js';
|
||||
@@ -11,7 +11,7 @@ import {boundingExtent, createEmpty} from '../extent.js';
|
||||
import {TRUE, FALSE} from '../functions.js';
|
||||
import GeometryType from '../geom/GeometryType.js';
|
||||
import {fromCircle} from '../geom/Polygon.js';
|
||||
import _ol_interaction_Pointer_ from '../interaction/Pointer.js';
|
||||
import PointerInteraction from '../interaction/Pointer.js';
|
||||
import _ol_obj_ from '../obj.js';
|
||||
import VectorSource from '../source/Vector.js';
|
||||
import VectorEventType from '../source/VectorEventType.js';
|
||||
@@ -39,12 +39,12 @@ import RBush from '../structs/RBush.js';
|
||||
* @param {olx.interaction.SnapOptions=} opt_options Options.
|
||||
* @api
|
||||
*/
|
||||
var _ol_interaction_Snap_ = function(opt_options) {
|
||||
var Snap = function(opt_options) {
|
||||
|
||||
_ol_interaction_Pointer_.call(this, {
|
||||
handleEvent: _ol_interaction_Snap_.handleEvent_,
|
||||
PointerInteraction.call(this, {
|
||||
handleEvent: Snap.handleEvent_,
|
||||
handleDownEvent: TRUE,
|
||||
handleUpEvent: _ol_interaction_Snap_.handleUpEvent_
|
||||
handleUpEvent: Snap.handleUpEvent_
|
||||
});
|
||||
|
||||
var options = opt_options ? opt_options : {};
|
||||
@@ -120,7 +120,7 @@ var _ol_interaction_Snap_ = function(opt_options) {
|
||||
* @type {function(ol.SnapSegmentDataType, ol.SnapSegmentDataType): number}
|
||||
* @private
|
||||
*/
|
||||
this.sortByDistance_ = _ol_interaction_Snap_.sortByDistance.bind(this);
|
||||
this.sortByDistance_ = Snap.sortByDistance.bind(this);
|
||||
|
||||
|
||||
/**
|
||||
@@ -149,7 +149,7 @@ var _ol_interaction_Snap_ = function(opt_options) {
|
||||
};
|
||||
};
|
||||
|
||||
inherits(_ol_interaction_Snap_, _ol_interaction_Pointer_);
|
||||
inherits(Snap, PointerInteraction);
|
||||
|
||||
|
||||
/**
|
||||
@@ -159,7 +159,7 @@ inherits(_ol_interaction_Snap_, _ol_interaction_Pointer_);
|
||||
* Defaults to `true`.
|
||||
* @api
|
||||
*/
|
||||
_ol_interaction_Snap_.prototype.addFeature = function(feature, opt_listen) {
|
||||
Snap.prototype.addFeature = function(feature, opt_listen) {
|
||||
var listen = opt_listen !== undefined ? opt_listen : true;
|
||||
var feature_uid = getUid(feature);
|
||||
var geometry = feature.getGeometry();
|
||||
@@ -184,7 +184,7 @@ _ol_interaction_Snap_.prototype.addFeature = function(feature, opt_listen) {
|
||||
* @param {ol.Feature} feature Feature.
|
||||
* @private
|
||||
*/
|
||||
_ol_interaction_Snap_.prototype.forEachFeatureAdd_ = function(feature) {
|
||||
Snap.prototype.forEachFeatureAdd_ = function(feature) {
|
||||
this.addFeature(feature);
|
||||
};
|
||||
|
||||
@@ -193,7 +193,7 @@ _ol_interaction_Snap_.prototype.forEachFeatureAdd_ = function(feature) {
|
||||
* @param {ol.Feature} feature Feature.
|
||||
* @private
|
||||
*/
|
||||
_ol_interaction_Snap_.prototype.forEachFeatureRemove_ = function(feature) {
|
||||
Snap.prototype.forEachFeatureRemove_ = function(feature) {
|
||||
this.removeFeature(feature);
|
||||
};
|
||||
|
||||
@@ -202,7 +202,7 @@ _ol_interaction_Snap_.prototype.forEachFeatureRemove_ = function(feature) {
|
||||
* @return {ol.Collection.<ol.Feature>|Array.<ol.Feature>} Features.
|
||||
* @private
|
||||
*/
|
||||
_ol_interaction_Snap_.prototype.getFeatures_ = function() {
|
||||
Snap.prototype.getFeatures_ = function() {
|
||||
var features;
|
||||
if (this.features_) {
|
||||
features = this.features_;
|
||||
@@ -217,11 +217,11 @@ _ol_interaction_Snap_.prototype.getFeatures_ = function() {
|
||||
* @param {ol.source.Vector.Event|ol.Collection.Event} evt Event.
|
||||
* @private
|
||||
*/
|
||||
_ol_interaction_Snap_.prototype.handleFeatureAdd_ = function(evt) {
|
||||
Snap.prototype.handleFeatureAdd_ = function(evt) {
|
||||
var feature;
|
||||
if (evt instanceof VectorSource.Event) {
|
||||
feature = evt.feature;
|
||||
} else if (evt instanceof _ol_Collection_.Event) {
|
||||
} else if (evt instanceof Collection.Event) {
|
||||
feature = evt.element;
|
||||
}
|
||||
this.addFeature(/** @type {ol.Feature} */ (feature));
|
||||
@@ -232,11 +232,11 @@ _ol_interaction_Snap_.prototype.handleFeatureAdd_ = function(evt) {
|
||||
* @param {ol.source.Vector.Event|ol.Collection.Event} evt Event.
|
||||
* @private
|
||||
*/
|
||||
_ol_interaction_Snap_.prototype.handleFeatureRemove_ = function(evt) {
|
||||
Snap.prototype.handleFeatureRemove_ = function(evt) {
|
||||
var feature;
|
||||
if (evt instanceof VectorSource.Event) {
|
||||
feature = evt.feature;
|
||||
} else if (evt instanceof _ol_Collection_.Event) {
|
||||
} else if (evt instanceof Collection.Event) {
|
||||
feature = evt.element;
|
||||
}
|
||||
this.removeFeature(/** @type {ol.Feature} */ (feature));
|
||||
@@ -247,7 +247,7 @@ _ol_interaction_Snap_.prototype.handleFeatureRemove_ = function(evt) {
|
||||
* @param {ol.events.Event} evt Event.
|
||||
* @private
|
||||
*/
|
||||
_ol_interaction_Snap_.prototype.handleFeatureChange_ = function(evt) {
|
||||
Snap.prototype.handleFeatureChange_ = function(evt) {
|
||||
var feature = /** @type {ol.Feature} */ (evt.target);
|
||||
if (this.handlingDownUpSequence) {
|
||||
var uid = getUid(feature);
|
||||
@@ -267,7 +267,7 @@ _ol_interaction_Snap_.prototype.handleFeatureChange_ = function(evt) {
|
||||
* or not. Defaults to `true`.
|
||||
* @api
|
||||
*/
|
||||
_ol_interaction_Snap_.prototype.removeFeature = function(feature, opt_unlisten) {
|
||||
Snap.prototype.removeFeature = function(feature, opt_unlisten) {
|
||||
var unlisten = opt_unlisten !== undefined ? opt_unlisten : true;
|
||||
var feature_uid = getUid(feature);
|
||||
var extent = this.indexedFeaturesExtents_[feature_uid];
|
||||
@@ -294,7 +294,7 @@ _ol_interaction_Snap_.prototype.removeFeature = function(feature, opt_unlisten)
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
_ol_interaction_Snap_.prototype.setMap = function(map) {
|
||||
Snap.prototype.setMap = function(map) {
|
||||
var currentMap = this.getMap();
|
||||
var keys = this.featuresListenerKeys_;
|
||||
var features = this.getFeatures_();
|
||||
@@ -304,7 +304,7 @@ _ol_interaction_Snap_.prototype.setMap = function(map) {
|
||||
keys.length = 0;
|
||||
features.forEach(this.forEachFeatureRemove_.bind(this));
|
||||
}
|
||||
_ol_interaction_Pointer_.prototype.setMap.call(this, map);
|
||||
PointerInteraction.prototype.setMap.call(this, map);
|
||||
|
||||
if (map) {
|
||||
if (this.features_) {
|
||||
@@ -330,7 +330,7 @@ _ol_interaction_Snap_.prototype.setMap = function(map) {
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
_ol_interaction_Snap_.prototype.shouldStopEvent = FALSE;
|
||||
Snap.prototype.shouldStopEvent = FALSE;
|
||||
|
||||
|
||||
/**
|
||||
@@ -339,7 +339,7 @@ _ol_interaction_Snap_.prototype.shouldStopEvent = FALSE;
|
||||
* @param {ol.PluggableMap} map Map.
|
||||
* @return {ol.SnapResultType} Snap result
|
||||
*/
|
||||
_ol_interaction_Snap_.prototype.snapTo = function(pixel, pixelCoordinate, map) {
|
||||
Snap.prototype.snapTo = function(pixel, pixelCoordinate, map) {
|
||||
|
||||
var lowerLeft = map.getCoordinateFromPixel(
|
||||
[pixel[0] - this.pixelTolerance_, pixel[1] + this.pixelTolerance_]);
|
||||
@@ -423,7 +423,7 @@ _ol_interaction_Snap_.prototype.snapTo = function(pixel, pixelCoordinate, map) {
|
||||
* @param {ol.Feature} feature Feature
|
||||
* @private
|
||||
*/
|
||||
_ol_interaction_Snap_.prototype.updateFeature_ = function(feature) {
|
||||
Snap.prototype.updateFeature_ = function(feature) {
|
||||
this.removeFeature(feature, false);
|
||||
this.addFeature(feature, false);
|
||||
};
|
||||
@@ -434,7 +434,7 @@ _ol_interaction_Snap_.prototype.updateFeature_ = function(feature) {
|
||||
* @param {ol.geom.Circle} geometry Geometry.
|
||||
* @private
|
||||
*/
|
||||
_ol_interaction_Snap_.prototype.writeCircleGeometry_ = function(feature, geometry) {
|
||||
Snap.prototype.writeCircleGeometry_ = function(feature, geometry) {
|
||||
var polygon = fromCircle(geometry);
|
||||
var coordinates = polygon.getCoordinates()[0];
|
||||
var i, ii, segment, segmentData;
|
||||
@@ -454,7 +454,7 @@ _ol_interaction_Snap_.prototype.writeCircleGeometry_ = function(feature, geometr
|
||||
* @param {ol.geom.GeometryCollection} geometry Geometry.
|
||||
* @private
|
||||
*/
|
||||
_ol_interaction_Snap_.prototype.writeGeometryCollectionGeometry_ = function(feature, geometry) {
|
||||
Snap.prototype.writeGeometryCollectionGeometry_ = function(feature, geometry) {
|
||||
var i, geometries = geometry.getGeometriesArray();
|
||||
for (i = 0; i < geometries.length; ++i) {
|
||||
var segmentWriter = this.SEGMENT_WRITERS_[geometries[i].getType()];
|
||||
@@ -470,7 +470,7 @@ _ol_interaction_Snap_.prototype.writeGeometryCollectionGeometry_ = function(feat
|
||||
* @param {ol.geom.LineString} geometry Geometry.
|
||||
* @private
|
||||
*/
|
||||
_ol_interaction_Snap_.prototype.writeLineStringGeometry_ = function(feature, geometry) {
|
||||
Snap.prototype.writeLineStringGeometry_ = function(feature, geometry) {
|
||||
var coordinates = geometry.getCoordinates();
|
||||
var i, ii, segment, segmentData;
|
||||
for (i = 0, ii = coordinates.length - 1; i < ii; ++i) {
|
||||
@@ -489,7 +489,7 @@ _ol_interaction_Snap_.prototype.writeLineStringGeometry_ = function(feature, geo
|
||||
* @param {ol.geom.MultiLineString} geometry Geometry.
|
||||
* @private
|
||||
*/
|
||||
_ol_interaction_Snap_.prototype.writeMultiLineStringGeometry_ = function(feature, geometry) {
|
||||
Snap.prototype.writeMultiLineStringGeometry_ = function(feature, geometry) {
|
||||
var lines = geometry.getCoordinates();
|
||||
var coordinates, i, ii, j, jj, segment, segmentData;
|
||||
for (j = 0, jj = lines.length; j < jj; ++j) {
|
||||
@@ -511,7 +511,7 @@ _ol_interaction_Snap_.prototype.writeMultiLineStringGeometry_ = function(feature
|
||||
* @param {ol.geom.MultiPoint} geometry Geometry.
|
||||
* @private
|
||||
*/
|
||||
_ol_interaction_Snap_.prototype.writeMultiPointGeometry_ = function(feature, geometry) {
|
||||
Snap.prototype.writeMultiPointGeometry_ = function(feature, geometry) {
|
||||
var points = geometry.getCoordinates();
|
||||
var coordinates, i, ii, segmentData;
|
||||
for (i = 0, ii = points.length; i < ii; ++i) {
|
||||
@@ -530,7 +530,7 @@ _ol_interaction_Snap_.prototype.writeMultiPointGeometry_ = function(feature, geo
|
||||
* @param {ol.geom.MultiPolygon} geometry Geometry.
|
||||
* @private
|
||||
*/
|
||||
_ol_interaction_Snap_.prototype.writeMultiPolygonGeometry_ = function(feature, geometry) {
|
||||
Snap.prototype.writeMultiPolygonGeometry_ = function(feature, geometry) {
|
||||
var polygons = geometry.getCoordinates();
|
||||
var coordinates, i, ii, j, jj, k, kk, rings, segment, segmentData;
|
||||
for (k = 0, kk = polygons.length; k < kk; ++k) {
|
||||
@@ -555,7 +555,7 @@ _ol_interaction_Snap_.prototype.writeMultiPolygonGeometry_ = function(feature, g
|
||||
* @param {ol.geom.Point} geometry Geometry.
|
||||
* @private
|
||||
*/
|
||||
_ol_interaction_Snap_.prototype.writePointGeometry_ = function(feature, geometry) {
|
||||
Snap.prototype.writePointGeometry_ = function(feature, geometry) {
|
||||
var coordinates = geometry.getCoordinates();
|
||||
var segmentData = /** @type {ol.SnapSegmentDataType} */ ({
|
||||
feature: feature,
|
||||
@@ -570,7 +570,7 @@ _ol_interaction_Snap_.prototype.writePointGeometry_ = function(feature, geometry
|
||||
* @param {ol.geom.Polygon} geometry Geometry.
|
||||
* @private
|
||||
*/
|
||||
_ol_interaction_Snap_.prototype.writePolygonGeometry_ = function(feature, geometry) {
|
||||
Snap.prototype.writePolygonGeometry_ = function(feature, geometry) {
|
||||
var rings = geometry.getCoordinates();
|
||||
var coordinates, i, ii, j, jj, segment, segmentData;
|
||||
for (j = 0, jj = rings.length; j < jj; ++j) {
|
||||
@@ -594,13 +594,13 @@ _ol_interaction_Snap_.prototype.writePolygonGeometry_ = function(feature, geomet
|
||||
* @this {ol.interaction.Snap}
|
||||
* @private
|
||||
*/
|
||||
_ol_interaction_Snap_.handleEvent_ = function(evt) {
|
||||
Snap.handleEvent_ = function(evt) {
|
||||
var result = this.snapTo(evt.pixel, evt.coordinate, evt.map);
|
||||
if (result.snapped) {
|
||||
evt.coordinate = result.vertex.slice(0, 2);
|
||||
evt.pixel = result.vertexPixel;
|
||||
}
|
||||
return _ol_interaction_Pointer_.handleEvent.call(this, evt);
|
||||
return PointerInteraction.handleEvent.call(this, evt);
|
||||
};
|
||||
|
||||
|
||||
@@ -610,7 +610,7 @@ _ol_interaction_Snap_.handleEvent_ = function(evt) {
|
||||
* @this {ol.interaction.Snap}
|
||||
* @private
|
||||
*/
|
||||
_ol_interaction_Snap_.handleUpEvent_ = function(evt) {
|
||||
Snap.handleUpEvent_ = function(evt) {
|
||||
var featuresToUpdate = _ol_obj_.getValues(this.pendingFeatures_);
|
||||
if (featuresToUpdate.length) {
|
||||
featuresToUpdate.forEach(this.updateFeature_.bind(this));
|
||||
@@ -627,10 +627,10 @@ _ol_interaction_Snap_.handleUpEvent_ = function(evt) {
|
||||
* @return {number} The difference in distance.
|
||||
* @this {ol.interaction.Snap}
|
||||
*/
|
||||
_ol_interaction_Snap_.sortByDistance = function(a, b) {
|
||||
Snap.sortByDistance = function(a, b) {
|
||||
return _ol_coordinate_.squaredDistanceToSegment(
|
||||
this.pixelCoordinate_, a.segment) -
|
||||
_ol_coordinate_.squaredDistanceToSegment(
|
||||
this.pixelCoordinate_, b.segment);
|
||||
};
|
||||
export default _ol_interaction_Snap_;
|
||||
export default Snap;
|
||||
|
||||
@@ -2,15 +2,15 @@
|
||||
* @module ol/interaction/Translate
|
||||
*/
|
||||
import {inherits} from '../index.js';
|
||||
import _ol_Collection_ from '../Collection.js';
|
||||
import Collection from '../Collection.js';
|
||||
import BaseObject from '../Object.js';
|
||||
import _ol_events_ from '../events.js';
|
||||
import Event from '../events/Event.js';
|
||||
import {TRUE} from '../functions.js';
|
||||
import {includes} from '../array.js';
|
||||
import _ol_interaction_Pointer_ from '../interaction/Pointer.js';
|
||||
import PointerInteraction from '../interaction/Pointer.js';
|
||||
import InteractionProperty from '../interaction/Property.js';
|
||||
import _ol_interaction_TranslateEventType_ from '../interaction/TranslateEventType.js';
|
||||
import TranslateEventType from '../interaction/TranslateEventType.js';
|
||||
|
||||
/**
|
||||
* @classdesc
|
||||
@@ -23,7 +23,7 @@ import _ol_interaction_TranslateEventType_ from '../interaction/TranslateEventTy
|
||||
* @api
|
||||
*/
|
||||
var _ol_interaction_Translate_ = function(opt_options) {
|
||||
_ol_interaction_Pointer_.call(this, {
|
||||
PointerInteraction.call(this, {
|
||||
handleDownEvent: _ol_interaction_Translate_.handleDownEvent_,
|
||||
handleDragEvent: _ol_interaction_Translate_.handleDragEvent_,
|
||||
handleMoveEvent: _ol_interaction_Translate_.handleMoveEvent_,
|
||||
@@ -85,7 +85,7 @@ var _ol_interaction_Translate_ = function(opt_options) {
|
||||
|
||||
};
|
||||
|
||||
inherits(_ol_interaction_Translate_, _ol_interaction_Pointer_);
|
||||
inherits(_ol_interaction_Translate_, PointerInteraction);
|
||||
|
||||
|
||||
/**
|
||||
@@ -100,11 +100,11 @@ _ol_interaction_Translate_.handleDownEvent_ = function(event) {
|
||||
this.lastCoordinate_ = event.coordinate;
|
||||
_ol_interaction_Translate_.handleMoveEvent_.call(this, event);
|
||||
|
||||
var features = this.features_ || new _ol_Collection_([this.lastFeature_]);
|
||||
var features = this.features_ || new Collection([this.lastFeature_]);
|
||||
|
||||
this.dispatchEvent(
|
||||
new _ol_interaction_Translate_.Event(
|
||||
_ol_interaction_TranslateEventType_.TRANSLATESTART, features,
|
||||
TranslateEventType.TRANSLATESTART, features,
|
||||
event.coordinate));
|
||||
return true;
|
||||
}
|
||||
@@ -123,11 +123,11 @@ _ol_interaction_Translate_.handleUpEvent_ = function(event) {
|
||||
this.lastCoordinate_ = null;
|
||||
_ol_interaction_Translate_.handleMoveEvent_.call(this, event);
|
||||
|
||||
var features = this.features_ || new _ol_Collection_([this.lastFeature_]);
|
||||
var features = this.features_ || new Collection([this.lastFeature_]);
|
||||
|
||||
this.dispatchEvent(
|
||||
new _ol_interaction_Translate_.Event(
|
||||
_ol_interaction_TranslateEventType_.TRANSLATEEND, features,
|
||||
TranslateEventType.TRANSLATEEND, features,
|
||||
event.coordinate));
|
||||
return true;
|
||||
}
|
||||
@@ -146,7 +146,7 @@ _ol_interaction_Translate_.handleDragEvent_ = function(event) {
|
||||
var deltaX = newCoordinate[0] - this.lastCoordinate_[0];
|
||||
var deltaY = newCoordinate[1] - this.lastCoordinate_[1];
|
||||
|
||||
var features = this.features_ || new _ol_Collection_([this.lastFeature_]);
|
||||
var features = this.features_ || new Collection([this.lastFeature_]);
|
||||
|
||||
features.forEach(function(feature) {
|
||||
var geom = feature.getGeometry();
|
||||
@@ -157,7 +157,7 @@ _ol_interaction_Translate_.handleDragEvent_ = function(event) {
|
||||
this.lastCoordinate_ = newCoordinate;
|
||||
this.dispatchEvent(
|
||||
new _ol_interaction_Translate_.Event(
|
||||
_ol_interaction_TranslateEventType_.TRANSLATING, features,
|
||||
TranslateEventType.TRANSLATING, features,
|
||||
newCoordinate));
|
||||
}
|
||||
};
|
||||
@@ -231,7 +231,7 @@ _ol_interaction_Translate_.prototype.setHitTolerance = function(hitTolerance) {
|
||||
*/
|
||||
_ol_interaction_Translate_.prototype.setMap = function(map) {
|
||||
var oldMap = this.getMap();
|
||||
_ol_interaction_Pointer_.prototype.setMap.call(this, map);
|
||||
PointerInteraction.prototype.setMap.call(this, map);
|
||||
this.updateState_(oldMap);
|
||||
};
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ import _ol_obj_ from '../obj.js';
|
||||
* @param {olx.layer.BaseOptions} options Layer options.
|
||||
* @api
|
||||
*/
|
||||
var _ol_layer_Base_ = function(options) {
|
||||
var BaseLayer = function(options) {
|
||||
|
||||
BaseObject.call(this);
|
||||
|
||||
@@ -60,14 +60,14 @@ var _ol_layer_Base_ = function(options) {
|
||||
|
||||
};
|
||||
|
||||
inherits(_ol_layer_Base_, BaseObject);
|
||||
inherits(BaseLayer, BaseObject);
|
||||
|
||||
|
||||
/**
|
||||
* Get the layer type (used when creating a layer renderer).
|
||||
* @return {ol.LayerType} The layer type.
|
||||
*/
|
||||
_ol_layer_Base_.prototype.getType = function() {
|
||||
BaseLayer.prototype.getType = function() {
|
||||
return this.type;
|
||||
};
|
||||
|
||||
@@ -75,7 +75,7 @@ _ol_layer_Base_.prototype.getType = function() {
|
||||
/**
|
||||
* @return {ol.LayerState} Layer state.
|
||||
*/
|
||||
_ol_layer_Base_.prototype.getLayerState = function() {
|
||||
BaseLayer.prototype.getLayerState = function() {
|
||||
this.state_.opacity = clamp(this.getOpacity(), 0, 1);
|
||||
this.state_.sourceState = this.getSourceState();
|
||||
this.state_.visible = this.getVisible();
|
||||
@@ -94,7 +94,7 @@ _ol_layer_Base_.prototype.getLayerState = function() {
|
||||
* modified in place).
|
||||
* @return {Array.<ol.layer.Layer>} Array of layers.
|
||||
*/
|
||||
_ol_layer_Base_.prototype.getLayersArray = function(opt_array) {};
|
||||
BaseLayer.prototype.getLayersArray = function(opt_array) {};
|
||||
|
||||
|
||||
/**
|
||||
@@ -103,7 +103,7 @@ _ol_layer_Base_.prototype.getLayersArray = function(opt_array) {};
|
||||
* states (to be modified in place).
|
||||
* @return {Array.<ol.LayerState>} List of layer states.
|
||||
*/
|
||||
_ol_layer_Base_.prototype.getLayerStatesArray = function(opt_states) {};
|
||||
BaseLayer.prototype.getLayerStatesArray = function(opt_states) {};
|
||||
|
||||
|
||||
/**
|
||||
@@ -113,7 +113,7 @@ _ol_layer_Base_.prototype.getLayerStatesArray = function(opt_states) {};
|
||||
* @observable
|
||||
* @api
|
||||
*/
|
||||
_ol_layer_Base_.prototype.getExtent = function() {
|
||||
BaseLayer.prototype.getExtent = function() {
|
||||
return (
|
||||
/** @type {ol.Extent|undefined} */ this.get(LayerProperty.EXTENT)
|
||||
);
|
||||
@@ -126,7 +126,7 @@ _ol_layer_Base_.prototype.getExtent = function() {
|
||||
* @observable
|
||||
* @api
|
||||
*/
|
||||
_ol_layer_Base_.prototype.getMaxResolution = function() {
|
||||
BaseLayer.prototype.getMaxResolution = function() {
|
||||
return (
|
||||
/** @type {number} */ this.get(LayerProperty.MAX_RESOLUTION)
|
||||
);
|
||||
@@ -139,7 +139,7 @@ _ol_layer_Base_.prototype.getMaxResolution = function() {
|
||||
* @observable
|
||||
* @api
|
||||
*/
|
||||
_ol_layer_Base_.prototype.getMinResolution = function() {
|
||||
BaseLayer.prototype.getMinResolution = function() {
|
||||
return (
|
||||
/** @type {number} */ this.get(LayerProperty.MIN_RESOLUTION)
|
||||
);
|
||||
@@ -152,7 +152,7 @@ _ol_layer_Base_.prototype.getMinResolution = function() {
|
||||
* @observable
|
||||
* @api
|
||||
*/
|
||||
_ol_layer_Base_.prototype.getOpacity = function() {
|
||||
BaseLayer.prototype.getOpacity = function() {
|
||||
return (
|
||||
/** @type {number} */ this.get(LayerProperty.OPACITY)
|
||||
);
|
||||
@@ -163,7 +163,7 @@ _ol_layer_Base_.prototype.getOpacity = function() {
|
||||
* @abstract
|
||||
* @return {ol.source.State} Source state.
|
||||
*/
|
||||
_ol_layer_Base_.prototype.getSourceState = function() {};
|
||||
BaseLayer.prototype.getSourceState = function() {};
|
||||
|
||||
|
||||
/**
|
||||
@@ -172,7 +172,7 @@ _ol_layer_Base_.prototype.getSourceState = function() {};
|
||||
* @observable
|
||||
* @api
|
||||
*/
|
||||
_ol_layer_Base_.prototype.getVisible = function() {
|
||||
BaseLayer.prototype.getVisible = function() {
|
||||
return (
|
||||
/** @type {boolean} */ this.get(LayerProperty.VISIBLE)
|
||||
);
|
||||
@@ -186,7 +186,7 @@ _ol_layer_Base_.prototype.getVisible = function() {
|
||||
* @observable
|
||||
* @api
|
||||
*/
|
||||
_ol_layer_Base_.prototype.getZIndex = function() {
|
||||
BaseLayer.prototype.getZIndex = function() {
|
||||
return (
|
||||
/** @type {number} */ this.get(LayerProperty.Z_INDEX)
|
||||
);
|
||||
@@ -200,7 +200,7 @@ _ol_layer_Base_.prototype.getZIndex = function() {
|
||||
* @observable
|
||||
* @api
|
||||
*/
|
||||
_ol_layer_Base_.prototype.setExtent = function(extent) {
|
||||
BaseLayer.prototype.setExtent = function(extent) {
|
||||
this.set(LayerProperty.EXTENT, extent);
|
||||
};
|
||||
|
||||
@@ -211,7 +211,7 @@ _ol_layer_Base_.prototype.setExtent = function(extent) {
|
||||
* @observable
|
||||
* @api
|
||||
*/
|
||||
_ol_layer_Base_.prototype.setMaxResolution = function(maxResolution) {
|
||||
BaseLayer.prototype.setMaxResolution = function(maxResolution) {
|
||||
this.set(LayerProperty.MAX_RESOLUTION, maxResolution);
|
||||
};
|
||||
|
||||
@@ -222,7 +222,7 @@ _ol_layer_Base_.prototype.setMaxResolution = function(maxResolution) {
|
||||
* @observable
|
||||
* @api
|
||||
*/
|
||||
_ol_layer_Base_.prototype.setMinResolution = function(minResolution) {
|
||||
BaseLayer.prototype.setMinResolution = function(minResolution) {
|
||||
this.set(LayerProperty.MIN_RESOLUTION, minResolution);
|
||||
};
|
||||
|
||||
@@ -233,7 +233,7 @@ _ol_layer_Base_.prototype.setMinResolution = function(minResolution) {
|
||||
* @observable
|
||||
* @api
|
||||
*/
|
||||
_ol_layer_Base_.prototype.setOpacity = function(opacity) {
|
||||
BaseLayer.prototype.setOpacity = function(opacity) {
|
||||
this.set(LayerProperty.OPACITY, opacity);
|
||||
};
|
||||
|
||||
@@ -244,7 +244,7 @@ _ol_layer_Base_.prototype.setOpacity = function(opacity) {
|
||||
* @observable
|
||||
* @api
|
||||
*/
|
||||
_ol_layer_Base_.prototype.setVisible = function(visible) {
|
||||
BaseLayer.prototype.setVisible = function(visible) {
|
||||
this.set(LayerProperty.VISIBLE, visible);
|
||||
};
|
||||
|
||||
@@ -256,7 +256,7 @@ _ol_layer_Base_.prototype.setVisible = function(visible) {
|
||||
* @observable
|
||||
* @api
|
||||
*/
|
||||
_ol_layer_Base_.prototype.setZIndex = function(zindex) {
|
||||
BaseLayer.prototype.setZIndex = function(zindex) {
|
||||
this.set(LayerProperty.Z_INDEX, zindex);
|
||||
};
|
||||
export default _ol_layer_Base_;
|
||||
export default BaseLayer;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @module ol/layer/Group
|
||||
*/
|
||||
import {getUid, inherits} from '../index.js';
|
||||
import _ol_Collection_ from '../Collection.js';
|
||||
import Collection from '../Collection.js';
|
||||
import CollectionEventType from '../CollectionEventType.js';
|
||||
import BaseObject from '../Object.js';
|
||||
import ObjectEventType from '../ObjectEventType.js';
|
||||
@@ -10,7 +10,7 @@ import {assert} from '../asserts.js';
|
||||
import _ol_events_ from '../events.js';
|
||||
import EventType from '../events/EventType.js';
|
||||
import {getIntersection} from '../extent.js';
|
||||
import _ol_layer_Base_ from '../layer/Base.js';
|
||||
import BaseLayer from '../layer/Base.js';
|
||||
import _ol_obj_ from '../obj.js';
|
||||
import SourceState from '../source/State.js';
|
||||
|
||||
@@ -35,7 +35,7 @@ var Property = {
|
||||
* @param {olx.layer.GroupOptions=} opt_options Layer options.
|
||||
* @api
|
||||
*/
|
||||
var _ol_layer_Group_ = function(opt_options) {
|
||||
var LayerGroup = function(opt_options) {
|
||||
|
||||
var options = opt_options || {};
|
||||
var baseOptions = /** @type {olx.layer.GroupOptions} */
|
||||
@@ -44,7 +44,7 @@ var _ol_layer_Group_ = function(opt_options) {
|
||||
|
||||
var layers = options.layers;
|
||||
|
||||
_ol_layer_Base_.call(this, baseOptions);
|
||||
BaseLayer.call(this, baseOptions);
|
||||
|
||||
/**
|
||||
* @private
|
||||
@@ -64,27 +64,27 @@ var _ol_layer_Group_ = function(opt_options) {
|
||||
|
||||
if (layers) {
|
||||
if (Array.isArray(layers)) {
|
||||
layers = new _ol_Collection_(layers.slice(), {unique: true});
|
||||
layers = new Collection(layers.slice(), {unique: true});
|
||||
} else {
|
||||
assert(layers instanceof _ol_Collection_,
|
||||
assert(layers instanceof Collection,
|
||||
43); // Expected `layers` to be an array or an `ol.Collection`
|
||||
layers = layers;
|
||||
}
|
||||
} else {
|
||||
layers = new _ol_Collection_(undefined, {unique: true});
|
||||
layers = new Collection(undefined, {unique: true});
|
||||
}
|
||||
|
||||
this.setLayers(layers);
|
||||
|
||||
};
|
||||
|
||||
inherits(_ol_layer_Group_, _ol_layer_Base_);
|
||||
inherits(LayerGroup, BaseLayer);
|
||||
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
_ol_layer_Group_.prototype.handleLayerChange_ = function() {
|
||||
LayerGroup.prototype.handleLayerChange_ = function() {
|
||||
this.changed();
|
||||
};
|
||||
|
||||
@@ -93,7 +93,7 @@ _ol_layer_Group_.prototype.handleLayerChange_ = function() {
|
||||
* @param {ol.events.Event} event Event.
|
||||
* @private
|
||||
*/
|
||||
_ol_layer_Group_.prototype.handleLayersChanged_ = function(event) {
|
||||
LayerGroup.prototype.handleLayersChanged_ = function(event) {
|
||||
this.layersListenerKeys_.forEach(_ol_events_.unlistenByKey);
|
||||
this.layersListenerKeys_.length = 0;
|
||||
|
||||
@@ -129,7 +129,7 @@ _ol_layer_Group_.prototype.handleLayersChanged_ = function(event) {
|
||||
* @param {ol.Collection.Event} collectionEvent Collection event.
|
||||
* @private
|
||||
*/
|
||||
_ol_layer_Group_.prototype.handleLayersAdd_ = function(collectionEvent) {
|
||||
LayerGroup.prototype.handleLayersAdd_ = function(collectionEvent) {
|
||||
var layer = /** @type {ol.layer.Base} */ (collectionEvent.element);
|
||||
var key = getUid(layer).toString();
|
||||
this.listenerKeys_[key] = [
|
||||
@@ -146,7 +146,7 @@ _ol_layer_Group_.prototype.handleLayersAdd_ = function(collectionEvent) {
|
||||
* @param {ol.Collection.Event} collectionEvent Collection event.
|
||||
* @private
|
||||
*/
|
||||
_ol_layer_Group_.prototype.handleLayersRemove_ = function(collectionEvent) {
|
||||
LayerGroup.prototype.handleLayersRemove_ = function(collectionEvent) {
|
||||
var layer = /** @type {ol.layer.Base} */ (collectionEvent.element);
|
||||
var key = getUid(layer).toString();
|
||||
this.listenerKeys_[key].forEach(_ol_events_.unlistenByKey);
|
||||
@@ -163,7 +163,7 @@ _ol_layer_Group_.prototype.handleLayersRemove_ = function(collectionEvent) {
|
||||
* @observable
|
||||
* @api
|
||||
*/
|
||||
_ol_layer_Group_.prototype.getLayers = function() {
|
||||
LayerGroup.prototype.getLayers = function() {
|
||||
return (/** @type {!ol.Collection.<ol.layer.Base>} */ this.get(Property.LAYERS));
|
||||
};
|
||||
|
||||
@@ -176,7 +176,7 @@ _ol_layer_Group_.prototype.getLayers = function() {
|
||||
* @observable
|
||||
* @api
|
||||
*/
|
||||
_ol_layer_Group_.prototype.setLayers = function(layers) {
|
||||
LayerGroup.prototype.setLayers = function(layers) {
|
||||
this.set(Property.LAYERS, layers);
|
||||
};
|
||||
|
||||
@@ -184,7 +184,7 @@ _ol_layer_Group_.prototype.setLayers = function(layers) {
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
_ol_layer_Group_.prototype.getLayersArray = function(opt_array) {
|
||||
LayerGroup.prototype.getLayersArray = function(opt_array) {
|
||||
var array = opt_array !== undefined ? opt_array : [];
|
||||
this.getLayers().forEach(function(layer) {
|
||||
layer.getLayersArray(array);
|
||||
@@ -196,7 +196,7 @@ _ol_layer_Group_.prototype.getLayersArray = function(opt_array) {
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
_ol_layer_Group_.prototype.getLayerStatesArray = function(opt_states) {
|
||||
LayerGroup.prototype.getLayerStatesArray = function(opt_states) {
|
||||
var states = opt_states !== undefined ? opt_states : [];
|
||||
|
||||
var pos = states.length;
|
||||
@@ -231,8 +231,8 @@ _ol_layer_Group_.prototype.getLayerStatesArray = function(opt_states) {
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
_ol_layer_Group_.prototype.getSourceState = function() {
|
||||
LayerGroup.prototype.getSourceState = function() {
|
||||
return SourceState.READY;
|
||||
};
|
||||
|
||||
export default _ol_layer_Group_;
|
||||
export default LayerGroup;
|
||||
|
||||
@@ -9,8 +9,8 @@ import VectorLayer from '../layer/Vector.js';
|
||||
import {clamp} from '../math.js';
|
||||
import _ol_obj_ from '../obj.js';
|
||||
import RenderEventType from '../render/EventType.js';
|
||||
import _ol_style_Icon_ from '../style/Icon.js';
|
||||
import _ol_style_Style_ from '../style/Style.js';
|
||||
import Icon from '../style/Icon.js';
|
||||
import Style from '../style/Style.js';
|
||||
|
||||
|
||||
/**
|
||||
@@ -117,8 +117,8 @@ var Heatmap = function(opt_options) {
|
||||
var style = this.styleCache_[index];
|
||||
if (!style) {
|
||||
style = [
|
||||
new _ol_style_Style_({
|
||||
image: new _ol_style_Icon_({
|
||||
new Style({
|
||||
image: new Icon({
|
||||
opacity: opacity,
|
||||
src: this.circleImage_
|
||||
})
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*/
|
||||
import {inherits} from '../index.js';
|
||||
import LayerType from '../LayerType.js';
|
||||
import _ol_layer_Layer_ from '../layer/Layer.js';
|
||||
import Layer from '../layer/Layer.js';
|
||||
|
||||
/**
|
||||
* @classdesc
|
||||
@@ -21,7 +21,7 @@ import _ol_layer_Layer_ from '../layer/Layer.js';
|
||||
*/
|
||||
var ImageLayer = function(opt_options) {
|
||||
var options = opt_options ? opt_options : {};
|
||||
_ol_layer_Layer_.call(this, /** @type {olx.layer.LayerOptions} */ (options));
|
||||
Layer.call(this, /** @type {olx.layer.LayerOptions} */ (options));
|
||||
|
||||
/**
|
||||
* The layer type.
|
||||
@@ -32,7 +32,7 @@ var ImageLayer = function(opt_options) {
|
||||
|
||||
};
|
||||
|
||||
inherits(ImageLayer, _ol_layer_Layer_);
|
||||
inherits(ImageLayer, Layer);
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -5,7 +5,7 @@ import _ol_events_ from '../events.js';
|
||||
import EventType from '../events/EventType.js';
|
||||
import {getUid, inherits} from '../index.js';
|
||||
import BaseObject from '../Object.js';
|
||||
import _ol_layer_Base_ from '../layer/Base.js';
|
||||
import BaseLayer from '../layer/Base.js';
|
||||
import LayerProperty from '../layer/Property.js';
|
||||
import _ol_obj_ from '../obj.js';
|
||||
import RenderEventType from '../render/EventType.js';
|
||||
@@ -33,12 +33,12 @@ import SourceState from '../source/State.js';
|
||||
* @param {olx.layer.LayerOptions} options Layer options.
|
||||
* @api
|
||||
*/
|
||||
var _ol_layer_Layer_ = function(options) {
|
||||
var Layer = function(options) {
|
||||
|
||||
var baseOptions = _ol_obj_.assign({}, options);
|
||||
delete baseOptions.source;
|
||||
|
||||
_ol_layer_Base_.call(this, /** @type {olx.layer.BaseOptions} */ (baseOptions));
|
||||
BaseLayer.call(this, /** @type {olx.layer.BaseOptions} */ (baseOptions));
|
||||
|
||||
/**
|
||||
* @private
|
||||
@@ -70,7 +70,7 @@ var _ol_layer_Layer_ = function(options) {
|
||||
this.setSource(source);
|
||||
};
|
||||
|
||||
inherits(_ol_layer_Layer_, _ol_layer_Base_);
|
||||
inherits(Layer, BaseLayer);
|
||||
|
||||
|
||||
/**
|
||||
@@ -81,7 +81,7 @@ inherits(_ol_layer_Layer_, _ol_layer_Base_);
|
||||
* @param {number} resolution Resolution.
|
||||
* @return {boolean} The layer is visible at the given resolution.
|
||||
*/
|
||||
_ol_layer_Layer_.visibleAtResolution = function(layerState, resolution) {
|
||||
Layer.visibleAtResolution = function(layerState, resolution) {
|
||||
return layerState.visible && resolution >= layerState.minResolution &&
|
||||
resolution < layerState.maxResolution;
|
||||
};
|
||||
@@ -90,7 +90,7 @@ _ol_layer_Layer_.visibleAtResolution = function(layerState, resolution) {
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
_ol_layer_Layer_.prototype.getLayersArray = function(opt_array) {
|
||||
Layer.prototype.getLayersArray = function(opt_array) {
|
||||
var array = opt_array ? opt_array : [];
|
||||
array.push(this);
|
||||
return array;
|
||||
@@ -100,7 +100,7 @@ _ol_layer_Layer_.prototype.getLayersArray = function(opt_array) {
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
_ol_layer_Layer_.prototype.getLayerStatesArray = function(opt_states) {
|
||||
Layer.prototype.getLayerStatesArray = function(opt_states) {
|
||||
var states = opt_states ? opt_states : [];
|
||||
states.push(this.getLayerState());
|
||||
return states;
|
||||
@@ -113,7 +113,7 @@ _ol_layer_Layer_.prototype.getLayerStatesArray = function(opt_states) {
|
||||
* @observable
|
||||
* @api
|
||||
*/
|
||||
_ol_layer_Layer_.prototype.getSource = function() {
|
||||
Layer.prototype.getSource = function() {
|
||||
var source = this.get(LayerProperty.SOURCE);
|
||||
return /** @type {ol.source.Source} */ (source) || null;
|
||||
};
|
||||
@@ -122,7 +122,7 @@ _ol_layer_Layer_.prototype.getSource = function() {
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
_ol_layer_Layer_.prototype.getSourceState = function() {
|
||||
Layer.prototype.getSourceState = function() {
|
||||
var source = this.getSource();
|
||||
return !source ? SourceState.UNDEFINED : source.getState();
|
||||
};
|
||||
@@ -131,7 +131,7 @@ _ol_layer_Layer_.prototype.getSourceState = function() {
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
_ol_layer_Layer_.prototype.handleSourceChange_ = function() {
|
||||
Layer.prototype.handleSourceChange_ = function() {
|
||||
this.changed();
|
||||
};
|
||||
|
||||
@@ -139,7 +139,7 @@ _ol_layer_Layer_.prototype.handleSourceChange_ = function() {
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
_ol_layer_Layer_.prototype.handleSourcePropertyChange_ = function() {
|
||||
Layer.prototype.handleSourcePropertyChange_ = function() {
|
||||
if (this.sourceChangeKey_) {
|
||||
_ol_events_.unlistenByKey(this.sourceChangeKey_);
|
||||
this.sourceChangeKey_ = null;
|
||||
@@ -165,7 +165,7 @@ _ol_layer_Layer_.prototype.handleSourcePropertyChange_ = function() {
|
||||
* @param {ol.PluggableMap} map Map.
|
||||
* @api
|
||||
*/
|
||||
_ol_layer_Layer_.prototype.setMap = function(map) {
|
||||
Layer.prototype.setMap = function(map) {
|
||||
if (this.mapPrecomposeKey_) {
|
||||
_ol_events_.unlistenByKey(this.mapPrecomposeKey_);
|
||||
this.mapPrecomposeKey_ = null;
|
||||
@@ -199,7 +199,7 @@ _ol_layer_Layer_.prototype.setMap = function(map) {
|
||||
* @observable
|
||||
* @api
|
||||
*/
|
||||
_ol_layer_Layer_.prototype.setSource = function(source) {
|
||||
Layer.prototype.setSource = function(source) {
|
||||
this.set(LayerProperty.SOURCE, source);
|
||||
};
|
||||
export default _ol_layer_Layer_;
|
||||
export default Layer;
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*/
|
||||
import {inherits} from '../index.js';
|
||||
import LayerType from '../LayerType.js';
|
||||
import _ol_layer_Layer_ from '../layer/Layer.js';
|
||||
import Layer from '../layer/Layer.js';
|
||||
import _ol_layer_TileProperty_ from '../layer/TileProperty.js';
|
||||
import _ol_obj_ from '../obj.js';
|
||||
|
||||
@@ -28,7 +28,7 @@ var TileLayer = function(opt_options) {
|
||||
|
||||
delete baseOptions.preload;
|
||||
delete baseOptions.useInterimTilesOnError;
|
||||
_ol_layer_Layer_.call(this, /** @type {olx.layer.LayerOptions} */ (baseOptions));
|
||||
Layer.call(this, /** @type {olx.layer.LayerOptions} */ (baseOptions));
|
||||
|
||||
this.setPreload(options.preload !== undefined ? options.preload : 0);
|
||||
this.setUseInterimTilesOnError(options.useInterimTilesOnError !== undefined ?
|
||||
@@ -43,7 +43,7 @@ var TileLayer = function(opt_options) {
|
||||
|
||||
};
|
||||
|
||||
inherits(TileLayer, _ol_layer_Layer_);
|
||||
inherits(TileLayer, Layer);
|
||||
|
||||
|
||||
/**
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user