Merge pull request #7695 from tschaub/rename

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