From 87295a74ddf96e2dc4cb22c71416e8cda2fd7aec Mon Sep 17 00:00:00 2001 From: Tim Schaub Date: Tue, 12 Dec 2017 10:24:58 -0700 Subject: [PATCH] Use named exports from ol/index.js --- doc/tutorials/raster-reprojection.md | 2 +- examples/custom-controls.js | 4 +- examples/custom-interactions.js | 4 +- src/ol/AssertionError.js | 7 +- src/ol/CanvasMap.js | 5 +- src/ol/Collection.js | 7 +- src/ol/DeviceOrientation.js | 4 +- src/ol/Disposable.js | 4 +- src/ol/Feature.js | 4 +- src/ol/Geolocation.js | 4 +- src/ol/Image.js | 4 +- src/ol/ImageBase.js | 4 +- src/ol/ImageCanvas.js | 4 +- src/ol/ImageTile.js | 4 +- src/ol/Map.js | 9 +- src/ol/MapBrowserEvent.js | 4 +- src/ol/MapBrowserEventHandler.js | 4 +- src/ol/MapBrowserPointerEvent.js | 4 +- src/ol/MapEvent.js | 4 +- src/ol/Object.js | 8 +- src/ol/Observable.js | 4 +- src/ol/Overlay.js | 4 +- src/ol/PluggableMap.js | 14 +- src/ol/Tile.js | 4 +- src/ol/TileCache.js | 4 +- src/ol/TileQueue.js | 4 +- src/ol/VectorImageTile.js | 10 +- src/ol/VectorTile.js | 8 +- src/ol/View.js | 16 +- src/ol/control/Attribution.js | 4 +- src/ol/control/Control.js | 8 +- src/ol/control/FullScreen.js | 4 +- src/ol/control/MousePosition.js | 5 +- src/ol/control/OverviewMap.js | 18 +- src/ol/control/Rotate.js | 9 +- src/ol/control/ScaleLine.js | 4 +- src/ol/control/Zoom.js | 4 +- src/ol/control/ZoomSlider.js | 4 +- src/ol/control/ZoomToExtent.js | 4 +- src/ol/events/EventTarget.js | 8 +- src/ol/featureloader.js | 4 +- src/ol/format/EsriJSON.js | 4 +- src/ol/format/GML2.js | 4 +- src/ol/format/GML3.js | 4 +- src/ol/format/GMLBase.js | 4 +- src/ol/format/GPX.js | 4 +- src/ol/format/GeoJSON.js | 4 +- src/ol/format/IGC.js | 4 +- src/ol/format/JSONFeature.js | 4 +- src/ol/format/KML.js | 4 +- src/ol/format/MVT.js | 4 +- src/ol/format/OSMXML.js | 4 +- src/ol/format/OWS.js | 4 +- src/ol/format/Polyline.js | 4 +- src/ol/format/TextFeature.js | 4 +- src/ol/format/TopoJSON.js | 4 +- src/ol/format/WFS.js | 4 +- src/ol/format/WKT.js | 4 +- src/ol/format/WMSCapabilities.js | 4 +- src/ol/format/WMSGetFeatureInfo.js | 4 +- src/ol/format/WMTSCapabilities.js | 4 +- src/ol/format/XMLFeature.js | 4 +- src/ol/format/filter/And.js | 5 +- src/ol/format/filter/Bbox.js | 5 +- src/ol/format/filter/Comparison.js | 5 +- src/ol/format/filter/ComparisonBinary.js | 4 +- src/ol/format/filter/Contains.js | 4 +- src/ol/format/filter/During.js | 4 +- src/ol/format/filter/EqualTo.js | 4 +- src/ol/format/filter/GreaterThan.js | 4 +- src/ol/format/filter/GreaterThanOrEqualTo.js | 4 +- src/ol/format/filter/Intersects.js | 4 +- src/ol/format/filter/IsBetween.js | 4 +- src/ol/format/filter/IsLike.js | 4 +- src/ol/format/filter/IsNull.js | 4 +- src/ol/format/filter/LessThan.js | 4 +- src/ol/format/filter/LessThanOrEqualTo.js | 4 +- src/ol/format/filter/LogicalNary.js | 4 +- src/ol/format/filter/Not.js | 4 +- src/ol/format/filter/NotEqualTo.js | 4 +- src/ol/format/filter/Or.js | 4 +- src/ol/format/filter/Spatial.js | 4 +- src/ol/format/filter/Within.js | 4 +- src/ol/geom/Circle.js | 4 +- src/ol/geom/Geometry.js | 4 +- src/ol/geom/GeometryCollection.js | 4 +- src/ol/geom/LineString.js | 4 +- src/ol/geom/LinearRing.js | 4 +- src/ol/geom/MultiLineString.js | 4 +- src/ol/geom/MultiPoint.js | 4 +- src/ol/geom/MultiPolygon.js | 4 +- src/ol/geom/Point.js | 4 +- src/ol/geom/Polygon.js | 4 +- src/ol/geom/SimpleGeometry.js | 4 +- src/ol/has.js | 41 +--- src/ol/index.js | 205 +++++++++++------- src/ol/interaction/DoubleClickZoom.js | 4 +- src/ol/interaction/DragAndDrop.js | 6 +- src/ol/interaction/DragBox.js | 8 +- src/ol/interaction/DragPan.js | 4 +- src/ol/interaction/DragRotate.js | 4 +- src/ol/interaction/DragRotateAndZoom.js | 4 +- src/ol/interaction/DragZoom.js | 4 +- src/ol/interaction/Draw.js | 6 +- src/ol/interaction/Extent.js | 6 +- src/ol/interaction/Interaction.js | 4 +- src/ol/interaction/KeyboardPan.js | 4 +- src/ol/interaction/KeyboardZoom.js | 4 +- src/ol/interaction/Modify.js | 16 +- src/ol/interaction/MouseWheelZoom.js | 6 +- src/ol/interaction/PinchRotate.js | 4 +- src/ol/interaction/PinchZoom.js | 4 +- src/ol/interaction/Pointer.js | 8 +- src/ol/interaction/Select.js | 12 +- src/ol/interaction/Snap.js | 10 +- src/ol/interaction/Translate.js | 6 +- src/ol/layer/Base.js | 4 +- src/ol/layer/Group.js | 10 +- src/ol/layer/Heatmap.js | 4 +- src/ol/layer/Image.js | 4 +- src/ol/layer/Layer.js | 6 +- src/ol/layer/Tile.js | 4 +- src/ol/layer/Vector.js | 4 +- src/ol/layer/VectorTile.js | 4 +- src/ol/net.js | 4 +- src/ol/pointer/MouseSource.js | 4 +- src/ol/pointer/MsSource.js | 4 +- src/ol/pointer/NativeSource.js | 4 +- src/ol/pointer/PointerEvent.js | 4 +- src/ol/pointer/PointerEventHandler.js | 4 +- src/ol/pointer/TouchSource.js | 4 +- src/ol/proj.js | 8 +- src/ol/proj/EPSG3857.js | 4 +- src/ol/proj/EPSG4326.js | 4 +- src/ol/proj/Projection.js | 4 +- src/ol/render/Box.js | 4 +- src/ol/render/Event.js | 4 +- src/ol/render/Feature.js | 4 +- src/ol/render/canvas/ImageReplay.js | 4 +- src/ol/render/canvas/Immediate.js | 4 +- src/ol/render/canvas/LineStringReplay.js | 4 +- src/ol/render/canvas/PolygonReplay.js | 4 +- src/ol/render/canvas/Replay.js | 8 +- src/ol/render/canvas/ReplayGroup.js | 4 +- src/ol/render/canvas/TextReplay.js | 8 +- src/ol/render/webgl/CircleReplay.js | 8 +- src/ol/render/webgl/ImageReplay.js | 8 +- src/ol/render/webgl/Immediate.js | 4 +- src/ol/render/webgl/LineStringReplay.js | 8 +- src/ol/render/webgl/PolygonReplay.js | 8 +- src/ol/render/webgl/Replay.js | 4 +- src/ol/render/webgl/ReplayGroup.js | 4 +- src/ol/render/webgl/TextReplay.js | 6 +- src/ol/render/webgl/TextureReplay.js | 10 +- .../webgl/circlereplay/defaultshader.js | 6 +- .../circlereplay/defaultshader/Locations.js | 26 +-- .../webgl/linestringreplay/defaultshader.js | 6 +- .../defaultshader/Locations.js | 28 +-- .../webgl/polygonreplay/defaultshader.js | 6 +- .../polygonreplay/defaultshader/Locations.js | 14 +- .../webgl/texturereplay/defaultshader.js | 6 +- .../texturereplay/defaultshader/Locations.js | 22 +- src/ol/renderer/Layer.js | 12 +- src/ol/renderer/Map.js | 12 +- src/ol/renderer/canvas/ImageLayer.js | 6 +- src/ol/renderer/canvas/IntermediateCanvas.js | 6 +- src/ol/renderer/canvas/Layer.js | 4 +- src/ol/renderer/canvas/Map.js | 4 +- src/ol/renderer/canvas/TileLayer.js | 8 +- src/ol/renderer/canvas/VectorLayer.js | 6 +- src/ol/renderer/canvas/VectorTileLayer.js | 6 +- src/ol/renderer/vector.js | 6 +- src/ol/renderer/webgl/ImageLayer.js | 8 +- src/ol/renderer/webgl/Layer.js | 4 +- src/ol/renderer/webgl/Map.js | 8 +- src/ol/renderer/webgl/TileLayer.js | 4 +- src/ol/renderer/webgl/VectorLayer.js | 6 +- src/ol/renderer/webgl/defaultmapshader.js | 6 +- .../webgl/defaultmapshader/Locations.js | 14 +- src/ol/renderer/webgl/tilelayershader.js | 6 +- .../webgl/tilelayershader/Locations.js | 10 +- src/ol/reproj/Image.js | 6 +- src/ol/reproj/Tile.js | 6 +- src/ol/reproj/Triangulation.js | 8 +- src/ol/source/BingMaps.js | 4 +- src/ol/source/CartoDB.js | 4 +- src/ol/source/Cluster.js | 10 +- src/ol/source/Image.js | 8 +- src/ol/source/ImageArcGISRest.js | 4 +- src/ol/source/ImageCanvas.js | 4 +- src/ol/source/ImageMapGuide.js | 4 +- src/ol/source/ImageStatic.js | 4 +- src/ol/source/ImageVector.js | 6 +- src/ol/source/ImageWMS.js | 11 +- src/ol/source/OSM.js | 4 +- src/ol/source/Raster.js | 8 +- src/ol/source/Source.js | 6 +- src/ol/source/Stamen.js | 4 +- src/ol/source/Tile.js | 8 +- src/ol/source/TileArcGISRest.js | 4 +- src/ol/source/TileDebug.js | 6 +- src/ol/source/TileImage.js | 28 +-- src/ol/source/TileJSON.js | 4 +- src/ol/source/TileUTFGrid.js | 6 +- src/ol/source/TileWMS.js | 13 +- src/ol/source/UrlTile.js | 6 +- src/ol/source/Vector.js | 22 +- src/ol/source/VectorTile.js | 4 +- src/ol/source/WMTS.js | 4 +- src/ol/source/XYZ.js | 4 +- src/ol/source/Zoomify.js | 8 +- src/ol/structs/LRUCache.js | 4 +- src/ol/structs/RBush.js | 10 +- src/ol/style/AtlasManager.js | 12 +- src/ol/style/Circle.js | 4 +- src/ol/style/Fill.js | 4 +- src/ol/style/Icon.js | 6 +- src/ol/style/IconImage.js | 4 +- src/ol/style/RegularShape.js | 4 +- src/ol/style/Stroke.js | 4 +- src/ol/tilegrid.js | 18 +- src/ol/tilegrid/TileGrid.js | 4 +- src/ol/tilegrid/WMTS.js | 4 +- src/ol/webgl/Context.js | 14 +- src/ol/webgl/Fragment.js | 4 +- src/ol/webgl/Vertex.js | 4 +- src/ol/webgl/shader.mustache | 6 +- src/ol/webgl/shaderlocations.mustache | 6 +- test/spec/ol/assertionerror.test.js | 4 +- test/spec/ol/color.test.js | 8 - test/spec/ol/index.test.js | 16 +- test/spec/ol/interaction/draganddrop.test.js | 4 +- test/spec/ol/layer/group.test.js | 4 +- test/spec/ol/layer/layer.test.js | 4 +- test/spec/ol/net.test.js | 4 +- .../spec/ol/render/webgl/circlereplay.test.js | 4 +- .../ol/render/webgl/linestringreplay.test.js | 4 +- .../ol/render/webgl/polygonreplay.test.js | 4 +- test/spec/ol/renderer/canvas/map.test.js | 4 +- test/spec/ol/renderer/canvas/replay.test.js | 10 +- .../ol/renderer/canvas/vectorlayer.test.js | 4 +- .../renderer/canvas/vectortilelayer.test.js | 8 +- test/spec/ol/renderer/vector.test.js | 14 +- test/spec/ol/source/tile.test.js | 4 +- test/spec/ol/source/zoomify.test.js | 4 +- test/spec/ol/style/icon.test.js | 4 +- test/spec/ol/style/iconimagecache.test.js | 8 +- test/spec/ol/tile.test.js | 8 +- test/spec/ol/tilegrid/tilegrid.test.js | 14 +- test/spec/ol/view.test.js | 24 -- 250 files changed, 874 insertions(+), 887 deletions(-) diff --git a/doc/tutorials/raster-reprojection.md b/doc/tutorials/raster-reprojection.md index d9830c8469..e771d50d67 100644 --- a/doc/tutorials/raster-reprojection.md +++ b/doc/tutorials/raster-reprojection.md @@ -107,7 +107,7 @@ In case you are creating a custom build of OpenLayers and do not need the reproj See [Custom builds](custom-builds.html#defines) tutorial on how to do this. ### Triangulation precision threshold -The default [triangulation error threshold](#dynamic-triangulation) in pixels is given by `ol.DEFAULT_RASTER_REPROJECTION_ERROR_THRESHOLD` (0.5 pixel). +The default [triangulation error threshold](#dynamic-triangulation) in pixels is given by `DEFAULT_RASTER_REPROJECTION_ERROR_THRESHOLD` (0.5 pixel). In case a different threshold needs to be defined for different sources, the `reprojectionErrorThreshold` option can be passed when constructing the tile image source. ###Limiting visibility of reprojected map by extent diff --git a/examples/custom-controls.js b/examples/custom-controls.js index fdbe5b9120..993c12daa4 100644 --- a/examples/custom-controls.js +++ b/examples/custom-controls.js @@ -1,4 +1,4 @@ -import _ol_ from '../src/ol/index.js'; +import {inherits} from '../src/ol/index.js'; import _ol_Map_ from '../src/ol/Map.js'; import _ol_View_ from '../src/ol/View.js'; import _ol_control_ from '../src/ol/control.js'; @@ -49,7 +49,7 @@ app.RotateNorthControl = function(opt_options) { }); }; -_ol_.inherits(app.RotateNorthControl, _ol_control_Control_); +inherits(app.RotateNorthControl, _ol_control_Control_); // diff --git a/examples/custom-interactions.js b/examples/custom-interactions.js index 89b2e91ade..2a2669e577 100644 --- a/examples/custom-interactions.js +++ b/examples/custom-interactions.js @@ -1,4 +1,4 @@ -import _ol_ from '../src/ol/index.js'; +import {inherits} from '../src/ol/index.js'; import _ol_Feature_ from '../src/ol/Feature.js'; import _ol_Map_ from '../src/ol/Map.js'; import _ol_View_ from '../src/ol/View.js'; @@ -61,7 +61,7 @@ app.Drag = function() { this.previousCursor_ = undefined; }; -_ol_.inherits(app.Drag, _ol_interaction_Pointer_); +inherits(app.Drag, _ol_interaction_Pointer_); /** diff --git a/src/ol/AssertionError.js b/src/ol/AssertionError.js index 8b864b6e81..95418f2112 100644 --- a/src/ol/AssertionError.js +++ b/src/ol/AssertionError.js @@ -1,7 +1,7 @@ /** * @module ol/AssertionError */ -import _ol_ from './index.js'; +import {VERSION, inherits} from './index.js'; /** * Error object thrown when an assertion failed. This is an ECMA-262 Error, @@ -14,7 +14,7 @@ import _ol_ from './index.js'; */ var _ol_AssertionError_ = function(code) { - var path = _ol_.VERSION ? _ol_.VERSION.split('-')[0] : 'latest'; + var path = VERSION ? VERSION.split('-')[0] : 'latest'; /** * @type {string} @@ -36,5 +36,6 @@ var _ol_AssertionError_ = function(code) { }; -_ol_.inherits(_ol_AssertionError_, Error); +inherits(_ol_AssertionError_, Error); + export default _ol_AssertionError_; diff --git a/src/ol/CanvasMap.js b/src/ol/CanvasMap.js index d9cfd425f1..663595b65b 100644 --- a/src/ol/CanvasMap.js +++ b/src/ol/CanvasMap.js @@ -1,7 +1,7 @@ /** * @module ol/CanvasMap */ -import _ol_ from './index.js'; +import {inherits} from './index.js'; import _ol_PluggableMap_ from './PluggableMap.js'; import _ol_PluginType_ from './PluginType.js'; import _ol_control_ from './control.js'; @@ -85,5 +85,6 @@ var _ol_CanvasMap_ = function(options) { _ol_PluggableMap_.call(this, options); }; -_ol_.inherits(_ol_CanvasMap_, _ol_PluggableMap_); +inherits(_ol_CanvasMap_, _ol_PluggableMap_); + export default _ol_CanvasMap_; diff --git a/src/ol/Collection.js b/src/ol/Collection.js index 52a2f7bea8..bca831adc8 100644 --- a/src/ol/Collection.js +++ b/src/ol/Collection.js @@ -6,7 +6,7 @@ * @see https://developers.google.com/maps/documentation/javascript/reference */ -import _ol_ from './index.js'; +import {inherits} from './index.js'; import _ol_AssertionError_ from './AssertionError.js'; import _ol_CollectionEventType_ from './CollectionEventType.js'; import _ol_Object_ from './Object.js'; @@ -56,7 +56,7 @@ var _ol_Collection_ = function(opt_array, opt_options) { }; -_ol_.inherits(_ol_Collection_, _ol_Object_); +inherits(_ol_Collection_, _ol_Object_); /** @@ -302,5 +302,6 @@ _ol_Collection_.Event = function(type, opt_element) { this.element = opt_element; }; -_ol_.inherits(_ol_Collection_.Event, _ol_events_Event_); +inherits(_ol_Collection_.Event, _ol_events_Event_); + export default _ol_Collection_; diff --git a/src/ol/DeviceOrientation.js b/src/ol/DeviceOrientation.js index 71bc027cb8..9f3e9e7eab 100644 --- a/src/ol/DeviceOrientation.js +++ b/src/ol/DeviceOrientation.js @@ -2,7 +2,7 @@ * @module ol/DeviceOrientation */ import _ol_events_ from './events.js'; -import _ol_ from './index.js'; +import {inherits} from './index.js'; import _ol_Object_ from './Object.js'; import _ol_has_ from './has.js'; import _ol_math_ from './math.js'; @@ -84,7 +84,7 @@ var _ol_DeviceOrientation_ = function(opt_options) { }; -_ol_.inherits(_ol_DeviceOrientation_, _ol_Object_); +inherits(_ol_DeviceOrientation_, _ol_Object_); /** diff --git a/src/ol/Disposable.js b/src/ol/Disposable.js index db8315b133..1b39a0125b 100644 --- a/src/ol/Disposable.js +++ b/src/ol/Disposable.js @@ -1,7 +1,7 @@ /** * @module ol/Disposable */ -import _ol_ from './index.js'; +import {nullFunction} from './index.js'; /** * Objects that need to clean up after themselves. @@ -30,5 +30,5 @@ _ol_Disposable_.prototype.dispose = function() { * Extension point for disposable objects. * @protected */ -_ol_Disposable_.prototype.disposeInternal = _ol_.nullFunction; +_ol_Disposable_.prototype.disposeInternal = nullFunction; export default _ol_Disposable_; diff --git a/src/ol/Feature.js b/src/ol/Feature.js index 9947eac82a..a1799bd21a 100644 --- a/src/ol/Feature.js +++ b/src/ol/Feature.js @@ -4,7 +4,7 @@ import _ol_asserts_ from './asserts.js'; import _ol_events_ from './events.js'; import _ol_events_EventType_ from './events/EventType.js'; -import _ol_ from './index.js'; +import {inherits} from './index.js'; import _ol_Object_ from './Object.js'; import _ol_geom_Geometry_ from './geom/Geometry.js'; import _ol_style_Style_ from './style/Style.js'; @@ -107,7 +107,7 @@ var _ol_Feature_ = function(opt_geometryOrProperties) { } }; -_ol_.inherits(_ol_Feature_, _ol_Object_); +inherits(_ol_Feature_, _ol_Object_); /** diff --git a/src/ol/Geolocation.js b/src/ol/Geolocation.js index eec6638af4..96774f3bd3 100644 --- a/src/ol/Geolocation.js +++ b/src/ol/Geolocation.js @@ -3,7 +3,7 @@ */ // FIXME handle geolocation not supported -import _ol_ from './index.js'; +import {inherits} from './index.js'; import _ol_GeolocationProperty_ from './GeolocationProperty.js'; import _ol_Object_ from './Object.js'; import _ol_Sphere_ from './Sphere.js'; @@ -90,7 +90,7 @@ var _ol_Geolocation_ = function(opt_options) { }; -_ol_.inherits(_ol_Geolocation_, _ol_Object_); +inherits(_ol_Geolocation_, _ol_Object_); /** diff --git a/src/ol/Image.js b/src/ol/Image.js index be19a01ba1..ae4c7fce1e 100644 --- a/src/ol/Image.js +++ b/src/ol/Image.js @@ -1,7 +1,7 @@ /** * @module ol/Image */ -import _ol_ from './index.js'; +import {inherits} from './index.js'; import _ol_ImageBase_ from './ImageBase.js'; import _ol_ImageState_ from './ImageState.js'; import _ol_events_ from './events.js'; @@ -57,7 +57,7 @@ var _ol_Image_ = function(extent, resolution, pixelRatio, src, crossOrigin, imag }; -_ol_.inherits(_ol_Image_, _ol_ImageBase_); +inherits(_ol_Image_, _ol_ImageBase_); /** diff --git a/src/ol/ImageBase.js b/src/ol/ImageBase.js index 08469e278d..ff72c64c99 100644 --- a/src/ol/ImageBase.js +++ b/src/ol/ImageBase.js @@ -1,7 +1,7 @@ /** * @module ol/ImageBase */ -import _ol_ from './index.js'; +import {inherits} from './index.js'; import _ol_events_EventTarget_ from './events/EventTarget.js'; import _ol_events_EventType_ from './events/EventType.js'; @@ -44,7 +44,7 @@ var _ol_ImageBase_ = function(extent, resolution, pixelRatio, state) { }; -_ol_.inherits(_ol_ImageBase_, _ol_events_EventTarget_); +inherits(_ol_ImageBase_, _ol_events_EventTarget_); /** diff --git a/src/ol/ImageCanvas.js b/src/ol/ImageCanvas.js index 8598f5d89a..16e3c74119 100644 --- a/src/ol/ImageCanvas.js +++ b/src/ol/ImageCanvas.js @@ -1,7 +1,7 @@ /** * @module ol/ImageCanvas */ -import _ol_ from './index.js'; +import {inherits} from './index.js'; import _ol_ImageBase_ from './ImageBase.js'; import _ol_ImageState_ from './ImageState.js'; @@ -43,7 +43,7 @@ var _ol_ImageCanvas_ = function(extent, resolution, pixelRatio, canvas, opt_load }; -_ol_.inherits(_ol_ImageCanvas_, _ol_ImageBase_); +inherits(_ol_ImageCanvas_, _ol_ImageBase_); /** diff --git a/src/ol/ImageTile.js b/src/ol/ImageTile.js index 6a74473cc0..6c10a2a673 100644 --- a/src/ol/ImageTile.js +++ b/src/ol/ImageTile.js @@ -1,7 +1,7 @@ /** * @module ol/ImageTile */ -import _ol_ from './index.js'; +import {inherits} from './index.js'; import _ol_Tile_ from './Tile.js'; import _ol_TileState_ from './TileState.js'; import _ol_dom_ from './dom.js'; @@ -59,7 +59,7 @@ var _ol_ImageTile_ = function(tileCoord, state, src, crossOrigin, tileLoadFuncti }; -_ol_.inherits(_ol_ImageTile_, _ol_Tile_); +inherits(_ol_ImageTile_, _ol_Tile_); /** diff --git a/src/ol/Map.js b/src/ol/Map.js index 80b7289e11..5987b2f158 100644 --- a/src/ol/Map.js +++ b/src/ol/Map.js @@ -1,7 +1,7 @@ /** * @module ol/Map */ -import _ol_ from './index.js'; +import {ENABLE_CANVAS, ENABLE_WEBGL, inherits} from './index.js'; import _ol_PluggableMap_ from './PluggableMap.js'; import _ol_PluginType_ from './PluginType.js'; import _ol_control_ from './control.js'; @@ -19,7 +19,7 @@ import _ol_renderer_webgl_TileLayer_ from './renderer/webgl/TileLayer.js'; import _ol_renderer_webgl_VectorLayer_ from './renderer/webgl/VectorLayer.js'; -if (_ol_.ENABLE_CANVAS) { +if (ENABLE_CANVAS) { _ol_plugins_.register(_ol_PluginType_.MAP_RENDERER, _ol_renderer_canvas_Map_); _ol_plugins_.registerMultiple(_ol_PluginType_.LAYER_RENDERER, [ _ol_renderer_canvas_ImageLayer_, @@ -29,7 +29,7 @@ if (_ol_.ENABLE_CANVAS) { ]); } -if (_ol_.ENABLE_WEBGL) { +if (ENABLE_WEBGL) { _ol_plugins_.register(_ol_PluginType_.MAP_RENDERER, _ol_renderer_webgl_Map_); _ol_plugins_.registerMultiple(_ol_PluginType_.LAYER_RENDERER, [ _ol_renderer_webgl_ImageLayer_, @@ -99,5 +99,6 @@ var _ol_Map_ = function(options) { _ol_PluggableMap_.call(this, options); }; -_ol_.inherits(_ol_Map_, _ol_PluggableMap_); +inherits(_ol_Map_, _ol_PluggableMap_); + export default _ol_Map_; diff --git a/src/ol/MapBrowserEvent.js b/src/ol/MapBrowserEvent.js index 8eb0534e91..6d43d13584 100644 --- a/src/ol/MapBrowserEvent.js +++ b/src/ol/MapBrowserEvent.js @@ -1,7 +1,7 @@ /** * @module ol/MapBrowserEvent */ -import _ol_ from './index.js'; +import {inherits} from './index.js'; import _ol_MapEvent_ from './MapEvent.js'; /** @@ -56,7 +56,7 @@ var _ol_MapBrowserEvent_ = function(type, map, browserEvent, opt_dragging, }; -_ol_.inherits(_ol_MapBrowserEvent_, _ol_MapEvent_); +inherits(_ol_MapBrowserEvent_, _ol_MapEvent_); /** diff --git a/src/ol/MapBrowserEventHandler.js b/src/ol/MapBrowserEventHandler.js index 850f96e038..28e35e6fa0 100644 --- a/src/ol/MapBrowserEventHandler.js +++ b/src/ol/MapBrowserEventHandler.js @@ -1,7 +1,7 @@ /** * @module ol/MapBrowserEventHandler */ -import _ol_ from './index.js'; +import {inherits} from './index.js'; import _ol_has_ from './has.js'; import _ol_MapBrowserEventType_ from './MapBrowserEventType.js'; import _ol_MapBrowserPointerEvent_ from './MapBrowserPointerEvent.js'; @@ -110,7 +110,7 @@ var _ol_MapBrowserEventHandler_ = function(map, moveTolerance) { }; -_ol_.inherits(_ol_MapBrowserEventHandler_, _ol_events_EventTarget_); +inherits(_ol_MapBrowserEventHandler_, _ol_events_EventTarget_); /** diff --git a/src/ol/MapBrowserPointerEvent.js b/src/ol/MapBrowserPointerEvent.js index 93c6ff026c..e79bf013b9 100644 --- a/src/ol/MapBrowserPointerEvent.js +++ b/src/ol/MapBrowserPointerEvent.js @@ -1,7 +1,7 @@ /** * @module ol/MapBrowserPointerEvent */ -import _ol_ from './index.js'; +import {inherits} from './index.js'; import _ol_MapBrowserEvent_ from './MapBrowserEvent.js'; /** @@ -27,5 +27,5 @@ var _ol_MapBrowserPointerEvent_ = function(type, map, pointerEvent, opt_dragging }; -_ol_.inherits(_ol_MapBrowserPointerEvent_, _ol_MapBrowserEvent_); +inherits(_ol_MapBrowserPointerEvent_, _ol_MapBrowserEvent_); export default _ol_MapBrowserPointerEvent_; diff --git a/src/ol/MapEvent.js b/src/ol/MapEvent.js index e808d5eee0..e2166d2333 100644 --- a/src/ol/MapEvent.js +++ b/src/ol/MapEvent.js @@ -1,7 +1,7 @@ /** * @module ol/MapEvent */ -import _ol_ from './index.js'; +import {inherits} from './index.js'; import _ol_events_Event_ from './events/Event.js'; /** @@ -36,5 +36,5 @@ var _ol_MapEvent_ = function(type, map, opt_frameState) { }; -_ol_.inherits(_ol_MapEvent_, _ol_events_Event_); +inherits(_ol_MapEvent_, _ol_events_Event_); export default _ol_MapEvent_; diff --git a/src/ol/Object.js b/src/ol/Object.js index 559507acfc..308decde28 100644 --- a/src/ol/Object.js +++ b/src/ol/Object.js @@ -1,7 +1,7 @@ /** * @module ol/Object */ -import _ol_ from './index.js'; +import {getUid, inherits} from './index.js'; import _ol_ObjectEventType_ from './ObjectEventType.js'; import _ol_Observable_ from './Observable.js'; import _ol_events_Event_ from './events/Event.js'; @@ -59,7 +59,7 @@ var _ol_Object_ = function(opt_values) { // the order in which they were created. This also helps to ensure that // object properties are always added in the same order, which helps many // JavaScript engines generate faster code. - _ol_.getUid(this); + getUid(this); /** * @private @@ -72,7 +72,7 @@ var _ol_Object_ = function(opt_values) { } }; -_ol_.inherits(_ol_Object_, _ol_Observable_); +inherits(_ol_Object_, _ol_Observable_); /** @@ -223,5 +223,5 @@ _ol_Object_.Event = function(type, key, oldValue) { this.oldValue = oldValue; }; -_ol_.inherits(_ol_Object_.Event, _ol_events_Event_); +inherits(_ol_Object_.Event, _ol_events_Event_); export default _ol_Object_; diff --git a/src/ol/Observable.js b/src/ol/Observable.js index dbf396ac7a..a0da0a3f1c 100644 --- a/src/ol/Observable.js +++ b/src/ol/Observable.js @@ -1,7 +1,7 @@ /** * @module ol/Observable */ -import _ol_ from './index.js'; +import {inherits} from './index.js'; import _ol_events_ from './events.js'; import _ol_events_EventTarget_ from './events/EventTarget.js'; import _ol_events_EventType_ from './events/EventType.js'; @@ -32,7 +32,7 @@ var _ol_Observable_ = function() { }; -_ol_.inherits(_ol_Observable_, _ol_events_EventTarget_); +inherits(_ol_Observable_, _ol_events_EventTarget_); /** diff --git a/src/ol/Overlay.js b/src/ol/Overlay.js index dd775ec240..ffc10b58c7 100644 --- a/src/ol/Overlay.js +++ b/src/ol/Overlay.js @@ -1,7 +1,7 @@ /** * @module ol/Overlay */ -import _ol_ from './index.js'; +import {inherits} from './index.js'; import _ol_MapEventType_ from './MapEventType.js'; import _ol_Object_ from './Object.js'; import _ol_OverlayPositioning_ from './OverlayPositioning.js'; @@ -147,7 +147,7 @@ var _ol_Overlay_ = function(options) { }; -_ol_.inherits(_ol_Overlay_, _ol_Object_); +inherits(_ol_Overlay_, _ol_Object_); /** diff --git a/src/ol/PluggableMap.js b/src/ol/PluggableMap.js index 1e4f5eaa06..c72de4f313 100644 --- a/src/ol/PluggableMap.js +++ b/src/ol/PluggableMap.js @@ -1,7 +1,7 @@ /** * @module ol/PluggableMap */ -import _ol_ from './index.js'; +import {getUid, inherits} from './index.js'; import _ol_Collection_ from './Collection.js'; import _ol_CollectionEventType_ from './CollectionEventType.js'; import _ol_MapBrowserEvent_ from './MapBrowserEvent.js'; @@ -363,7 +363,7 @@ var _ol_PluggableMap_ = function(options) { }; -_ol_.inherits(_ol_PluggableMap_, _ol_Object_); +inherits(_ol_PluggableMap_, _ol_Object_); /** @@ -1010,7 +1010,7 @@ _ol_PluggableMap_.prototype.handleViewChanged_ = function() { } var view = this.getView(); if (view) { - this.viewport_.setAttribute('data-view', _ol_.getUid(view)); + this.viewport_.setAttribute('data-view', getUid(view)); this.viewPropertyListenerKey_ = _ol_events_.listen( view, _ol_ObjectEventType_.PROPERTYCHANGE, this.handleViewPropertyChanged_, this); @@ -1144,7 +1144,7 @@ _ol_PluggableMap_.prototype.renderFrame_ = function(time) { var layerStatesArray = this.getLayerGroup().getLayerStatesArray(); var layerStates = {}; for (i = 0, ii = layerStatesArray.length; i < ii; ++i) { - layerStates[_ol_.getUid(layerStatesArray[i].layer)] = layerStatesArray[i]; + layerStates[getUid(layerStatesArray[i].layer)] = layerStatesArray[i]; } viewState = view.getState(); var center = viewState.center; @@ -1270,7 +1270,7 @@ _ol_PluggableMap_.prototype.setView = function(view) { * @param {ol.Feature} feature Feature. */ _ol_PluggableMap_.prototype.skipFeature = function(feature) { - var featureUid = _ol_.getUid(feature).toString(); + var featureUid = getUid(feature).toString(); this.skippedFeatureUids_[featureUid] = true; this.render(); }; @@ -1308,7 +1308,7 @@ _ol_PluggableMap_.prototype.updateSize = function() { * @param {ol.Feature} feature Feature. */ _ol_PluggableMap_.prototype.unskipFeature = function(feature) { - var featureUid = _ol_.getUid(feature).toString(); + var featureUid = getUid(feature).toString(); delete this.skippedFeatureUids_[featureUid]; this.render(); }; @@ -1382,7 +1382,7 @@ _ol_PluggableMap_.createOptionsInternal = function(options) { if (typeof logo === 'string') { logos[logo] = ''; } else if (logo instanceof HTMLElement) { - logos[_ol_.getUid(logo).toString()] = logo; + logos[getUid(logo).toString()] = logo; } else if (logo) { _ol_asserts_.assert(typeof logo.href == 'string', 44); // `logo.href` should be a string. _ol_asserts_.assert(typeof logo.src == 'string', 45); // `logo.src` should be a string. diff --git a/src/ol/Tile.js b/src/ol/Tile.js index 095ded43d0..cf659b72fc 100644 --- a/src/ol/Tile.js +++ b/src/ol/Tile.js @@ -1,7 +1,7 @@ /** * @module ol/Tile */ -import _ol_ from './index.js'; +import {inherits} from './index.js'; import _ol_TileState_ from './TileState.js'; import _ol_easing_ from './easing.js'; import _ol_events_EventTarget_ from './events/EventTarget.js'; @@ -66,7 +66,7 @@ var _ol_Tile_ = function(tileCoord, state, opt_options) { }; -_ol_.inherits(_ol_Tile_, _ol_events_EventTarget_); +inherits(_ol_Tile_, _ol_events_EventTarget_); /** diff --git a/src/ol/TileCache.js b/src/ol/TileCache.js index 553b04f00e..e65f988a11 100644 --- a/src/ol/TileCache.js +++ b/src/ol/TileCache.js @@ -1,7 +1,7 @@ /** * @module ol/TileCache */ -import _ol_ from './index.js'; +import {inherits} from './index.js'; import _ol_structs_LRUCache_ from './structs/LRUCache.js'; import _ol_tilecoord_ from './tilecoord.js'; @@ -17,7 +17,7 @@ var _ol_TileCache_ = function(opt_highWaterMark) { }; -_ol_.inherits(_ol_TileCache_, _ol_structs_LRUCache_); +inherits(_ol_TileCache_, _ol_structs_LRUCache_); /** diff --git a/src/ol/TileQueue.js b/src/ol/TileQueue.js index 288738d776..e4c3b6b7b4 100644 --- a/src/ol/TileQueue.js +++ b/src/ol/TileQueue.js @@ -1,7 +1,7 @@ /** * @module ol/TileQueue */ -import _ol_ from './index.js'; +import {inherits} from './index.js'; import _ol_TileState_ from './TileState.js'; import _ol_events_ from './events.js'; import _ol_events_EventType_ from './events/EventType.js'; @@ -55,7 +55,7 @@ var _ol_TileQueue_ = function(tilePriorityFunction, tileChangeCallback) { }; -_ol_.inherits(_ol_TileQueue_, _ol_structs_PriorityQueue_); +inherits(_ol_TileQueue_, _ol_structs_PriorityQueue_); /** diff --git a/src/ol/VectorImageTile.js b/src/ol/VectorImageTile.js index 4a6266c018..7c9f42c355 100644 --- a/src/ol/VectorImageTile.js +++ b/src/ol/VectorImageTile.js @@ -1,7 +1,7 @@ /** * @module ol/VectorImageTile */ -import _ol_ from './index.js'; +import {getUid, inherits} from './index.js'; import _ol_Tile_ from './Tile.js'; import _ol_TileState_ from './TileState.js'; import _ol_dom_ from './dom.js'; @@ -121,7 +121,7 @@ var _ol_VectorImageTile_ = function(tileCoord, state, sourceRevision, format, }; -_ol_.inherits(_ol_VectorImageTile_, _ol_Tile_); +inherits(_ol_VectorImageTile_, _ol_Tile_); /** @@ -157,7 +157,7 @@ _ol_VectorImageTile_.prototype.disposeInternal = function() { * @return {CanvasRenderingContext2D} The rendering context. */ _ol_VectorImageTile_.prototype.getContext = function(layer) { - var key = _ol_.getUid(layer).toString(); + var key = getUid(layer).toString(); if (!(key in this.context_)) { this.context_[key] = _ol_dom_.createCanvasContext2D(); } @@ -181,7 +181,7 @@ _ol_VectorImageTile_.prototype.getImage = function(layer) { * @return {ol.TileReplayState} The replay state. */ _ol_VectorImageTile_.prototype.getReplayState = function(layer) { - var key = _ol_.getUid(layer).toString(); + var key = getUid(layer).toString(); if (!(key in this.replayState_)) { this.replayState_[key] = { dirty: false, @@ -237,7 +237,7 @@ _ol_VectorImageTile_.prototype.load = function() { var state = sourceTile.getState(); if (state == _ol_TileState_.LOADED || state == _ol_TileState_.ERROR) { - var uid = _ol_.getUid(sourceTile); + var uid = getUid(sourceTile); if (state == _ol_TileState_.ERROR) { errorSourceTiles[uid] = true; } else { diff --git a/src/ol/VectorTile.js b/src/ol/VectorTile.js index 4de2c1803e..8f5753cd6e 100644 --- a/src/ol/VectorTile.js +++ b/src/ol/VectorTile.js @@ -1,7 +1,7 @@ /** * @module ol/VectorTile */ -import _ol_ from './index.js'; +import {getUid, inherits} from './index.js'; import _ol_Tile_ from './Tile.js'; import _ol_TileState_ from './TileState.js'; @@ -75,7 +75,7 @@ var _ol_VectorTile_ = function(tileCoord, state, src, format, tileLoadFunction, }; -_ol_.inherits(_ol_VectorTile_, _ol_Tile_); +inherits(_ol_VectorTile_, _ol_Tile_); /** @@ -146,7 +146,7 @@ _ol_VectorTile_.prototype.getProjection = function() { * @return {ol.render.ReplayGroup} Replay group. */ _ol_VectorTile_.prototype.getReplayGroup = function(layer, key) { - return this.replayGroups_[_ol_.getUid(layer) + ',' + key]; + return this.replayGroups_[getUid(layer) + ',' + key]; }; @@ -230,7 +230,7 @@ _ol_VectorTile_.prototype.setProjection = function(projection) { * @param {ol.render.ReplayGroup} replayGroup Replay group. */ _ol_VectorTile_.prototype.setReplayGroup = function(layer, key, replayGroup) { - this.replayGroups_[_ol_.getUid(layer) + ',' + key] = replayGroup; + this.replayGroups_[getUid(layer) + ',' + key] = replayGroup; }; diff --git a/src/ol/View.js b/src/ol/View.js index 33b9471ace..88212a3699 100644 --- a/src/ol/View.js +++ b/src/ol/View.js @@ -1,7 +1,7 @@ /** * @module ol/View */ -import _ol_ from './index.js'; +import {DEFAULT_MIN_ZOOM, DEFAULT_TILE_SIZE, inherits, getUid, nullFunction} from './index.js'; import _ol_CenterConstraint_ from './CenterConstraint.js'; import _ol_Object_ from './Object.js'; import _ol_ResolutionConstraint_ from './ResolutionConstraint.js'; @@ -113,7 +113,7 @@ var _ol_View_ = function(opt_options) { this.applyOptions_(options); }; -_ol_.inherits(_ol_View_, _ol_Object_); +inherits(_ol_View_, _ol_Object_); /** @@ -500,7 +500,7 @@ _ol_View_.prototype.calculateCenterZoom = function(resolution, anchor) { */ _ol_View_.prototype.getSizeFromViewport_ = function() { var size = [100, 100]; - var selector = '.ol-viewport[data-view="' + _ol_.getUid(this) + '"]'; + var selector = '.ol-viewport[data-view="' + getUid(this) + '"]'; var element = document.querySelector(selector); if (element) { var metrics = getComputedStyle(element); @@ -942,7 +942,7 @@ _ol_View_.prototype.fit = function(geometryOrExtent, opt_options) { var centerX = centerRotX * cosAngle - centerRotY * sinAngle; var centerY = centerRotY * cosAngle + centerRotX * sinAngle; var center = [centerX, centerY]; - var callback = options.callback ? options.callback : _ol_.nullFunction; + var callback = options.callback ? options.callback : nullFunction; if (options.duration !== undefined) { this.animate({ @@ -1104,7 +1104,7 @@ _ol_View_.createResolutionConstraint_ = function(options) { var defaultZoomFactor = 2; var minZoom = options.minZoom !== undefined ? - options.minZoom : _ol_.DEFAULT_MIN_ZOOM; + options.minZoom : DEFAULT_MIN_ZOOM; var maxZoom = options.maxZoom !== undefined ? options.maxZoom : defaultMaxZoom; @@ -1129,11 +1129,11 @@ _ol_View_.createResolutionConstraint_ = function(options) { projection.getMetersPerUnit() : Math.max(_ol_extent_.getWidth(extent), _ol_extent_.getHeight(extent)); - var defaultMaxResolution = size / _ol_.DEFAULT_TILE_SIZE / Math.pow( - defaultZoomFactor, _ol_.DEFAULT_MIN_ZOOM); + var defaultMaxResolution = size / DEFAULT_TILE_SIZE / Math.pow( + defaultZoomFactor, DEFAULT_MIN_ZOOM); var defaultMinResolution = defaultMaxResolution / Math.pow( - defaultZoomFactor, defaultMaxZoom - _ol_.DEFAULT_MIN_ZOOM); + defaultZoomFactor, defaultMaxZoom - DEFAULT_MIN_ZOOM); // user provided maxResolution takes precedence maxResolution = options.maxResolution; diff --git a/src/ol/control/Attribution.js b/src/ol/control/Attribution.js index b6824c9fe2..d18ba642a2 100644 --- a/src/ol/control/Attribution.js +++ b/src/ol/control/Attribution.js @@ -3,7 +3,7 @@ */ // FIXME handle date line wrap -import _ol_ from '../index.js'; +import {inherits} from '../index.js'; import _ol_array_ from '../array.js'; import _ol_control_Control_ from '../control/Control.js'; import _ol_css_ from '../css.js'; @@ -139,7 +139,7 @@ var _ol_control_Attribution_ = function(opt_options) { }; -_ol_.inherits(_ol_control_Attribution_, _ol_control_Control_); +inherits(_ol_control_Attribution_, _ol_control_Control_); /** diff --git a/src/ol/control/Control.js b/src/ol/control/Control.js index c8085a30e1..c640863e6c 100644 --- a/src/ol/control/Control.js +++ b/src/ol/control/Control.js @@ -1,7 +1,7 @@ /** * @module ol/control/Control */ -import _ol_ from '../index.js'; +import {inherits, nullFunction} from '../index.js'; import _ol_MapEventType_ from '../MapEventType.js'; import _ol_Object_ from '../Object.js'; import _ol_dom_ from '../dom.js'; @@ -67,7 +67,7 @@ var _ol_control_Control_ = function(options) { /** * @type {function(ol.MapEvent)} */ - this.render = options.render ? options.render : _ol_.nullFunction; + this.render = options.render ? options.render : nullFunction; if (options.target) { this.setTarget(options.target); @@ -75,7 +75,7 @@ var _ol_control_Control_ = function(options) { }; -_ol_.inherits(_ol_control_Control_, _ol_Object_); +inherits(_ol_control_Control_, _ol_Object_); /** @@ -118,7 +118,7 @@ _ol_control_Control_.prototype.setMap = function(map) { var target = this.target_ ? this.target_ : map.getOverlayContainerStopEvent(); target.appendChild(this.element); - if (this.render !== _ol_.nullFunction) { + if (this.render !== nullFunction) { this.listenerKeys.push(_ol_events_.listen(map, _ol_MapEventType_.POSTRENDER, this.render, this)); } diff --git a/src/ol/control/FullScreen.js b/src/ol/control/FullScreen.js index ad0a8caa06..fd731c9315 100644 --- a/src/ol/control/FullScreen.js +++ b/src/ol/control/FullScreen.js @@ -1,7 +1,7 @@ /** * @module ol/control/FullScreen */ -import _ol_ from '../index.js'; +import {inherits} from '../index.js'; import _ol_control_Control_ from '../control/Control.js'; import _ol_css_ from '../css.js'; import _ol_dom_ from '../dom.js'; @@ -90,7 +90,7 @@ var _ol_control_FullScreen_ = function(opt_options) { }; -_ol_.inherits(_ol_control_FullScreen_, _ol_control_Control_); +inherits(_ol_control_FullScreen_, _ol_control_Control_); /** diff --git a/src/ol/control/MousePosition.js b/src/ol/control/MousePosition.js index 4535ac7f1e..689de76455 100644 --- a/src/ol/control/MousePosition.js +++ b/src/ol/control/MousePosition.js @@ -1,9 +1,8 @@ /** * @module ol/control/MousePosition */ -// FIXME should listen on appropriate pane, once it is defined -import _ol_ from '../index.js'; +import {inherits} from '../index.js'; import _ol_events_ from '../events.js'; import _ol_events_EventType_ from '../events/EventType.js'; import _ol_Object_ from '../Object.js'; @@ -82,7 +81,7 @@ var _ol_control_MousePosition_ = function(opt_options) { }; -_ol_.inherits(_ol_control_MousePosition_, _ol_control_Control_); +inherits(_ol_control_MousePosition_, _ol_control_Control_); /** diff --git a/src/ol/control/OverviewMap.js b/src/ol/control/OverviewMap.js index 7612e400f9..0fc75f9325 100644 --- a/src/ol/control/OverviewMap.js +++ b/src/ol/control/OverviewMap.js @@ -1,7 +1,7 @@ /** * @module ol/control/OverviewMap */ -import _ol_ from '../index.js'; +import {OVERVIEWMAP_MAX_RATIO, OVERVIEWMAP_MIN_RATIO, inherits} from '../index.js'; import _ol_Collection_ from '../Collection.js'; import _ol_PluggableMap_ from '../PluggableMap.js'; import _ol_MapEventType_ from '../MapEventType.js'; @@ -188,7 +188,7 @@ var _ol_control_OverviewMap_ = function(opt_options) { }); }; -_ol_.inherits(_ol_control_OverviewMap_, _ol_control_Control_); +inherits(_ol_control_OverviewMap_, _ol_control_Control_); /** @@ -336,10 +336,10 @@ _ol_control_OverviewMap_.prototype.validateExtent_ = function() { var ovmapWidth = ovmapSize[0]; var ovmapHeight = ovmapSize[1]; - if (boxWidth < ovmapWidth * _ol_.OVERVIEWMAP_MIN_RATIO || - boxHeight < ovmapHeight * _ol_.OVERVIEWMAP_MIN_RATIO || - boxWidth > ovmapWidth * _ol_.OVERVIEWMAP_MAX_RATIO || - boxHeight > ovmapHeight * _ol_.OVERVIEWMAP_MAX_RATIO) { + if (boxWidth < ovmapWidth * OVERVIEWMAP_MIN_RATIO || + boxHeight < ovmapHeight * OVERVIEWMAP_MIN_RATIO || + boxWidth > ovmapWidth * OVERVIEWMAP_MAX_RATIO || + boxHeight > ovmapHeight * OVERVIEWMAP_MAX_RATIO) { this.resetExtent_(); } else if (!_ol_extent_.containsExtent(ovextent, extent)) { this.recenter_(); @@ -353,7 +353,7 @@ _ol_control_OverviewMap_.prototype.validateExtent_ = function() { * @private */ _ol_control_OverviewMap_.prototype.resetExtent_ = function() { - if (_ol_.OVERVIEWMAP_MAX_RATIO === 0 || _ol_.OVERVIEWMAP_MIN_RATIO === 0) { + if (OVERVIEWMAP_MAX_RATIO === 0 || OVERVIEWMAP_MIN_RATIO === 0) { return; } @@ -371,8 +371,8 @@ _ol_control_OverviewMap_.prototype.resetExtent_ = function() { // box sizes using the min and max ratio, pick the step in the middle used // to calculate the extent from the main map to set it to the overview map, var steps = Math.log( - _ol_.OVERVIEWMAP_MAX_RATIO / _ol_.OVERVIEWMAP_MIN_RATIO) / Math.LN2; - var ratio = 1 / (Math.pow(2, steps / 2) * _ol_.OVERVIEWMAP_MIN_RATIO); + OVERVIEWMAP_MAX_RATIO / OVERVIEWMAP_MIN_RATIO) / Math.LN2; + var ratio = 1 / (Math.pow(2, steps / 2) * OVERVIEWMAP_MIN_RATIO); _ol_extent_.scaleFromCenter(extent, ratio); ovview.fit(extent); }; diff --git a/src/ol/control/Rotate.js b/src/ol/control/Rotate.js index ce66901566..43f7f70582 100644 --- a/src/ol/control/Rotate.js +++ b/src/ol/control/Rotate.js @@ -1,12 +1,13 @@ /** * @module ol/control/Rotate */ -import _ol_events_ from '../events.js'; -import _ol_events_EventType_ from '../events/EventType.js'; -import _ol_ from '../index.js'; + import _ol_control_Control_ from '../control/Control.js'; import _ol_css_ from '../css.js'; import _ol_easing_ from '../easing.js'; +import _ol_events_ from '../events.js'; +import _ol_events_EventType_ from '../events/EventType.js'; +import {inherits} from '../index.js'; /** * @classdesc @@ -93,7 +94,7 @@ var _ol_control_Rotate_ = function(opt_options) { }; -_ol_.inherits(_ol_control_Rotate_, _ol_control_Control_); +inherits(_ol_control_Rotate_, _ol_control_Control_); /** diff --git a/src/ol/control/ScaleLine.js b/src/ol/control/ScaleLine.js index 21dd4f77a6..d88f2c9c3c 100644 --- a/src/ol/control/ScaleLine.js +++ b/src/ol/control/ScaleLine.js @@ -1,7 +1,7 @@ /** * @module ol/control/ScaleLine */ -import _ol_ from '../index.js'; +import {inherits} from '../index.js'; import _ol_Object_ from '../Object.js'; import _ol_asserts_ from '../asserts.js'; import _ol_control_Control_ from '../control/Control.js'; @@ -94,7 +94,7 @@ var _ol_control_ScaleLine_ = function(opt_options) { }; -_ol_.inherits(_ol_control_ScaleLine_, _ol_control_Control_); +inherits(_ol_control_ScaleLine_, _ol_control_Control_); /** diff --git a/src/ol/control/Zoom.js b/src/ol/control/Zoom.js index 6b0e48093c..1ede3bd3e4 100644 --- a/src/ol/control/Zoom.js +++ b/src/ol/control/Zoom.js @@ -1,7 +1,7 @@ /** * @module ol/control/Zoom */ -import _ol_ from '../index.js'; +import {inherits} from '../index.js'; import _ol_events_ from '../events.js'; import _ol_events_EventType_ from '../events/EventType.js'; import _ol_control_Control_ from '../control/Control.js'; @@ -77,7 +77,7 @@ var _ol_control_Zoom_ = function(opt_options) { }; -_ol_.inherits(_ol_control_Zoom_, _ol_control_Control_); +inherits(_ol_control_Zoom_, _ol_control_Control_); /** diff --git a/src/ol/control/ZoomSlider.js b/src/ol/control/ZoomSlider.js index b68377cb8f..f8714dbc33 100644 --- a/src/ol/control/ZoomSlider.js +++ b/src/ol/control/ZoomSlider.js @@ -3,7 +3,7 @@ */ // FIXME should possibly show tooltip when dragging? -import _ol_ from '../index.js'; +import {inherits} from '../index.js'; import _ol_ViewHint_ from '../ViewHint.js'; import _ol_control_Control_ from '../control/Control.js'; import _ol_css_ from '../css.js'; @@ -133,7 +133,7 @@ var _ol_control_ZoomSlider_ = function(opt_options) { }); }; -_ol_.inherits(_ol_control_ZoomSlider_, _ol_control_Control_); +inherits(_ol_control_ZoomSlider_, _ol_control_Control_); /** diff --git a/src/ol/control/ZoomToExtent.js b/src/ol/control/ZoomToExtent.js index 172e9103eb..b420ac2374 100644 --- a/src/ol/control/ZoomToExtent.js +++ b/src/ol/control/ZoomToExtent.js @@ -1,7 +1,7 @@ /** * @module ol/control/ZoomToExtent */ -import _ol_ from '../index.js'; +import {inherits} from '../index.js'; import _ol_events_ from '../events.js'; import _ol_events_EventType_ from '../events/EventType.js'; import _ol_control_Control_ from '../control/Control.js'; @@ -54,7 +54,7 @@ var _ol_control_ZoomToExtent_ = function(opt_options) { }); }; -_ol_.inherits(_ol_control_ZoomToExtent_, _ol_control_Control_); +inherits(_ol_control_ZoomToExtent_, _ol_control_Control_); /** diff --git a/src/ol/events/EventTarget.js b/src/ol/events/EventTarget.js index 3b5b2cafdc..fe57136e0c 100644 --- a/src/ol/events/EventTarget.js +++ b/src/ol/events/EventTarget.js @@ -1,7 +1,7 @@ /** * @module ol/events/EventTarget */ -import _ol_ from '../index.js'; +import {inherits, nullFunction} from '../index.js'; import _ol_Disposable_ from '../Disposable.js'; import _ol_events_ from '../events.js'; import _ol_events_Event_ from '../events/Event.js'; @@ -48,7 +48,7 @@ var _ol_events_EventTarget_ = function() { }; -_ol_.inherits(_ol_events_EventTarget_, _ol_Disposable_); +inherits(_ol_events_EventTarget_, _ol_Disposable_); /** @@ -96,7 +96,7 @@ _ol_events_EventTarget_.prototype.dispatchEvent = function(event) { var pendingRemovals = this.pendingRemovals_[type]; delete this.pendingRemovals_[type]; while (pendingRemovals--) { - this.removeEventListener(type, _ol_.nullFunction); + this.removeEventListener(type, nullFunction); } delete this.dispatching_[type]; } @@ -147,7 +147,7 @@ _ol_events_EventTarget_.prototype.removeEventListener = function(type, listener) var index = listeners.indexOf(listener); if (type in this.pendingRemovals_) { // make listener a no-op, and remove later in #dispatchEvent() - listeners[index] = _ol_.nullFunction; + listeners[index] = nullFunction; ++this.pendingRemovals_[type]; } else { listeners.splice(index, 1); diff --git a/src/ol/featureloader.js b/src/ol/featureloader.js index 152331e94f..359e0c245a 100644 --- a/src/ol/featureloader.js +++ b/src/ol/featureloader.js @@ -1,7 +1,7 @@ /** * @module ol/featureloader */ -import _ol_ from './index.js'; +import {nullFunction} from './index.js'; import _ol_format_FormatType_ from './format/FormatType.js'; import _ol_xml_ from './xml.js'; var _ol_featureloader_ = {}; @@ -96,6 +96,6 @@ _ol_featureloader_.xhr = function(url, format) { */ function(features, dataProjection) { this.addFeatures(features); - }, /* FIXME handle error */ _ol_.nullFunction); + }, /* FIXME handle error */ nullFunction); }; export default _ol_featureloader_; diff --git a/src/ol/format/EsriJSON.js b/src/ol/format/EsriJSON.js index 9eaa808565..74f5bc1ec0 100644 --- a/src/ol/format/EsriJSON.js +++ b/src/ol/format/EsriJSON.js @@ -1,7 +1,7 @@ /** * @module ol/format/EsriJSON */ -import _ol_ from '../index.js'; +import {inherits} from '../index.js'; import _ol_Feature_ from '../Feature.js'; import _ol_asserts_ from '../asserts.js'; import _ol_extent_ from '../extent.js'; @@ -45,7 +45,7 @@ var _ol_format_EsriJSON_ = function(opt_options) { }; -_ol_.inherits(_ol_format_EsriJSON_, _ol_format_JSONFeature_); +inherits(_ol_format_EsriJSON_, _ol_format_JSONFeature_); /** diff --git a/src/ol/format/GML2.js b/src/ol/format/GML2.js index 5be784b5b1..20144c57ab 100644 --- a/src/ol/format/GML2.js +++ b/src/ol/format/GML2.js @@ -1,7 +1,7 @@ /** * @module ol/format/GML2 */ -import _ol_ from '../index.js'; +import {inherits} from '../index.js'; import _ol_extent_ from '../extent.js'; import _ol_format_Feature_ from '../format/Feature.js'; import _ol_format_GMLBase_ from '../format/GMLBase.js'; @@ -39,7 +39,7 @@ var _ol_format_GML2_ = function(opt_options) { }; -_ol_.inherits(_ol_format_GML2_, _ol_format_GMLBase_); +inherits(_ol_format_GML2_, _ol_format_GMLBase_); /** diff --git a/src/ol/format/GML3.js b/src/ol/format/GML3.js index 0c5490ec1d..77bd97372b 100644 --- a/src/ol/format/GML3.js +++ b/src/ol/format/GML3.js @@ -1,7 +1,7 @@ /** * @module ol/format/GML3 */ -import _ol_ from '../index.js'; +import {inherits} from '../index.js'; import _ol_array_ from '../array.js'; import _ol_extent_ from '../extent.js'; import _ol_format_Feature_ from '../format/Feature.js'; @@ -76,7 +76,7 @@ var _ol_format_GML3_ = function(opt_options) { }; -_ol_.inherits(_ol_format_GML3_, _ol_format_GMLBase_); +inherits(_ol_format_GML3_, _ol_format_GMLBase_); /** diff --git a/src/ol/format/GMLBase.js b/src/ol/format/GMLBase.js index 14be28588e..0ed7100eda 100644 --- a/src/ol/format/GMLBase.js +++ b/src/ol/format/GMLBase.js @@ -4,7 +4,7 @@ // FIXME Envelopes should not be treated as geometries! readEnvelope_ is part // of GEOMETRY_PARSERS_ and methods using GEOMETRY_PARSERS_ do not expect // envelopes/extents, only geometries! -import _ol_ from '../index.js'; +import {inherits} from '../index.js'; import _ol_array_ from '../array.js'; import _ol_Feature_ from '../Feature.js'; import _ol_format_Feature_ from '../format/Feature.js'; @@ -78,7 +78,7 @@ var _ol_format_GMLBase_ = function(opt_options) { _ol_format_XMLFeature_.call(this); }; -_ol_.inherits(_ol_format_GMLBase_, _ol_format_XMLFeature_); +inherits(_ol_format_GMLBase_, _ol_format_XMLFeature_); /** diff --git a/src/ol/format/GPX.js b/src/ol/format/GPX.js index 02744f40f2..9931081710 100644 --- a/src/ol/format/GPX.js +++ b/src/ol/format/GPX.js @@ -1,7 +1,7 @@ /** * @module ol/format/GPX */ -import _ol_ from '../index.js'; +import {inherits} from '../index.js'; import _ol_Feature_ from '../Feature.js'; import _ol_array_ from '../array.js'; import _ol_format_Feature_ from '../format/Feature.js'; @@ -41,7 +41,7 @@ var _ol_format_GPX_ = function(opt_options) { this.readExtensions_ = options.readExtensions; }; -_ol_.inherits(_ol_format_GPX_, _ol_format_XMLFeature_); +inherits(_ol_format_GPX_, _ol_format_XMLFeature_); /** diff --git a/src/ol/format/GeoJSON.js b/src/ol/format/GeoJSON.js index 5aa8e46591..a7980fda93 100644 --- a/src/ol/format/GeoJSON.js +++ b/src/ol/format/GeoJSON.js @@ -4,7 +4,7 @@ // TODO: serialize dataProjection as crs member when writing // see https://github.com/openlayers/openlayers/issues/2078 -import _ol_ from '../index.js'; +import {inherits} from '../index.js'; import _ol_asserts_ from '../asserts.js'; import _ol_Feature_ from '../Feature.js'; import _ol_format_Feature_ from '../format/Feature.js'; @@ -62,7 +62,7 @@ var _ol_format_GeoJSON_ = function(opt_options) { }; -_ol_.inherits(_ol_format_GeoJSON_, _ol_format_JSONFeature_); +inherits(_ol_format_GeoJSON_, _ol_format_JSONFeature_); /** diff --git a/src/ol/format/IGC.js b/src/ol/format/IGC.js index 4defa8c89d..a1c14974f9 100644 --- a/src/ol/format/IGC.js +++ b/src/ol/format/IGC.js @@ -1,7 +1,7 @@ /** * @module ol/format/IGC */ -import _ol_ from '../index.js'; +import {inherits} from '../index.js'; import _ol_Feature_ from '../Feature.js'; import _ol_format_Feature_ from '../format/Feature.js'; import _ol_format_IGCZ_ from '../format/IGCZ.js'; @@ -39,7 +39,7 @@ var _ol_format_IGC_ = function(opt_options) { }; -_ol_.inherits(_ol_format_IGC_, _ol_format_TextFeature_); +inherits(_ol_format_IGC_, _ol_format_TextFeature_); /** diff --git a/src/ol/format/JSONFeature.js b/src/ol/format/JSONFeature.js index 9aaeb4a3b5..39facbebbe 100644 --- a/src/ol/format/JSONFeature.js +++ b/src/ol/format/JSONFeature.js @@ -1,7 +1,7 @@ /** * @module ol/format/JSONFeature */ -import _ol_ from '../index.js'; +import {inherits} from '../index.js'; import _ol_format_Feature_ from '../format/Feature.js'; import _ol_format_FormatType_ from '../format/FormatType.js'; @@ -19,7 +19,7 @@ var _ol_format_JSONFeature_ = function() { _ol_format_Feature_.call(this); }; -_ol_.inherits(_ol_format_JSONFeature_, _ol_format_Feature_); +inherits(_ol_format_JSONFeature_, _ol_format_Feature_); /** diff --git a/src/ol/format/KML.js b/src/ol/format/KML.js index 6d86898aea..0c10fb006b 100644 --- a/src/ol/format/KML.js +++ b/src/ol/format/KML.js @@ -6,7 +6,7 @@ // FIXME serialize arbitrary feature properties // FIXME don't parse style if extractStyles is false -import _ol_ from '../index.js'; +import {inherits} from '../index.js'; import _ol_Feature_ from '../Feature.js'; import _ol_array_ from '../array.js'; import _ol_asserts_ from '../asserts.js'; @@ -97,7 +97,7 @@ var _ol_format_KML_ = function(opt_options) { }; -_ol_.inherits(_ol_format_KML_, _ol_format_XMLFeature_); +inherits(_ol_format_KML_, _ol_format_XMLFeature_); /** diff --git a/src/ol/format/MVT.js b/src/ol/format/MVT.js index 65e2e4bfb1..2f9acd0fc8 100644 --- a/src/ol/format/MVT.js +++ b/src/ol/format/MVT.js @@ -3,7 +3,7 @@ */ //FIXME Implement projection handling -import _ol_ from '../index.js'; +import {inherits} from '../index.js'; import _ol_asserts_ from '../asserts.js'; import _ol_ext_PBF_ from 'pbf'; import _ol_format_Feature_ from '../format/Feature.js'; @@ -79,7 +79,7 @@ var _ol_format_MVT_ = function(opt_options) { }; -_ol_.inherits(_ol_format_MVT_, _ol_format_Feature_); +inherits(_ol_format_MVT_, _ol_format_Feature_); /** diff --git a/src/ol/format/OSMXML.js b/src/ol/format/OSMXML.js index 71f93982e1..9a2d5d123f 100644 --- a/src/ol/format/OSMXML.js +++ b/src/ol/format/OSMXML.js @@ -2,7 +2,7 @@ * @module ol/format/OSMXML */ // FIXME add typedef for stack state objects -import _ol_ from '../index.js'; +import {inherits} from '../index.js'; import _ol_array_ from '../array.js'; import _ol_Feature_ from '../Feature.js'; import _ol_format_Feature_ from '../format/Feature.js'; @@ -33,7 +33,7 @@ var _ol_format_OSMXML_ = function() { this.defaultDataProjection = _ol_proj_.get('EPSG:4326'); }; -_ol_.inherits(_ol_format_OSMXML_, _ol_format_XMLFeature_); +inherits(_ol_format_OSMXML_, _ol_format_XMLFeature_); /** diff --git a/src/ol/format/OWS.js b/src/ol/format/OWS.js index 3699982d38..a210d4d6dc 100644 --- a/src/ol/format/OWS.js +++ b/src/ol/format/OWS.js @@ -1,7 +1,7 @@ /** * @module ol/format/OWS */ -import _ol_ from '../index.js'; +import {inherits} from '../index.js'; import _ol_format_XLink_ from '../format/XLink.js'; import _ol_format_XML_ from '../format/XML.js'; import _ol_format_XSD_ from '../format/XSD.js'; @@ -15,7 +15,7 @@ var _ol_format_OWS_ = function() { _ol_format_XML_.call(this); }; -_ol_.inherits(_ol_format_OWS_, _ol_format_XML_); +inherits(_ol_format_OWS_, _ol_format_XML_); /** diff --git a/src/ol/format/Polyline.js b/src/ol/format/Polyline.js index 86986147eb..3be58527fa 100644 --- a/src/ol/format/Polyline.js +++ b/src/ol/format/Polyline.js @@ -1,7 +1,7 @@ /** * @module ol/format/Polyline */ -import _ol_ from '../index.js'; +import {inherits} from '../index.js'; import _ol_asserts_ from '../asserts.js'; import _ol_Feature_ from '../Feature.js'; import _ol_format_Feature_ from '../format/Feature.js'; @@ -49,7 +49,7 @@ var _ol_format_Polyline_ = function(opt_options) { options.geometryLayout : _ol_geom_GeometryLayout_.XY; }; -_ol_.inherits(_ol_format_Polyline_, _ol_format_TextFeature_); +inherits(_ol_format_Polyline_, _ol_format_TextFeature_); /** diff --git a/src/ol/format/TextFeature.js b/src/ol/format/TextFeature.js index 0570b92877..d39087ca3f 100644 --- a/src/ol/format/TextFeature.js +++ b/src/ol/format/TextFeature.js @@ -1,7 +1,7 @@ /** * @module ol/format/TextFeature */ -import _ol_ from '../index.js'; +import {inherits} from '../index.js'; import _ol_format_Feature_ from '../format/Feature.js'; import _ol_format_FormatType_ from '../format/FormatType.js'; @@ -19,7 +19,7 @@ var _ol_format_TextFeature_ = function() { _ol_format_Feature_.call(this); }; -_ol_.inherits(_ol_format_TextFeature_, _ol_format_Feature_); +inherits(_ol_format_TextFeature_, _ol_format_Feature_); /** diff --git a/src/ol/format/TopoJSON.js b/src/ol/format/TopoJSON.js index e79b9dbf8f..b2283c4034 100644 --- a/src/ol/format/TopoJSON.js +++ b/src/ol/format/TopoJSON.js @@ -1,7 +1,7 @@ /** * @module ol/format/TopoJSON */ -import _ol_ from '../index.js'; +import {inherits} from '../index.js'; import _ol_Feature_ from '../Feature.js'; import _ol_format_Feature_ from '../format/Feature.js'; import _ol_format_JSONFeature_ from '../format/JSONFeature.js'; @@ -49,7 +49,7 @@ var _ol_format_TopoJSON_ = function(opt_options) { }; -_ol_.inherits(_ol_format_TopoJSON_, _ol_format_JSONFeature_); +inherits(_ol_format_TopoJSON_, _ol_format_JSONFeature_); /** diff --git a/src/ol/format/WFS.js b/src/ol/format/WFS.js index 0fe8e66785..8d7a1232ee 100644 --- a/src/ol/format/WFS.js +++ b/src/ol/format/WFS.js @@ -1,7 +1,7 @@ /** * @module ol/format/WFS */ -import _ol_ from '../index.js'; +import {inherits} from '../index.js'; import _ol_asserts_ from '../asserts.js'; import _ol_format_GML2_ from '../format/GML2.js'; import _ol_format_GML3_ from '../format/GML3.js'; @@ -60,7 +60,7 @@ var _ol_format_WFS_ = function(opt_options) { _ol_format_XMLFeature_.call(this); }; -_ol_.inherits(_ol_format_WFS_, _ol_format_XMLFeature_); +inherits(_ol_format_WFS_, _ol_format_XMLFeature_); /** diff --git a/src/ol/format/WKT.js b/src/ol/format/WKT.js index e21ab6477c..4308d3383f 100644 --- a/src/ol/format/WKT.js +++ b/src/ol/format/WKT.js @@ -1,7 +1,7 @@ /** * @module ol/format/WKT */ -import _ol_ from '../index.js'; +import {inherits} from '../index.js'; import _ol_Feature_ from '../Feature.js'; import _ol_format_Feature_ from '../format/Feature.js'; import _ol_format_TextFeature_ from '../format/TextFeature.js'; @@ -42,7 +42,7 @@ var _ol_format_WKT_ = function(opt_options) { }; -_ol_.inherits(_ol_format_WKT_, _ol_format_TextFeature_); +inherits(_ol_format_WKT_, _ol_format_TextFeature_); /** diff --git a/src/ol/format/WMSCapabilities.js b/src/ol/format/WMSCapabilities.js index 2b3dd80cce..91d850abca 100644 --- a/src/ol/format/WMSCapabilities.js +++ b/src/ol/format/WMSCapabilities.js @@ -1,7 +1,7 @@ /** * @module ol/format/WMSCapabilities */ -import _ol_ from '../index.js'; +import {inherits} from '../index.js'; import _ol_format_XLink_ from '../format/XLink.js'; import _ol_format_XML_ from '../format/XML.js'; import _ol_format_XSD_ from '../format/XSD.js'; @@ -25,7 +25,7 @@ var _ol_format_WMSCapabilities_ = function() { this.version = undefined; }; -_ol_.inherits(_ol_format_WMSCapabilities_, _ol_format_XML_); +inherits(_ol_format_WMSCapabilities_, _ol_format_XML_); /** diff --git a/src/ol/format/WMSGetFeatureInfo.js b/src/ol/format/WMSGetFeatureInfo.js index 4122920866..719f17bf56 100644 --- a/src/ol/format/WMSGetFeatureInfo.js +++ b/src/ol/format/WMSGetFeatureInfo.js @@ -1,7 +1,7 @@ /** * @module ol/format/WMSGetFeatureInfo */ -import _ol_ from '../index.js'; +import {inherits} from '../index.js'; import _ol_array_ from '../array.js'; import _ol_format_GML2_ from '../format/GML2.js'; import _ol_format_XMLFeature_ from '../format/XMLFeature.js'; @@ -45,7 +45,7 @@ var _ol_format_WMSGetFeatureInfo_ = function(opt_options) { _ol_format_XMLFeature_.call(this); }; -_ol_.inherits(_ol_format_WMSGetFeatureInfo_, _ol_format_XMLFeature_); +inherits(_ol_format_WMSGetFeatureInfo_, _ol_format_XMLFeature_); /** diff --git a/src/ol/format/WMTSCapabilities.js b/src/ol/format/WMTSCapabilities.js index 976a8afd83..f636d9e29d 100644 --- a/src/ol/format/WMTSCapabilities.js +++ b/src/ol/format/WMTSCapabilities.js @@ -1,7 +1,7 @@ /** * @module ol/format/WMTSCapabilities */ -import _ol_ from '../index.js'; +import {inherits} from '../index.js'; import _ol_extent_ from '../extent.js'; import _ol_format_OWS_ from '../format/OWS.js'; import _ol_format_XLink_ from '../format/XLink.js'; @@ -27,7 +27,7 @@ var _ol_format_WMTSCapabilities_ = function() { this.owsParser_ = new _ol_format_OWS_(); }; -_ol_.inherits(_ol_format_WMTSCapabilities_, _ol_format_XML_); +inherits(_ol_format_WMTSCapabilities_, _ol_format_XML_); /** diff --git a/src/ol/format/XMLFeature.js b/src/ol/format/XMLFeature.js index 880ee2aabb..0b27764aa1 100644 --- a/src/ol/format/XMLFeature.js +++ b/src/ol/format/XMLFeature.js @@ -1,7 +1,7 @@ /** * @module ol/format/XMLFeature */ -import _ol_ from '../index.js'; +import {inherits} from '../index.js'; import _ol_array_ from '../array.js'; import _ol_format_Feature_ from '../format/Feature.js'; import _ol_format_FormatType_ from '../format/FormatType.js'; @@ -28,7 +28,7 @@ var _ol_format_XMLFeature_ = function() { _ol_format_Feature_.call(this); }; -_ol_.inherits(_ol_format_XMLFeature_, _ol_format_Feature_); +inherits(_ol_format_XMLFeature_, _ol_format_Feature_); /** diff --git a/src/ol/format/filter/And.js b/src/ol/format/filter/And.js index f73ddba39f..07667202cb 100644 --- a/src/ol/format/filter/And.js +++ b/src/ol/format/filter/And.js @@ -1,7 +1,7 @@ /** * @module ol/format/filter/And */ -import _ol_ from '../../index.js'; +import {inherits} from '../../index.js'; import _ol_format_filter_LogicalNary_ from '../filter/LogicalNary.js'; /** @@ -21,5 +21,6 @@ var _ol_format_filter_And_ = function(conditions) { _ol_format_filter_LogicalNary_.apply(this, params); }; -_ol_.inherits(_ol_format_filter_And_, _ol_format_filter_LogicalNary_); +inherits(_ol_format_filter_And_, _ol_format_filter_LogicalNary_); + export default _ol_format_filter_And_; diff --git a/src/ol/format/filter/Bbox.js b/src/ol/format/filter/Bbox.js index 2c2c2428d6..b5b07abf21 100644 --- a/src/ol/format/filter/Bbox.js +++ b/src/ol/format/filter/Bbox.js @@ -1,7 +1,7 @@ /** * @module ol/format/filter/Bbox */ -import _ol_ from '../../index.js'; +import {inherits} from '../../index.js'; import _ol_format_filter_Filter_ from '../filter/Filter.js'; /** @@ -40,5 +40,6 @@ var _ol_format_filter_Bbox_ = function(geometryName, extent, opt_srsName) { this.srsName = opt_srsName; }; -_ol_.inherits(_ol_format_filter_Bbox_, _ol_format_filter_Filter_); +inherits(_ol_format_filter_Bbox_, _ol_format_filter_Filter_); + export default _ol_format_filter_Bbox_; diff --git a/src/ol/format/filter/Comparison.js b/src/ol/format/filter/Comparison.js index 073eac22f4..f62c31bc82 100644 --- a/src/ol/format/filter/Comparison.js +++ b/src/ol/format/filter/Comparison.js @@ -1,7 +1,7 @@ /** * @module ol/format/filter/Comparison */ -import _ol_ from '../../index.js'; +import {inherits} from '../../index.js'; import _ol_format_filter_Filter_ from '../filter/Filter.js'; /** @@ -29,5 +29,6 @@ var _ol_format_filter_Comparison_ = function(tagName, propertyName) { this.propertyName = propertyName; }; -_ol_.inherits(_ol_format_filter_Comparison_, _ol_format_filter_Filter_); +inherits(_ol_format_filter_Comparison_, _ol_format_filter_Filter_); + export default _ol_format_filter_Comparison_; diff --git a/src/ol/format/filter/ComparisonBinary.js b/src/ol/format/filter/ComparisonBinary.js index 415c145988..8b4e0b0731 100644 --- a/src/ol/format/filter/ComparisonBinary.js +++ b/src/ol/format/filter/ComparisonBinary.js @@ -1,7 +1,7 @@ /** * @module ol/format/filter/ComparisonBinary */ -import _ol_ from '../../index.js'; +import {inherits} from '../../index.js'; import _ol_format_filter_Comparison_ from '../filter/Comparison.js'; /** @@ -38,5 +38,5 @@ var _ol_format_filter_ComparisonBinary_ = function( this.matchCase = opt_matchCase; }; -_ol_.inherits(_ol_format_filter_ComparisonBinary_, _ol_format_filter_Comparison_); +inherits(_ol_format_filter_ComparisonBinary_, _ol_format_filter_Comparison_); export default _ol_format_filter_ComparisonBinary_; diff --git a/src/ol/format/filter/Contains.js b/src/ol/format/filter/Contains.js index 4ac3acafbd..58668430e8 100644 --- a/src/ol/format/filter/Contains.js +++ b/src/ol/format/filter/Contains.js @@ -1,7 +1,7 @@ /** * @module ol/format/filter/Contains */ -import _ol_ from '../../index.js'; +import {inherits} from '../../index.js'; import _ol_format_filter_Spatial_ from '../filter/Spatial.js'; /** @@ -23,5 +23,5 @@ var _ol_format_filter_Contains_ = function(geometryName, geometry, opt_srsName) }; -_ol_.inherits(_ol_format_filter_Contains_, _ol_format_filter_Spatial_); +inherits(_ol_format_filter_Contains_, _ol_format_filter_Spatial_); export default _ol_format_filter_Contains_; diff --git a/src/ol/format/filter/During.js b/src/ol/format/filter/During.js index 4536ec25f2..7b49715914 100644 --- a/src/ol/format/filter/During.js +++ b/src/ol/format/filter/During.js @@ -1,7 +1,7 @@ /** * @module ol/format/filter/During */ -import _ol_ from '../../index.js'; +import {inherits} from '../../index.js'; import _ol_format_filter_Comparison_ from '../filter/Comparison.js'; /** @@ -31,5 +31,5 @@ var _ol_format_filter_During_ = function(propertyName, begin, end) { this.end = end; }; -_ol_.inherits(_ol_format_filter_During_, _ol_format_filter_Comparison_); +inherits(_ol_format_filter_During_, _ol_format_filter_Comparison_); export default _ol_format_filter_During_; diff --git a/src/ol/format/filter/EqualTo.js b/src/ol/format/filter/EqualTo.js index f26fff30e1..06f78be96b 100644 --- a/src/ol/format/filter/EqualTo.js +++ b/src/ol/format/filter/EqualTo.js @@ -1,7 +1,7 @@ /** * @module ol/format/filter/EqualTo */ -import _ol_ from '../../index.js'; +import {inherits} from '../../index.js'; import _ol_format_filter_ComparisonBinary_ from '../filter/ComparisonBinary.js'; /** @@ -19,5 +19,5 @@ var _ol_format_filter_EqualTo_ = function(propertyName, expression, opt_matchCas _ol_format_filter_ComparisonBinary_.call(this, 'PropertyIsEqualTo', propertyName, expression, opt_matchCase); }; -_ol_.inherits(_ol_format_filter_EqualTo_, _ol_format_filter_ComparisonBinary_); +inherits(_ol_format_filter_EqualTo_, _ol_format_filter_ComparisonBinary_); export default _ol_format_filter_EqualTo_; diff --git a/src/ol/format/filter/GreaterThan.js b/src/ol/format/filter/GreaterThan.js index 3cd1c92845..52de00d23e 100644 --- a/src/ol/format/filter/GreaterThan.js +++ b/src/ol/format/filter/GreaterThan.js @@ -1,7 +1,7 @@ /** * @module ol/format/filter/GreaterThan */ -import _ol_ from '../../index.js'; +import {inherits} from '../../index.js'; import _ol_format_filter_ComparisonBinary_ from '../filter/ComparisonBinary.js'; /** @@ -18,5 +18,5 @@ var _ol_format_filter_GreaterThan_ = function(propertyName, expression) { _ol_format_filter_ComparisonBinary_.call(this, 'PropertyIsGreaterThan', propertyName, expression); }; -_ol_.inherits(_ol_format_filter_GreaterThan_, _ol_format_filter_ComparisonBinary_); +inherits(_ol_format_filter_GreaterThan_, _ol_format_filter_ComparisonBinary_); export default _ol_format_filter_GreaterThan_; diff --git a/src/ol/format/filter/GreaterThanOrEqualTo.js b/src/ol/format/filter/GreaterThanOrEqualTo.js index e62881fa8d..009ab0225f 100644 --- a/src/ol/format/filter/GreaterThanOrEqualTo.js +++ b/src/ol/format/filter/GreaterThanOrEqualTo.js @@ -1,7 +1,7 @@ /** * @module ol/format/filter/GreaterThanOrEqualTo */ -import _ol_ from '../../index.js'; +import {inherits} from '../../index.js'; import _ol_format_filter_ComparisonBinary_ from '../filter/ComparisonBinary.js'; /** @@ -18,5 +18,5 @@ var _ol_format_filter_GreaterThanOrEqualTo_ = function(propertyName, expression) _ol_format_filter_ComparisonBinary_.call(this, 'PropertyIsGreaterThanOrEqualTo', propertyName, expression); }; -_ol_.inherits(_ol_format_filter_GreaterThanOrEqualTo_, _ol_format_filter_ComparisonBinary_); +inherits(_ol_format_filter_GreaterThanOrEqualTo_, _ol_format_filter_ComparisonBinary_); export default _ol_format_filter_GreaterThanOrEqualTo_; diff --git a/src/ol/format/filter/Intersects.js b/src/ol/format/filter/Intersects.js index 697c893182..42342a666c 100644 --- a/src/ol/format/filter/Intersects.js +++ b/src/ol/format/filter/Intersects.js @@ -1,7 +1,7 @@ /** * @module ol/format/filter/Intersects */ -import _ol_ from '../../index.js'; +import {inherits} from '../../index.js'; import _ol_format_filter_Spatial_ from '../filter/Spatial.js'; /** @@ -23,5 +23,5 @@ var _ol_format_filter_Intersects_ = function(geometryName, geometry, opt_srsName }; -_ol_.inherits(_ol_format_filter_Intersects_, _ol_format_filter_Spatial_); +inherits(_ol_format_filter_Intersects_, _ol_format_filter_Spatial_); export default _ol_format_filter_Intersects_; diff --git a/src/ol/format/filter/IsBetween.js b/src/ol/format/filter/IsBetween.js index 5457fea6aa..3bf1a46191 100644 --- a/src/ol/format/filter/IsBetween.js +++ b/src/ol/format/filter/IsBetween.js @@ -1,7 +1,7 @@ /** * @module ol/format/filter/IsBetween */ -import _ol_ from '../../index.js'; +import {inherits} from '../../index.js'; import _ol_format_filter_Comparison_ from '../filter/Comparison.js'; /** @@ -31,5 +31,5 @@ var _ol_format_filter_IsBetween_ = function(propertyName, lowerBoundary, upperBo this.upperBoundary = upperBoundary; }; -_ol_.inherits(_ol_format_filter_IsBetween_, _ol_format_filter_Comparison_); +inherits(_ol_format_filter_IsBetween_, _ol_format_filter_Comparison_); export default _ol_format_filter_IsBetween_; diff --git a/src/ol/format/filter/IsLike.js b/src/ol/format/filter/IsLike.js index b27dc4dde3..00e674e955 100644 --- a/src/ol/format/filter/IsLike.js +++ b/src/ol/format/filter/IsLike.js @@ -1,7 +1,7 @@ /** * @module ol/format/filter/IsLike */ -import _ol_ from '../../index.js'; +import {inherits} from '../../index.js'; import _ol_format_filter_Comparison_ from '../filter/Comparison.js'; /** @@ -56,5 +56,5 @@ var _ol_format_filter_IsLike_ = function(propertyName, pattern, this.matchCase = opt_matchCase; }; -_ol_.inherits(_ol_format_filter_IsLike_, _ol_format_filter_Comparison_); +inherits(_ol_format_filter_IsLike_, _ol_format_filter_Comparison_); export default _ol_format_filter_IsLike_; diff --git a/src/ol/format/filter/IsNull.js b/src/ol/format/filter/IsNull.js index af025ac72c..8133af3079 100644 --- a/src/ol/format/filter/IsNull.js +++ b/src/ol/format/filter/IsNull.js @@ -1,7 +1,7 @@ /** * @module ol/format/filter/IsNull */ -import _ol_ from '../../index.js'; +import {inherits} from '../../index.js'; import _ol_format_filter_Comparison_ from '../filter/Comparison.js'; /** @@ -17,5 +17,5 @@ var _ol_format_filter_IsNull_ = function(propertyName) { _ol_format_filter_Comparison_.call(this, 'PropertyIsNull', propertyName); }; -_ol_.inherits(_ol_format_filter_IsNull_, _ol_format_filter_Comparison_); +inherits(_ol_format_filter_IsNull_, _ol_format_filter_Comparison_); export default _ol_format_filter_IsNull_; diff --git a/src/ol/format/filter/LessThan.js b/src/ol/format/filter/LessThan.js index d13005be8f..09268cb95b 100644 --- a/src/ol/format/filter/LessThan.js +++ b/src/ol/format/filter/LessThan.js @@ -1,7 +1,7 @@ /** * @module ol/format/filter/LessThan */ -import _ol_ from '../../index.js'; +import {inherits} from '../../index.js'; import _ol_format_filter_ComparisonBinary_ from '../filter/ComparisonBinary.js'; /** @@ -18,5 +18,5 @@ var _ol_format_filter_LessThan_ = function(propertyName, expression) { _ol_format_filter_ComparisonBinary_.call(this, 'PropertyIsLessThan', propertyName, expression); }; -_ol_.inherits(_ol_format_filter_LessThan_, _ol_format_filter_ComparisonBinary_); +inherits(_ol_format_filter_LessThan_, _ol_format_filter_ComparisonBinary_); export default _ol_format_filter_LessThan_; diff --git a/src/ol/format/filter/LessThanOrEqualTo.js b/src/ol/format/filter/LessThanOrEqualTo.js index c7b9c52861..d67f308700 100644 --- a/src/ol/format/filter/LessThanOrEqualTo.js +++ b/src/ol/format/filter/LessThanOrEqualTo.js @@ -1,7 +1,7 @@ /** * @module ol/format/filter/LessThanOrEqualTo */ -import _ol_ from '../../index.js'; +import {inherits} from '../../index.js'; import _ol_format_filter_ComparisonBinary_ from '../filter/ComparisonBinary.js'; /** @@ -18,5 +18,5 @@ var _ol_format_filter_LessThanOrEqualTo_ = function(propertyName, expression) { _ol_format_filter_ComparisonBinary_.call(this, 'PropertyIsLessThanOrEqualTo', propertyName, expression); }; -_ol_.inherits(_ol_format_filter_LessThanOrEqualTo_, _ol_format_filter_ComparisonBinary_); +inherits(_ol_format_filter_LessThanOrEqualTo_, _ol_format_filter_ComparisonBinary_); export default _ol_format_filter_LessThanOrEqualTo_; diff --git a/src/ol/format/filter/LogicalNary.js b/src/ol/format/filter/LogicalNary.js index b6d4322597..f488869da7 100644 --- a/src/ol/format/filter/LogicalNary.js +++ b/src/ol/format/filter/LogicalNary.js @@ -1,7 +1,7 @@ /** * @module ol/format/filter/LogicalNary */ -import _ol_ from '../../index.js'; +import {inherits} from '../../index.js'; import _ol_asserts_ from '../../asserts.js'; import _ol_format_filter_Filter_ from '../filter/Filter.js'; @@ -28,5 +28,5 @@ var _ol_format_filter_LogicalNary_ = function(tagName, conditions) { _ol_asserts_.assert(this.conditions.length >= 2, 57); // At least 2 conditions are required. }; -_ol_.inherits(_ol_format_filter_LogicalNary_, _ol_format_filter_Filter_); +inherits(_ol_format_filter_LogicalNary_, _ol_format_filter_Filter_); export default _ol_format_filter_LogicalNary_; diff --git a/src/ol/format/filter/Not.js b/src/ol/format/filter/Not.js index d9e5eb406a..ded16ec4f3 100644 --- a/src/ol/format/filter/Not.js +++ b/src/ol/format/filter/Not.js @@ -1,7 +1,7 @@ /** * @module ol/format/filter/Not */ -import _ol_ from '../../index.js'; +import {inherits} from '../../index.js'; import _ol_format_filter_Filter_ from '../filter/Filter.js'; /** @@ -24,5 +24,5 @@ var _ol_format_filter_Not_ = function(condition) { this.condition = condition; }; -_ol_.inherits(_ol_format_filter_Not_, _ol_format_filter_Filter_); +inherits(_ol_format_filter_Not_, _ol_format_filter_Filter_); export default _ol_format_filter_Not_; diff --git a/src/ol/format/filter/NotEqualTo.js b/src/ol/format/filter/NotEqualTo.js index 971dbb5213..c44d5d3791 100644 --- a/src/ol/format/filter/NotEqualTo.js +++ b/src/ol/format/filter/NotEqualTo.js @@ -1,7 +1,7 @@ /** * @module ol/format/filter/NotEqualTo */ -import _ol_ from '../../index.js'; +import {inherits} from '../../index.js'; import _ol_format_filter_ComparisonBinary_ from '../filter/ComparisonBinary.js'; /** @@ -19,5 +19,5 @@ var _ol_format_filter_NotEqualTo_ = function(propertyName, expression, opt_match _ol_format_filter_ComparisonBinary_.call(this, 'PropertyIsNotEqualTo', propertyName, expression, opt_matchCase); }; -_ol_.inherits(_ol_format_filter_NotEqualTo_, _ol_format_filter_ComparisonBinary_); +inherits(_ol_format_filter_NotEqualTo_, _ol_format_filter_ComparisonBinary_); export default _ol_format_filter_NotEqualTo_; diff --git a/src/ol/format/filter/Or.js b/src/ol/format/filter/Or.js index 71f3edacef..5b2b8910bd 100644 --- a/src/ol/format/filter/Or.js +++ b/src/ol/format/filter/Or.js @@ -1,7 +1,7 @@ /** * @module ol/format/filter/Or */ -import _ol_ from '../../index.js'; +import {inherits} from '../../index.js'; import _ol_format_filter_LogicalNary_ from '../filter/LogicalNary.js'; /** @@ -18,5 +18,5 @@ var _ol_format_filter_Or_ = function(conditions) { _ol_format_filter_LogicalNary_.apply(this, params); }; -_ol_.inherits(_ol_format_filter_Or_, _ol_format_filter_LogicalNary_); +inherits(_ol_format_filter_Or_, _ol_format_filter_LogicalNary_); export default _ol_format_filter_Or_; diff --git a/src/ol/format/filter/Spatial.js b/src/ol/format/filter/Spatial.js index 043da0dde7..95efa3a1c5 100644 --- a/src/ol/format/filter/Spatial.js +++ b/src/ol/format/filter/Spatial.js @@ -1,7 +1,7 @@ /** * @module ol/format/filter/Spatial */ -import _ol_ from '../../index.js'; +import {inherits} from '../../index.js'; import _ol_format_filter_Filter_ from '../filter/Filter.js'; /** @@ -45,5 +45,5 @@ var _ol_format_filter_Spatial_ = function(tagName, geometryName, geometry, opt_s this.srsName = opt_srsName; }; -_ol_.inherits(_ol_format_filter_Spatial_, _ol_format_filter_Filter_); +inherits(_ol_format_filter_Spatial_, _ol_format_filter_Filter_); export default _ol_format_filter_Spatial_; diff --git a/src/ol/format/filter/Within.js b/src/ol/format/filter/Within.js index d84bff09cd..be16561844 100644 --- a/src/ol/format/filter/Within.js +++ b/src/ol/format/filter/Within.js @@ -1,7 +1,7 @@ /** * @module ol/format/filter/Within */ -import _ol_ from '../../index.js'; +import {inherits} from '../../index.js'; import _ol_format_filter_Spatial_ from '../filter/Spatial.js'; /** @@ -23,5 +23,5 @@ var _ol_format_filter_Within_ = function(geometryName, geometry, opt_srsName) { }; -_ol_.inherits(_ol_format_filter_Within_, _ol_format_filter_Spatial_); +inherits(_ol_format_filter_Within_, _ol_format_filter_Spatial_); export default _ol_format_filter_Within_; diff --git a/src/ol/geom/Circle.js b/src/ol/geom/Circle.js index 4df84da725..a84bf31a62 100644 --- a/src/ol/geom/Circle.js +++ b/src/ol/geom/Circle.js @@ -1,7 +1,7 @@ /** * @module ol/geom/Circle */ -import _ol_ from '../index.js'; +import {inherits} from '../index.js'; import _ol_extent_ from '../extent.js'; import _ol_geom_GeometryLayout_ from '../geom/GeometryLayout.js'; import _ol_geom_GeometryType_ from '../geom/GeometryType.js'; @@ -25,7 +25,7 @@ var _ol_geom_Circle_ = function(center, opt_radius, opt_layout) { this.setCenterAndRadius(center, radius, opt_layout); }; -_ol_.inherits(_ol_geom_Circle_, _ol_geom_SimpleGeometry_); +inherits(_ol_geom_Circle_, _ol_geom_SimpleGeometry_); /** diff --git a/src/ol/geom/Geometry.js b/src/ol/geom/Geometry.js index 41426cf61e..6131bf73cb 100644 --- a/src/ol/geom/Geometry.js +++ b/src/ol/geom/Geometry.js @@ -1,7 +1,7 @@ /** * @module ol/geom/Geometry */ -import _ol_ from '../index.js'; +import {inherits} from '../index.js'; import _ol_Object_ from '../Object.js'; import _ol_extent_ from '../extent.js'; import _ol_functions_ from '../functions.js'; @@ -66,7 +66,7 @@ var _ol_geom_Geometry_ = function() { }; -_ol_.inherits(_ol_geom_Geometry_, _ol_Object_); +inherits(_ol_geom_Geometry_, _ol_Object_); /** diff --git a/src/ol/geom/GeometryCollection.js b/src/ol/geom/GeometryCollection.js index 8d7abd0ee3..e8a76aeacc 100644 --- a/src/ol/geom/GeometryCollection.js +++ b/src/ol/geom/GeometryCollection.js @@ -1,7 +1,7 @@ /** * @module ol/geom/GeometryCollection */ -import _ol_ from '../index.js'; +import {inherits} from '../index.js'; import _ol_events_ from '../events.js'; import _ol_events_EventType_ from '../events/EventType.js'; import _ol_extent_ from '../extent.js'; @@ -31,7 +31,7 @@ var _ol_geom_GeometryCollection_ = function(opt_geometries) { this.listenGeometriesChange_(); }; -_ol_.inherits(_ol_geom_GeometryCollection_, _ol_geom_Geometry_); +inherits(_ol_geom_GeometryCollection_, _ol_geom_Geometry_); /** diff --git a/src/ol/geom/LineString.js b/src/ol/geom/LineString.js index 850b00d2dc..f1db362181 100644 --- a/src/ol/geom/LineString.js +++ b/src/ol/geom/LineString.js @@ -1,7 +1,7 @@ /** * @module ol/geom/LineString */ -import _ol_ from '../index.js'; +import {inherits} from '../index.js'; import _ol_array_ from '../array.js'; import _ol_extent_ from '../extent.js'; import _ol_geom_GeometryLayout_ from '../geom/GeometryLayout.js'; @@ -58,7 +58,7 @@ var _ol_geom_LineString_ = function(coordinates, opt_layout) { }; -_ol_.inherits(_ol_geom_LineString_, _ol_geom_SimpleGeometry_); +inherits(_ol_geom_LineString_, _ol_geom_SimpleGeometry_); /** diff --git a/src/ol/geom/LinearRing.js b/src/ol/geom/LinearRing.js index a147126471..6e207912ec 100644 --- a/src/ol/geom/LinearRing.js +++ b/src/ol/geom/LinearRing.js @@ -1,7 +1,7 @@ /** * @module ol/geom/LinearRing */ -import _ol_ from '../index.js'; +import {inherits} from '../index.js'; import _ol_extent_ from '../extent.js'; import _ol_geom_GeometryLayout_ from '../geom/GeometryLayout.js'; import _ol_geom_GeometryType_ from '../geom/GeometryType.js'; @@ -43,7 +43,7 @@ var _ol_geom_LinearRing_ = function(coordinates, opt_layout) { }; -_ol_.inherits(_ol_geom_LinearRing_, _ol_geom_SimpleGeometry_); +inherits(_ol_geom_LinearRing_, _ol_geom_SimpleGeometry_); /** diff --git a/src/ol/geom/MultiLineString.js b/src/ol/geom/MultiLineString.js index fa492483ce..f29ac628a1 100644 --- a/src/ol/geom/MultiLineString.js +++ b/src/ol/geom/MultiLineString.js @@ -1,7 +1,7 @@ /** * @module ol/geom/MultiLineString */ -import _ol_ from '../index.js'; +import {inherits} from '../index.js'; import _ol_array_ from '../array.js'; import _ol_extent_ from '../extent.js'; import _ol_geom_GeometryLayout_ from '../geom/GeometryLayout.js'; @@ -51,7 +51,7 @@ var _ol_geom_MultiLineString_ = function(coordinates, opt_layout) { }; -_ol_.inherits(_ol_geom_MultiLineString_, _ol_geom_SimpleGeometry_); +inherits(_ol_geom_MultiLineString_, _ol_geom_SimpleGeometry_); /** diff --git a/src/ol/geom/MultiPoint.js b/src/ol/geom/MultiPoint.js index 0bfa364955..c25f24fd86 100644 --- a/src/ol/geom/MultiPoint.js +++ b/src/ol/geom/MultiPoint.js @@ -1,7 +1,7 @@ /** * @module ol/geom/MultiPoint */ -import _ol_ from '../index.js'; +import {inherits} from '../index.js'; import _ol_array_ from '../array.js'; import _ol_extent_ from '../extent.js'; import _ol_geom_GeometryLayout_ from '../geom/GeometryLayout.js'; @@ -27,7 +27,7 @@ var _ol_geom_MultiPoint_ = function(coordinates, opt_layout) { this.setCoordinates(coordinates, opt_layout); }; -_ol_.inherits(_ol_geom_MultiPoint_, _ol_geom_SimpleGeometry_); +inherits(_ol_geom_MultiPoint_, _ol_geom_SimpleGeometry_); /** diff --git a/src/ol/geom/MultiPolygon.js b/src/ol/geom/MultiPolygon.js index 6ba72eb2d1..c9da109936 100644 --- a/src/ol/geom/MultiPolygon.js +++ b/src/ol/geom/MultiPolygon.js @@ -1,7 +1,7 @@ /** * @module ol/geom/MultiPolygon */ -import _ol_ from '../index.js'; +import {inherits} from '../index.js'; import _ol_array_ from '../array.js'; import _ol_extent_ from '../extent.js'; import _ol_geom_GeometryLayout_ from '../geom/GeometryLayout.js'; @@ -80,7 +80,7 @@ var _ol_geom_MultiPolygon_ = function(coordinates, opt_layout) { }; -_ol_.inherits(_ol_geom_MultiPolygon_, _ol_geom_SimpleGeometry_); +inherits(_ol_geom_MultiPolygon_, _ol_geom_SimpleGeometry_); /** diff --git a/src/ol/geom/Point.js b/src/ol/geom/Point.js index 02c2a1abc2..d752a4e055 100644 --- a/src/ol/geom/Point.js +++ b/src/ol/geom/Point.js @@ -1,7 +1,7 @@ /** * @module ol/geom/Point */ -import _ol_ from '../index.js'; +import {inherits} from '../index.js'; import _ol_extent_ from '../extent.js'; import _ol_geom_GeometryLayout_ from '../geom/GeometryLayout.js'; import _ol_geom_GeometryType_ from '../geom/GeometryType.js'; @@ -24,7 +24,7 @@ var _ol_geom_Point_ = function(coordinates, opt_layout) { this.setCoordinates(coordinates, opt_layout); }; -_ol_.inherits(_ol_geom_Point_, _ol_geom_SimpleGeometry_); +inherits(_ol_geom_Point_, _ol_geom_SimpleGeometry_); /** diff --git a/src/ol/geom/Polygon.js b/src/ol/geom/Polygon.js index c85c655360..85a4093c20 100644 --- a/src/ol/geom/Polygon.js +++ b/src/ol/geom/Polygon.js @@ -1,7 +1,7 @@ /** * @module ol/geom/Polygon */ -import _ol_ from '../index.js'; +import {inherits} from '../index.js'; import _ol_array_ from '../array.js'; import _ol_extent_ from '../extent.js'; import _ol_geom_GeometryLayout_ from '../geom/GeometryLayout.js'; @@ -85,7 +85,7 @@ var _ol_geom_Polygon_ = function(coordinates, opt_layout) { }; -_ol_.inherits(_ol_geom_Polygon_, _ol_geom_SimpleGeometry_); +inherits(_ol_geom_Polygon_, _ol_geom_SimpleGeometry_); /** diff --git a/src/ol/geom/SimpleGeometry.js b/src/ol/geom/SimpleGeometry.js index a01c06aecc..a40face690 100644 --- a/src/ol/geom/SimpleGeometry.js +++ b/src/ol/geom/SimpleGeometry.js @@ -1,7 +1,7 @@ /** * @module ol/geom/SimpleGeometry */ -import _ol_ from '../index.js'; +import {inherits} from '../index.js'; import _ol_functions_ from '../functions.js'; import _ol_extent_ from '../extent.js'; import _ol_geom_Geometry_ from '../geom/Geometry.js'; @@ -43,7 +43,7 @@ var _ol_geom_SimpleGeometry_ = function() { }; -_ol_.inherits(_ol_geom_SimpleGeometry_, _ol_geom_Geometry_); +inherits(_ol_geom_SimpleGeometry_, _ol_geom_Geometry_); /** diff --git a/src/ol/has.js b/src/ol/has.js index 62a0208f8b..7428ec4c60 100644 --- a/src/ol/has.js +++ b/src/ol/has.js @@ -1,8 +1,8 @@ /** * @module ol/has */ -import _ol_ from './index.js'; -import _ol_webgl_ from './webgl.js'; +import {ENABLE_CANVAS, ASSUME_TOUCH, HAS_WEBGL} from './index.js'; + var _ol_has_ = {}; var ua = typeof navigator !== 'undefined' ? @@ -57,7 +57,7 @@ _ol_has_.CANVAS_LINE_DASH = false; * @type {boolean} * @api */ -_ol_has_.CANVAS = _ol_.ENABLE_CANVAS && ( +_ol_has_.CANVAS = ENABLE_CANVAS && ( /** * @return {boolean} Canvas supported. */ @@ -105,7 +105,7 @@ _ol_has_.GEOLOCATION = 'geolocation' in navigator; * @type {boolean} * @api */ -_ol_has_.TOUCH = _ol_.ASSUME_TOUCH || 'ontouchstart' in window; +_ol_has_.TOUCH = ASSUME_TOUCH || 'ontouchstart' in window; /** @@ -125,41 +125,12 @@ _ol_has_.MSPOINTER = !!(navigator.msPointerEnabled); /** - * True if both OpenLayers and browser support WebGL. Always `false` - * if `ol.ENABLE_WEBGL` is set to `false` at compile time. + * True if both OpenLayers and browser support WebGL. * @const * @type {boolean} * @api */ -_ol_has_.WEBGL; +_ol_has_.WEBGL = HAS_WEBGL; -(function() { - if (_ol_.ENABLE_WEBGL) { - var hasWebGL = false; - var textureSize; - var /** @type {Array.} */ extensions = []; - - if ('WebGLRenderingContext' in window) { - try { - var canvas = /** @type {HTMLCanvasElement} */ - (document.createElement('CANVAS')); - var gl = _ol_webgl_.getContext(canvas, { - failIfMajorPerformanceCaveat: true - }); - if (gl) { - hasWebGL = true; - textureSize = /** @type {number} */ - (gl.getParameter(gl.MAX_TEXTURE_SIZE)); - extensions = gl.getSupportedExtensions(); - } - } catch (e) { - // pass - } - } - _ol_has_.WEBGL = hasWebGL; - _ol_.WEBGL_EXTENSIONS = extensions; - _ol_.WEBGL_MAX_TEXTURE_SIZE = textureSize; - } -})(); export default _ol_has_; diff --git a/src/ol/index.js b/src/ol/index.js index b2d34ff1d5..5c04cec288 100644 --- a/src/ol/index.js +++ b/src/ol/index.js @@ -1,7 +1,8 @@ /** * @module ol/index */ -var _ol_ = {}; + +import webgl from './webgl.js'; /** @@ -12,168 +13,164 @@ var _ol_ = {}; /** - * @define {boolean} Assume touch. Default is `false`. + * @type {boolean} Assume touch. Default is `false`. */ -_ol_.ASSUME_TOUCH = false; +export var ASSUME_TOUCH = false; /** * TODO: rename this to something having to do with tile grids * see https://github.com/openlayers/openlayers/issues/2076 - * @define {number} Default maximum zoom for default tile grids. + * @type {number} Default maximum zoom for default tile grids. */ -_ol_.DEFAULT_MAX_ZOOM = 42; +export var DEFAULT_MAX_ZOOM = 42; /** - * @define {number} Default min zoom level for the map view. Default is `0`. + * @type {number} Default min zoom level for the map view. Default is `0`. */ -_ol_.DEFAULT_MIN_ZOOM = 0; +export var DEFAULT_MIN_ZOOM = 0; /** - * @define {number} Default maximum allowed threshold (in pixels) for + * @type {number} Default maximum allowed threshold (in pixels) for * reprojection triangulation. Default is `0.5`. */ -_ol_.DEFAULT_RASTER_REPROJECTION_ERROR_THRESHOLD = 0.5; +export var DEFAULT_RASTER_REPROJECTION_ERROR_THRESHOLD = 0.5; /** - * @define {number} Default tile size. + * @type {number} Default tile size. */ -_ol_.DEFAULT_TILE_SIZE = 256; +export var DEFAULT_TILE_SIZE = 256; /** - * @define {string} Default WMS version. + * @type {string} Default WMS version. */ -_ol_.DEFAULT_WMS_VERSION = '1.3.0'; +export var DEFAULT_WMS_VERSION = '1.3.0'; /** - * @define {boolean} Enable the Canvas renderer. Default is `true`. Setting + * @type {boolean} Enable the Canvas renderer. Default is `true`. Setting * this to false at compile time in advanced mode removes all code * supporting the Canvas renderer from the build. */ -_ol_.ENABLE_CANVAS = true; +export var ENABLE_CANVAS = true; /** - * @define {boolean} Enable integration with the Proj4js library. Default is + * @type {boolean} Enable integration with the Proj4js library. Default is * `true`. */ -_ol_.ENABLE_PROJ4JS = true; +export var ENABLE_PROJ4JS = true; /** - * @define {boolean} Enable automatic reprojection of raster sources. Default is + * @type {boolean} Enable automatic reprojection of raster sources. Default is * `true`. */ -_ol_.ENABLE_RASTER_REPROJECTION = true; +export var ENABLE_RASTER_REPROJECTION = true; /** - * @define {boolean} Enable the WebGL renderer. Default is `true`. Setting + * @type {boolean} Enable the WebGL renderer. Default is `true`. Setting * this to false at compile time in advanced mode removes all code * supporting the WebGL renderer from the build. */ -_ol_.ENABLE_WEBGL = true; +export var ENABLE_WEBGL = true; /** - * @define {boolean} Include debuggable shader sources. Default is `true`. - * This should be set to `false` for production builds (if `ol.ENABLE_WEBGL` + * @type {boolean} Include debuggable shader sources. Default is `true`. + * This should be set to `false` for production builds (if `ENABLE_WEBGL` * is `true`). */ -_ol_.DEBUG_WEBGL = true; +export var DEBUG_WEBGL = true; /** - * @define {number} The size in pixels of the first atlas image. Default is + * TODO: get rid of this or move it to AtlasManager.js + * @type {number} The size in pixels of the first atlas image. Default is * `256`. */ -_ol_.INITIAL_ATLAS_SIZE = 256; +export var INITIAL_ATLAS_SIZE = 256; /** - * @define {number} The maximum size in pixels of atlas images. Default is - * `-1`, meaning it is not used (and `ol.WEBGL_MAX_TEXTURE_SIZE` is + * TODO: get rid of this or move it to AtlasManager.js + * @type {number} The maximum size in pixels of atlas images. Default is + * `-1`, meaning it is not used (and `WEBGL_MAX_TEXTURE_SIZE` is * used instead). */ -_ol_.MAX_ATLAS_SIZE = -1; +export var MAX_ATLAS_SIZE = -1; /** - * @define {number} Maximum mouse wheel delta. + * TODO: move this to MouseWheelZoom.js + * @type {number} Maximum mouse wheel delta. */ -_ol_.MOUSEWHEELZOOM_MAXDELTA = 1; +export var MOUSEWHEELZOOM_MAXDELTA = 1; /** - * @define {number} Maximum width and/or height extent ratio that determines + * TODO: move this to OverviewMap.js + * @type {number} Maximum width and/or height extent ratio that determines * when the overview map should be zoomed out. */ -_ol_.OVERVIEWMAP_MAX_RATIO = 0.75; +export var OVERVIEWMAP_MAX_RATIO = 0.75; /** - * @define {number} Minimum width and/or height extent ratio that determines + * TODO: move this to OverviewMap.js + * @type {number} Minimum width and/or height extent ratio that determines * when the overview map should be zoomed in. */ -_ol_.OVERVIEWMAP_MIN_RATIO = 0.1; +export var OVERVIEWMAP_MIN_RATIO = 0.1; /** - * @define {number} Maximum number of source tiles for raster reprojection of - * a single tile. - * If too many source tiles are determined to be loaded to create a single - * reprojected tile the browser can become unresponsive or even crash. - * This can happen if the developer defines projections improperly and/or - * with unlimited extents. - * If too many tiles are required, no tiles are loaded and - * `ol.TileState.ERROR` state is set. Default is `100`. - */ -_ol_.RASTER_REPROJECTION_MAX_SOURCE_TILES = 100; - - -/** - * @define {number} Maximum number of subdivision steps during raster + * TODO: move this to Triangulation.js + * @type {number} Maximum number of subdivision steps during raster * reprojection triangulation. Prevents high memory usage and large * number of proj4 calls (for certain transformations and areas). * At most `2*(2^this)` triangles are created for each triangulated * extent (tile/image). Default is `10`. */ -_ol_.RASTER_REPROJECTION_MAX_SUBDIVISION = 10; +export var RASTER_REPROJECTION_MAX_SUBDIVISION = 10; /** - * @define {number} Maximum allowed size of triangle relative to world width. + * TODO: move this to Triangulation.js + * @type {number} Maximum allowed size of triangle relative to world width. * When transforming corners of world extent between certain projections, * the resulting triangulation seems to have zero error and no subdivision * is performed. * If the triangle width is more than this (relative to world width; 0-1), - * subdivison is forced (up to `ol.RASTER_REPROJECTION_MAX_SUBDIVISION`). + * subdivison is forced (up to `RASTER_REPROJECTION_MAX_SUBDIVISION`). * Default is `0.25`. */ -_ol_.RASTER_REPROJECTION_MAX_TRIANGLE_WIDTH = 0.25; +export var RASTER_REPROJECTION_MAX_TRIANGLE_WIDTH = 0.25; /** - * @define {number} Tolerance for geometry simplification in device pixels. + * TODO: move this to renderer/vector.js + * @type {number} Tolerance for geometry simplification in device pixels. */ -_ol_.SIMPLIFY_TOLERANCE = 0.5; +export var SIMPLIFY_TOLERANCE = 0.5; /** - * @define {number} Texture cache high water mark. + * TODO: move this to webgl/Map.js + * @type {number} Texture cache high water mark. */ -_ol_.WEBGL_TEXTURE_CACHE_HIGH_WATER_MARK = 1024; +export var WEBGL_TEXTURE_CACHE_HIGH_WATER_MARK = 1024; /** - * @define {string} OpenLayers version. + * @type {string} OpenLayers version. */ -_ol_.VERSION = 'v4.6.4'; +export var VERSION = 'v4.6.4'; /** @@ -182,7 +179,7 @@ _ol_.VERSION = 'v4.6.4'; * @const * @type {number|undefined} */ -_ol_.WEBGL_MAX_TEXTURE_SIZE; // value is set in `ol.has` +var WEBGL_MAX_TEXTURE_SIZE; // value is set below /** @@ -190,7 +187,33 @@ _ol_.WEBGL_MAX_TEXTURE_SIZE; // value is set in `ol.has` * @const * @type {Array.} */ -_ol_.WEBGL_EXTENSIONS; // value is set in `ol.has` +var WEBGL_EXTENSIONS; // value is set below + + +/** + * WebGL is available. + * @type {boolean} + */ +var HAS_WEBGL = false; + + +if (ENABLE_WEBGL && 'WebGLRenderingContext' in window) { + try { + var canvas = /** @type {HTMLCanvasElement} */ + (document.createElement('CANVAS')); + var gl = webgl.getContext(canvas, {failIfMajorPerformanceCaveat: true}); + if (gl) { + HAS_WEBGL = true; + WEBGL_MAX_TEXTURE_SIZE = /** @type {number} */ + (gl.getParameter(gl.MAX_TEXTURE_SIZE)); + WEBGL_EXTENSIONS = gl.getSupportedExtensions(); + } + } catch (e) { + // pass + } +} + +export {HAS_WEBGL, WEBGL_MAX_TEXTURE_SIZE, WEBGL_EXTENSIONS}; /** @@ -205,7 +228,7 @@ _ol_.WEBGL_EXTENSIONS; // value is set in `ol.has` * // Call parent constructor * ParentClass.call(this, a, b); * } - * ol.inherits(ChildClass, ParentClass); + * inherits(ChildClass, ParentClass); * * var child = new ChildClass('a', 'b', 'see'); * child.foo(); // This works. @@ -215,10 +238,10 @@ _ol_.WEBGL_EXTENSIONS; // value is set in `ol.has` * @function * @api */ -_ol_.inherits = function(childCtor, parentCtor) { +export function inherits(childCtor, parentCtor) { childCtor.prototype = Object.create(parentCtor.prototype); childCtor.prototype.constructor = childCtor; -}; +} /** @@ -226,9 +249,16 @@ _ol_.inherits = function(childCtor, parentCtor) { * * @return {undefined} Nothing. */ -_ol_.nullFunction = function() {}; +export function nullFunction() {} +/** + * Counter for getUid. + * @type {number} + * @private + */ +var uidCounter_ = 0; + /** * Gets a unique ID for an object. This mutates the object so that further calls * with the same object as a parameter returns the same value. Unique IDs are generated @@ -237,16 +267,37 @@ _ol_.nullFunction = function() {}; * @param {Object} obj The object to get the unique ID for. * @return {number} The unique ID for the object. */ -_ol_.getUid = function(obj) { - return obj.ol_uid || - (obj.ol_uid = ++_ol_.uidCounter_); +export function getUid(obj) { + return obj.ol_uid || (obj.ol_uid = ++uidCounter_); +} + + +export default { + getUid: getUid, + nullFunction: nullFunction, + inherits: inherits, + VERSION: VERSION, + ASSUME_TOUCH: ASSUME_TOUCH, + DEFAULT_MAX_ZOOM: DEFAULT_MAX_ZOOM, + DEFAULT_MIN_ZOOM: DEFAULT_MIN_ZOOM, + DEFAULT_RASTER_REPROJECTION_ERROR_THRESHOLD: DEFAULT_RASTER_REPROJECTION_ERROR_THRESHOLD, + DEFAULT_TILE_SIZE: DEFAULT_TILE_SIZE, + DEFAULT_WMS_VERSION: DEFAULT_WMS_VERSION, + ENABLE_CANVAS: ENABLE_CANVAS, + ENABLE_PROJ4JS: ENABLE_PROJ4JS, + ENABLE_RASTER_REPROJECTION: ENABLE_RASTER_REPROJECTION, + ENABLE_WEBGL: ENABLE_WEBGL, + DEBUG_WEBGL: DEBUG_WEBGL, + INITIAL_ATLAS_SIZE: INITIAL_ATLAS_SIZE, + MAX_ATLAS_SIZE: MAX_ATLAS_SIZE, + MOUSEWHEELZOOM_MAXDELTA: MOUSEWHEELZOOM_MAXDELTA, + OVERVIEWMAP_MAX_RATIO: OVERVIEWMAP_MAX_RATIO, + OVERVIEWMAP_MIN_RATIO: OVERVIEWMAP_MIN_RATIO, + RASTER_REPROJECTION_MAX_SUBDIVISION: RASTER_REPROJECTION_MAX_SUBDIVISION, + RASTER_REPROJECTION_MAX_TRIANGLE_WIDTH: RASTER_REPROJECTION_MAX_TRIANGLE_WIDTH, + SIMPLIFY_TOLERANCE: SIMPLIFY_TOLERANCE, + HAS_WEBGL: HAS_WEBGL, + WEBGL_TEXTURE_CACHE_HIGH_WATER_MARK: WEBGL_TEXTURE_CACHE_HIGH_WATER_MARK, + WEBGL_MAX_TEXTURE_SIZE: WEBGL_MAX_TEXTURE_SIZE, + WEBGL_EXTENSIONS: WEBGL_EXTENSIONS }; - - -/** - * Counter for getUid. - * @type {number} - * @private - */ -_ol_.uidCounter_ = 0; -export default _ol_; diff --git a/src/ol/interaction/DoubleClickZoom.js b/src/ol/interaction/DoubleClickZoom.js index 1cdc375b66..f9a951c104 100644 --- a/src/ol/interaction/DoubleClickZoom.js +++ b/src/ol/interaction/DoubleClickZoom.js @@ -1,7 +1,7 @@ /** * @module ol/interaction/DoubleClickZoom */ -import _ol_ from '../index.js'; +import {inherits} from '../index.js'; import _ol_MapBrowserEventType_ from '../MapBrowserEventType.js'; import _ol_interaction_Interaction_ from '../interaction/Interaction.js'; @@ -36,7 +36,7 @@ var _ol_interaction_DoubleClickZoom_ = function(opt_options) { }; -_ol_.inherits(_ol_interaction_DoubleClickZoom_, _ol_interaction_Interaction_); +inherits(_ol_interaction_DoubleClickZoom_, _ol_interaction_Interaction_); /** diff --git a/src/ol/interaction/DragAndDrop.js b/src/ol/interaction/DragAndDrop.js index 1bf6ce05ec..5056161635 100644 --- a/src/ol/interaction/DragAndDrop.js +++ b/src/ol/interaction/DragAndDrop.js @@ -3,7 +3,7 @@ */ // FIXME should handle all geo-referenced data, not just vector data -import _ol_ from '../index.js'; +import {inherits} from '../index.js'; import _ol_functions_ from '../functions.js'; import _ol_events_ from '../events.js'; import _ol_events_Event_ from '../events/Event.js'; @@ -63,7 +63,7 @@ var _ol_interaction_DragAndDrop_ = function(opt_options) { }; -_ol_.inherits(_ol_interaction_DragAndDrop_, _ol_interaction_Interaction_); +inherits(_ol_interaction_DragAndDrop_, _ol_interaction_Interaction_); /** @@ -277,5 +277,5 @@ _ol_interaction_DragAndDrop_.Event = function(type, file, opt_features, opt_proj this.projection = opt_projection; }; -_ol_.inherits(_ol_interaction_DragAndDrop_.Event, _ol_events_Event_); +inherits(_ol_interaction_DragAndDrop_.Event, _ol_events_Event_); export default _ol_interaction_DragAndDrop_; diff --git a/src/ol/interaction/DragBox.js b/src/ol/interaction/DragBox.js index 50974faf1f..1ee3e33850 100644 --- a/src/ol/interaction/DragBox.js +++ b/src/ol/interaction/DragBox.js @@ -3,7 +3,7 @@ */ // FIXME draw drag box import _ol_events_Event_ from '../events/Event.js'; -import _ol_ from '../index.js'; +import {inherits, nullFunction} from '../index.js'; import _ol_events_condition_ from '../events/condition.js'; import _ol_interaction_Pointer_ from '../interaction/Pointer.js'; import _ol_render_Box_ from '../render/Box.js'; @@ -68,7 +68,7 @@ var _ol_interaction_DragBox_ = function(opt_options) { options.boxEndCondition : _ol_interaction_DragBox_.defaultBoxEndCondition; }; -_ol_.inherits(_ol_interaction_DragBox_, _ol_interaction_Pointer_); +inherits(_ol_interaction_DragBox_, _ol_interaction_Pointer_); /** @@ -121,7 +121,7 @@ _ol_interaction_DragBox_.prototype.getGeometry = function() { * @param {ol.MapBrowserEvent} mapBrowserEvent Map browser event. * @protected */ -_ol_interaction_DragBox_.prototype.onBoxEnd = _ol_.nullFunction; +_ol_interaction_DragBox_.prototype.onBoxEnd = nullFunction; /** @@ -231,5 +231,5 @@ _ol_interaction_DragBox_.Event = function(type, coordinate, mapBrowserEvent) { this.mapBrowserEvent = mapBrowserEvent; }; -_ol_.inherits(_ol_interaction_DragBox_.Event, _ol_events_Event_); +inherits(_ol_interaction_DragBox_.Event, _ol_events_Event_); export default _ol_interaction_DragBox_; diff --git a/src/ol/interaction/DragPan.js b/src/ol/interaction/DragPan.js index 7cdc0acd65..dec18402c5 100644 --- a/src/ol/interaction/DragPan.js +++ b/src/ol/interaction/DragPan.js @@ -1,7 +1,7 @@ /** * @module ol/interaction/DragPan */ -import _ol_ from '../index.js'; +import {inherits} from '../index.js'; import _ol_ViewHint_ from '../ViewHint.js'; import _ol_coordinate_ from '../coordinate.js'; import _ol_easing_ from '../easing.js'; @@ -59,7 +59,7 @@ var _ol_interaction_DragPan_ = function(opt_options) { }; -_ol_.inherits(_ol_interaction_DragPan_, _ol_interaction_Pointer_); +inherits(_ol_interaction_DragPan_, _ol_interaction_Pointer_); /** diff --git a/src/ol/interaction/DragRotate.js b/src/ol/interaction/DragRotate.js index 2ba9bb4911..c820937e29 100644 --- a/src/ol/interaction/DragRotate.js +++ b/src/ol/interaction/DragRotate.js @@ -1,7 +1,7 @@ /** * @module ol/interaction/DragRotate */ -import _ol_ from '../index.js'; +import {inherits} from '../index.js'; import _ol_RotationConstraint_ from '../RotationConstraint.js'; import _ol_ViewHint_ from '../ViewHint.js'; import _ol_events_condition_ from '../events/condition.js'; @@ -52,7 +52,7 @@ var _ol_interaction_DragRotate_ = function(opt_options) { this.duration_ = options.duration !== undefined ? options.duration : 250; }; -_ol_.inherits(_ol_interaction_DragRotate_, _ol_interaction_Pointer_); +inherits(_ol_interaction_DragRotate_, _ol_interaction_Pointer_); /** diff --git a/src/ol/interaction/DragRotateAndZoom.js b/src/ol/interaction/DragRotateAndZoom.js index 8810f50b99..4a1e163fd9 100644 --- a/src/ol/interaction/DragRotateAndZoom.js +++ b/src/ol/interaction/DragRotateAndZoom.js @@ -1,7 +1,7 @@ /** * @module ol/interaction/DragRotateAndZoom */ -import _ol_ from '../index.js'; +import {inherits} from '../index.js'; import _ol_RotationConstraint_ from '../RotationConstraint.js'; import _ol_ViewHint_ from '../ViewHint.js'; import _ol_events_condition_ from '../events/condition.js'; @@ -66,7 +66,7 @@ var _ol_interaction_DragRotateAndZoom_ = function(opt_options) { }; -_ol_.inherits(_ol_interaction_DragRotateAndZoom_, _ol_interaction_Pointer_); +inherits(_ol_interaction_DragRotateAndZoom_, _ol_interaction_Pointer_); /** diff --git a/src/ol/interaction/DragZoom.js b/src/ol/interaction/DragZoom.js index 1783d537be..53cdbf94ea 100644 --- a/src/ol/interaction/DragZoom.js +++ b/src/ol/interaction/DragZoom.js @@ -1,7 +1,7 @@ /** * @module ol/interaction/DragZoom */ -import _ol_ from '../index.js'; +import {inherits} from '../index.js'; import _ol_easing_ from '../easing.js'; import _ol_events_condition_ from '../events/condition.js'; import _ol_extent_ from '../extent.js'; @@ -46,7 +46,7 @@ var _ol_interaction_DragZoom_ = function(opt_options) { }; -_ol_.inherits(_ol_interaction_DragZoom_, _ol_interaction_DragBox_); +inherits(_ol_interaction_DragZoom_, _ol_interaction_DragBox_); /** diff --git a/src/ol/interaction/Draw.js b/src/ol/interaction/Draw.js index d657ad6e36..a52ae1213c 100644 --- a/src/ol/interaction/Draw.js +++ b/src/ol/interaction/Draw.js @@ -1,7 +1,7 @@ /** * @module ol/interaction/Draw */ -import _ol_ from '../index.js'; +import {inherits} from '../index.js'; import _ol_Feature_ from '../Feature.js'; import _ol_MapBrowserEventType_ from '../MapBrowserEventType.js'; import _ol_Object_ from '../Object.js'; @@ -290,7 +290,7 @@ var _ol_interaction_Draw_ = function(options) { }; -_ol_.inherits(_ol_interaction_Draw_, _ol_interaction_Pointer_); +inherits(_ol_interaction_Draw_, _ol_interaction_Pointer_); /** @@ -899,5 +899,5 @@ _ol_interaction_Draw_.Event = function(type, feature) { this.feature = feature; }; -_ol_.inherits(_ol_interaction_Draw_.Event, _ol_events_Event_); +inherits(_ol_interaction_Draw_.Event, _ol_events_Event_); export default _ol_interaction_Draw_; diff --git a/src/ol/interaction/Extent.js b/src/ol/interaction/Extent.js index 7cf26c6b87..61cf829556 100644 --- a/src/ol/interaction/Extent.js +++ b/src/ol/interaction/Extent.js @@ -1,7 +1,7 @@ /** * @module ol/interaction/Extent */ -import _ol_ from '../index.js'; +import {inherits} from '../index.js'; import _ol_Feature_ from '../Feature.js'; import _ol_MapBrowserEventType_ from '../MapBrowserEventType.js'; import _ol_MapBrowserPointerEvent_ from '../MapBrowserPointerEvent.js'; @@ -123,7 +123,7 @@ var _ol_interaction_Extent_ = function(opt_options) { } }; -_ol_.inherits(_ol_interaction_Extent_, _ol_interaction_Pointer_); +inherits(_ol_interaction_Extent_, _ol_interaction_Pointer_); /** * @param {ol.MapBrowserEvent} mapBrowserEvent Event. @@ -464,5 +464,5 @@ _ol_interaction_Extent_.Event = function(extent) { this.extent = extent; }; -_ol_.inherits(_ol_interaction_Extent_.Event, _ol_events_Event_); +inherits(_ol_interaction_Extent_.Event, _ol_events_Event_); export default _ol_interaction_Extent_; diff --git a/src/ol/interaction/Interaction.js b/src/ol/interaction/Interaction.js index 03ce2752ba..de1597544b 100644 --- a/src/ol/interaction/Interaction.js +++ b/src/ol/interaction/Interaction.js @@ -3,7 +3,7 @@ */ // FIXME factor out key precondition (shift et. al) -import _ol_ from '../index.js'; +import {inherits} from '../index.js'; import _ol_Object_ from '../Object.js'; import _ol_easing_ from '../easing.js'; import _ol_interaction_Property_ from '../interaction/Property.js'; @@ -45,7 +45,7 @@ var _ol_interaction_Interaction_ = function(options) { }; -_ol_.inherits(_ol_interaction_Interaction_, _ol_Object_); +inherits(_ol_interaction_Interaction_, _ol_Object_); /** diff --git a/src/ol/interaction/KeyboardPan.js b/src/ol/interaction/KeyboardPan.js index 3fdb68fa4c..00c02a7f2a 100644 --- a/src/ol/interaction/KeyboardPan.js +++ b/src/ol/interaction/KeyboardPan.js @@ -1,7 +1,7 @@ /** * @module ol/interaction/KeyboardPan */ -import _ol_ from '../index.js'; +import {inherits} from '../index.js'; import _ol_coordinate_ from '../coordinate.js'; import _ol_events_EventType_ from '../events/EventType.js'; import _ol_events_KeyCode_ from '../events/KeyCode.js'; @@ -65,7 +65,7 @@ var _ol_interaction_KeyboardPan_ = function(opt_options) { }; -_ol_.inherits(_ol_interaction_KeyboardPan_, _ol_interaction_Interaction_); +inherits(_ol_interaction_KeyboardPan_, _ol_interaction_Interaction_); /** * Handles the {@link ol.MapBrowserEvent map browser event} if it was a diff --git a/src/ol/interaction/KeyboardZoom.js b/src/ol/interaction/KeyboardZoom.js index e6d3f1fad0..b09a31e193 100644 --- a/src/ol/interaction/KeyboardZoom.js +++ b/src/ol/interaction/KeyboardZoom.js @@ -1,7 +1,7 @@ /** * @module ol/interaction/KeyboardZoom */ -import _ol_ from '../index.js'; +import {inherits} from '../index.js'; import _ol_events_EventType_ from '../events/EventType.js'; import _ol_events_condition_ from '../events/condition.js'; import _ol_interaction_Interaction_ from '../interaction/Interaction.js'; @@ -52,7 +52,7 @@ var _ol_interaction_KeyboardZoom_ = function(opt_options) { }; -_ol_.inherits(_ol_interaction_KeyboardZoom_, _ol_interaction_Interaction_); +inherits(_ol_interaction_KeyboardZoom_, _ol_interaction_Interaction_); /** diff --git a/src/ol/interaction/Modify.js b/src/ol/interaction/Modify.js index 6a12f817bf..63a8c67613 100644 --- a/src/ol/interaction/Modify.js +++ b/src/ol/interaction/Modify.js @@ -1,7 +1,7 @@ /** * @module ol/interaction/Modify */ -import _ol_ from '../index.js'; +import {getUid, inherits} from '../index.js'; import _ol_Collection_ from '../Collection.js'; import _ol_CollectionEventType_ from '../CollectionEventType.js'; import _ol_Feature_ from '../Feature.js'; @@ -227,7 +227,7 @@ var _ol_interaction_Modify_ = function(options) { }; -_ol_.inherits(_ol_interaction_Modify_, _ol_interaction_Pointer_); +inherits(_ol_interaction_Modify_, _ol_interaction_Pointer_); /** @@ -627,7 +627,7 @@ _ol_interaction_Modify_.handleDownEvent_ = function(evt) { for (var i = 0, ii = segmentDataMatches.length; i < ii; ++i) { var segmentDataMatch = segmentDataMatches[i]; var segment = segmentDataMatch.segment; - var uid = _ol_.getUid(segmentDataMatch.feature); + var uid = getUid(segmentDataMatch.feature); var depth = segmentDataMatch.depth; if (depth) { uid += '-' + depth.join('-'); // separate feature components @@ -662,7 +662,7 @@ _ol_interaction_Modify_.handleDownEvent_ = function(evt) { this.dragSegments_.push([segmentDataMatch, 1]); componentSegments[uid][1] = segmentDataMatch; - } else if (this.insertVertexCondition_(evt) && _ol_.getUid(segment) in this.vertexSegments_ && + } else if (this.insertVertexCondition_(evt) && getUid(segment) in this.vertexSegments_ && (!componentSegments[uid][0] && !componentSegments[uid][1])) { insertVertices.push([segmentDataMatch, vertex]); } @@ -890,14 +890,14 @@ _ol_interaction_Modify_.prototype.handlePointerAtPixel_ = function(pixel, map) { _ol_coordinate_.equals(closestSegment[1], segment[1]) || (_ol_coordinate_.equals(closestSegment[0], segment[1]) && _ol_coordinate_.equals(closestSegment[1], segment[0])))) { - vertexSegments[_ol_.getUid(segment)] = true; + vertexSegments[getUid(segment)] = true; } else { break; } } } - vertexSegments[_ol_.getUid(closestSegment)] = true; + vertexSegments[getUid(closestSegment)] = true; this.vertexSegments_ = vertexSegments; return; } @@ -1053,7 +1053,7 @@ _ol_interaction_Modify_.prototype.removeVertex_ = function() { for (i = dragSegments.length - 1; i >= 0; --i) { dragSegment = dragSegments[i]; segmentData = dragSegment[0]; - uid = _ol_.getUid(segmentData.feature); + uid = getUid(segmentData.feature); if (segmentData.depth) { // separate feature components uid += '-' + segmentData.depth.join('-'); @@ -1232,5 +1232,5 @@ _ol_interaction_Modify_.Event = function(type, features, mapBrowserPointerEvent) */ this.mapBrowserEvent = mapBrowserPointerEvent; }; -_ol_.inherits(_ol_interaction_Modify_.Event, _ol_events_Event_); +inherits(_ol_interaction_Modify_.Event, _ol_events_Event_); export default _ol_interaction_Modify_; diff --git a/src/ol/interaction/MouseWheelZoom.js b/src/ol/interaction/MouseWheelZoom.js index 3a229f1f3d..16e16dc7cc 100644 --- a/src/ol/interaction/MouseWheelZoom.js +++ b/src/ol/interaction/MouseWheelZoom.js @@ -1,7 +1,7 @@ /** * @module ol/interaction/MouseWheelZoom */ -import _ol_ from '../index.js'; +import {MOUSEWHEELZOOM_MAXDELTA, inherits} from '../index.js'; import _ol_ViewHint_ from '../ViewHint.js'; import _ol_easing_ from '../easing.js'; import _ol_events_EventType_ from '../events/EventType.js'; @@ -108,7 +108,7 @@ var _ol_interaction_MouseWheelZoom_ = function(opt_options) { }; -_ol_.inherits(_ol_interaction_MouseWheelZoom_, _ol_interaction_Interaction_); +inherits(_ol_interaction_MouseWheelZoom_, _ol_interaction_Interaction_); /** @@ -252,7 +252,7 @@ _ol_interaction_MouseWheelZoom_.prototype.handleWheelZoom_ = function(map) { if (view.getAnimating()) { view.cancelAnimations(); } - var maxDelta = _ol_.MOUSEWHEELZOOM_MAXDELTA; + var maxDelta = MOUSEWHEELZOOM_MAXDELTA; var delta = _ol_math_.clamp(this.delta_, -maxDelta, maxDelta); _ol_interaction_Interaction_.zoomByDelta(view, -delta, this.lastAnchor_, this.duration_); diff --git a/src/ol/interaction/PinchRotate.js b/src/ol/interaction/PinchRotate.js index 1cb0ca088c..a58b2e4bbc 100644 --- a/src/ol/interaction/PinchRotate.js +++ b/src/ol/interaction/PinchRotate.js @@ -1,7 +1,7 @@ /** * @module ol/interaction/PinchRotate */ -import _ol_ from '../index.js'; +import {inherits} from '../index.js'; import _ol_ViewHint_ from '../ViewHint.js'; import _ol_functions_ from '../functions.js'; import _ol_interaction_Interaction_ from '../interaction/Interaction.js'; @@ -66,7 +66,7 @@ var _ol_interaction_PinchRotate_ = function(opt_options) { }; -_ol_.inherits(_ol_interaction_PinchRotate_, _ol_interaction_Pointer_); +inherits(_ol_interaction_PinchRotate_, _ol_interaction_Pointer_); /** diff --git a/src/ol/interaction/PinchZoom.js b/src/ol/interaction/PinchZoom.js index 47c051a95d..d60b511bdb 100644 --- a/src/ol/interaction/PinchZoom.js +++ b/src/ol/interaction/PinchZoom.js @@ -1,7 +1,7 @@ /** * @module ol/interaction/PinchZoom */ -import _ol_ from '../index.js'; +import {inherits} from '../index.js'; import _ol_ViewHint_ from '../ViewHint.js'; import _ol_functions_ from '../functions.js'; import _ol_interaction_Interaction_ from '../interaction/Interaction.js'; @@ -59,7 +59,7 @@ var _ol_interaction_PinchZoom_ = function(opt_options) { }; -_ol_.inherits(_ol_interaction_PinchZoom_, _ol_interaction_Pointer_); +inherits(_ol_interaction_PinchZoom_, _ol_interaction_Pointer_); /** diff --git a/src/ol/interaction/Pointer.js b/src/ol/interaction/Pointer.js index e15a1bbadf..40735c1460 100644 --- a/src/ol/interaction/Pointer.js +++ b/src/ol/interaction/Pointer.js @@ -1,7 +1,7 @@ /** * @module ol/interaction/Pointer */ -import _ol_ from '../index.js'; +import {inherits, nullFunction} from '../index.js'; import _ol_functions_ from '../functions.js'; import _ol_MapBrowserEventType_ from '../MapBrowserEventType.js'; import _ol_MapBrowserPointerEvent_ from '../MapBrowserPointerEvent.js'; @@ -82,7 +82,7 @@ var _ol_interaction_Pointer_ = function(opt_options) { }; -_ol_.inherits(_ol_interaction_Pointer_, _ol_interaction_Interaction_); +inherits(_ol_interaction_Pointer_, _ol_interaction_Interaction_); /** @@ -142,7 +142,7 @@ _ol_interaction_Pointer_.prototype.updateTrackedPointers_ = function(mapBrowserE * @param {ol.MapBrowserPointerEvent} mapBrowserEvent Event. * @this {ol.interaction.Pointer} */ -_ol_interaction_Pointer_.handleDragEvent = _ol_.nullFunction; +_ol_interaction_Pointer_.handleDragEvent = nullFunction; /** @@ -165,7 +165,7 @@ _ol_interaction_Pointer_.handleDownEvent = _ol_functions_.FALSE; * @param {ol.MapBrowserPointerEvent} mapBrowserEvent Event. * @this {ol.interaction.Pointer} */ -_ol_interaction_Pointer_.handleMoveEvent = _ol_.nullFunction; +_ol_interaction_Pointer_.handleMoveEvent = nullFunction; /** diff --git a/src/ol/interaction/Select.js b/src/ol/interaction/Select.js index 4d89194bc6..628bc46321 100644 --- a/src/ol/interaction/Select.js +++ b/src/ol/interaction/Select.js @@ -1,7 +1,7 @@ /** * @module ol/interaction/Select */ -import _ol_ from '../index.js'; +import {getUid, inherits} from '../index.js'; import _ol_CollectionEventType_ from '../CollectionEventType.js'; import _ol_array_ from '../array.js'; import _ol_events_ from '../events.js'; @@ -143,7 +143,7 @@ var _ol_interaction_Select_ = function(opt_options) { }; -_ol_.inherits(_ol_interaction_Select_, _ol_interaction_Interaction_); +inherits(_ol_interaction_Select_, _ol_interaction_Interaction_); /** @@ -152,7 +152,7 @@ _ol_.inherits(_ol_interaction_Select_, _ol_interaction_Interaction_); * @private */ _ol_interaction_Select_.prototype.addFeatureLayerAssociation_ = function(feature, layer) { - var key = _ol_.getUid(feature); + var key = getUid(feature); this.featureLayerAssociation_[key] = layer; }; @@ -187,7 +187,7 @@ _ol_interaction_Select_.prototype.getHitTolerance = function() { * @api */ _ol_interaction_Select_.prototype.getLayer = function(feature) { - var key = _ol_.getUid(feature); + var key = getUid(feature); return /** @type {ol.layer.Vector} */ (this.featureLayerAssociation_[key]); }; @@ -372,7 +372,7 @@ _ol_interaction_Select_.prototype.removeFeature_ = function(evt) { * @private */ _ol_interaction_Select_.prototype.removeFeatureLayerAssociation_ = function(feature) { - var key = _ol_.getUid(feature); + var key = getUid(feature); delete this.featureLayerAssociation_[key]; }; @@ -415,7 +415,7 @@ _ol_interaction_Select_.Event = function(type, selected, deselected, mapBrowserE */ this.mapBrowserEvent = mapBrowserEvent; }; -_ol_.inherits(_ol_interaction_Select_.Event, _ol_events_Event_); +inherits(_ol_interaction_Select_.Event, _ol_events_Event_); /** diff --git a/src/ol/interaction/Snap.js b/src/ol/interaction/Snap.js index 594a606172..15bc348fdf 100644 --- a/src/ol/interaction/Snap.js +++ b/src/ol/interaction/Snap.js @@ -1,7 +1,7 @@ /** * @module ol/interaction/Snap */ -import _ol_ from '../index.js'; +import {getUid, inherits} from '../index.js'; import _ol_Collection_ from '../Collection.js'; import _ol_CollectionEventType_ from '../CollectionEventType.js'; import _ol_coordinate_ from '../coordinate.js'; @@ -149,7 +149,7 @@ var _ol_interaction_Snap_ = function(opt_options) { }; }; -_ol_.inherits(_ol_interaction_Snap_, _ol_interaction_Pointer_); +inherits(_ol_interaction_Snap_, _ol_interaction_Pointer_); /** @@ -161,7 +161,7 @@ _ol_.inherits(_ol_interaction_Snap_, _ol_interaction_Pointer_); */ _ol_interaction_Snap_.prototype.addFeature = function(feature, opt_listen) { var listen = opt_listen !== undefined ? opt_listen : true; - var feature_uid = _ol_.getUid(feature); + var feature_uid = getUid(feature); var geometry = feature.getGeometry(); if (geometry) { var segmentWriter = this.SEGMENT_WRITERS_[geometry.getType()]; @@ -251,7 +251,7 @@ _ol_interaction_Snap_.prototype.handleFeatureRemove_ = function(evt) { _ol_interaction_Snap_.prototype.handleFeatureChange_ = function(evt) { var feature = /** @type {ol.Feature} */ (evt.target); if (this.handlingDownUpSequence) { - var uid = _ol_.getUid(feature); + var uid = getUid(feature); if (!(uid in this.pendingFeatures_)) { this.pendingFeatures_[uid] = feature; } @@ -270,7 +270,7 @@ _ol_interaction_Snap_.prototype.handleFeatureChange_ = function(evt) { */ _ol_interaction_Snap_.prototype.removeFeature = function(feature, opt_unlisten) { var unlisten = opt_unlisten !== undefined ? opt_unlisten : true; - var feature_uid = _ol_.getUid(feature); + var feature_uid = getUid(feature); var extent = this.indexedFeaturesExtents_[feature_uid]; if (extent) { var rBush = this.rBush_; diff --git a/src/ol/interaction/Translate.js b/src/ol/interaction/Translate.js index 675149a18c..7560b17205 100644 --- a/src/ol/interaction/Translate.js +++ b/src/ol/interaction/Translate.js @@ -1,7 +1,7 @@ /** * @module ol/interaction/Translate */ -import _ol_ from '../index.js'; +import {inherits} from '../index.js'; import _ol_Collection_ from '../Collection.js'; import _ol_Object_ from '../Object.js'; import _ol_events_ from '../events.js'; @@ -85,7 +85,7 @@ var _ol_interaction_Translate_ = function(opt_options) { }; -_ol_.inherits(_ol_interaction_Translate_, _ol_interaction_Pointer_); +inherits(_ol_interaction_Translate_, _ol_interaction_Pointer_); /** @@ -293,5 +293,5 @@ _ol_interaction_Translate_.Event = function(type, features, coordinate) { */ this.coordinate = coordinate; }; -_ol_.inherits(_ol_interaction_Translate_.Event, _ol_events_Event_); +inherits(_ol_interaction_Translate_.Event, _ol_events_Event_); export default _ol_interaction_Translate_; diff --git a/src/ol/layer/Base.js b/src/ol/layer/Base.js index d3e6308214..9e0af69142 100644 --- a/src/ol/layer/Base.js +++ b/src/ol/layer/Base.js @@ -1,7 +1,7 @@ /** * @module ol/layer/Base */ -import _ol_ from '../index.js'; +import {inherits} from '../index.js'; import _ol_Object_ from '../Object.js'; import _ol_layer_Property_ from '../layer/Property.js'; import _ol_math_ from '../math.js'; @@ -60,7 +60,7 @@ var _ol_layer_Base_ = function(options) { }; -_ol_.inherits(_ol_layer_Base_, _ol_Object_); +inherits(_ol_layer_Base_, _ol_Object_); /** diff --git a/src/ol/layer/Group.js b/src/ol/layer/Group.js index f144c3d47b..5d880eb1c7 100644 --- a/src/ol/layer/Group.js +++ b/src/ol/layer/Group.js @@ -1,7 +1,7 @@ /** * @module ol/layer/Group */ -import _ol_ from '../index.js'; +import {getUid, inherits} from '../index.js'; import _ol_Collection_ from '../Collection.js'; import _ol_CollectionEventType_ from '../CollectionEventType.js'; import _ol_Object_ from '../Object.js'; @@ -68,7 +68,7 @@ var _ol_layer_Group_ = function(opt_options) { }; -_ol_.inherits(_ol_layer_Group_, _ol_layer_Base_); +inherits(_ol_layer_Group_, _ol_layer_Base_); /** @@ -103,7 +103,7 @@ _ol_layer_Group_.prototype.handleLayersChanged_ = function(event) { var i, ii, layer; for (i = 0, ii = layersArray.length; i < ii; i++) { layer = layersArray[i]; - this.listenerKeys_[_ol_.getUid(layer).toString()] = [ + this.listenerKeys_[getUid(layer).toString()] = [ _ol_events_.listen(layer, _ol_ObjectEventType_.PROPERTYCHANGE, this.handleLayerChange_, this), _ol_events_.listen(layer, _ol_events_EventType_.CHANGE, @@ -121,7 +121,7 @@ _ol_layer_Group_.prototype.handleLayersChanged_ = function(event) { */ _ol_layer_Group_.prototype.handleLayersAdd_ = function(collectionEvent) { var layer = /** @type {ol.layer.Base} */ (collectionEvent.element); - var key = _ol_.getUid(layer).toString(); + var key = getUid(layer).toString(); this.listenerKeys_[key] = [ _ol_events_.listen(layer, _ol_ObjectEventType_.PROPERTYCHANGE, this.handleLayerChange_, this), @@ -138,7 +138,7 @@ _ol_layer_Group_.prototype.handleLayersAdd_ = function(collectionEvent) { */ _ol_layer_Group_.prototype.handleLayersRemove_ = function(collectionEvent) { var layer = /** @type {ol.layer.Base} */ (collectionEvent.element); - var key = _ol_.getUid(layer).toString(); + var key = getUid(layer).toString(); this.listenerKeys_[key].forEach(_ol_events_.unlistenByKey); delete this.listenerKeys_[key]; this.changed(); diff --git a/src/ol/layer/Heatmap.js b/src/ol/layer/Heatmap.js index 57e9729084..b6a94ff922 100644 --- a/src/ol/layer/Heatmap.js +++ b/src/ol/layer/Heatmap.js @@ -2,7 +2,7 @@ * @module ol/layer/Heatmap */ import _ol_events_ from '../events.js'; -import _ol_ from '../index.js'; +import {inherits} from '../index.js'; import _ol_Object_ from '../Object.js'; import _ol_dom_ from '../dom.js'; import _ol_layer_Vector_ from '../layer/Vector.js'; @@ -118,7 +118,7 @@ var _ol_layer_Heatmap_ = function(opt_options) { _ol_events_.listen(this, _ol_render_EventType_.RENDER, this.handleRender_, this); }; -_ol_.inherits(_ol_layer_Heatmap_, _ol_layer_Vector_); +inherits(_ol_layer_Heatmap_, _ol_layer_Vector_); /** diff --git a/src/ol/layer/Image.js b/src/ol/layer/Image.js index 35de5b8d42..ca262f1d70 100644 --- a/src/ol/layer/Image.js +++ b/src/ol/layer/Image.js @@ -1,7 +1,7 @@ /** * @module ol/layer/Image */ -import _ol_ from '../index.js'; +import {inherits} from '../index.js'; import _ol_LayerType_ from '../LayerType.js'; import _ol_layer_Layer_ from '../layer/Layer.js'; @@ -32,7 +32,7 @@ var _ol_layer_Image_ = function(opt_options) { }; -_ol_.inherits(_ol_layer_Image_, _ol_layer_Layer_); +inherits(_ol_layer_Image_, _ol_layer_Layer_); /** diff --git a/src/ol/layer/Layer.js b/src/ol/layer/Layer.js index a850da96fb..9daf837d04 100644 --- a/src/ol/layer/Layer.js +++ b/src/ol/layer/Layer.js @@ -3,7 +3,7 @@ */ import _ol_events_ from '../events.js'; import _ol_events_EventType_ from '../events/EventType.js'; -import _ol_ from '../index.js'; +import {getUid, inherits} from '../index.js'; import _ol_Object_ from '../Object.js'; import _ol_layer_Base_ from '../layer/Base.js'; import _ol_layer_Property_ from '../layer/Property.js'; @@ -70,7 +70,7 @@ var _ol_layer_Layer_ = function(options) { this.setSource(source); }; -_ol_.inherits(_ol_layer_Layer_, _ol_layer_Base_); +inherits(_ol_layer_Layer_, _ol_layer_Base_); /** @@ -184,7 +184,7 @@ _ol_layer_Layer_.prototype.setMap = function(map) { layerState.managed = false; layerState.zIndex = Infinity; evt.frameState.layerStatesArray.push(layerState); - evt.frameState.layerStates[_ol_.getUid(this)] = layerState; + evt.frameState.layerStates[getUid(this)] = layerState; }, this); this.mapRenderKey_ = _ol_events_.listen( this, _ol_events_EventType_.CHANGE, map.render, map); diff --git a/src/ol/layer/Tile.js b/src/ol/layer/Tile.js index 808543d4d4..4f788d2a9b 100644 --- a/src/ol/layer/Tile.js +++ b/src/ol/layer/Tile.js @@ -1,7 +1,7 @@ /** * @module ol/layer/Tile */ -import _ol_ from '../index.js'; +import {inherits} from '../index.js'; import _ol_LayerType_ from '../LayerType.js'; import _ol_layer_Layer_ from '../layer/Layer.js'; import _ol_layer_TileProperty_ from '../layer/TileProperty.js'; @@ -43,7 +43,7 @@ var _ol_layer_Tile_ = function(opt_options) { }; -_ol_.inherits(_ol_layer_Tile_, _ol_layer_Layer_); +inherits(_ol_layer_Tile_, _ol_layer_Layer_); /** diff --git a/src/ol/layer/Vector.js b/src/ol/layer/Vector.js index 5954f0892b..8df28ea20a 100644 --- a/src/ol/layer/Vector.js +++ b/src/ol/layer/Vector.js @@ -1,7 +1,7 @@ /** * @module ol/layer/Vector */ -import _ol_ from '../index.js'; +import {inherits} from '../index.js'; import _ol_LayerType_ from '../LayerType.js'; import _ol_layer_Layer_ from '../layer/Layer.js'; import _ol_layer_VectorRenderType_ from '../layer/VectorRenderType.js'; @@ -91,7 +91,7 @@ var _ol_layer_Vector_ = function(opt_options) { }; -_ol_.inherits(_ol_layer_Vector_, _ol_layer_Layer_); +inherits(_ol_layer_Vector_, _ol_layer_Layer_); /** diff --git a/src/ol/layer/VectorTile.js b/src/ol/layer/VectorTile.js index edbe026e54..3d11211b0a 100644 --- a/src/ol/layer/VectorTile.js +++ b/src/ol/layer/VectorTile.js @@ -1,7 +1,7 @@ /** * @module ol/layer/VectorTile */ -import _ol_ from '../index.js'; +import {inherits} from '../index.js'; import _ol_LayerType_ from '../LayerType.js'; import _ol_asserts_ from '../asserts.js'; import _ol_layer_TileProperty_ from '../layer/TileProperty.js'; @@ -54,7 +54,7 @@ var _ol_layer_VectorTile_ = function(opt_options) { }; -_ol_.inherits(_ol_layer_VectorTile_, _ol_layer_Vector_); +inherits(_ol_layer_VectorTile_, _ol_layer_Vector_); /** diff --git a/src/ol/net.js b/src/ol/net.js index c1ba1812af..10ff5b40d7 100644 --- a/src/ol/net.js +++ b/src/ol/net.js @@ -1,7 +1,7 @@ /** * @module ol/net */ -import _ol_ from './index.js'; +import {getUid} from './index.js'; var _ol_net_ = {}; @@ -18,7 +18,7 @@ var _ol_net_ = {}; */ _ol_net_.jsonp = function(url, callback, opt_errback, opt_callbackParam) { var script = document.createElement('script'); - var key = 'olc_' + _ol_.getUid(callback); + var key = 'olc_' + getUid(callback); function cleanup() { delete window[key]; script.parentNode.removeChild(script); diff --git a/src/ol/pointer/MouseSource.js b/src/ol/pointer/MouseSource.js index 22c02ced94..e9be05264d 100644 --- a/src/ol/pointer/MouseSource.js +++ b/src/ol/pointer/MouseSource.js @@ -31,7 +31,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -import _ol_ from '../index.js'; +import {inherits} from '../index.js'; import _ol_pointer_EventSource_ from '../pointer/EventSource.js'; /** @@ -62,7 +62,7 @@ var _ol_pointer_MouseSource_ = function(dispatcher) { this.lastTouches = []; }; -_ol_.inherits(_ol_pointer_MouseSource_, _ol_pointer_EventSource_); +inherits(_ol_pointer_MouseSource_, _ol_pointer_EventSource_); /** diff --git a/src/ol/pointer/MsSource.js b/src/ol/pointer/MsSource.js index 3988645498..fce9a24849 100644 --- a/src/ol/pointer/MsSource.js +++ b/src/ol/pointer/MsSource.js @@ -31,7 +31,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -import _ol_ from '../index.js'; +import {inherits} from '../index.js'; import _ol_pointer_EventSource_ from '../pointer/EventSource.js'; /** @@ -71,7 +71,7 @@ var _ol_pointer_MsSource_ = function(dispatcher) { ]; }; -_ol_.inherits(_ol_pointer_MsSource_, _ol_pointer_EventSource_); +inherits(_ol_pointer_MsSource_, _ol_pointer_EventSource_); /** diff --git a/src/ol/pointer/NativeSource.js b/src/ol/pointer/NativeSource.js index 7c5fd1193c..60d234d975 100644 --- a/src/ol/pointer/NativeSource.js +++ b/src/ol/pointer/NativeSource.js @@ -31,7 +31,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -import _ol_ from '../index.js'; +import {inherits} from '../index.js'; import _ol_pointer_EventSource_ from '../pointer/EventSource.js'; /** @@ -53,7 +53,7 @@ var _ol_pointer_NativeSource_ = function(dispatcher) { _ol_pointer_EventSource_.call(this, dispatcher, mapping); }; -_ol_.inherits(_ol_pointer_NativeSource_, _ol_pointer_EventSource_); +inherits(_ol_pointer_NativeSource_, _ol_pointer_EventSource_); /** diff --git a/src/ol/pointer/PointerEvent.js b/src/ol/pointer/PointerEvent.js index 49d916bce3..60615f8b89 100644 --- a/src/ol/pointer/PointerEvent.js +++ b/src/ol/pointer/PointerEvent.js @@ -31,7 +31,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -import _ol_ from '../index.js'; +import {inherits} from '../index.js'; import _ol_events_Event_ from '../events/Event.js'; /** @@ -192,7 +192,7 @@ var _ol_pointer_PointerEvent_ = function(type, originalEvent, opt_eventDict) { } }; -_ol_.inherits(_ol_pointer_PointerEvent_, _ol_events_Event_); +inherits(_ol_pointer_PointerEvent_, _ol_events_Event_); /** diff --git a/src/ol/pointer/PointerEventHandler.js b/src/ol/pointer/PointerEventHandler.js index cd7c426a7a..96af4318f1 100644 --- a/src/ol/pointer/PointerEventHandler.js +++ b/src/ol/pointer/PointerEventHandler.js @@ -31,7 +31,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -import _ol_ from '../index.js'; +import {inherits} from '../index.js'; import _ol_events_ from '../events.js'; import _ol_events_EventTarget_ from '../events/EventTarget.js'; import _ol_has_ from '../has.js'; @@ -78,7 +78,7 @@ var _ol_pointer_PointerEventHandler_ = function(element) { this.registerSources(); }; -_ol_.inherits(_ol_pointer_PointerEventHandler_, _ol_events_EventTarget_); +inherits(_ol_pointer_PointerEventHandler_, _ol_events_EventTarget_); /** diff --git a/src/ol/pointer/TouchSource.js b/src/ol/pointer/TouchSource.js index 1a483be84e..eda947c3cc 100644 --- a/src/ol/pointer/TouchSource.js +++ b/src/ol/pointer/TouchSource.js @@ -31,7 +31,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -import _ol_ from '../index.js'; +import {inherits} from '../index.js'; import _ol_array_ from '../array.js'; import _ol_pointer_EventSource_ from '../pointer/EventSource.js'; import _ol_pointer_MouseSource_ from '../pointer/MouseSource.js'; @@ -82,7 +82,7 @@ var _ol_pointer_TouchSource_ = function(dispatcher, mouseSource) { this.resetId_ = undefined; }; -_ol_.inherits(_ol_pointer_TouchSource_, _ol_pointer_EventSource_); +inherits(_ol_pointer_TouchSource_, _ol_pointer_EventSource_); /** diff --git a/src/ol/proj.js b/src/ol/proj.js index 641b675228..d28c2616d1 100644 --- a/src/ol/proj.js +++ b/src/ol/proj.js @@ -1,7 +1,7 @@ /** * @module ol/proj */ -import _ol_ from './index.js'; +import {ENABLE_PROJ4JS} from './index.js'; import _ol_Sphere_ from './Sphere.js'; import _ol_extent_ from './extent.js'; import _ol_math_ from './math.js'; @@ -32,7 +32,7 @@ _ol_proj_.METERS_PER_UNIT = _ol_proj_Units_.METERS_PER_UNIT; _ol_proj_.SPHERE_ = new _ol_Sphere_(_ol_Sphere_.DEFAULT_RADIUS); -if (_ol_.ENABLE_PROJ4JS) { +if (ENABLE_PROJ4JS) { /** * Register proj4. If not explicitly registered, it will be assumed that * proj4js will be loaded in the global namespace. For example in a @@ -311,7 +311,7 @@ _ol_proj_.get = function(projectionLike) { } else if (typeof projectionLike === 'string') { var code = projectionLike; projection = _ol_proj_projections_.get(code); - if (_ol_.ENABLE_PROJ4JS && !projection) { + if (ENABLE_PROJ4JS && !projection) { var proj4js = _ol_proj_proj4_.get(); if (typeof proj4js == 'function' && proj4js.defs(code) !== undefined) { @@ -380,7 +380,7 @@ _ol_proj_.getTransformFromProjections = function(sourceProjection, destinationPr var sourceCode = sourceProjection.getCode(); var destinationCode = destinationProjection.getCode(); var transform = _ol_proj_transforms_.get(sourceCode, destinationCode); - if (_ol_.ENABLE_PROJ4JS && !transform) { + if (ENABLE_PROJ4JS && !transform) { var proj4js = _ol_proj_proj4_.get(); if (typeof proj4js == 'function') { var sourceDef = proj4js.defs(sourceCode); diff --git a/src/ol/proj/EPSG3857.js b/src/ol/proj/EPSG3857.js index 93b9fdeae6..75ecdf9321 100644 --- a/src/ol/proj/EPSG3857.js +++ b/src/ol/proj/EPSG3857.js @@ -1,7 +1,7 @@ /** * @module ol/proj/EPSG3857 */ -import _ol_ from '../index.js'; +import {inherits} from '../index.js'; import _ol_math_ from '../math.js'; import _ol_proj_Projection_ from '../proj/Projection.js'; import _ol_proj_Units_ from '../proj/Units.js'; @@ -29,7 +29,7 @@ _ol_proj_EPSG3857_.Projection_ = function(code) { } }); }; -_ol_.inherits(_ol_proj_EPSG3857_.Projection_, _ol_proj_Projection_); +inherits(_ol_proj_EPSG3857_.Projection_, _ol_proj_Projection_); /** diff --git a/src/ol/proj/EPSG4326.js b/src/ol/proj/EPSG4326.js index be7a9e1389..64f1ed70a5 100644 --- a/src/ol/proj/EPSG4326.js +++ b/src/ol/proj/EPSG4326.js @@ -1,7 +1,7 @@ /** * @module ol/proj/EPSG4326 */ -import _ol_ from '../index.js'; +import {inherits} from '../index.js'; import _ol_proj_Projection_ from '../proj/Projection.js'; import _ol_proj_Units_ from '../proj/Units.js'; var _ol_proj_EPSG4326_ = {}; @@ -32,7 +32,7 @@ _ol_proj_EPSG4326_.Projection_ = function(code, opt_axisOrientation) { worldExtent: _ol_proj_EPSG4326_.EXTENT }); }; -_ol_.inherits(_ol_proj_EPSG4326_.Projection_, _ol_proj_Projection_); +inherits(_ol_proj_EPSG4326_.Projection_, _ol_proj_Projection_); /** diff --git a/src/ol/proj/Projection.js b/src/ol/proj/Projection.js index b1d9dfe595..6a08d1a8ac 100644 --- a/src/ol/proj/Projection.js +++ b/src/ol/proj/Projection.js @@ -1,7 +1,7 @@ /** * @module ol/proj/Projection */ -import _ol_ from '../index.js'; +import {ENABLE_PROJ4JS} from '../index.js'; import _ol_proj_Units_ from '../proj/Units.js'; import _ol_proj_proj4_ from '../proj/proj4.js'; @@ -108,7 +108,7 @@ var _ol_proj_Projection_ = function(options) { this.metersPerUnit_ = options.metersPerUnit; var code = options.code; - if (_ol_.ENABLE_PROJ4JS) { + if (ENABLE_PROJ4JS) { var proj4js = _ol_proj_proj4_.get(); if (typeof proj4js == 'function') { var def = proj4js.defs(code); diff --git a/src/ol/render/Box.js b/src/ol/render/Box.js index d76727339b..1fefc970a2 100644 --- a/src/ol/render/Box.js +++ b/src/ol/render/Box.js @@ -3,7 +3,7 @@ */ // FIXME add rotation -import _ol_ from '../index.js'; +import {inherits} from '../index.js'; import _ol_Disposable_ from '../Disposable.js'; import _ol_geom_Polygon_ from '../geom/Polygon.js'; @@ -48,7 +48,7 @@ var _ol_render_Box_ = function(className) { }; -_ol_.inherits(_ol_render_Box_, _ol_Disposable_); +inherits(_ol_render_Box_, _ol_Disposable_); /** diff --git a/src/ol/render/Event.js b/src/ol/render/Event.js index da045347b1..ab92915519 100644 --- a/src/ol/render/Event.js +++ b/src/ol/render/Event.js @@ -1,7 +1,7 @@ /** * @module ol/render/Event */ -import _ol_ from '../index.js'; +import {inherits} from '../index.js'; import _ol_events_Event_ from '../events/Event.js'; /** @@ -52,5 +52,5 @@ var _ol_render_Event_ = function( }; -_ol_.inherits(_ol_render_Event_, _ol_events_Event_); +inherits(_ol_render_Event_, _ol_events_Event_); export default _ol_render_Event_; diff --git a/src/ol/render/Feature.js b/src/ol/render/Feature.js index 9c6a193be6..6c1432aeb9 100644 --- a/src/ol/render/Feature.js +++ b/src/ol/render/Feature.js @@ -1,7 +1,7 @@ /** * @module ol/render/Feature */ -import _ol_ from '../index.js'; +import {nullFunction} from '../index.js'; import _ol_array_ from '../array.js'; import _ol_extent_ from '../extent.js'; import _ol_geom_GeometryType_ from '../geom/GeometryType.js'; @@ -244,7 +244,7 @@ _ol_render_Feature_.prototype.getStride = function() { /** * @return {undefined} */ -_ol_render_Feature_.prototype.getStyleFunction = _ol_.nullFunction; +_ol_render_Feature_.prototype.getStyleFunction = nullFunction; /** diff --git a/src/ol/render/canvas/ImageReplay.js b/src/ol/render/canvas/ImageReplay.js index 6158c21a28..1fcb869226 100644 --- a/src/ol/render/canvas/ImageReplay.js +++ b/src/ol/render/canvas/ImageReplay.js @@ -1,7 +1,7 @@ /** * @module ol/render/canvas/ImageReplay */ -import _ol_ from '../../index.js'; +import {inherits} from '../../index.js'; import _ol_render_canvas_Instruction_ from '../canvas/Instruction.js'; import _ol_render_canvas_Replay_ from '../canvas/Replay.js'; @@ -107,7 +107,7 @@ var _ol_render_canvas_ImageReplay_ = function( }; -_ol_.inherits(_ol_render_canvas_ImageReplay_, _ol_render_canvas_Replay_); +inherits(_ol_render_canvas_ImageReplay_, _ol_render_canvas_Replay_); /** diff --git a/src/ol/render/canvas/Immediate.js b/src/ol/render/canvas/Immediate.js index bb9c1dcb3b..597a06b1a2 100644 --- a/src/ol/render/canvas/Immediate.js +++ b/src/ol/render/canvas/Immediate.js @@ -5,7 +5,7 @@ // FIXME need to handle large thick features (where pixel size matters) // FIXME add offset and end to ol.geom.flat.transform.transform2D? -import _ol_ from '../../index.js'; +import {inherits} from '../../index.js'; import _ol_array_ from '../../array.js'; import _ol_colorlike_ from '../../colorlike.js'; import _ol_extent_ from '../../extent.js'; @@ -238,7 +238,7 @@ var _ol_render_canvas_Immediate_ = function(context, pixelRatio, extent, transfo }; -_ol_.inherits(_ol_render_canvas_Immediate_, _ol_render_VectorContext_); +inherits(_ol_render_canvas_Immediate_, _ol_render_VectorContext_); /** diff --git a/src/ol/render/canvas/LineStringReplay.js b/src/ol/render/canvas/LineStringReplay.js index 09ccc10adb..372965f5e6 100644 --- a/src/ol/render/canvas/LineStringReplay.js +++ b/src/ol/render/canvas/LineStringReplay.js @@ -1,7 +1,7 @@ /** * @module ol/render/canvas/LineStringReplay */ -import _ol_ from '../../index.js'; +import {inherits} from '../../index.js'; import _ol_render_canvas_Instruction_ from '../canvas/Instruction.js'; import _ol_render_canvas_Replay_ from '../canvas/Replay.js'; @@ -22,7 +22,7 @@ var _ol_render_canvas_LineStringReplay_ = function( tolerance, maxExtent, resolution, pixelRatio, overlaps, declutterTree); }; -_ol_.inherits(_ol_render_canvas_LineStringReplay_, _ol_render_canvas_Replay_); +inherits(_ol_render_canvas_LineStringReplay_, _ol_render_canvas_Replay_); /** diff --git a/src/ol/render/canvas/PolygonReplay.js b/src/ol/render/canvas/PolygonReplay.js index 20079cf0ba..7e3d5e35c6 100644 --- a/src/ol/render/canvas/PolygonReplay.js +++ b/src/ol/render/canvas/PolygonReplay.js @@ -1,7 +1,7 @@ /** * @module ol/render/canvas/PolygonReplay */ -import _ol_ from '../../index.js'; +import {inherits} from '../../index.js'; import _ol_color_ from '../../color.js'; import _ol_geom_flat_simplify_ from '../../geom/flat/simplify.js'; import _ol_render_canvas_ from '../canvas.js'; @@ -25,7 +25,7 @@ var _ol_render_canvas_PolygonReplay_ = function( tolerance, maxExtent, resolution, pixelRatio, overlaps, declutterTree); }; -_ol_.inherits(_ol_render_canvas_PolygonReplay_, _ol_render_canvas_Replay_); +inherits(_ol_render_canvas_PolygonReplay_, _ol_render_canvas_Replay_); /** diff --git a/src/ol/render/canvas/Replay.js b/src/ol/render/canvas/Replay.js index 59c3f42915..1617adc010 100644 --- a/src/ol/render/canvas/Replay.js +++ b/src/ol/render/canvas/Replay.js @@ -1,7 +1,7 @@ /** * @module ol/render/canvas/Replay */ -import _ol_ from '../../index.js'; +import {getUid, inherits, nullFunction} from '../../index.js'; import _ol_array_ from '../../array.js'; import _ol_colorlike_ from '../../colorlike.js'; import _ol_extent_ from '../../extent.js'; @@ -167,7 +167,7 @@ var _ol_render_canvas_Replay_ = function(tolerance, maxExtent, resolution, pixel this.resetTransform_ = _ol_transform_.create(); }; -_ol_.inherits(_ol_render_canvas_Replay_, _ol_render_VectorContext_); +inherits(_ol_render_canvas_Replay_, _ol_render_VectorContext_); /** @@ -584,7 +584,7 @@ _ol_render_canvas_Replay_.prototype.replay_ = function( case _ol_render_canvas_Instruction_.BEGIN_GEOMETRY: feature = /** @type {ol.Feature|ol.render.Feature} */ (instruction[1]); if ((skipFeatures && - skippedFeaturesHash[_ol_.getUid(feature).toString()]) || + skippedFeaturesHash[getUid(feature).toString()]) || !feature.getGeometry()) { i = /** @type {number} */ (instruction[2]); } else if (opt_hitExtent !== undefined && !_ol_extent_.intersects( @@ -1048,7 +1048,7 @@ _ol_render_canvas_Replay_.prototype.endGeometry = function(geometry, feature) { /** * FIXME empty description for jsdoc */ -_ol_render_canvas_Replay_.prototype.finish = _ol_.nullFunction; +_ol_render_canvas_Replay_.prototype.finish = nullFunction; /** diff --git a/src/ol/render/canvas/ReplayGroup.js b/src/ol/render/canvas/ReplayGroup.js index 3c5b45fcd2..9b44af232e 100644 --- a/src/ol/render/canvas/ReplayGroup.js +++ b/src/ol/render/canvas/ReplayGroup.js @@ -1,7 +1,7 @@ /** * @module ol/render/canvas/ReplayGroup */ -import _ol_ from '../../index.js'; +import {inherits} from '../../index.js'; import _ol_array_ from '../../array.js'; import _ol_dom_ from '../../dom.js'; import _ol_extent_ from '../../extent.js'; @@ -102,7 +102,7 @@ var _ol_render_canvas_ReplayGroup_ = function( this.hitDetectionTransform_ = _ol_transform_.create(); }; -_ol_.inherits(_ol_render_canvas_ReplayGroup_, _ol_render_ReplayGroup_); +inherits(_ol_render_canvas_ReplayGroup_, _ol_render_ReplayGroup_); /** diff --git a/src/ol/render/canvas/TextReplay.js b/src/ol/render/canvas/TextReplay.js index 2d17eb790f..6a76ecdb03 100644 --- a/src/ol/render/canvas/TextReplay.js +++ b/src/ol/render/canvas/TextReplay.js @@ -1,7 +1,7 @@ /** * @module ol/render/canvas/TextReplay */ -import _ol_ from '../../index.js'; +import {getUid, inherits} from '../../index.js'; import _ol_colorlike_ from '../../colorlike.js'; import _ol_dom_ from '../../dom.js'; import _ol_extent_ from '../../extent.js'; @@ -134,7 +134,7 @@ var _ol_render_canvas_TextReplay_ = function( }; -_ol_.inherits(_ol_render_canvas_TextReplay_, _ol_render_canvas_Replay_); +inherits(_ol_render_canvas_TextReplay_, _ol_render_canvas_Replay_); /** @@ -533,13 +533,13 @@ _ol_render_canvas_TextReplay_.prototype.setTextStyle = function(textStyle, declu this.textRotation_ = textRotation === undefined ? 0 : textRotation; this.strokeKey_ = strokeState ? - (typeof strokeState.strokeStyle == 'string' ? strokeState.strokeStyle : _ol_.getUid(strokeState.strokeStyle)) + + (typeof strokeState.strokeStyle == 'string' ? strokeState.strokeStyle : getUid(strokeState.strokeStyle)) + strokeState.lineCap + strokeState.lineDashOffset + '|' + strokeState.lineWidth + strokeState.lineJoin + strokeState.miterLimit + '[' + strokeState.lineDash.join() + ']' : ''; this.textKey_ = textState.font + textState.scale + (textState.textAlign || '?'); this.fillKey_ = fillState ? - (typeof fillState.fillStyle == 'string' ? fillState.fillStyle : ('|' + _ol_.getUid(fillState.fillStyle))) : + (typeof fillState.fillStyle == 'string' ? fillState.fillStyle : ('|' + getUid(fillState.fillStyle))) : ''; } }; diff --git a/src/ol/render/webgl/CircleReplay.js b/src/ol/render/webgl/CircleReplay.js index 145022157b..2d981a7c26 100644 --- a/src/ol/render/webgl/CircleReplay.js +++ b/src/ol/render/webgl/CircleReplay.js @@ -1,7 +1,7 @@ /** * @module ol/render/webgl/CircleReplay */ -import _ol_ from '../../index.js'; +import {getUid, inherits} from '../../index.js'; import _ol_array_ from '../../array.js'; import _ol_color_ from '../../color.js'; import _ol_extent_ from '../../extent.js'; @@ -68,7 +68,7 @@ var _ol_render_webgl_CircleReplay_ = function(tolerance, maxExtent) { }; -_ol_.inherits(_ol_render_webgl_CircleReplay_, _ol_render_webgl_Replay_); +inherits(_ol_render_webgl_CircleReplay_, _ol_render_webgl_Replay_); /** @@ -285,7 +285,7 @@ _ol_render_webgl_CircleReplay_.prototype.drawHitDetectionReplayOneByOne = functi this.startIndices[featureIndex] >= groupStart) { start = this.startIndices[featureIndex]; feature = this.startIndicesFeature[featureIndex]; - featureUid = _ol_.getUid(feature).toString(); + featureUid = getUid(feature).toString(); if (skippedFeaturesHash[featureUid] === undefined && feature.getGeometry() && @@ -331,7 +331,7 @@ _ol_render_webgl_CircleReplay_.prototype.drawReplaySkipping_ = function(gl, cont this.startIndices[featureIndex] >= groupStart) { featureStart = this.startIndices[featureIndex]; feature = this.startIndicesFeature[featureIndex]; - featureUid = _ol_.getUid(feature).toString(); + featureUid = getUid(feature).toString(); if (skippedFeaturesHash[featureUid]) { if (start !== end) { diff --git a/src/ol/render/webgl/ImageReplay.js b/src/ol/render/webgl/ImageReplay.js index 44f6ed0b6c..c72d3f4ff0 100644 --- a/src/ol/render/webgl/ImageReplay.js +++ b/src/ol/render/webgl/ImageReplay.js @@ -1,7 +1,7 @@ /** * @module ol/render/webgl/ImageReplay */ -import _ol_ from '../../index.js'; +import {getUid, inherits} from '../../index.js'; import _ol_render_webgl_TextureReplay_ from '../webgl/TextureReplay.js'; import _ol_webgl_Buffer_ from '../../webgl/Buffer.js'; @@ -41,7 +41,7 @@ var _ol_render_webgl_ImageReplay_ = function(tolerance, maxExtent) { }; -_ol_.inherits(_ol_render_webgl_ImageReplay_, _ol_render_webgl_TextureReplay_); +inherits(_ol_render_webgl_ImageReplay_, _ol_render_webgl_TextureReplay_); /** @@ -122,7 +122,7 @@ _ol_render_webgl_ImageReplay_.prototype.setImageStyle = function(imageStyle) { this.images_.push(image); } else { currentImage = this.images_[this.images_.length - 1]; - if (_ol_.getUid(currentImage) != _ol_.getUid(image)) { + if (getUid(currentImage) != getUid(image)) { this.groupIndices.push(this.indices.length); this.images_.push(image); } @@ -133,7 +133,7 @@ _ol_render_webgl_ImageReplay_.prototype.setImageStyle = function(imageStyle) { } else { currentImage = this.hitDetectionImages_[this.hitDetectionImages_.length - 1]; - if (_ol_.getUid(currentImage) != _ol_.getUid(hitDetectionImage)) { + if (getUid(currentImage) != getUid(hitDetectionImage)) { this.hitDetectionGroupIndices.push(this.indices.length); this.hitDetectionImages_.push(hitDetectionImage); } diff --git a/src/ol/render/webgl/Immediate.js b/src/ol/render/webgl/Immediate.js index be2fea1a73..b04f658555 100644 --- a/src/ol/render/webgl/Immediate.js +++ b/src/ol/render/webgl/Immediate.js @@ -1,7 +1,7 @@ /** * @module ol/render/webgl/Immediate */ -import _ol_ from '../../index.js'; +import {inherits} from '../../index.js'; import _ol_extent_ from '../../extent.js'; import _ol_geom_GeometryType_ from '../../geom/GeometryType.js'; import _ol_render_ReplayType_ from '../ReplayType.js'; @@ -84,7 +84,7 @@ var _ol_render_webgl_Immediate_ = function(context, center, resolution, rotation }; -_ol_.inherits(_ol_render_webgl_Immediate_, _ol_render_VectorContext_); +inherits(_ol_render_webgl_Immediate_, _ol_render_VectorContext_); /** diff --git a/src/ol/render/webgl/LineStringReplay.js b/src/ol/render/webgl/LineStringReplay.js index 3e8203007f..20862252d8 100644 --- a/src/ol/render/webgl/LineStringReplay.js +++ b/src/ol/render/webgl/LineStringReplay.js @@ -1,7 +1,7 @@ /** * @module ol/render/webgl/LineStringReplay */ -import _ol_ from '../../index.js'; +import {getUid, inherits} from '../../index.js'; import _ol_array_ from '../../array.js'; import _ol_color_ from '../../color.js'; import _ol_extent_ from '../../extent.js'; @@ -68,7 +68,7 @@ var _ol_render_webgl_LineStringReplay_ = function(tolerance, maxExtent) { }; -_ol_.inherits(_ol_render_webgl_LineStringReplay_, _ol_render_webgl_Replay_); +inherits(_ol_render_webgl_LineStringReplay_, _ol_render_webgl_Replay_); /** @@ -551,7 +551,7 @@ _ol_render_webgl_LineStringReplay_.prototype.drawReplaySkipping_ = function(gl, this.startIndices[featureIndex] >= groupStart) { featureStart = this.startIndices[featureIndex]; feature = this.startIndicesFeature[featureIndex]; - featureUid = _ol_.getUid(feature).toString(); + featureUid = getUid(feature).toString(); if (skippedFeaturesHash[featureUid]) { if (start !== end) { @@ -589,7 +589,7 @@ _ol_render_webgl_LineStringReplay_.prototype.drawHitDetectionReplayOneByOne = fu this.startIndices[featureIndex] >= groupStart) { start = this.startIndices[featureIndex]; feature = this.startIndicesFeature[featureIndex]; - featureUid = _ol_.getUid(feature).toString(); + featureUid = getUid(feature).toString(); if (skippedFeaturesHash[featureUid] === undefined && feature.getGeometry() && diff --git a/src/ol/render/webgl/PolygonReplay.js b/src/ol/render/webgl/PolygonReplay.js index bde72d54c6..8eacc6f8c9 100644 --- a/src/ol/render/webgl/PolygonReplay.js +++ b/src/ol/render/webgl/PolygonReplay.js @@ -1,7 +1,7 @@ /** * @module ol/render/webgl/PolygonReplay */ -import _ol_ from '../../index.js'; +import {getUid, inherits} from '../../index.js'; import _ol_array_ from '../../array.js'; import _ol_color_ from '../../color.js'; import _ol_extent_ from '../../extent.js'; @@ -63,7 +63,7 @@ var _ol_render_webgl_PolygonReplay_ = function(tolerance, maxExtent) { }; -_ol_.inherits(_ol_render_webgl_PolygonReplay_, _ol_render_webgl_Replay_); +inherits(_ol_render_webgl_PolygonReplay_, _ol_render_webgl_Replay_); /** @@ -966,7 +966,7 @@ _ol_render_webgl_PolygonReplay_.prototype.drawHitDetectionReplayOneByOne = funct this.startIndices[featureIndex] >= groupStart) { start = this.startIndices[featureIndex]; feature = this.startIndicesFeature[featureIndex]; - featureUid = _ol_.getUid(feature).toString(); + featureUid = getUid(feature).toString(); if (skippedFeaturesHash[featureUid] === undefined && feature.getGeometry() && @@ -1010,7 +1010,7 @@ _ol_render_webgl_PolygonReplay_.prototype.drawReplaySkipping_ = function(gl, con this.startIndices[featureIndex] >= groupStart) { featureStart = this.startIndices[featureIndex]; feature = this.startIndicesFeature[featureIndex]; - featureUid = _ol_.getUid(feature).toString(); + featureUid = getUid(feature).toString(); if (skippedFeaturesHash[featureUid]) { if (start !== end) { diff --git a/src/ol/render/webgl/Replay.js b/src/ol/render/webgl/Replay.js index 06994ac66c..d2ac6850d3 100644 --- a/src/ol/render/webgl/Replay.js +++ b/src/ol/render/webgl/Replay.js @@ -1,7 +1,7 @@ /** * @module ol/render/webgl/Replay */ -import _ol_ from '../../index.js'; +import {inherits} from '../../index.js'; import _ol_extent_ from '../../extent.js'; import _ol_render_VectorContext_ from '../VectorContext.js'; import _ol_transform_ from '../../transform.js'; @@ -113,7 +113,7 @@ var _ol_render_webgl_Replay_ = function(tolerance, maxExtent) { }; -_ol_.inherits(_ol_render_webgl_Replay_, _ol_render_VectorContext_); +inherits(_ol_render_webgl_Replay_, _ol_render_VectorContext_); /** diff --git a/src/ol/render/webgl/ReplayGroup.js b/src/ol/render/webgl/ReplayGroup.js index 71384bbc34..162b0aaaed 100644 --- a/src/ol/render/webgl/ReplayGroup.js +++ b/src/ol/render/webgl/ReplayGroup.js @@ -1,7 +1,7 @@ /** * @module ol/render/webgl/ReplayGroup */ -import _ol_ from '../../index.js'; +import {inherits} from '../../index.js'; import _ol_array_ from '../../array.js'; import _ol_extent_ from '../../extent.js'; import _ol_obj_ from '../../obj.js'; @@ -51,7 +51,7 @@ var _ol_render_webgl_ReplayGroup_ = function(tolerance, maxExtent, opt_renderBuf }; -_ol_.inherits(_ol_render_webgl_ReplayGroup_, _ol_render_ReplayGroup_); +inherits(_ol_render_webgl_ReplayGroup_, _ol_render_ReplayGroup_); /** diff --git a/src/ol/render/webgl/TextReplay.js b/src/ol/render/webgl/TextReplay.js index a79573f2d9..f2c4f19882 100644 --- a/src/ol/render/webgl/TextReplay.js +++ b/src/ol/render/webgl/TextReplay.js @@ -1,7 +1,7 @@ /** * @module ol/render/webgl/TextReplay */ -import _ol_ from '../../index.js'; +import {getUid, inherits} from '../../index.js'; import _ol_colorlike_ from '../../colorlike.js'; import _ol_dom_ from '../../dom.js'; import _ol_geom_GeometryType_ from '../../geom/GeometryType.js'; @@ -114,7 +114,7 @@ var _ol_render_webgl_TextReplay_ = function(tolerance, maxExtent) { }; -_ol_.inherits(_ol_render_webgl_TextReplay_, _ol_render_webgl_TextureReplay_); +inherits(_ol_render_webgl_TextReplay_, _ol_render_webgl_TextureReplay_); /** @@ -189,7 +189,7 @@ _ol_render_webgl_TextReplay_.prototype.drawText = function(geometry, feature) { this.images_.push(image); } else { currentImage = this.images_[this.images_.length - 1]; - if (_ol_.getUid(currentImage) != _ol_.getUid(image)) { + if (getUid(currentImage) != getUid(image)) { this.groupIndices.push(this.indices.length); this.images_.push(image); } diff --git a/src/ol/render/webgl/TextureReplay.js b/src/ol/render/webgl/TextureReplay.js index b7021fee9e..771bacc766 100644 --- a/src/ol/render/webgl/TextureReplay.js +++ b/src/ol/render/webgl/TextureReplay.js @@ -1,7 +1,7 @@ /** * @module ol/render/webgl/TextureReplay */ -import _ol_ from '../../index.js'; +import {getUid, inherits} from '../../index.js'; import _ol_extent_ from '../../extent.js'; import _ol_obj_ from '../../obj.js'; import _ol_render_webgl_texturereplay_defaultshader_ from '../webgl/texturereplay/defaultshader.js'; @@ -112,7 +112,7 @@ var _ol_render_webgl_TextureReplay_ = function(tolerance, maxExtent) { this.width = undefined; }; -_ol_.inherits(_ol_render_webgl_TextureReplay_, _ol_render_webgl_Replay_); +inherits(_ol_render_webgl_TextureReplay_, _ol_render_webgl_Replay_); /** @@ -253,7 +253,7 @@ _ol_render_webgl_TextureReplay_.prototype.createTextures = function(textures, im for (i = 0; i < ii; ++i) { image = images[i]; - uid = _ol_.getUid(image).toString(); + uid = getUid(image).toString(); if (uid in texturePerImage) { texture = texturePerImage[uid]; } else { @@ -388,7 +388,7 @@ _ol_render_webgl_TextureReplay_.prototype.drawReplaySkipping = function(gl, cont this.startIndices[featureIndex] <= groupEnd) { var feature = this.startIndicesFeature[featureIndex]; - var featureUid = _ol_.getUid(feature).toString(); + var featureUid = getUid(feature).toString(); if (skippedFeaturesHash[featureUid] !== undefined) { // feature should be skipped if (start !== end) { @@ -434,7 +434,7 @@ _ol_render_webgl_TextureReplay_.prototype.drawHitDetectionReplayOneByOne = funct this.startIndices[featureIndex] >= groupStart) { start = this.startIndices[featureIndex]; feature = this.startIndicesFeature[featureIndex]; - featureUid = _ol_.getUid(feature).toString(); + featureUid = getUid(feature).toString(); if (skippedFeaturesHash[featureUid] === undefined && feature.getGeometry() && diff --git a/src/ol/render/webgl/circlereplay/defaultshader.js b/src/ol/render/webgl/circlereplay/defaultshader.js index e6ba346fc6..a958fdf3a7 100644 --- a/src/ol/render/webgl/circlereplay/defaultshader.js +++ b/src/ol/render/webgl/circlereplay/defaultshader.js @@ -1,16 +1,16 @@ // This file is automatically generated, do not edit. // Run `make shaders` to generate, and commit the result. -import _ol_ from '../../../index.js'; +import {DEBUG_WEBGL} from '../../../index.js'; import _ol_webgl_Fragment_ from '../../../webgl/Fragment.js'; import _ol_webgl_Vertex_ from '../../../webgl/Vertex.js'; var _ol_render_webgl_circlereplay_defaultshader_ = {}; -_ol_render_webgl_circlereplay_defaultshader_.fragment = new _ol_webgl_Fragment_(_ol_.DEBUG_WEBGL ? +_ol_render_webgl_circlereplay_defaultshader_.fragment = new _ol_webgl_Fragment_(DEBUG_WEBGL ? 'precision mediump float;\nvarying vec2 v_center;\nvarying vec2 v_offset;\nvarying float v_halfWidth;\nvarying float v_pixelRatio;\n\n\n\nuniform float u_opacity;\nuniform vec4 u_fillColor;\nuniform vec4 u_strokeColor;\nuniform vec2 u_size;\n\nvoid main(void) {\n vec2 windowCenter = vec2((v_center.x + 1.0) / 2.0 * u_size.x * v_pixelRatio,\n (v_center.y + 1.0) / 2.0 * u_size.y * v_pixelRatio);\n vec2 windowOffset = vec2((v_offset.x + 1.0) / 2.0 * u_size.x * v_pixelRatio,\n (v_offset.y + 1.0) / 2.0 * u_size.y * v_pixelRatio);\n float radius = length(windowCenter - windowOffset);\n float dist = length(windowCenter - gl_FragCoord.xy);\n if (dist > radius + v_halfWidth) {\n if (u_strokeColor.a == 0.0) {\n gl_FragColor = u_fillColor;\n } else {\n gl_FragColor = u_strokeColor;\n }\n gl_FragColor.a = gl_FragColor.a - (dist - (radius + v_halfWidth));\n } else if (u_fillColor.a == 0.0) {\n // Hooray, no fill, just stroke. We can use real antialiasing.\n gl_FragColor = u_strokeColor;\n if (dist < radius - v_halfWidth) {\n gl_FragColor.a = gl_FragColor.a - (radius - v_halfWidth - dist);\n }\n } else {\n gl_FragColor = u_fillColor;\n float strokeDist = radius - v_halfWidth;\n float antialias = 2.0 * v_pixelRatio;\n if (dist > strokeDist) {\n gl_FragColor = u_strokeColor;\n } else if (dist >= strokeDist - antialias) {\n float step = smoothstep(strokeDist - antialias, strokeDist, dist);\n gl_FragColor = mix(u_fillColor, u_strokeColor, step);\n }\n }\n gl_FragColor.a = gl_FragColor.a * u_opacity;\n if (gl_FragColor.a <= 0.0) {\n discard;\n }\n}\n' : 'precision mediump float;varying vec2 a;varying vec2 b;varying float c;varying float d;uniform float m;uniform vec4 n;uniform vec4 o;uniform vec2 p;void main(void){vec2 windowCenter=vec2((a.x+1.0)/2.0*p.x*d,(a.y+1.0)/2.0*p.y*d);vec2 windowOffset=vec2((b.x+1.0)/2.0*p.x*d,(b.y+1.0)/2.0*p.y*d);float radius=length(windowCenter-windowOffset);float dist=length(windowCenter-gl_FragCoord.xy);if(dist>radius+c){if(o.a==0.0){gl_FragColor=n;}else{gl_FragColor=o;}gl_FragColor.a=gl_FragColor.a-(dist-(radius+c));}else if(n.a==0.0){gl_FragColor=o;if(diststrokeDist){gl_FragColor=o;}else if(dist>=strokeDist-antialias){float step=smoothstep(strokeDist-antialias,strokeDist,dist);gl_FragColor=mix(n,o,step);}} gl_FragColor.a=gl_FragColor.a*m;if(gl_FragColor.a<=0.0){discard;}}'); -_ol_render_webgl_circlereplay_defaultshader_.vertex = new _ol_webgl_Vertex_(_ol_.DEBUG_WEBGL ? +_ol_render_webgl_circlereplay_defaultshader_.vertex = new _ol_webgl_Vertex_(DEBUG_WEBGL ? 'varying vec2 v_center;\nvarying vec2 v_offset;\nvarying float v_halfWidth;\nvarying float v_pixelRatio;\n\n\nattribute vec2 a_position;\nattribute float a_instruction;\nattribute float a_radius;\n\nuniform mat4 u_projectionMatrix;\nuniform mat4 u_offsetScaleMatrix;\nuniform mat4 u_offsetRotateMatrix;\nuniform float u_lineWidth;\nuniform float u_pixelRatio;\n\nvoid main(void) {\n mat4 offsetMatrix = u_offsetScaleMatrix * u_offsetRotateMatrix;\n v_center = vec4(u_projectionMatrix * vec4(a_position, 0.0, 1.0)).xy;\n v_pixelRatio = u_pixelRatio;\n float lineWidth = u_lineWidth * u_pixelRatio;\n v_halfWidth = lineWidth / 2.0;\n if (lineWidth == 0.0) {\n lineWidth = 2.0 * u_pixelRatio;\n }\n vec2 offset;\n // Radius with anitaliasing (roughly).\n float radius = a_radius + 3.0 * u_pixelRatio;\n // Until we get gl_VertexID in WebGL, we store an instruction.\n if (a_instruction == 0.0) {\n // Offsetting the edges of the triangle by lineWidth / 2 is necessary, however\n // we should also leave some space for the antialiasing, thus we offset by lineWidth.\n offset = vec2(-1.0, 1.0);\n } else if (a_instruction == 1.0) {\n offset = vec2(-1.0, -1.0);\n } else if (a_instruction == 2.0) {\n offset = vec2(1.0, -1.0);\n } else {\n offset = vec2(1.0, 1.0);\n }\n\n gl_Position = u_projectionMatrix * vec4(a_position + offset * radius, 0.0, 1.0) +\n offsetMatrix * vec4(offset * lineWidth, 0.0, 0.0);\n v_offset = vec4(u_projectionMatrix * vec4(a_position.x + a_radius, a_position.y,\n 0.0, 1.0)).xy;\n\n if (distance(v_center, v_offset) > 20000.0) {\n gl_Position = vec4(v_center, 0.0, 1.0);\n }\n}\n\n\n' : 'varying vec2 a;varying vec2 b;varying float c;varying float d;attribute vec2 e;attribute float f;attribute float g;uniform mat4 h;uniform mat4 i;uniform mat4 j;uniform float k;uniform float l;void main(void){mat4 offsetMatrix=i*j;a=vec4(h*vec4(e,0.0,1.0)).xy;d=l;float lineWidth=k*l;c=lineWidth/2.0;if(lineWidth==0.0){lineWidth=2.0*l;}vec2 offset;float radius=g+3.0*l;//Until we get gl_VertexID in WebGL,we store an instruction.if(f==0.0){//Offsetting the edges of the triangle by lineWidth/2 is necessary,however//we should also leave some space for the antialiasing,thus we offset by lineWidth.offset=vec2(-1.0,1.0);}else if(f==1.0){offset=vec2(-1.0,-1.0);}else if(f==2.0){offset=vec2(1.0,-1.0);}else{offset=vec2(1.0,1.0);}gl_Position=h*vec4(e+offset*radius,0.0,1.0)+offsetMatrix*vec4(offset*lineWidth,0.0,0.0);b=vec4(h*vec4(e.x+g,e.y,0.0,1.0)).xy;if(distance(a,b)>20000.0){gl_Position=vec4(a,0.0,1.0);}}'); diff --git a/src/ol/render/webgl/circlereplay/defaultshader/Locations.js b/src/ol/render/webgl/circlereplay/defaultshader/Locations.js index 1039a7d58e..fc19474dee 100644 --- a/src/ol/render/webgl/circlereplay/defaultshader/Locations.js +++ b/src/ol/render/webgl/circlereplay/defaultshader/Locations.js @@ -2,7 +2,7 @@ * @module ol/render/webgl/circlereplay/defaultshader/Locations */ // This file is automatically generated, do not edit -import _ol_ from '../../../../index.js'; +import {DEBUG_WEBGL} from '../../../../index.js'; /** * @constructor @@ -16,73 +16,73 @@ var _ol_render_webgl_circlereplay_defaultshader_Locations_ = function(gl, progra * @type {WebGLUniformLocation} */ this.u_projectionMatrix = gl.getUniformLocation( - program, _ol_.DEBUG_WEBGL ? 'u_projectionMatrix' : 'h'); + program, DEBUG_WEBGL ? 'u_projectionMatrix' : 'h'); /** * @type {WebGLUniformLocation} */ this.u_offsetScaleMatrix = gl.getUniformLocation( - program, _ol_.DEBUG_WEBGL ? 'u_offsetScaleMatrix' : 'i'); + program, DEBUG_WEBGL ? 'u_offsetScaleMatrix' : 'i'); /** * @type {WebGLUniformLocation} */ this.u_offsetRotateMatrix = gl.getUniformLocation( - program, _ol_.DEBUG_WEBGL ? 'u_offsetRotateMatrix' : 'j'); + program, DEBUG_WEBGL ? 'u_offsetRotateMatrix' : 'j'); /** * @type {WebGLUniformLocation} */ this.u_lineWidth = gl.getUniformLocation( - program, _ol_.DEBUG_WEBGL ? 'u_lineWidth' : 'k'); + program, DEBUG_WEBGL ? 'u_lineWidth' : 'k'); /** * @type {WebGLUniformLocation} */ this.u_pixelRatio = gl.getUniformLocation( - program, _ol_.DEBUG_WEBGL ? 'u_pixelRatio' : 'l'); + program, DEBUG_WEBGL ? 'u_pixelRatio' : 'l'); /** * @type {WebGLUniformLocation} */ this.u_opacity = gl.getUniformLocation( - program, _ol_.DEBUG_WEBGL ? 'u_opacity' : 'm'); + program, DEBUG_WEBGL ? 'u_opacity' : 'm'); /** * @type {WebGLUniformLocation} */ this.u_fillColor = gl.getUniformLocation( - program, _ol_.DEBUG_WEBGL ? 'u_fillColor' : 'n'); + program, DEBUG_WEBGL ? 'u_fillColor' : 'n'); /** * @type {WebGLUniformLocation} */ this.u_strokeColor = gl.getUniformLocation( - program, _ol_.DEBUG_WEBGL ? 'u_strokeColor' : 'o'); + program, DEBUG_WEBGL ? 'u_strokeColor' : 'o'); /** * @type {WebGLUniformLocation} */ this.u_size = gl.getUniformLocation( - program, _ol_.DEBUG_WEBGL ? 'u_size' : 'p'); + program, DEBUG_WEBGL ? 'u_size' : 'p'); /** * @type {number} */ this.a_position = gl.getAttribLocation( - program, _ol_.DEBUG_WEBGL ? 'a_position' : 'e'); + program, DEBUG_WEBGL ? 'a_position' : 'e'); /** * @type {number} */ this.a_instruction = gl.getAttribLocation( - program, _ol_.DEBUG_WEBGL ? 'a_instruction' : 'f'); + program, DEBUG_WEBGL ? 'a_instruction' : 'f'); /** * @type {number} */ this.a_radius = gl.getAttribLocation( - program, _ol_.DEBUG_WEBGL ? 'a_radius' : 'g'); + program, DEBUG_WEBGL ? 'a_radius' : 'g'); }; export default _ol_render_webgl_circlereplay_defaultshader_Locations_; diff --git a/src/ol/render/webgl/linestringreplay/defaultshader.js b/src/ol/render/webgl/linestringreplay/defaultshader.js index df3f2323f6..49005b4d39 100644 --- a/src/ol/render/webgl/linestringreplay/defaultshader.js +++ b/src/ol/render/webgl/linestringreplay/defaultshader.js @@ -1,16 +1,16 @@ // This file is automatically generated, do not edit. // Run `make shaders` to generate, and commit the result. -import _ol_ from '../../../index.js'; +import {DEBUG_WEBGL} from '../../../index.js'; import _ol_webgl_Fragment_ from '../../../webgl/Fragment.js'; import _ol_webgl_Vertex_ from '../../../webgl/Vertex.js'; var _ol_render_webgl_linestringreplay_defaultshader_ = {}; -_ol_render_webgl_linestringreplay_defaultshader_.fragment = new _ol_webgl_Fragment_(_ol_.DEBUG_WEBGL ? +_ol_render_webgl_linestringreplay_defaultshader_.fragment = new _ol_webgl_Fragment_(DEBUG_WEBGL ? 'precision mediump float;\nvarying float v_round;\nvarying vec2 v_roundVertex;\nvarying float v_halfWidth;\n\n\n\nuniform float u_opacity;\nuniform vec4 u_color;\nuniform vec2 u_size;\nuniform float u_pixelRatio;\n\nvoid main(void) {\n if (v_round > 0.0) {\n vec2 windowCoords = vec2((v_roundVertex.x + 1.0) / 2.0 * u_size.x * u_pixelRatio,\n (v_roundVertex.y + 1.0) / 2.0 * u_size.y * u_pixelRatio);\n if (length(windowCoords - gl_FragCoord.xy) > v_halfWidth * u_pixelRatio) {\n discard;\n }\n }\n gl_FragColor = u_color;\n float alpha = u_color.a * u_opacity;\n if (alpha == 0.0) {\n discard;\n }\n gl_FragColor.a = alpha;\n}\n' : 'precision mediump float;varying float a;varying vec2 aVertex;varying float c;uniform float m;uniform vec4 n;uniform vec2 o;uniform float p;void main(void){if(a>0.0){vec2 windowCoords=vec2((aVertex.x+1.0)/2.0*o.x*p,(aVertex.y+1.0)/2.0*o.y*p);if(length(windowCoords-gl_FragCoord.xy)>c*p){discard;}} gl_FragColor=n;float alpha=n.a*m;if(alpha==0.0){discard;}gl_FragColor.a=alpha;}'); -_ol_render_webgl_linestringreplay_defaultshader_.vertex = new _ol_webgl_Vertex_(_ol_.DEBUG_WEBGL ? +_ol_render_webgl_linestringreplay_defaultshader_.vertex = new _ol_webgl_Vertex_(DEBUG_WEBGL ? 'varying float v_round;\nvarying vec2 v_roundVertex;\nvarying float v_halfWidth;\n\n\nattribute vec2 a_lastPos;\nattribute vec2 a_position;\nattribute vec2 a_nextPos;\nattribute float a_direction;\n\nuniform mat4 u_projectionMatrix;\nuniform mat4 u_offsetScaleMatrix;\nuniform mat4 u_offsetRotateMatrix;\nuniform float u_lineWidth;\nuniform float u_miterLimit;\n\nbool nearlyEquals(in float value, in float ref) {\n float epsilon = 0.000000000001;\n return value >= ref - epsilon && value <= ref + epsilon;\n}\n\nvoid alongNormal(out vec2 offset, in vec2 nextP, in float turnDir, in float direction) {\n vec2 dirVect = nextP - a_position;\n vec2 normal = normalize(vec2(-turnDir * dirVect.y, turnDir * dirVect.x));\n offset = u_lineWidth / 2.0 * normal * direction;\n}\n\nvoid miterUp(out vec2 offset, out float round, in bool isRound, in float direction) {\n float halfWidth = u_lineWidth / 2.0;\n vec2 tangent = normalize(normalize(a_nextPos - a_position) + normalize(a_position - a_lastPos));\n vec2 normal = vec2(-tangent.y, tangent.x);\n vec2 dirVect = a_nextPos - a_position;\n vec2 tmpNormal = normalize(vec2(-dirVect.y, dirVect.x));\n float miterLength = abs(halfWidth / dot(normal, tmpNormal));\n offset = normal * direction * miterLength;\n round = 0.0;\n if (isRound) {\n round = 1.0;\n } else if (miterLength > u_miterLimit + u_lineWidth) {\n offset = halfWidth * tmpNormal * direction;\n }\n}\n\nbool miterDown(out vec2 offset, in vec4 projPos, in mat4 offsetMatrix, in float direction) {\n bool degenerate = false;\n vec2 tangent = normalize(normalize(a_nextPos - a_position) + normalize(a_position - a_lastPos));\n vec2 normal = vec2(-tangent.y, tangent.x);\n vec2 dirVect = a_lastPos - a_position;\n vec2 tmpNormal = normalize(vec2(-dirVect.y, dirVect.x));\n vec2 longOffset, shortOffset, longVertex;\n vec4 shortProjVertex;\n float halfWidth = u_lineWidth / 2.0;\n if (length(a_nextPos - a_position) > length(a_lastPos - a_position)) {\n longOffset = tmpNormal * direction * halfWidth;\n shortOffset = normalize(vec2(dirVect.y, -dirVect.x)) * direction * halfWidth;\n longVertex = a_nextPos;\n shortProjVertex = u_projectionMatrix * vec4(a_lastPos, 0.0, 1.0);\n } else {\n shortOffset = tmpNormal * direction * halfWidth;\n longOffset = normalize(vec2(dirVect.y, -dirVect.x)) * direction * halfWidth;\n longVertex = a_lastPos;\n shortProjVertex = u_projectionMatrix * vec4(a_nextPos, 0.0, 1.0);\n }\n //Intersection algorithm based on theory by Paul Bourke (http://paulbourke.net/geometry/pointlineplane/).\n vec4 p1 = u_projectionMatrix * vec4(longVertex, 0.0, 1.0) + offsetMatrix * vec4(longOffset, 0.0, 0.0);\n vec4 p2 = projPos + offsetMatrix * vec4(longOffset, 0.0, 0.0);\n vec4 p3 = shortProjVertex + offsetMatrix * vec4(-shortOffset, 0.0, 0.0);\n vec4 p4 = shortProjVertex + offsetMatrix * vec4(shortOffset, 0.0, 0.0);\n float denom = (p4.y - p3.y) * (p2.x - p1.x) - (p4.x - p3.x) * (p2.y - p1.y);\n float firstU = ((p4.x - p3.x) * (p1.y - p3.y) - (p4.y - p3.y) * (p1.x - p3.x)) / denom;\n float secondU = ((p2.x - p1.x) * (p1.y - p3.y) - (p2.y - p1.y) * (p1.x - p3.x)) / denom;\n float epsilon = 0.000000000001;\n if (firstU > epsilon && firstU < 1.0 - epsilon && secondU > epsilon && secondU < 1.0 - epsilon) {\n shortProjVertex.x = p1.x + firstU * (p2.x - p1.x);\n shortProjVertex.y = p1.y + firstU * (p2.y - p1.y);\n offset = shortProjVertex.xy;\n degenerate = true;\n } else {\n float miterLength = abs(halfWidth / dot(normal, tmpNormal));\n offset = normal * direction * miterLength;\n }\n return degenerate;\n}\n\nvoid squareCap(out vec2 offset, out float round, in bool isRound, in vec2 nextP,\n in float turnDir, in float direction) {\n round = 0.0;\n vec2 dirVect = a_position - nextP;\n vec2 firstNormal = normalize(dirVect);\n vec2 secondNormal = vec2(turnDir * firstNormal.y * direction, -turnDir * firstNormal.x * direction);\n vec2 hypotenuse = normalize(firstNormal - secondNormal);\n vec2 normal = vec2(turnDir * hypotenuse.y * direction, -turnDir * hypotenuse.x * direction);\n float length = sqrt(v_halfWidth * v_halfWidth * 2.0);\n offset = normal * length;\n if (isRound) {\n round = 1.0;\n }\n}\n\nvoid main(void) {\n bool degenerate = false;\n float direction = float(sign(a_direction));\n mat4 offsetMatrix = u_offsetScaleMatrix * u_offsetRotateMatrix;\n vec2 offset;\n vec4 projPos = u_projectionMatrix * vec4(a_position, 0.0, 1.0);\n bool round = nearlyEquals(mod(a_direction, 2.0), 0.0);\n\n v_round = 0.0;\n v_halfWidth = u_lineWidth / 2.0;\n v_roundVertex = projPos.xy;\n\n if (nearlyEquals(mod(a_direction, 3.0), 0.0) || nearlyEquals(mod(a_direction, 17.0), 0.0)) {\n alongNormal(offset, a_nextPos, 1.0, direction);\n } else if (nearlyEquals(mod(a_direction, 5.0), 0.0) || nearlyEquals(mod(a_direction, 13.0), 0.0)) {\n alongNormal(offset, a_lastPos, -1.0, direction);\n } else if (nearlyEquals(mod(a_direction, 23.0), 0.0)) {\n miterUp(offset, v_round, round, direction);\n } else if (nearlyEquals(mod(a_direction, 19.0), 0.0)) {\n degenerate = miterDown(offset, projPos, offsetMatrix, direction);\n } else if (nearlyEquals(mod(a_direction, 7.0), 0.0)) {\n squareCap(offset, v_round, round, a_nextPos, 1.0, direction);\n } else if (nearlyEquals(mod(a_direction, 11.0), 0.0)) {\n squareCap(offset, v_round, round, a_lastPos, -1.0, direction);\n }\n if (!degenerate) {\n vec4 offsets = offsetMatrix * vec4(offset, 0.0, 0.0);\n gl_Position = projPos + offsets;\n } else {\n gl_Position = vec4(offset, 0.0, 1.0);\n }\n}\n\n\n' : 'varying float a;varying vec2 aVertex;varying float c;attribute vec2 d;attribute vec2 e;attribute vec2 f;attribute float g;uniform mat4 h;uniform mat4 i;uniform mat4 j;uniform float k;uniform float l;bool nearlyEquals(in float value,in float ref){float epsilon=0.000000000001;return value>=ref-epsilon&&value<=ref+epsilon;}void alongNormal(out vec2 offset,in vec2 nextP,in float turnDir,in float direction){vec2 dirVect=nextP-e;vec2 normal=normalize(vec2(-turnDir*dirVect.y,turnDir*dirVect.x));offset=k/2.0*normal*direction;}void miterUp(out vec2 offset,out float round,in bool isRound,in float direction){float halfWidth=k/2.0;vec2 tangent=normalize(normalize(f-e)+normalize(e-d));vec2 normal=vec2(-tangent.y,tangent.x);vec2 dirVect=f-e;vec2 tmpNormal=normalize(vec2(-dirVect.y,dirVect.x));float miterLength=abs(halfWidth/dot(normal,tmpNormal));offset=normal*direction*miterLength;round=0.0;if(isRound){round=1.0;}else if(miterLength>l+k){offset=halfWidth*tmpNormal*direction;}} bool miterDown(out vec2 offset,in vec4 projPos,in mat4 offsetMatrix,in float direction){bool degenerate=false;vec2 tangent=normalize(normalize(f-e)+normalize(e-d));vec2 normal=vec2(-tangent.y,tangent.x);vec2 dirVect=d-e;vec2 tmpNormal=normalize(vec2(-dirVect.y,dirVect.x));vec2 longOffset,shortOffset,longVertex;vec4 shortProjVertex;float halfWidth=k/2.0;if(length(f-e)>length(d-e)){longOffset=tmpNormal*direction*halfWidth;shortOffset=normalize(vec2(dirVect.y,-dirVect.x))*direction*halfWidth;longVertex=f;shortProjVertex=h*vec4(d,0.0,1.0);}else{shortOffset=tmpNormal*direction*halfWidth;longOffset=normalize(vec2(dirVect.y,-dirVect.x))*direction*halfWidth;longVertex=d;shortProjVertex=h*vec4(f,0.0,1.0);}vec4 p1=h*vec4(longVertex,0.0,1.0)+offsetMatrix*vec4(longOffset,0.0,0.0);vec4 p2=projPos+offsetMatrix*vec4(longOffset,0.0,0.0);vec4 p3=shortProjVertex+offsetMatrix*vec4(-shortOffset,0.0,0.0);vec4 p4=shortProjVertex+offsetMatrix*vec4(shortOffset,0.0,0.0);float denom=(p4.y-p3.y)*(p2.x-p1.x)-(p4.x-p3.x)*(p2.y-p1.y);float firstU=((p4.x-p3.x)*(p1.y-p3.y)-(p4.y-p3.y)*(p1.x-p3.x))/denom;float secondU=((p2.x-p1.x)*(p1.y-p3.y)-(p2.y-p1.y)*(p1.x-p3.x))/denom;float epsilon=0.000000000001;if(firstU>epsilon&&firstU<1.0-epsilon&&secondU>epsilon&&secondU<1.0-epsilon){shortProjVertex.x=p1.x+firstU*(p2.x-p1.x);shortProjVertex.y=p1.y+firstU*(p2.y-p1.y);offset=shortProjVertex.xy;degenerate=true;}else{float miterLength=abs(halfWidth/dot(normal,tmpNormal));offset=normal*direction*miterLength;}return degenerate;}void squareCap(out vec2 offset,out float round,in bool isRound,in vec2 nextP,in float turnDir,in float direction){round=0.0;vec2 dirVect=e-nextP;vec2 firstNormal=normalize(dirVect);vec2 secondNormal=vec2(turnDir*firstNormal.y*direction,-turnDir*firstNormal.x*direction);vec2 hypotenuse=normalize(firstNormal-secondNormal);vec2 normal=vec2(turnDir*hypotenuse.y*direction,-turnDir*hypotenuse.x*direction);float length=sqrt(c*c*2.0);offset=normal*length;if(isRound){round=1.0;}} void main(void){bool degenerate=false;float direction=float(sign(g));mat4 offsetMatrix=i*j;vec2 offset;vec4 projPos=h*vec4(e,0.0,1.0);bool round=nearlyEquals(mod(g,2.0),0.0);a=0.0;c=k/2.0;aVertex=projPos.xy;if(nearlyEquals(mod(g,3.0),0.0)||nearlyEquals(mod(g,17.0),0.0)){alongNormal(offset,f,1.0,direction);}else if(nearlyEquals(mod(g,5.0),0.0)||nearlyEquals(mod(g,13.0),0.0)){alongNormal(offset,d,-1.0,direction);}else if(nearlyEquals(mod(g,23.0),0.0)){miterUp(offset,a,round,direction);}else if(nearlyEquals(mod(g,19.0),0.0)){degenerate=miterDown(offset,projPos,offsetMatrix,direction);}else if(nearlyEquals(mod(g,7.0),0.0)){squareCap(offset,a,round,f,1.0,direction);}else if(nearlyEquals(mod(g,11.0),0.0)){squareCap(offset,a,round,d,-1.0,direction);}if(!degenerate){vec4 offsets=offsetMatrix*vec4(offset,0.0,0.0);gl_Position=projPos+offsets;}else{gl_Position=vec4(offset,0.0,1.0);}}'); diff --git a/src/ol/render/webgl/linestringreplay/defaultshader/Locations.js b/src/ol/render/webgl/linestringreplay/defaultshader/Locations.js index d7e270e11f..e2a20f8da4 100644 --- a/src/ol/render/webgl/linestringreplay/defaultshader/Locations.js +++ b/src/ol/render/webgl/linestringreplay/defaultshader/Locations.js @@ -2,7 +2,7 @@ * @module ol/render/webgl/linestringreplay/defaultshader/Locations */ // This file is automatically generated, do not edit -import _ol_ from '../../../../index.js'; +import {DEBUG_WEBGL} from '../../../../index.js'; /** * @constructor @@ -16,79 +16,79 @@ var _ol_render_webgl_linestringreplay_defaultshader_Locations_ = function(gl, pr * @type {WebGLUniformLocation} */ this.u_projectionMatrix = gl.getUniformLocation( - program, _ol_.DEBUG_WEBGL ? 'u_projectionMatrix' : 'h'); + program, DEBUG_WEBGL ? 'u_projectionMatrix' : 'h'); /** * @type {WebGLUniformLocation} */ this.u_offsetScaleMatrix = gl.getUniformLocation( - program, _ol_.DEBUG_WEBGL ? 'u_offsetScaleMatrix' : 'i'); + program, DEBUG_WEBGL ? 'u_offsetScaleMatrix' : 'i'); /** * @type {WebGLUniformLocation} */ this.u_offsetRotateMatrix = gl.getUniformLocation( - program, _ol_.DEBUG_WEBGL ? 'u_offsetRotateMatrix' : 'j'); + program, DEBUG_WEBGL ? 'u_offsetRotateMatrix' : 'j'); /** * @type {WebGLUniformLocation} */ this.u_lineWidth = gl.getUniformLocation( - program, _ol_.DEBUG_WEBGL ? 'u_lineWidth' : 'k'); + program, DEBUG_WEBGL ? 'u_lineWidth' : 'k'); /** * @type {WebGLUniformLocation} */ this.u_miterLimit = gl.getUniformLocation( - program, _ol_.DEBUG_WEBGL ? 'u_miterLimit' : 'l'); + program, DEBUG_WEBGL ? 'u_miterLimit' : 'l'); /** * @type {WebGLUniformLocation} */ this.u_opacity = gl.getUniformLocation( - program, _ol_.DEBUG_WEBGL ? 'u_opacity' : 'm'); + program, DEBUG_WEBGL ? 'u_opacity' : 'm'); /** * @type {WebGLUniformLocation} */ this.u_color = gl.getUniformLocation( - program, _ol_.DEBUG_WEBGL ? 'u_color' : 'n'); + program, DEBUG_WEBGL ? 'u_color' : 'n'); /** * @type {WebGLUniformLocation} */ this.u_size = gl.getUniformLocation( - program, _ol_.DEBUG_WEBGL ? 'u_size' : 'o'); + program, DEBUG_WEBGL ? 'u_size' : 'o'); /** * @type {WebGLUniformLocation} */ this.u_pixelRatio = gl.getUniformLocation( - program, _ol_.DEBUG_WEBGL ? 'u_pixelRatio' : 'p'); + program, DEBUG_WEBGL ? 'u_pixelRatio' : 'p'); /** * @type {number} */ this.a_lastPos = gl.getAttribLocation( - program, _ol_.DEBUG_WEBGL ? 'a_lastPos' : 'd'); + program, DEBUG_WEBGL ? 'a_lastPos' : 'd'); /** * @type {number} */ this.a_position = gl.getAttribLocation( - program, _ol_.DEBUG_WEBGL ? 'a_position' : 'e'); + program, DEBUG_WEBGL ? 'a_position' : 'e'); /** * @type {number} */ this.a_nextPos = gl.getAttribLocation( - program, _ol_.DEBUG_WEBGL ? 'a_nextPos' : 'f'); + program, DEBUG_WEBGL ? 'a_nextPos' : 'f'); /** * @type {number} */ this.a_direction = gl.getAttribLocation( - program, _ol_.DEBUG_WEBGL ? 'a_direction' : 'g'); + program, DEBUG_WEBGL ? 'a_direction' : 'g'); }; export default _ol_render_webgl_linestringreplay_defaultshader_Locations_; diff --git a/src/ol/render/webgl/polygonreplay/defaultshader.js b/src/ol/render/webgl/polygonreplay/defaultshader.js index 03dd482d32..33230ab722 100644 --- a/src/ol/render/webgl/polygonreplay/defaultshader.js +++ b/src/ol/render/webgl/polygonreplay/defaultshader.js @@ -1,16 +1,16 @@ // This file is automatically generated, do not edit. // Run `make shaders` to generate, and commit the result. -import _ol_ from '../../../index.js'; +import {DEBUG_WEBGL} from '../../../index.js'; import _ol_webgl_Fragment_ from '../../../webgl/Fragment.js'; import _ol_webgl_Vertex_ from '../../../webgl/Vertex.js'; var _ol_render_webgl_polygonreplay_defaultshader_ = {}; -_ol_render_webgl_polygonreplay_defaultshader_.fragment = new _ol_webgl_Fragment_(_ol_.DEBUG_WEBGL ? +_ol_render_webgl_polygonreplay_defaultshader_.fragment = new _ol_webgl_Fragment_(DEBUG_WEBGL ? 'precision mediump float;\n\n\n\nuniform vec4 u_color;\nuniform float u_opacity;\n\nvoid main(void) {\n gl_FragColor = u_color;\n float alpha = u_color.a * u_opacity;\n if (alpha == 0.0) {\n discard;\n }\n gl_FragColor.a = alpha;\n}\n' : 'precision mediump float;uniform vec4 e;uniform float f;void main(void){gl_FragColor=e;float alpha=e.a*f;if(alpha==0.0){discard;}gl_FragColor.a=alpha;}'); -_ol_render_webgl_polygonreplay_defaultshader_.vertex = new _ol_webgl_Vertex_(_ol_.DEBUG_WEBGL ? +_ol_render_webgl_polygonreplay_defaultshader_.vertex = new _ol_webgl_Vertex_(DEBUG_WEBGL ? '\n\nattribute vec2 a_position;\n\nuniform mat4 u_projectionMatrix;\nuniform mat4 u_offsetScaleMatrix;\nuniform mat4 u_offsetRotateMatrix;\n\nvoid main(void) {\n gl_Position = u_projectionMatrix * vec4(a_position, 0.0, 1.0);\n}\n\n\n' : 'attribute vec2 a;uniform mat4 b;uniform mat4 c;uniform mat4 d;void main(void){gl_Position=b*vec4(a,0.0,1.0);}'); diff --git a/src/ol/render/webgl/polygonreplay/defaultshader/Locations.js b/src/ol/render/webgl/polygonreplay/defaultshader/Locations.js index 57b8c1ecd4..70f9e6f67a 100644 --- a/src/ol/render/webgl/polygonreplay/defaultshader/Locations.js +++ b/src/ol/render/webgl/polygonreplay/defaultshader/Locations.js @@ -2,7 +2,7 @@ * @module ol/render/webgl/polygonreplay/defaultshader/Locations */ // This file is automatically generated, do not edit -import _ol_ from '../../../../index.js'; +import {DEBUG_WEBGL} from '../../../../index.js'; /** * @constructor @@ -16,37 +16,37 @@ var _ol_render_webgl_polygonreplay_defaultshader_Locations_ = function(gl, progr * @type {WebGLUniformLocation} */ this.u_projectionMatrix = gl.getUniformLocation( - program, _ol_.DEBUG_WEBGL ? 'u_projectionMatrix' : 'b'); + program, DEBUG_WEBGL ? 'u_projectionMatrix' : 'b'); /** * @type {WebGLUniformLocation} */ this.u_offsetScaleMatrix = gl.getUniformLocation( - program, _ol_.DEBUG_WEBGL ? 'u_offsetScaleMatrix' : 'c'); + program, DEBUG_WEBGL ? 'u_offsetScaleMatrix' : 'c'); /** * @type {WebGLUniformLocation} */ this.u_offsetRotateMatrix = gl.getUniformLocation( - program, _ol_.DEBUG_WEBGL ? 'u_offsetRotateMatrix' : 'd'); + program, DEBUG_WEBGL ? 'u_offsetRotateMatrix' : 'd'); /** * @type {WebGLUniformLocation} */ this.u_color = gl.getUniformLocation( - program, _ol_.DEBUG_WEBGL ? 'u_color' : 'e'); + program, DEBUG_WEBGL ? 'u_color' : 'e'); /** * @type {WebGLUniformLocation} */ this.u_opacity = gl.getUniformLocation( - program, _ol_.DEBUG_WEBGL ? 'u_opacity' : 'f'); + program, DEBUG_WEBGL ? 'u_opacity' : 'f'); /** * @type {number} */ this.a_position = gl.getAttribLocation( - program, _ol_.DEBUG_WEBGL ? 'a_position' : 'a'); + program, DEBUG_WEBGL ? 'a_position' : 'a'); }; export default _ol_render_webgl_polygonreplay_defaultshader_Locations_; diff --git a/src/ol/render/webgl/texturereplay/defaultshader.js b/src/ol/render/webgl/texturereplay/defaultshader.js index a276ebfda4..6d0f10c62f 100644 --- a/src/ol/render/webgl/texturereplay/defaultshader.js +++ b/src/ol/render/webgl/texturereplay/defaultshader.js @@ -1,16 +1,16 @@ // This file is automatically generated, do not edit. // Run `make shaders` to generate, and commit the result. -import _ol_ from '../../../index.js'; +import {DEBUG_WEBGL} from '../../../index.js'; import _ol_webgl_Fragment_ from '../../../webgl/Fragment.js'; import _ol_webgl_Vertex_ from '../../../webgl/Vertex.js'; var _ol_render_webgl_texturereplay_defaultshader_ = {}; -_ol_render_webgl_texturereplay_defaultshader_.fragment = new _ol_webgl_Fragment_(_ol_.DEBUG_WEBGL ? +_ol_render_webgl_texturereplay_defaultshader_.fragment = new _ol_webgl_Fragment_(DEBUG_WEBGL ? 'precision mediump float;\nvarying vec2 v_texCoord;\nvarying float v_opacity;\n\nuniform float u_opacity;\nuniform sampler2D u_image;\n\nvoid main(void) {\n vec4 texColor = texture2D(u_image, v_texCoord);\n gl_FragColor.rgb = texColor.rgb;\n float alpha = texColor.a * v_opacity * u_opacity;\n if (alpha == 0.0) {\n discard;\n }\n gl_FragColor.a = alpha;\n}\n' : 'precision mediump float;varying vec2 a;varying float b;uniform float k;uniform sampler2D l;void main(void){vec4 texColor=texture2D(l,a);gl_FragColor.rgb=texColor.rgb;float alpha=texColor.a*b*k;if(alpha==0.0){discard;}gl_FragColor.a=alpha;}'); -_ol_render_webgl_texturereplay_defaultshader_.vertex = new _ol_webgl_Vertex_(_ol_.DEBUG_WEBGL ? +_ol_render_webgl_texturereplay_defaultshader_.vertex = new _ol_webgl_Vertex_(DEBUG_WEBGL ? 'varying vec2 v_texCoord;\nvarying float v_opacity;\n\nattribute vec2 a_position;\nattribute vec2 a_texCoord;\nattribute vec2 a_offsets;\nattribute float a_opacity;\nattribute float a_rotateWithView;\n\nuniform mat4 u_projectionMatrix;\nuniform mat4 u_offsetScaleMatrix;\nuniform mat4 u_offsetRotateMatrix;\n\nvoid main(void) {\n mat4 offsetMatrix = u_offsetScaleMatrix;\n if (a_rotateWithView == 1.0) {\n offsetMatrix = u_offsetScaleMatrix * u_offsetRotateMatrix;\n }\n vec4 offsets = offsetMatrix * vec4(a_offsets, 0.0, 0.0);\n gl_Position = u_projectionMatrix * vec4(a_position, 0.0, 1.0) + offsets;\n v_texCoord = a_texCoord;\n v_opacity = a_opacity;\n}\n\n\n' : 'varying vec2 a;varying float b;attribute vec2 c;attribute vec2 d;attribute vec2 e;attribute float f;attribute float g;uniform mat4 h;uniform mat4 i;uniform mat4 j;void main(void){mat4 offsetMatrix=i;if(g==1.0){offsetMatrix=i*j;}vec4 offsets=offsetMatrix*vec4(e,0.0,0.0);gl_Position=h*vec4(c,0.0,1.0)+offsets;a=d;b=f;}'); diff --git a/src/ol/render/webgl/texturereplay/defaultshader/Locations.js b/src/ol/render/webgl/texturereplay/defaultshader/Locations.js index 2bdd2389bc..97f3511498 100644 --- a/src/ol/render/webgl/texturereplay/defaultshader/Locations.js +++ b/src/ol/render/webgl/texturereplay/defaultshader/Locations.js @@ -2,7 +2,7 @@ * @module ol/render/webgl/texturereplay/defaultshader/Locations */ // This file is automatically generated, do not edit -import _ol_ from '../../../../index.js'; +import {DEBUG_WEBGL} from '../../../../index.js'; /** * @constructor @@ -16,61 +16,61 @@ var _ol_render_webgl_texturereplay_defaultshader_Locations_ = function(gl, progr * @type {WebGLUniformLocation} */ this.u_projectionMatrix = gl.getUniformLocation( - program, _ol_.DEBUG_WEBGL ? 'u_projectionMatrix' : 'h'); + program, DEBUG_WEBGL ? 'u_projectionMatrix' : 'h'); /** * @type {WebGLUniformLocation} */ this.u_offsetScaleMatrix = gl.getUniformLocation( - program, _ol_.DEBUG_WEBGL ? 'u_offsetScaleMatrix' : 'i'); + program, DEBUG_WEBGL ? 'u_offsetScaleMatrix' : 'i'); /** * @type {WebGLUniformLocation} */ this.u_offsetRotateMatrix = gl.getUniformLocation( - program, _ol_.DEBUG_WEBGL ? 'u_offsetRotateMatrix' : 'j'); + program, DEBUG_WEBGL ? 'u_offsetRotateMatrix' : 'j'); /** * @type {WebGLUniformLocation} */ this.u_opacity = gl.getUniformLocation( - program, _ol_.DEBUG_WEBGL ? 'u_opacity' : 'k'); + program, DEBUG_WEBGL ? 'u_opacity' : 'k'); /** * @type {WebGLUniformLocation} */ this.u_image = gl.getUniformLocation( - program, _ol_.DEBUG_WEBGL ? 'u_image' : 'l'); + program, DEBUG_WEBGL ? 'u_image' : 'l'); /** * @type {number} */ this.a_position = gl.getAttribLocation( - program, _ol_.DEBUG_WEBGL ? 'a_position' : 'c'); + program, DEBUG_WEBGL ? 'a_position' : 'c'); /** * @type {number} */ this.a_texCoord = gl.getAttribLocation( - program, _ol_.DEBUG_WEBGL ? 'a_texCoord' : 'd'); + program, DEBUG_WEBGL ? 'a_texCoord' : 'd'); /** * @type {number} */ this.a_offsets = gl.getAttribLocation( - program, _ol_.DEBUG_WEBGL ? 'a_offsets' : 'e'); + program, DEBUG_WEBGL ? 'a_offsets' : 'e'); /** * @type {number} */ this.a_opacity = gl.getAttribLocation( - program, _ol_.DEBUG_WEBGL ? 'a_opacity' : 'f'); + program, DEBUG_WEBGL ? 'a_opacity' : 'f'); /** * @type {number} */ this.a_rotateWithView = gl.getAttribLocation( - program, _ol_.DEBUG_WEBGL ? 'a_rotateWithView' : 'g'); + program, DEBUG_WEBGL ? 'a_rotateWithView' : 'g'); }; export default _ol_render_webgl_texturereplay_defaultshader_Locations_; diff --git a/src/ol/renderer/Layer.js b/src/ol/renderer/Layer.js index 568f901fd8..e61ad6104a 100644 --- a/src/ol/renderer/Layer.js +++ b/src/ol/renderer/Layer.js @@ -1,7 +1,7 @@ /** * @module ol/renderer/Layer */ -import _ol_ from '../index.js'; +import {getUid, inherits, nullFunction} from '../index.js'; import _ol_ImageState_ from '../ImageState.js'; import _ol_Observable_ from '../Observable.js'; import _ol_TileState_ from '../TileState.js'; @@ -30,7 +30,7 @@ var _ol_renderer_Layer_ = function(layer) { }; -_ol_.inherits(_ol_renderer_Layer_, _ol_Observable_); +inherits(_ol_renderer_Layer_, _ol_Observable_); /** @@ -43,7 +43,7 @@ _ol_.inherits(_ol_renderer_Layer_, _ol_Observable_); * @return {T|undefined} Callback result. * @template S,T */ -_ol_renderer_Layer_.prototype.forEachFeatureAtCoordinate = _ol_.nullFunction; +_ol_renderer_Layer_.prototype.forEachFeatureAtCoordinate = nullFunction; /** @@ -152,7 +152,7 @@ _ol_renderer_Layer_.prototype.scheduleExpireCache = function(frameState, tileSou * @param {olx.FrameState} frameState Frame state. */ var postRenderFunction = function(tileSource, map, frameState) { - var tileSourceKey = _ol_.getUid(tileSource).toString(); + var tileSourceKey = getUid(tileSource).toString(); if (tileSourceKey in frameState.usedTiles) { tileSource.expireCache(frameState.viewState.projection, frameState.usedTiles[tileSourceKey]); @@ -194,7 +194,7 @@ _ol_renderer_Layer_.prototype.updateLogos = function(frameState, source) { */ _ol_renderer_Layer_.prototype.updateUsedTiles = function(usedTiles, tileSource, z, tileRange) { // FIXME should we use tilesToDrawByZ instead? - var tileSourceKey = _ol_.getUid(tileSource).toString(); + var tileSourceKey = getUid(tileSource).toString(); var zKey = z.toString(); if (tileSourceKey in usedTiles) { if (zKey in usedTiles[tileSourceKey]) { @@ -232,7 +232,7 @@ _ol_renderer_Layer_.prototype.updateUsedTiles = function(usedTiles, tileSource, _ol_renderer_Layer_.prototype.manageTilePyramid = function( frameState, tileSource, tileGrid, pixelRatio, projection, extent, currentZ, preload, opt_tileCallback, opt_this) { - var tileSourceKey = _ol_.getUid(tileSource).toString(); + var tileSourceKey = getUid(tileSource).toString(); if (!(tileSourceKey in frameState.wantedTiles)) { frameState.wantedTiles[tileSourceKey] = {}; } diff --git a/src/ol/renderer/Map.js b/src/ol/renderer/Map.js index 8fe5658882..909d796bc4 100644 --- a/src/ol/renderer/Map.js +++ b/src/ol/renderer/Map.js @@ -1,7 +1,7 @@ /** * @module ol/renderer/Map */ -import _ol_ from '../index.js'; +import {getUid, inherits, nullFunction} from '../index.js'; import _ol_Disposable_ from '../Disposable.js'; import _ol_events_ from '../events.js'; import _ol_events_EventType_ from '../events/EventType.js'; @@ -45,7 +45,7 @@ var _ol_renderer_Map_ = function(container, map) { }; -_ol_.inherits(_ol_renderer_Map_, _ol_Disposable_); +inherits(_ol_renderer_Map_, _ol_Disposable_); /** @@ -116,8 +116,8 @@ _ol_renderer_Map_.prototype.forEachFeatureAtCoordinate = function(coordinate, fr * @return {?} Callback result. */ function forEachFeatureAtCoordinate(feature, layer) { - var key = _ol_.getUid(feature).toString(); - var managed = frameState.layerStates[_ol_.getUid(layer)].managed; + var key = getUid(feature).toString(); + var managed = frameState.layerStates[getUid(layer)].managed; if (!(key in frameState.skippedFeatureUids && !managed)) { return callback.call(thisArg, feature, managed ? layer : null); } @@ -204,7 +204,7 @@ _ol_renderer_Map_.prototype.hasFeatureAtCoordinate = function(coordinate, frameS * @return {ol.renderer.Layer} Layer renderer. */ _ol_renderer_Map_.prototype.getLayerRenderer = function(layer) { - var layerKey = _ol_.getUid(layer).toString(); + var layerKey = getUid(layer).toString(); if (layerKey in this.layerRenderers_) { return this.layerRenderers_[layerKey]; } else { @@ -293,7 +293,7 @@ _ol_renderer_Map_.prototype.removeLayerRendererByKey_ = function(layerKey) { * Render. * @param {?olx.FrameState} frameState Frame state. */ -_ol_renderer_Map_.prototype.renderFrame = _ol_.nullFunction; +_ol_renderer_Map_.prototype.renderFrame = nullFunction; /** diff --git a/src/ol/renderer/canvas/ImageLayer.js b/src/ol/renderer/canvas/ImageLayer.js index 957a644301..ab01e9a8a1 100644 --- a/src/ol/renderer/canvas/ImageLayer.js +++ b/src/ol/renderer/canvas/ImageLayer.js @@ -1,7 +1,7 @@ /** * @module ol/renderer/canvas/ImageLayer */ -import _ol_ from '../../index.js'; +import {ENABLE_RASTER_REPROJECTION, inherits} from '../../index.js'; import _ol_ImageCanvas_ from '../../ImageCanvas.js'; import _ol_LayerType_ from '../../LayerType.js'; import _ol_ViewHint_ from '../../ViewHint.js'; @@ -49,7 +49,7 @@ var _ol_renderer_canvas_ImageLayer_ = function(imageLayer) { }; -_ol_.inherits(_ol_renderer_canvas_ImageLayer_, _ol_renderer_canvas_IntermediateCanvas_); +inherits(_ol_renderer_canvas_ImageLayer_, _ol_renderer_canvas_IntermediateCanvas_); /** @@ -128,7 +128,7 @@ _ol_renderer_canvas_ImageLayer_.prototype.prepareFrame = function(frameState, la if (!hints[_ol_ViewHint_.ANIMATING] && !hints[_ol_ViewHint_.INTERACTING] && !_ol_extent_.isEmpty(renderedExtent)) { var projection = viewState.projection; - if (!_ol_.ENABLE_RASTER_REPROJECTION) { + if (!ENABLE_RASTER_REPROJECTION) { var sourceProjection = imageSource.getProjection(); if (sourceProjection) { projection = sourceProjection; diff --git a/src/ol/renderer/canvas/IntermediateCanvas.js b/src/ol/renderer/canvas/IntermediateCanvas.js index e4241cd82b..a9515a56f9 100644 --- a/src/ol/renderer/canvas/IntermediateCanvas.js +++ b/src/ol/renderer/canvas/IntermediateCanvas.js @@ -1,7 +1,7 @@ /** * @module ol/renderer/canvas/IntermediateCanvas */ -import _ol_ from '../../index.js'; +import {inherits, nullFunction} from '../../index.js'; import _ol_coordinate_ from '../../coordinate.js'; import _ol_dom_ from '../../dom.js'; import _ol_extent_ from '../../extent.js'; @@ -32,7 +32,7 @@ var _ol_renderer_canvas_IntermediateCanvas_ = function(layer) { }; -_ol_.inherits(_ol_renderer_canvas_IntermediateCanvas_, _ol_renderer_canvas_Layer_); +inherits(_ol_renderer_canvas_IntermediateCanvas_, _ol_renderer_canvas_Layer_); /** @@ -123,7 +123,7 @@ _ol_renderer_canvas_IntermediateCanvas_.prototype.forEachLayerAtCoordinate = fun return undefined; } - if (this.getLayer().getSource().forEachFeatureAtCoordinate !== _ol_.nullFunction) { + if (this.getLayer().getSource().forEachFeatureAtCoordinate !== nullFunction) { // for ImageCanvas sources use the original hit-detection logic, // so that for example also transparent polygons are detected return _ol_renderer_canvas_Layer_.prototype.forEachLayerAtCoordinate.apply(this, arguments); diff --git a/src/ol/renderer/canvas/Layer.js b/src/ol/renderer/canvas/Layer.js index 0556a3194f..fdf0321ef2 100644 --- a/src/ol/renderer/canvas/Layer.js +++ b/src/ol/renderer/canvas/Layer.js @@ -1,7 +1,7 @@ /** * @module ol/renderer/canvas/Layer */ -import _ol_ from '../../index.js'; +import {inherits} from '../../index.js'; import _ol_extent_ from '../../extent.js'; import _ol_functions_ from '../../functions.js'; import _ol_render_Event_ from '../../render/Event.js'; @@ -35,7 +35,7 @@ var _ol_renderer_canvas_Layer_ = function(layer) { }; -_ol_.inherits(_ol_renderer_canvas_Layer_, _ol_renderer_Layer_); +inherits(_ol_renderer_canvas_Layer_, _ol_renderer_Layer_); /** diff --git a/src/ol/renderer/canvas/Map.js b/src/ol/renderer/canvas/Map.js index b612d0fafa..c5a41441f6 100644 --- a/src/ol/renderer/canvas/Map.js +++ b/src/ol/renderer/canvas/Map.js @@ -4,7 +4,7 @@ // FIXME offset panning import _ol_transform_ from '../../transform.js'; -import _ol_ from '../../index.js'; +import {inherits} from '../../index.js'; import _ol_array_ from '../../array.js'; import _ol_css_ from '../../css.js'; import _ol_dom_ from '../../dom.js'; @@ -60,7 +60,7 @@ var _ol_renderer_canvas_Map_ = function(container, map) { }; -_ol_.inherits(_ol_renderer_canvas_Map_, _ol_renderer_Map_); +inherits(_ol_renderer_canvas_Map_, _ol_renderer_Map_); /** diff --git a/src/ol/renderer/canvas/TileLayer.js b/src/ol/renderer/canvas/TileLayer.js index f2712ada1d..18b86a3476 100644 --- a/src/ol/renderer/canvas/TileLayer.js +++ b/src/ol/renderer/canvas/TileLayer.js @@ -1,7 +1,7 @@ /** * @module ol/renderer/canvas/TileLayer */ -import _ol_ from '../../index.js'; +import {getUid, inherits} from '../../index.js'; import _ol_LayerType_ from '../../LayerType.js'; import _ol_TileRange_ from '../../TileRange.js'; import _ol_TileState_ from '../../TileState.js'; @@ -78,7 +78,7 @@ var _ol_renderer_canvas_TileLayer_ = function(tileLayer) { }; -_ol_.inherits(_ol_renderer_canvas_TileLayer_, _ol_renderer_canvas_IntermediateCanvas_); +inherits(_ol_renderer_canvas_TileLayer_, _ol_renderer_canvas_IntermediateCanvas_); /** @@ -179,7 +179,7 @@ _ol_renderer_canvas_TileLayer_.prototype.prepareFrame = function(frameState, lay tile = tile.getInterimTile(); } if (this.isDrawableTile_(tile)) { - var uid = _ol_.getUid(this); + var uid = getUid(this); if (tile.getState() == _ol_TileState_.LOADED) { tilesToDrawByZ[z][tile.tileCoord.toString()] = tile; var inTransition = tile.inTransition(uid); @@ -314,7 +314,7 @@ _ol_renderer_canvas_TileLayer_.prototype.drawTileImage = function(tile, frameSta if (!image) { return; } - var uid = _ol_.getUid(this); + var uid = getUid(this); var alpha = transition ? tile.getAlpha(uid, frameState.time) : 1; if (alpha === 1 && !this.getLayer().getSource().getOpaque(frameState.viewState.projection)) { this.context.clearRect(x, y, w, h); diff --git a/src/ol/renderer/canvas/VectorLayer.js b/src/ol/renderer/canvas/VectorLayer.js index 4c079d34f4..928ea09283 100644 --- a/src/ol/renderer/canvas/VectorLayer.js +++ b/src/ol/renderer/canvas/VectorLayer.js @@ -1,7 +1,7 @@ /** * @module ol/renderer/canvas/VectorLayer */ -import _ol_ from '../../index.js'; +import {getUid, inherits} from '../../index.js'; import _ol_LayerType_ from '../../LayerType.js'; import _ol_ViewHint_ from '../../ViewHint.js'; import _ol_dom_ from '../../dom.js'; @@ -84,7 +84,7 @@ var _ol_renderer_canvas_VectorLayer_ = function(vectorLayer) { }; -_ol_.inherits(_ol_renderer_canvas_VectorLayer_, _ol_renderer_canvas_Layer_); +inherits(_ol_renderer_canvas_VectorLayer_, _ol_renderer_canvas_Layer_); /** @@ -263,7 +263,7 @@ _ol_renderer_canvas_VectorLayer_.prototype.forEachFeatureAtCoordinate = function * @return {?} Callback result. */ function(feature) { - var key = _ol_.getUid(feature).toString(); + var key = getUid(feature).toString(); if (!(key in features)) { features[key] = true; return callback.call(thisArg, feature, layer); diff --git a/src/ol/renderer/canvas/VectorTileLayer.js b/src/ol/renderer/canvas/VectorTileLayer.js index eaa796e12e..798f06344b 100644 --- a/src/ol/renderer/canvas/VectorTileLayer.js +++ b/src/ol/renderer/canvas/VectorTileLayer.js @@ -1,7 +1,7 @@ /** * @module ol/renderer/canvas/VectorTileLayer */ -import _ol_ from '../../index.js'; +import {getUid, inherits} from '../../index.js'; import _ol_LayerType_ from '../../LayerType.js'; import _ol_TileState_ from '../../TileState.js'; import _ol_dom_ from '../../dom.js'; @@ -68,7 +68,7 @@ var _ol_renderer_canvas_VectorTileLayer_ = function(layer) { }; -_ol_.inherits(_ol_renderer_canvas_VectorTileLayer_, _ol_renderer_canvas_TileLayer_); +inherits(_ol_renderer_canvas_VectorTileLayer_, _ol_renderer_canvas_TileLayer_); /** @@ -303,7 +303,7 @@ _ol_renderer_canvas_VectorTileLayer_.prototype.forEachFeatureAtCoordinate = func * @return {?} Callback result. */ function(feature) { - var key = _ol_.getUid(feature).toString(); + var key = getUid(feature).toString(); if (!(key in features)) { features[key] = true; return callback.call(thisArg, feature, layer); diff --git a/src/ol/renderer/vector.js b/src/ol/renderer/vector.js index 528e3ce28b..dd9003b7dd 100644 --- a/src/ol/renderer/vector.js +++ b/src/ol/renderer/vector.js @@ -1,7 +1,7 @@ /** * @module ol/renderer/vector */ -import _ol_ from '../index.js'; +import {SIMPLIFY_TOLERANCE, getUid} from '../index.js'; import _ol_ImageState_ from '../ImageState.js'; import _ol_geom_GeometryType_ from '../geom/GeometryType.js'; import _ol_render_ReplayType_ from '../render/ReplayType.js'; @@ -14,7 +14,7 @@ var _ol_renderer_vector_ = {}; * @return {number} Order. */ _ol_renderer_vector_.defaultOrder = function(feature1, feature2) { - return _ol_.getUid(feature1) - _ol_.getUid(feature2); + return getUid(feature1) - getUid(feature2); }; @@ -35,7 +35,7 @@ _ol_renderer_vector_.getSquaredTolerance = function(resolution, pixelRatio) { * @return {number} Pixel tolerance. */ _ol_renderer_vector_.getTolerance = function(resolution, pixelRatio) { - return _ol_.SIMPLIFY_TOLERANCE * resolution / pixelRatio; + return SIMPLIFY_TOLERANCE * resolution / pixelRatio; }; diff --git a/src/ol/renderer/webgl/ImageLayer.js b/src/ol/renderer/webgl/ImageLayer.js index bd5c60a061..d67457c8c2 100644 --- a/src/ol/renderer/webgl/ImageLayer.js +++ b/src/ol/renderer/webgl/ImageLayer.js @@ -1,7 +1,7 @@ /** * @module ol/renderer/webgl/ImageLayer */ -import _ol_ from '../../index.js'; +import {ENABLE_RASTER_REPROJECTION, inherits, nullFunction} from '../../index.js'; import _ol_LayerType_ from '../../LayerType.js'; import _ol_ViewHint_ from '../../ViewHint.js'; import _ol_dom_ from '../../dom.js'; @@ -45,7 +45,7 @@ var _ol_renderer_webgl_ImageLayer_ = function(mapRenderer, imageLayer) { }; -_ol_.inherits(_ol_renderer_webgl_ImageLayer_, _ol_renderer_webgl_Layer_); +inherits(_ol_renderer_webgl_ImageLayer_, _ol_renderer_webgl_Layer_); /** @@ -142,7 +142,7 @@ _ol_renderer_webgl_ImageLayer_.prototype.prepareFrame = function(frameState, lay if (!hints[_ol_ViewHint_.ANIMATING] && !hints[_ol_ViewHint_.INTERACTING] && !_ol_extent_.isEmpty(renderedExtent)) { var projection = viewState.projection; - if (!_ol_.ENABLE_RASTER_REPROJECTION) { + if (!ENABLE_RASTER_REPROJECTION) { var sourceProjection = imageSource.getProjection(); if (sourceProjection) { projection = sourceProjection; @@ -248,7 +248,7 @@ _ol_renderer_webgl_ImageLayer_.prototype.forEachLayerAtPixel = function(pixel, f return undefined; } - if (this.getLayer().getSource().forEachFeatureAtCoordinate !== _ol_.nullFunction) { + if (this.getLayer().getSource().forEachFeatureAtCoordinate !== nullFunction) { // for ImageCanvas sources use the original hit-detection logic, // so that for example also transparent polygons are detected var coordinate = _ol_transform_.apply( diff --git a/src/ol/renderer/webgl/Layer.js b/src/ol/renderer/webgl/Layer.js index f62c4bf084..e92d04c9a4 100644 --- a/src/ol/renderer/webgl/Layer.js +++ b/src/ol/renderer/webgl/Layer.js @@ -1,7 +1,7 @@ /** * @module ol/renderer/webgl/Layer */ -import _ol_ from '../../index.js'; +import {inherits} from '../../index.js'; import _ol_render_Event_ from '../../render/Event.js'; import _ol_render_EventType_ from '../../render/EventType.js'; import _ol_render_webgl_Immediate_ from '../../render/webgl/Immediate.js'; @@ -86,7 +86,7 @@ var _ol_renderer_webgl_Layer_ = function(mapRenderer, layer) { }; -_ol_.inherits(_ol_renderer_webgl_Layer_, _ol_renderer_Layer_); +inherits(_ol_renderer_webgl_Layer_, _ol_renderer_Layer_); /** diff --git a/src/ol/renderer/webgl/Map.js b/src/ol/renderer/webgl/Map.js index 802a79c4aa..7515e47673 100644 --- a/src/ol/renderer/webgl/Map.js +++ b/src/ol/renderer/webgl/Map.js @@ -3,7 +3,7 @@ */ // FIXME check against gl.getParameter(webgl.MAX_TEXTURE_SIZE) -import _ol_ from '../../index.js'; +import {WEBGL_TEXTURE_CACHE_HIGH_WATER_MARK, inherits} from '../../index.js'; import _ol_array_ from '../../array.js'; import _ol_css_ from '../../css.js'; import _ol_dom_ from '../../dom.js'; @@ -160,7 +160,7 @@ var _ol_renderer_webgl_Map_ = function(container, map) { this.initializeGL_(); }; -_ol_.inherits(_ol_renderer_webgl_Map_, _ol_renderer_Map_); +inherits(_ol_renderer_webgl_Map_, _ol_renderer_Map_); /** @@ -308,7 +308,7 @@ _ol_renderer_webgl_Map_.prototype.expireCache_ = function(map, frameState) { var gl = this.getGL(); var textureCacheEntry; while (this.textureCache_.getCount() - this.textureCacheFrameMarkerCount_ > - _ol_.WEBGL_TEXTURE_CACHE_HIGH_WATER_MARK) { + WEBGL_TEXTURE_CACHE_HIGH_WATER_MARK) { textureCacheEntry = this.textureCache_.peekLast(); if (!textureCacheEntry) { if (+this.textureCache_.peekLastKey() == frameState.index) { @@ -480,7 +480,7 @@ _ol_renderer_webgl_Map_.prototype.renderFrame = function(frameState) { this.calculateMatrices2D(frameState); if (this.textureCache_.getCount() - this.textureCacheFrameMarkerCount_ > - _ol_.WEBGL_TEXTURE_CACHE_HIGH_WATER_MARK) { + WEBGL_TEXTURE_CACHE_HIGH_WATER_MARK) { frameState.postRenderFunctions.push( /** @type {ol.PostRenderFunction} */ (this.expireCache_.bind(this)) ); diff --git a/src/ol/renderer/webgl/TileLayer.js b/src/ol/renderer/webgl/TileLayer.js index 2eba29ec4b..f317b34356 100644 --- a/src/ol/renderer/webgl/TileLayer.js +++ b/src/ol/renderer/webgl/TileLayer.js @@ -4,7 +4,7 @@ // FIXME large resolutions lead to too large framebuffers :-( // FIXME animated shaders! check in redraw -import _ol_ from '../../index.js'; +import {inherits} from '../../index.js'; import _ol_LayerType_ from '../../LayerType.js'; import _ol_TileRange_ from '../../TileRange.js'; import _ol_TileState_ from '../../TileState.js'; @@ -86,7 +86,7 @@ var _ol_renderer_webgl_TileLayer_ = function(mapRenderer, tileLayer) { }; -_ol_.inherits(_ol_renderer_webgl_TileLayer_, _ol_renderer_webgl_Layer_); +inherits(_ol_renderer_webgl_TileLayer_, _ol_renderer_webgl_Layer_); /** diff --git a/src/ol/renderer/webgl/VectorLayer.js b/src/ol/renderer/webgl/VectorLayer.js index a6f134d72d..2ba2c96913 100644 --- a/src/ol/renderer/webgl/VectorLayer.js +++ b/src/ol/renderer/webgl/VectorLayer.js @@ -1,7 +1,7 @@ /** * @module ol/renderer/webgl/VectorLayer */ -import _ol_ from '../../index.js'; +import {getUid, inherits} from '../../index.js'; import _ol_LayerType_ from '../../LayerType.js'; import _ol_ViewHint_ from '../../ViewHint.js'; import _ol_extent_ from '../../extent.js'; @@ -67,7 +67,7 @@ var _ol_renderer_webgl_VectorLayer_ = function(mapRenderer, vectorLayer) { }; -_ol_.inherits(_ol_renderer_webgl_VectorLayer_, _ol_renderer_webgl_Layer_); +inherits(_ol_renderer_webgl_VectorLayer_, _ol_renderer_webgl_Layer_); /** @@ -154,7 +154,7 @@ _ol_renderer_webgl_VectorLayer_.prototype.forEachFeatureAtCoordinate = function( * @return {?} Callback result. */ function(feature) { - var key = _ol_.getUid(feature).toString(); + var key = getUid(feature).toString(); if (!(key in features)) { features[key] = true; return callback.call(thisArg, feature, layer); diff --git a/src/ol/renderer/webgl/defaultmapshader.js b/src/ol/renderer/webgl/defaultmapshader.js index e2446c300d..6dacbc9ccd 100644 --- a/src/ol/renderer/webgl/defaultmapshader.js +++ b/src/ol/renderer/webgl/defaultmapshader.js @@ -1,16 +1,16 @@ // This file is automatically generated, do not edit. // Run `make shaders` to generate, and commit the result. -import _ol_ from '../../index.js'; +import {DEBUG_WEBGL} from '../../index.js'; import _ol_webgl_Fragment_ from '../../webgl/Fragment.js'; import _ol_webgl_Vertex_ from '../../webgl/Vertex.js'; var _ol_renderer_webgl_defaultmapshader_ = {}; -_ol_renderer_webgl_defaultmapshader_.fragment = new _ol_webgl_Fragment_(_ol_.DEBUG_WEBGL ? +_ol_renderer_webgl_defaultmapshader_.fragment = new _ol_webgl_Fragment_(DEBUG_WEBGL ? 'precision mediump float;\nvarying vec2 v_texCoord;\n\n\nuniform float u_opacity;\nuniform sampler2D u_texture;\n\nvoid main(void) {\n vec4 texColor = texture2D(u_texture, v_texCoord);\n gl_FragColor.rgb = texColor.rgb;\n gl_FragColor.a = texColor.a * u_opacity;\n}\n' : 'precision mediump float;varying vec2 a;uniform float f;uniform sampler2D g;void main(void){vec4 texColor=texture2D(g,a);gl_FragColor.rgb=texColor.rgb;gl_FragColor.a=texColor.a*f;}'); -_ol_renderer_webgl_defaultmapshader_.vertex = new _ol_webgl_Vertex_(_ol_.DEBUG_WEBGL ? +_ol_renderer_webgl_defaultmapshader_.vertex = new _ol_webgl_Vertex_(DEBUG_WEBGL ? 'varying vec2 v_texCoord;\n\n\nattribute vec2 a_position;\nattribute vec2 a_texCoord;\n\nuniform mat4 u_texCoordMatrix;\nuniform mat4 u_projectionMatrix;\n\nvoid main(void) {\n gl_Position = u_projectionMatrix * vec4(a_position, 0., 1.);\n v_texCoord = (u_texCoordMatrix * vec4(a_texCoord, 0., 1.)).st;\n}\n\n\n' : 'varying vec2 a;attribute vec2 b;attribute vec2 c;uniform mat4 d;uniform mat4 e;void main(void){gl_Position=e*vec4(b,0.,1.);a=(d*vec4(c,0.,1.)).st;}'); diff --git a/src/ol/renderer/webgl/defaultmapshader/Locations.js b/src/ol/renderer/webgl/defaultmapshader/Locations.js index 632a32a710..95d1b9df9a 100644 --- a/src/ol/renderer/webgl/defaultmapshader/Locations.js +++ b/src/ol/renderer/webgl/defaultmapshader/Locations.js @@ -2,7 +2,7 @@ * @module ol/renderer/webgl/defaultmapshader/Locations */ // This file is automatically generated, do not edit -import _ol_ from '../../../index.js'; +import {DEBUG_WEBGL} from '../../../index.js'; /** * @constructor @@ -16,37 +16,37 @@ var _ol_renderer_webgl_defaultmapshader_Locations_ = function(gl, program) { * @type {WebGLUniformLocation} */ this.u_texCoordMatrix = gl.getUniformLocation( - program, _ol_.DEBUG_WEBGL ? 'u_texCoordMatrix' : 'd'); + program, DEBUG_WEBGL ? 'u_texCoordMatrix' : 'd'); /** * @type {WebGLUniformLocation} */ this.u_projectionMatrix = gl.getUniformLocation( - program, _ol_.DEBUG_WEBGL ? 'u_projectionMatrix' : 'e'); + program, DEBUG_WEBGL ? 'u_projectionMatrix' : 'e'); /** * @type {WebGLUniformLocation} */ this.u_opacity = gl.getUniformLocation( - program, _ol_.DEBUG_WEBGL ? 'u_opacity' : 'f'); + program, DEBUG_WEBGL ? 'u_opacity' : 'f'); /** * @type {WebGLUniformLocation} */ this.u_texture = gl.getUniformLocation( - program, _ol_.DEBUG_WEBGL ? 'u_texture' : 'g'); + program, DEBUG_WEBGL ? 'u_texture' : 'g'); /** * @type {number} */ this.a_position = gl.getAttribLocation( - program, _ol_.DEBUG_WEBGL ? 'a_position' : 'b'); + program, DEBUG_WEBGL ? 'a_position' : 'b'); /** * @type {number} */ this.a_texCoord = gl.getAttribLocation( - program, _ol_.DEBUG_WEBGL ? 'a_texCoord' : 'c'); + program, DEBUG_WEBGL ? 'a_texCoord' : 'c'); }; export default _ol_renderer_webgl_defaultmapshader_Locations_; diff --git a/src/ol/renderer/webgl/tilelayershader.js b/src/ol/renderer/webgl/tilelayershader.js index e5796690e1..ba46f5cb1f 100644 --- a/src/ol/renderer/webgl/tilelayershader.js +++ b/src/ol/renderer/webgl/tilelayershader.js @@ -1,16 +1,16 @@ // This file is automatically generated, do not edit. // Run `make shaders` to generate, and commit the result. -import _ol_ from '../../index.js'; +import {DEBUG_WEBGL} from '../../index.js'; import _ol_webgl_Fragment_ from '../../webgl/Fragment.js'; import _ol_webgl_Vertex_ from '../../webgl/Vertex.js'; var _ol_renderer_webgl_tilelayershader_ = {}; -_ol_renderer_webgl_tilelayershader_.fragment = new _ol_webgl_Fragment_(_ol_.DEBUG_WEBGL ? +_ol_renderer_webgl_tilelayershader_.fragment = new _ol_webgl_Fragment_(DEBUG_WEBGL ? 'precision mediump float;\nvarying vec2 v_texCoord;\n\n\nuniform sampler2D u_texture;\n\nvoid main(void) {\n gl_FragColor = texture2D(u_texture, v_texCoord);\n}\n' : 'precision mediump float;varying vec2 a;uniform sampler2D e;void main(void){gl_FragColor=texture2D(e,a);}'); -_ol_renderer_webgl_tilelayershader_.vertex = new _ol_webgl_Vertex_(_ol_.DEBUG_WEBGL ? +_ol_renderer_webgl_tilelayershader_.vertex = new _ol_webgl_Vertex_(DEBUG_WEBGL ? 'varying vec2 v_texCoord;\n\n\nattribute vec2 a_position;\nattribute vec2 a_texCoord;\nuniform vec4 u_tileOffset;\n\nvoid main(void) {\n gl_Position = vec4(a_position * u_tileOffset.xy + u_tileOffset.zw, 0., 1.);\n v_texCoord = a_texCoord;\n}\n\n\n' : 'varying vec2 a;attribute vec2 b;attribute vec2 c;uniform vec4 d;void main(void){gl_Position=vec4(b*d.xy+d.zw,0.,1.);a=c;}'); diff --git a/src/ol/renderer/webgl/tilelayershader/Locations.js b/src/ol/renderer/webgl/tilelayershader/Locations.js index feb5c8dc5f..a4e80c8362 100644 --- a/src/ol/renderer/webgl/tilelayershader/Locations.js +++ b/src/ol/renderer/webgl/tilelayershader/Locations.js @@ -2,7 +2,7 @@ * @module ol/renderer/webgl/tilelayershader/Locations */ // This file is automatically generated, do not edit -import _ol_ from '../../../index.js'; +import {DEBUG_WEBGL} from '../../../index.js'; /** * @constructor @@ -16,25 +16,25 @@ var _ol_renderer_webgl_tilelayershader_Locations_ = function(gl, program) { * @type {WebGLUniformLocation} */ this.u_tileOffset = gl.getUniformLocation( - program, _ol_.DEBUG_WEBGL ? 'u_tileOffset' : 'd'); + program, DEBUG_WEBGL ? 'u_tileOffset' : 'd'); /** * @type {WebGLUniformLocation} */ this.u_texture = gl.getUniformLocation( - program, _ol_.DEBUG_WEBGL ? 'u_texture' : 'e'); + program, DEBUG_WEBGL ? 'u_texture' : 'e'); /** * @type {number} */ this.a_position = gl.getAttribLocation( - program, _ol_.DEBUG_WEBGL ? 'a_position' : 'b'); + program, DEBUG_WEBGL ? 'a_position' : 'b'); /** * @type {number} */ this.a_texCoord = gl.getAttribLocation( - program, _ol_.DEBUG_WEBGL ? 'a_texCoord' : 'c'); + program, DEBUG_WEBGL ? 'a_texCoord' : 'c'); }; export default _ol_renderer_webgl_tilelayershader_Locations_; diff --git a/src/ol/reproj/Image.js b/src/ol/reproj/Image.js index dfa6088e63..cf843e2bdc 100644 --- a/src/ol/reproj/Image.js +++ b/src/ol/reproj/Image.js @@ -1,7 +1,7 @@ /** * @module ol/reproj/Image */ -import _ol_ from '../index.js'; +import {DEFAULT_RASTER_REPROJECTION_ERROR_THRESHOLD, inherits} from '../index.js'; import _ol_ImageBase_ from '../ImageBase.js'; import _ol_ImageState_ from '../ImageState.js'; import _ol_events_ from '../events.js'; @@ -48,7 +48,7 @@ var _ol_reproj_Image_ = function(sourceProj, targetProj, var sourceResolution = _ol_reproj_.calculateSourceResolution( sourceProj, targetProj, targetCenter, targetResolution); - var errorThresholdInPixels = _ol_.DEFAULT_RASTER_REPROJECTION_ERROR_THRESHOLD; + var errorThresholdInPixels = DEFAULT_RASTER_REPROJECTION_ERROR_THRESHOLD; /** * @private @@ -108,7 +108,7 @@ var _ol_reproj_Image_ = function(sourceProj, targetProj, _ol_ImageBase_.call(this, targetExtent, targetResolution, this.sourcePixelRatio_, state); }; -_ol_.inherits(_ol_reproj_Image_, _ol_ImageBase_); +inherits(_ol_reproj_Image_, _ol_ImageBase_); /** diff --git a/src/ol/reproj/Tile.js b/src/ol/reproj/Tile.js index fa7ca68250..d0e7be6530 100644 --- a/src/ol/reproj/Tile.js +++ b/src/ol/reproj/Tile.js @@ -1,7 +1,7 @@ /** * @module ol/reproj/Tile */ -import _ol_ from '../index.js'; +import {DEFAULT_RASTER_REPROJECTION_ERROR_THRESHOLD, inherits} from '../index.js'; import _ol_Tile_ from '../Tile.js'; import _ol_TileState_ from '../TileState.js'; import _ol_events_ from '../events.js'; @@ -136,7 +136,7 @@ var _ol_reproj_Tile_ = function(sourceProj, sourceTileGrid, } var errorThresholdInPixels = opt_errorThreshold !== undefined ? - opt_errorThreshold : _ol_.DEFAULT_RASTER_REPROJECTION_ERROR_THRESHOLD; + opt_errorThreshold : DEFAULT_RASTER_REPROJECTION_ERROR_THRESHOLD; /** * @private @@ -187,7 +187,7 @@ var _ol_reproj_Tile_ = function(sourceProj, sourceTileGrid, } }; -_ol_.inherits(_ol_reproj_Tile_, _ol_Tile_); +inherits(_ol_reproj_Tile_, _ol_Tile_); /** diff --git a/src/ol/reproj/Triangulation.js b/src/ol/reproj/Triangulation.js index bc3eaf5b50..d70031a88b 100644 --- a/src/ol/reproj/Triangulation.js +++ b/src/ol/reproj/Triangulation.js @@ -1,7 +1,7 @@ /** * @module ol/reproj/Triangulation */ -import _ol_ from '../index.js'; +import {RASTER_REPROJECTION_MAX_SUBDIVISION, RASTER_REPROJECTION_MAX_TRIANGLE_WIDTH} from '../index.js'; import _ol_extent_ from '../extent.js'; import _ol_math_ from '../math.js'; import _ol_proj_ from '../proj.js'; @@ -112,7 +112,7 @@ var _ol_reproj_Triangulation_ = function(sourceProj, targetProj, targetExtent, destinationTopLeft, destinationTopRight, destinationBottomRight, destinationBottomLeft, sourceTopLeft, sourceTopRight, sourceBottomRight, sourceBottomLeft, - _ol_.RASTER_REPROJECTION_MAX_SUBDIVISION); + RASTER_REPROJECTION_MAX_SUBDIVISION); if (this.wrapsXInSource_) { var leftBound = Infinity; @@ -213,11 +213,11 @@ _ol_reproj_Triangulation_.prototype.addQuad_ = function(a, b, c, d, var targetCoverageX = _ol_extent_.getWidth(targetQuadExtent) / this.targetWorldWidth_; needsSubdivision |= - targetCoverageX > _ol_.RASTER_REPROJECTION_MAX_TRIANGLE_WIDTH; + targetCoverageX > RASTER_REPROJECTION_MAX_TRIANGLE_WIDTH; } if (!wrapsX && this.sourceProj_.isGlobal() && sourceCoverageX) { needsSubdivision |= - sourceCoverageX > _ol_.RASTER_REPROJECTION_MAX_TRIANGLE_WIDTH; + sourceCoverageX > RASTER_REPROJECTION_MAX_TRIANGLE_WIDTH; } } diff --git a/src/ol/source/BingMaps.js b/src/ol/source/BingMaps.js index 007b406427..24b31ca878 100644 --- a/src/ol/source/BingMaps.js +++ b/src/ol/source/BingMaps.js @@ -1,7 +1,7 @@ /** * @module ol/source/BingMaps */ -import _ol_ from '../index.js'; +import {inherits} from '../index.js'; import _ol_TileUrlFunction_ from '../TileUrlFunction.js'; import _ol_extent_ from '../extent.js'; import _ol_net_ from '../net.js'; @@ -75,7 +75,7 @@ var _ol_source_BingMaps_ = function(options) { }; -_ol_.inherits(_ol_source_BingMaps_, _ol_source_TileImage_); +inherits(_ol_source_BingMaps_, _ol_source_TileImage_); /** diff --git a/src/ol/source/CartoDB.js b/src/ol/source/CartoDB.js index a992d0ab06..9b4c952f3f 100644 --- a/src/ol/source/CartoDB.js +++ b/src/ol/source/CartoDB.js @@ -1,7 +1,7 @@ /** * @module ol/source/CartoDB */ -import _ol_ from '../index.js'; +import {inherits} from '../index.js'; import _ol_obj_ from '../obj.js'; import _ol_source_State_ from '../source/State.js'; import _ol_source_XYZ_ from '../source/XYZ.js'; @@ -55,7 +55,7 @@ var _ol_source_CartoDB_ = function(options) { this.initializeMap_(); }; -_ol_.inherits(_ol_source_CartoDB_, _ol_source_XYZ_); +inherits(_ol_source_CartoDB_, _ol_source_XYZ_); /** diff --git a/src/ol/source/Cluster.js b/src/ol/source/Cluster.js index 438528878e..ccbada86d1 100644 --- a/src/ol/source/Cluster.js +++ b/src/ol/source/Cluster.js @@ -1,10 +1,8 @@ /** * @module ol/source/Cluster */ -// FIXME keep cluster cache by resolution ? -// FIXME distance not respected because of the centroid -import _ol_ from '../index.js'; +import {getUid, inherits} from '../index.js'; import _ol_asserts_ from '../asserts.js'; import _ol_Feature_ from '../Feature.js'; import _ol_coordinate_ from '../coordinate.js'; @@ -73,7 +71,7 @@ var _ol_source_Cluster_ = function(options) { _ol_source_Cluster_.prototype.refresh, this); }; -_ol_.inherits(_ol_source_Cluster_, _ol_source_Vector_); +inherits(_ol_source_Cluster_, _ol_source_Vector_); /** @@ -153,7 +151,7 @@ _ol_source_Cluster_.prototype.cluster = function() { for (var i = 0, ii = features.length; i < ii; i++) { var feature = features[i]; - if (!(_ol_.getUid(feature).toString() in clustered)) { + if (!(getUid(feature).toString() in clustered)) { var geometry = this.geometryFunction(feature); if (geometry) { var coordinates = geometry.getCoordinates(); @@ -162,7 +160,7 @@ _ol_source_Cluster_.prototype.cluster = function() { var neighbors = this.source.getFeaturesInExtent(extent); neighbors = neighbors.filter(function(neighbor) { - var uid = _ol_.getUid(neighbor).toString(); + var uid = getUid(neighbor).toString(); if (!(uid in clustered)) { clustered[uid] = true; return true; diff --git a/src/ol/source/Image.js b/src/ol/source/Image.js index 92645d7a67..1f9dc15919 100644 --- a/src/ol/source/Image.js +++ b/src/ol/source/Image.js @@ -1,7 +1,7 @@ /** * @module ol/source/Image */ -import _ol_ from '../index.js'; +import {ENABLE_RASTER_REPROJECTION, inherits} from '../index.js'; import _ol_ImageState_ from '../ImageState.js'; import _ol_array_ from '../array.js'; import _ol_events_Event_ from '../events/Event.js'; @@ -53,7 +53,7 @@ var _ol_source_Image_ = function(options) { this.reprojectedRevision_ = 0; }; -_ol_.inherits(_ol_source_Image_, _ol_source_Source_); +inherits(_ol_source_Image_, _ol_source_Source_); /** @@ -88,7 +88,7 @@ _ol_source_Image_.prototype.findNearestResolution = function(resolution) { */ _ol_source_Image_.prototype.getImage = function(extent, resolution, pixelRatio, projection) { var sourceProjection = this.getProjection(); - if (!_ol_.ENABLE_RASTER_REPROJECTION || + if (!ENABLE_RASTER_REPROJECTION || !sourceProjection || !projection || _ol_proj_.equivalent(sourceProjection, projection)) { @@ -197,7 +197,7 @@ _ol_source_Image_.Event = function(type, image) { this.image = image; }; -_ol_.inherits(_ol_source_Image_.Event, _ol_events_Event_); +inherits(_ol_source_Image_.Event, _ol_events_Event_); /** diff --git a/src/ol/source/ImageArcGISRest.js b/src/ol/source/ImageArcGISRest.js index 3c19f28e22..fa3da66292 100644 --- a/src/ol/source/ImageArcGISRest.js +++ b/src/ol/source/ImageArcGISRest.js @@ -1,7 +1,7 @@ /** * @module ol/source/ImageArcGISRest */ -import _ol_ from '../index.js'; +import {inherits} from '../index.js'; import _ol_Image_ from '../Image.js'; import _ol_asserts_ from '../asserts.js'; import _ol_events_ from '../events.js'; @@ -97,7 +97,7 @@ var _ol_source_ImageArcGISRest_ = function(opt_options) { }; -_ol_.inherits(_ol_source_ImageArcGISRest_, _ol_source_Image_); +inherits(_ol_source_ImageArcGISRest_, _ol_source_Image_); /** diff --git a/src/ol/source/ImageCanvas.js b/src/ol/source/ImageCanvas.js index 775d3aea5b..1e250b7408 100644 --- a/src/ol/source/ImageCanvas.js +++ b/src/ol/source/ImageCanvas.js @@ -1,7 +1,7 @@ /** * @module ol/source/ImageCanvas */ -import _ol_ from '../index.js'; +import {inherits} from '../index.js'; import _ol_ImageCanvas_ from '../ImageCanvas.js'; import _ol_extent_ from '../extent.js'; import _ol_source_Image_ from '../source/Image.js'; @@ -52,7 +52,7 @@ var _ol_source_ImageCanvas_ = function(options) { }; -_ol_.inherits(_ol_source_ImageCanvas_, _ol_source_Image_); +inherits(_ol_source_ImageCanvas_, _ol_source_Image_); /** diff --git a/src/ol/source/ImageMapGuide.js b/src/ol/source/ImageMapGuide.js index 5633fbf6df..4d3149c25e 100644 --- a/src/ol/source/ImageMapGuide.js +++ b/src/ol/source/ImageMapGuide.js @@ -1,7 +1,7 @@ /** * @module ol/source/ImageMapGuide */ -import _ol_ from '../index.js'; +import {inherits} from '../index.js'; import _ol_Image_ from '../Image.js'; import _ol_events_ from '../events.js'; import _ol_events_EventType_ from '../events/EventType.js'; @@ -100,7 +100,7 @@ var _ol_source_ImageMapGuide_ = function(options) { }; -_ol_.inherits(_ol_source_ImageMapGuide_, _ol_source_Image_); +inherits(_ol_source_ImageMapGuide_, _ol_source_Image_); /** diff --git a/src/ol/source/ImageStatic.js b/src/ol/source/ImageStatic.js index 27a6b3dbc8..df89ed0d76 100644 --- a/src/ol/source/ImageStatic.js +++ b/src/ol/source/ImageStatic.js @@ -1,7 +1,7 @@ /** * @module ol/source/ImageStatic */ -import _ol_ from '../index.js'; +import {inherits} from '../index.js'; import _ol_Image_ from '../Image.js'; import _ol_ImageState_ from '../ImageState.js'; import _ol_dom_ from '../dom.js'; @@ -53,7 +53,7 @@ var _ol_source_ImageStatic_ = function(options) { }; -_ol_.inherits(_ol_source_ImageStatic_, _ol_source_Image_); +inherits(_ol_source_ImageStatic_, _ol_source_Image_); /** diff --git a/src/ol/source/ImageVector.js b/src/ol/source/ImageVector.js index aaa1a0d8a7..71d868d66f 100644 --- a/src/ol/source/ImageVector.js +++ b/src/ol/source/ImageVector.js @@ -1,7 +1,7 @@ /** * @module ol/source/ImageVector */ -import _ol_ from '../index.js'; +import {getUid, inherits} from '../index.js'; import _ol_dom_ from '../dom.js'; import _ol_events_ from '../events.js'; import _ol_events_EventType_ from '../events/EventType.js'; @@ -109,7 +109,7 @@ var _ol_source_ImageVector_ = function(options) { }; -_ol_.inherits(_ol_source_ImageVector_, _ol_source_ImageCanvas_); +inherits(_ol_source_ImageVector_, _ol_source_ImageCanvas_); /** @@ -182,7 +182,7 @@ _ol_source_ImageVector_.prototype.forEachFeatureAtCoordinate = function( * @return {?} Callback result. */ function(feature) { - var key = _ol_.getUid(feature).toString(); + var key = getUid(feature).toString(); if (!(key in features)) { features[key] = true; return callback(feature); diff --git a/src/ol/source/ImageWMS.js b/src/ol/source/ImageWMS.js index 1e7d984738..74a7d46274 100644 --- a/src/ol/source/ImageWMS.js +++ b/src/ol/source/ImageWMS.js @@ -1,9 +1,8 @@ /** * @module ol/source/ImageWMS */ -// FIXME cannot be shared between maps with different projections -import _ol_ from '../index.js'; +import {DEFAULT_WMS_VERSION, inherits} from '../index.js'; import _ol_Image_ from '../Image.js'; import _ol_asserts_ from '../asserts.js'; import _ol_events_ from '../events.js'; @@ -109,7 +108,7 @@ var _ol_source_ImageWMS_ = function(opt_options) { }; -_ol_.inherits(_ol_source_ImageWMS_, _ol_source_Image_); +inherits(_ol_source_ImageWMS_, _ol_source_Image_); /** @@ -152,7 +151,7 @@ _ol_source_ImageWMS_.prototype.getGetFeatureInfoUrl = function(coordinate, resol var baseParams = { 'SERVICE': 'WMS', - 'VERSION': _ol_.DEFAULT_WMS_VERSION, + 'VERSION': DEFAULT_WMS_VERSION, 'REQUEST': 'GetFeatureInfo', 'FORMAT': 'image/png', 'TRANSPARENT': true, @@ -220,7 +219,7 @@ _ol_source_ImageWMS_.prototype.getImageInternal = function(extent, resolution, p var params = { 'SERVICE': 'WMS', - 'VERSION': _ol_.DEFAULT_WMS_VERSION, + 'VERSION': DEFAULT_WMS_VERSION, 'REQUEST': 'GetMap', 'FORMAT': 'image/png', 'TRANSPARENT': true @@ -368,7 +367,7 @@ _ol_source_ImageWMS_.prototype.updateParams = function(params) { * @private */ _ol_source_ImageWMS_.prototype.updateV13_ = function() { - var version = this.params_['VERSION'] || _ol_.DEFAULT_WMS_VERSION; + var version = this.params_['VERSION'] || DEFAULT_WMS_VERSION; this.v13_ = _ol_string_.compareVersions(version, '1.3') >= 0; }; export default _ol_source_ImageWMS_; diff --git a/src/ol/source/OSM.js b/src/ol/source/OSM.js index 1ce669d97e..7654012be5 100644 --- a/src/ol/source/OSM.js +++ b/src/ol/source/OSM.js @@ -1,7 +1,7 @@ /** * @module ol/source/OSM */ -import _ol_ from '../index.js'; +import {inherits} from '../index.js'; import _ol_source_XYZ_ from '../source/XYZ.js'; /** @@ -44,7 +44,7 @@ var _ol_source_OSM_ = function(opt_options) { }; -_ol_.inherits(_ol_source_OSM_, _ol_source_XYZ_); +inherits(_ol_source_OSM_, _ol_source_XYZ_); /** diff --git a/src/ol/source/Raster.js b/src/ol/source/Raster.js index 5170945cd1..6b90825728 100644 --- a/src/ol/source/Raster.js +++ b/src/ol/source/Raster.js @@ -1,7 +1,7 @@ /** * @module ol/source/Raster */ -import _ol_ from '../index.js'; +import {getUid, inherits} from '../index.js'; import _ol_ImageCanvas_ from '../ImageCanvas.js'; import _ol_TileQueue_ from '../TileQueue.js'; import _ol_dom_ from '../dom.js'; @@ -78,7 +78,7 @@ var _ol_source_Raster_ = function(options) { var layerStatesArray = _ol_source_Raster_.getLayerStatesArray_(this.renderers_); var layerStates = {}; for (var i = 0, ii = layerStatesArray.length; i < ii; ++i) { - layerStates[_ol_.getUid(layerStatesArray[i].layer)] = layerStatesArray[i]; + layerStates[getUid(layerStatesArray[i].layer)] = layerStatesArray[i]; } /** @@ -137,7 +137,7 @@ var _ol_source_Raster_ = function(options) { }; -_ol_.inherits(_ol_source_Raster_, _ol_source_Image_); +inherits(_ol_source_Raster_, _ol_source_Image_); /** @@ -456,7 +456,7 @@ _ol_source_Raster_.Event = function(type, frameState, data) { this.data = data; }; -_ol_.inherits(_ol_source_Raster_.Event, _ol_events_Event_); +inherits(_ol_source_Raster_.Event, _ol_events_Event_); /** diff --git a/src/ol/source/Source.js b/src/ol/source/Source.js index 6c03ba7126..58c464c4fa 100644 --- a/src/ol/source/Source.js +++ b/src/ol/source/Source.js @@ -1,7 +1,7 @@ /** * @module ol/source/Source */ -import _ol_ from '../index.js'; +import {inherits, nullFunction} from '../index.js'; import _ol_Attribution_ from '../Attribution.js'; import _ol_Object_ from '../Object.js'; import _ol_proj_ from '../proj.js'; @@ -64,7 +64,7 @@ var _ol_source_Source_ = function(options) { }; -_ol_.inherits(_ol_source_Source_, _ol_Object_); +inherits(_ol_source_Source_, _ol_Object_); /** * Turns the attributions option into an attributions function. @@ -134,7 +134,7 @@ _ol_source_Source_.prototype.adaptAttributions_ = function(attributionLike) { * @return {T|undefined} Callback result. * @template T */ -_ol_source_Source_.prototype.forEachFeatureAtCoordinate = _ol_.nullFunction; +_ol_source_Source_.prototype.forEachFeatureAtCoordinate = nullFunction; /** diff --git a/src/ol/source/Stamen.js b/src/ol/source/Stamen.js index 9c62d56607..1244ae20d4 100644 --- a/src/ol/source/Stamen.js +++ b/src/ol/source/Stamen.js @@ -1,7 +1,7 @@ /** * @module ol/source/Stamen */ -import _ol_ from '../index.js'; +import {inherits} from '../index.js'; import _ol_source_OSM_ from '../source/OSM.js'; import _ol_source_XYZ_ from '../source/XYZ.js'; @@ -39,7 +39,7 @@ var _ol_source_Stamen_ = function(options) { }); }; -_ol_.inherits(_ol_source_Stamen_, _ol_source_XYZ_); +inherits(_ol_source_Stamen_, _ol_source_XYZ_); /** diff --git a/src/ol/source/Tile.js b/src/ol/source/Tile.js index e0fdfa3ecb..b074889e3c 100644 --- a/src/ol/source/Tile.js +++ b/src/ol/source/Tile.js @@ -1,7 +1,7 @@ /** * @module ol/source/Tile */ -import _ol_ from '../index.js'; +import {inherits, nullFunction} from '../index.js'; import _ol_TileCache_ from '../TileCache.js'; import _ol_TileState_ from '../TileState.js'; import _ol_events_Event_ from '../events/Event.js'; @@ -79,7 +79,7 @@ var _ol_source_Tile_ = function(options) { }; -_ol_.inherits(_ol_source_Tile_, _ol_source_Source_); +inherits(_ol_source_Tile_, _ol_source_Source_); /** @@ -304,7 +304,7 @@ _ol_source_Tile_.prototype.refresh = function() { * @param {number} y Tile coordinate y. * @param {ol.proj.Projection} projection Projection. */ -_ol_source_Tile_.prototype.useTile = _ol_.nullFunction; +_ol_source_Tile_.prototype.useTile = nullFunction; /** @@ -330,5 +330,5 @@ _ol_source_Tile_.Event = function(type, tile) { this.tile = tile; }; -_ol_.inherits(_ol_source_Tile_.Event, _ol_events_Event_); +inherits(_ol_source_Tile_.Event, _ol_events_Event_); export default _ol_source_Tile_; diff --git a/src/ol/source/TileArcGISRest.js b/src/ol/source/TileArcGISRest.js index cb8031c1f2..e594038efd 100644 --- a/src/ol/source/TileArcGISRest.js +++ b/src/ol/source/TileArcGISRest.js @@ -1,7 +1,7 @@ /** * @module ol/source/TileArcGISRest */ -import _ol_ from '../index.js'; +import {inherits} from '../index.js'; import _ol_extent_ from '../extent.js'; import _ol_math_ from '../math.js'; import _ol_obj_ from '../obj.js'; @@ -58,7 +58,7 @@ var _ol_source_TileArcGISRest_ = function(opt_options) { this.setKey(this.getKeyForParams_()); }; -_ol_.inherits(_ol_source_TileArcGISRest_, _ol_source_TileImage_); +inherits(_ol_source_TileArcGISRest_, _ol_source_TileImage_); /** diff --git a/src/ol/source/TileDebug.js b/src/ol/source/TileDebug.js index 51b4d170d8..ca5e8fdb41 100644 --- a/src/ol/source/TileDebug.js +++ b/src/ol/source/TileDebug.js @@ -1,7 +1,7 @@ /** * @module ol/source/TileDebug */ -import _ol_ from '../index.js'; +import {inherits} from '../index.js'; import _ol_Tile_ from '../Tile.js'; import _ol_TileState_ from '../TileState.js'; import _ol_dom_ from '../dom.js'; @@ -33,7 +33,7 @@ var _ol_source_TileDebug_ = function(options) { }; -_ol_.inherits(_ol_source_TileDebug_, _ol_source_Tile_); +inherits(_ol_source_TileDebug_, _ol_source_Tile_); /** @@ -87,7 +87,7 @@ _ol_source_TileDebug_.Tile_ = function(tileCoord, tileSize, text) { this.canvas_ = null; }; -_ol_.inherits(_ol_source_TileDebug_.Tile_, _ol_Tile_); +inherits(_ol_source_TileDebug_.Tile_, _ol_Tile_); /** diff --git a/src/ol/source/TileImage.js b/src/ol/source/TileImage.js index 226083f21a..56ae68cd6d 100644 --- a/src/ol/source/TileImage.js +++ b/src/ol/source/TileImage.js @@ -1,7 +1,7 @@ /** * @module ol/source/TileImage */ -import _ol_ from '../index.js'; +import {ENABLE_RASTER_REPROJECTION, getUid, inherits} from '../index.js'; import _ol_ImageTile_ from '../ImageTile.js'; import _ol_TileCache_ from '../TileCache.js'; import _ol_TileState_ from '../TileState.js'; @@ -84,14 +84,14 @@ var _ol_source_TileImage_ = function(options) { this.renderReprojectionEdges_ = false; }; -_ol_.inherits(_ol_source_TileImage_, _ol_source_UrlTile_); +inherits(_ol_source_TileImage_, _ol_source_UrlTile_); /** * @inheritDoc */ _ol_source_TileImage_.prototype.canExpireCache = function() { - if (!_ol_.ENABLE_RASTER_REPROJECTION) { + if (!ENABLE_RASTER_REPROJECTION) { return _ol_source_UrlTile_.prototype.canExpireCache.call(this); } if (this.tileCache.canExpireCache()) { @@ -111,7 +111,7 @@ _ol_source_TileImage_.prototype.canExpireCache = function() { * @inheritDoc */ _ol_source_TileImage_.prototype.expireCache = function(projection, usedTiles) { - if (!_ol_.ENABLE_RASTER_REPROJECTION) { + if (!ENABLE_RASTER_REPROJECTION) { _ol_source_UrlTile_.prototype.expireCache.call(this, projection, usedTiles); return; } @@ -129,7 +129,7 @@ _ol_source_TileImage_.prototype.expireCache = function(projection, usedTiles) { * @inheritDoc */ _ol_source_TileImage_.prototype.getGutter = function(projection) { - if (_ol_.ENABLE_RASTER_REPROJECTION && + if (ENABLE_RASTER_REPROJECTION && this.getProjection() && projection && !_ol_proj_.equivalent(this.getProjection(), projection)) { return 0; @@ -152,7 +152,7 @@ _ol_source_TileImage_.prototype.getGutterInternal = function() { * @inheritDoc */ _ol_source_TileImage_.prototype.getOpaque = function(projection) { - if (_ol_.ENABLE_RASTER_REPROJECTION && + if (ENABLE_RASTER_REPROJECTION && this.getProjection() && projection && !_ol_proj_.equivalent(this.getProjection(), projection)) { return false; @@ -166,7 +166,7 @@ _ol_source_TileImage_.prototype.getOpaque = function(projection) { * @inheritDoc */ _ol_source_TileImage_.prototype.getTileGridForProjection = function(projection) { - if (!_ol_.ENABLE_RASTER_REPROJECTION) { + if (!ENABLE_RASTER_REPROJECTION) { return _ol_source_UrlTile_.prototype.getTileGridForProjection.call(this, projection); } var thisProj = this.getProjection(); @@ -174,7 +174,7 @@ _ol_source_TileImage_.prototype.getTileGridForProjection = function(projection) (!thisProj || _ol_proj_.equivalent(thisProj, projection))) { return this.tileGrid; } else { - var projKey = _ol_.getUid(projection).toString(); + var projKey = getUid(projection).toString(); if (!(projKey in this.tileGridForProjection)) { this.tileGridForProjection[projKey] = _ol_tilegrid_.getForProjection(projection); @@ -188,14 +188,14 @@ _ol_source_TileImage_.prototype.getTileGridForProjection = function(projection) * @inheritDoc */ _ol_source_TileImage_.prototype.getTileCacheForProjection = function(projection) { - if (!_ol_.ENABLE_RASTER_REPROJECTION) { + if (!ENABLE_RASTER_REPROJECTION) { return _ol_source_UrlTile_.prototype.getTileCacheForProjection.call(this, projection); } var thisProj = this.getProjection(); if (!thisProj || _ol_proj_.equivalent(thisProj, projection)) { return this.tileCache; } else { - var projKey = _ol_.getUid(projection).toString(); + var projKey = getUid(projection).toString(); if (!(projKey in this.tileCacheForProjection)) { this.tileCacheForProjection[projKey] = new _ol_TileCache_(this.tileCache.highWaterMark); } @@ -239,7 +239,7 @@ _ol_source_TileImage_.prototype.createTile_ = function(z, x, y, pixelRatio, proj */ _ol_source_TileImage_.prototype.getTile = function(z, x, y, pixelRatio, projection) { var sourceProjection = /** @type {!ol.proj.Projection} */ (this.getProjection()); - if (!_ol_.ENABLE_RASTER_REPROJECTION || + if (!ENABLE_RASTER_REPROJECTION || !sourceProjection || !projection || _ol_proj_.equivalent(sourceProjection, projection)) { return this.getTileInternal(z, x, y, pixelRatio, sourceProjection || projection); @@ -329,7 +329,7 @@ _ol_source_TileImage_.prototype.getTileInternal = function(z, x, y, pixelRatio, * @api */ _ol_source_TileImage_.prototype.setRenderReprojectionEdges = function(render) { - if (!_ol_.ENABLE_RASTER_REPROJECTION || + if (!ENABLE_RASTER_REPROJECTION || this.renderReprojectionEdges_ == render) { return; } @@ -354,10 +354,10 @@ _ol_source_TileImage_.prototype.setRenderReprojectionEdges = function(render) { * @api */ _ol_source_TileImage_.prototype.setTileGridForProjection = function(projection, tilegrid) { - if (_ol_.ENABLE_RASTER_REPROJECTION) { + if (ENABLE_RASTER_REPROJECTION) { var proj = _ol_proj_.get(projection); if (proj) { - var projKey = _ol_.getUid(proj).toString(); + var projKey = getUid(proj).toString(); if (!(projKey in this.tileGridForProjection)) { this.tileGridForProjection[projKey] = tilegrid; } diff --git a/src/ol/source/TileJSON.js b/src/ol/source/TileJSON.js index 68f35f941d..c191736595 100644 --- a/src/ol/source/TileJSON.js +++ b/src/ol/source/TileJSON.js @@ -7,7 +7,7 @@ * @see http://mapbox.com/developers/api/ */ -import _ol_ from '../index.js'; +import {inherits} from '../index.js'; import _ol_TileUrlFunction_ from '../TileUrlFunction.js'; import _ol_asserts_ from '../asserts.js'; import _ol_extent_ from '../extent.js'; @@ -65,7 +65,7 @@ var _ol_source_TileJSON_ = function(options) { }; -_ol_.inherits(_ol_source_TileJSON_, _ol_source_TileImage_); +inherits(_ol_source_TileJSON_, _ol_source_TileImage_); /** diff --git a/src/ol/source/TileUTFGrid.js b/src/ol/source/TileUTFGrid.js index 8fd7e88c5f..c4a06bcd3a 100644 --- a/src/ol/source/TileUTFGrid.js +++ b/src/ol/source/TileUTFGrid.js @@ -1,7 +1,7 @@ /** * @module ol/source/TileUTFGrid */ -import _ol_ from '../index.js'; +import {inherits} from '../index.js'; import _ol_Tile_ from '../Tile.js'; import _ol_TileState_ from '../TileState.js'; import _ol_TileUrlFunction_ from '../TileUrlFunction.js'; @@ -74,7 +74,7 @@ var _ol_source_TileUTFGrid_ = function(options) { } }; -_ol_.inherits(_ol_source_TileUTFGrid_, _ol_source_Tile_); +inherits(_ol_source_TileUTFGrid_, _ol_source_Tile_); /** @@ -308,7 +308,7 @@ _ol_source_TileUTFGrid_.Tile_ = function(tileCoord, state, src, extent, preempti this.jsonp_ = jsonp; }; -_ol_.inherits(_ol_source_TileUTFGrid_.Tile_, _ol_Tile_); +inherits(_ol_source_TileUTFGrid_.Tile_, _ol_Tile_); /** diff --git a/src/ol/source/TileWMS.js b/src/ol/source/TileWMS.js index 3815ec0016..1a63818b98 100644 --- a/src/ol/source/TileWMS.js +++ b/src/ol/source/TileWMS.js @@ -1,11 +1,8 @@ /** * @module ol/source/TileWMS */ -// FIXME add minZoom support -// FIXME add date line wrap (tile coord transform) -// FIXME cannot be shared between maps with different projections -import _ol_ from '../index.js'; +import {DEFAULT_WMS_VERSION, inherits} from '../index.js'; import _ol_asserts_ from '../asserts.js'; import _ol_extent_ from '../extent.js'; import _ol_obj_ from '../obj.js'; @@ -94,7 +91,7 @@ var _ol_source_TileWMS_ = function(opt_options) { }; -_ol_.inherits(_ol_source_TileWMS_, _ol_source_TileImage_); +inherits(_ol_source_TileWMS_, _ol_source_TileImage_); /** @@ -145,7 +142,7 @@ _ol_source_TileWMS_.prototype.getGetFeatureInfoUrl = function(coordinate, resolu var baseParams = { 'SERVICE': 'WMS', - 'VERSION': _ol_.DEFAULT_WMS_VERSION, + 'VERSION': DEFAULT_WMS_VERSION, 'REQUEST': 'GetFeatureInfo', 'FORMAT': 'image/png', 'TRANSPARENT': true, @@ -316,7 +313,7 @@ _ol_source_TileWMS_.prototype.fixedTileUrlFunction = function(tileCoord, pixelRa var baseParams = { 'SERVICE': 'WMS', - 'VERSION': _ol_.DEFAULT_WMS_VERSION, + 'VERSION': DEFAULT_WMS_VERSION, 'REQUEST': 'GetMap', 'FORMAT': 'image/png', 'TRANSPARENT': true @@ -343,7 +340,7 @@ _ol_source_TileWMS_.prototype.updateParams = function(params) { * @private */ _ol_source_TileWMS_.prototype.updateV13_ = function() { - var version = this.params_['VERSION'] || _ol_.DEFAULT_WMS_VERSION; + var version = this.params_['VERSION'] || DEFAULT_WMS_VERSION; this.v13_ = _ol_string_.compareVersions(version, '1.3') >= 0; }; export default _ol_source_TileWMS_; diff --git a/src/ol/source/UrlTile.js b/src/ol/source/UrlTile.js index c4218954ef..623f4c665c 100644 --- a/src/ol/source/UrlTile.js +++ b/src/ol/source/UrlTile.js @@ -1,7 +1,7 @@ /** * @module ol/source/UrlTile */ -import _ol_ from '../index.js'; +import {getUid, inherits} from '../index.js'; import _ol_TileState_ from '../TileState.js'; import _ol_TileUrlFunction_ from '../TileUrlFunction.js'; import _ol_source_Tile_ from '../source/Tile.js'; @@ -71,7 +71,7 @@ var _ol_source_UrlTile_ = function(options) { }; -_ol_.inherits(_ol_source_UrlTile_, _ol_source_Tile_); +inherits(_ol_source_UrlTile_, _ol_source_Tile_); /** @@ -119,7 +119,7 @@ _ol_source_UrlTile_.prototype.getUrls = function() { */ _ol_source_UrlTile_.prototype.handleTileChange = function(event) { var tile = /** @type {ol.Tile} */ (event.target); - var uid = _ol_.getUid(tile); + var uid = getUid(tile); var tileState = tile.getState(); var type; if (tileState == _ol_TileState_.LOADING) { diff --git a/src/ol/source/Vector.js b/src/ol/source/Vector.js index deb34faadb..7a7c4eb723 100644 --- a/src/ol/source/Vector.js +++ b/src/ol/source/Vector.js @@ -1,10 +1,8 @@ /** * @module ol/source/Vector */ -// FIXME bulk feature upload - suppress events -// FIXME make change-detection more refined (notably, geometry hint) -import _ol_ from '../index.js'; +import {getUid, inherits, nullFunction} from '../index.js'; import _ol_Collection_ from '../Collection.js'; import _ol_CollectionEventType_ from '../CollectionEventType.js'; import _ol_ObjectEventType_ from '../ObjectEventType.js'; @@ -51,7 +49,7 @@ var _ol_source_Vector_ = function(opt_options) { * @private * @type {ol.FeatureLoader} */ - this.loader_ = _ol_.nullFunction; + this.loader_ = nullFunction; /** * @private @@ -152,7 +150,7 @@ var _ol_source_Vector_ = function(opt_options) { }; -_ol_.inherits(_ol_source_Vector_, _ol_source_Source_); +inherits(_ol_source_Vector_, _ol_source_Source_); /** @@ -176,7 +174,7 @@ _ol_source_Vector_.prototype.addFeature = function(feature) { * @protected */ _ol_source_Vector_.prototype.addFeatureInternal = function(feature) { - var featureKey = _ol_.getUid(feature).toString(); + var featureKey = getUid(feature).toString(); if (!this.addToIndex_(featureKey, feature)) { return; @@ -264,7 +262,7 @@ _ol_source_Vector_.prototype.addFeaturesInternal = function(features) { for (i = 0, length = features.length; i < length; i++) { feature = features[i]; - featureKey = _ol_.getUid(feature).toString(); + featureKey = getUid(feature).toString(); if (this.addToIndex_(featureKey, feature)) { newFeatures.push(feature); } @@ -272,7 +270,7 @@ _ol_source_Vector_.prototype.addFeaturesInternal = function(features) { for (i = 0, length = newFeatures.length; i < length; i++) { feature = newFeatures[i]; - featureKey = _ol_.getUid(feature).toString(); + featureKey = getUid(feature).toString(); this.setupChangeEvents_(featureKey, feature); var geometry = feature.getGeometry(); @@ -680,7 +678,7 @@ _ol_source_Vector_.prototype.getUrl = function() { */ _ol_source_Vector_.prototype.handleFeatureChange_ = function(event) { var feature = /** @type {ol.Feature} */ (event.target); - var featureKey = _ol_.getUid(feature).toString(); + var featureKey = getUid(feature).toString(); var geometry = feature.getGeometry(); if (!geometry) { if (!(featureKey in this.nullGeometryFeatures_)) { @@ -791,7 +789,7 @@ _ol_source_Vector_.prototype.removeLoadedExtent = function(extent) { * @api */ _ol_source_Vector_.prototype.removeFeature = function(feature) { - var featureKey = _ol_.getUid(feature).toString(); + var featureKey = getUid(feature).toString(); if (featureKey in this.nullGeometryFeatures_) { delete this.nullGeometryFeatures_[featureKey]; } else { @@ -810,7 +808,7 @@ _ol_source_Vector_.prototype.removeFeature = function(feature) { * @protected */ _ol_source_Vector_.prototype.removeFeatureInternal = function(feature) { - var featureKey = _ol_.getUid(feature).toString(); + var featureKey = getUid(feature).toString(); this.featureChangeKeys_[featureKey].forEach(_ol_events_.unlistenByKey); delete this.featureChangeKeys_[featureKey]; var id = feature.getId(); @@ -878,5 +876,5 @@ _ol_source_Vector_.Event = function(type, opt_feature) { this.feature = opt_feature; }; -_ol_.inherits(_ol_source_Vector_.Event, _ol_events_Event_); +inherits(_ol_source_Vector_.Event, _ol_events_Event_); export default _ol_source_Vector_; diff --git a/src/ol/source/VectorTile.js b/src/ol/source/VectorTile.js index 56333441f0..e16bbc8ea3 100644 --- a/src/ol/source/VectorTile.js +++ b/src/ol/source/VectorTile.js @@ -1,7 +1,7 @@ /** * @module ol/source/VectorTile */ -import _ol_ from '../index.js'; +import {inherits} from '../index.js'; import _ol_TileState_ from '../TileState.js'; import _ol_VectorImageTile_ from '../VectorImageTile.js'; import _ol_VectorTile_ from '../VectorTile.js'; @@ -89,7 +89,7 @@ var _ol_source_VectorTile_ = function(options) { }; -_ol_.inherits(_ol_source_VectorTile_, _ol_source_UrlTile_); +inherits(_ol_source_VectorTile_, _ol_source_UrlTile_); /** diff --git a/src/ol/source/WMTS.js b/src/ol/source/WMTS.js index 15900ce641..0a69897f27 100644 --- a/src/ol/source/WMTS.js +++ b/src/ol/source/WMTS.js @@ -1,7 +1,7 @@ /** * @module ol/source/WMTS */ -import _ol_ from '../index.js'; +import {inherits} from '../index.js'; import _ol_TileUrlFunction_ from '../TileUrlFunction.js'; import _ol_array_ from '../array.js'; import _ol_extent_ from '../extent.js'; @@ -176,7 +176,7 @@ var _ol_source_WMTS_ = function(options) { }; -_ol_.inherits(_ol_source_WMTS_, _ol_source_TileImage_); +inherits(_ol_source_WMTS_, _ol_source_TileImage_); /** * Set the URLs to use for requests. diff --git a/src/ol/source/XYZ.js b/src/ol/source/XYZ.js index b54e049261..dfc5496a77 100644 --- a/src/ol/source/XYZ.js +++ b/src/ol/source/XYZ.js @@ -1,7 +1,7 @@ /** * @module ol/source/XYZ */ -import _ol_ from '../index.js'; +import {inherits} from '../index.js'; import _ol_source_TileImage_ from '../source/TileImage.js'; import _ol_tilegrid_ from '../tilegrid.js'; @@ -60,5 +60,5 @@ var _ol_source_XYZ_ = function(opt_options) { }; -_ol_.inherits(_ol_source_XYZ_, _ol_source_TileImage_); +inherits(_ol_source_XYZ_, _ol_source_TileImage_); export default _ol_source_XYZ_; diff --git a/src/ol/source/Zoomify.js b/src/ol/source/Zoomify.js index 1bf571c72a..d9e1179252 100644 --- a/src/ol/source/Zoomify.js +++ b/src/ol/source/Zoomify.js @@ -1,7 +1,7 @@ /** * @module ol/source/Zoomify */ -import _ol_ from '../index.js'; +import {DEFAULT_TILE_SIZE, inherits} from '../index.js'; import _ol_ImageTile_ from '../ImageTile.js'; import _ol_TileState_ from '../TileState.js'; import _ol_TileUrlFunction_ from '../TileUrlFunction.js'; @@ -35,7 +35,7 @@ var _ol_source_Zoomify_ = function(opt_options) { var imageHeight = size[1]; var extent = options.extent || [0, -size[1], size[0], 0]; var tierSizeInTiles = []; - var tileSize = options.tileSize || _ol_.DEFAULT_TILE_SIZE; + var tileSize = options.tileSize || DEFAULT_TILE_SIZE; var tileSizeForTierSizeCalculation = tileSize; switch (tierSizeCalculation) { @@ -151,7 +151,7 @@ var _ol_source_Zoomify_ = function(opt_options) { }; -_ol_.inherits(_ol_source_Zoomify_, _ol_source_TileImage_); +inherits(_ol_source_Zoomify_, _ol_source_TileImage_); /** * @constructor @@ -182,7 +182,7 @@ _ol_source_Zoomify_.Tile_ = function( */ this.tileSize_ = _ol_size_.toSize(tileGrid.getTileSize(tileCoord[0])); }; -_ol_.inherits(_ol_source_Zoomify_.Tile_, _ol_ImageTile_); +inherits(_ol_source_Zoomify_.Tile_, _ol_ImageTile_); /** diff --git a/src/ol/structs/LRUCache.js b/src/ol/structs/LRUCache.js index 4c7c5cd1a3..bfb70f5ff3 100644 --- a/src/ol/structs/LRUCache.js +++ b/src/ol/structs/LRUCache.js @@ -1,7 +1,7 @@ /** * @module ol/structs/LRUCache */ -import _ol_ from '../index.js'; +import {inherits} from '../index.js'; import _ol_asserts_ from '../asserts.js'; import _ol_events_EventTarget_ from '../events/EventTarget.js'; import _ol_events_EventType_ from '../events/EventType.js'; @@ -52,7 +52,7 @@ var _ol_structs_LRUCache_ = function(opt_highWaterMark) { }; -_ol_.inherits(_ol_structs_LRUCache_, _ol_events_EventTarget_); +inherits(_ol_structs_LRUCache_, _ol_events_EventTarget_); /** diff --git a/src/ol/structs/RBush.js b/src/ol/structs/RBush.js index 586236d0a1..dd92b2d85a 100644 --- a/src/ol/structs/RBush.js +++ b/src/ol/structs/RBush.js @@ -1,7 +1,7 @@ /** * @module ol/structs/RBush */ -import _ol_ from '../index.js'; +import {getUid} from '../index.js'; import _ol_ext_rbush_ from 'rbush'; import _ol_extent_ from '../extent.js'; import _ol_obj_ from '../obj.js'; @@ -49,7 +49,7 @@ _ol_structs_RBush_.prototype.insert = function(extent, value) { }; this.rbush_.insert(item); - this.items_[_ol_.getUid(value)] = item; + this.items_[getUid(value)] = item; }; @@ -73,7 +73,7 @@ _ol_structs_RBush_.prototype.load = function(extents, values) { value: value }; items[i] = item; - this.items_[_ol_.getUid(value)] = item; + this.items_[getUid(value)] = item; } this.rbush_.load(items); }; @@ -85,7 +85,7 @@ _ol_structs_RBush_.prototype.load = function(extents, values) { * @return {boolean} Removed. */ _ol_structs_RBush_.prototype.remove = function(value) { - var uid = _ol_.getUid(value); + var uid = getUid(value); // get the object in which the value was wrapped when adding to the // internal rbush. then use that object to do the removal. @@ -101,7 +101,7 @@ _ol_structs_RBush_.prototype.remove = function(value) { * @param {T} value Value. */ _ol_structs_RBush_.prototype.update = function(extent, value) { - var item = this.items_[_ol_.getUid(value)]; + var item = this.items_[getUid(value)]; var bbox = [item.minX, item.minY, item.maxX, item.maxY]; if (!_ol_extent_.equals(bbox, extent)) { this.remove(value); diff --git a/src/ol/style/AtlasManager.js b/src/ol/style/AtlasManager.js index 9601c0c497..26b01aeaeb 100644 --- a/src/ol/style/AtlasManager.js +++ b/src/ol/style/AtlasManager.js @@ -1,7 +1,7 @@ /** * @module ol/style/AtlasManager */ -import _ol_ from '../index.js'; +import {INITIAL_ATLAS_SIZE, MAX_ATLAS_SIZE, WEBGL_MAX_TEXTURE_SIZE, nullFunction} from '../index.js'; import _ol_style_Atlas_ from '../style/Atlas.js'; /** @@ -31,7 +31,7 @@ var _ol_style_AtlasManager_ = function(opt_options) { * @type {number} */ this.currentSize_ = options.initialSize !== undefined ? - options.initialSize : _ol_.INITIAL_ATLAS_SIZE; + options.initialSize : INITIAL_ATLAS_SIZE; /** * The maximum size in pixels of atlas images. @@ -39,9 +39,9 @@ var _ol_style_AtlasManager_ = function(opt_options) { * @type {number} */ this.maxSize_ = options.maxSize !== undefined ? - options.maxSize : _ol_.MAX_ATLAS_SIZE != -1 ? - _ol_.MAX_ATLAS_SIZE : _ol_.WEBGL_MAX_TEXTURE_SIZE !== undefined ? - _ol_.WEBGL_MAX_TEXTURE_SIZE : 2048; + options.maxSize : MAX_ATLAS_SIZE != -1 ? + MAX_ATLAS_SIZE : WEBGL_MAX_TEXTURE_SIZE !== undefined ? + WEBGL_MAX_TEXTURE_SIZE : 2048; /** * The size in pixels between images. @@ -167,7 +167,7 @@ _ol_style_AtlasManager_.prototype.add = function(id, width, height, // the hit-detection atlas, to make sure that the offset is the same for // the original image and the hit-detection image. var renderHitCallback = opt_renderHitCallback !== undefined ? - opt_renderHitCallback : _ol_.nullFunction; + opt_renderHitCallback : nullFunction; var hitInfo = /** @type {ol.AtlasInfo} */ (this.add_(true, id, width, height, renderHitCallback, opt_this)); diff --git a/src/ol/style/Circle.js b/src/ol/style/Circle.js index 03d59f9423..3cb75c995a 100644 --- a/src/ol/style/Circle.js +++ b/src/ol/style/Circle.js @@ -1,7 +1,7 @@ /** * @module ol/style/Circle */ -import _ol_ from '../index.js'; +import {inherits} from '../index.js'; import _ol_style_RegularShape_ from '../style/RegularShape.js'; /** @@ -28,7 +28,7 @@ var _ol_style_Circle_ = function(opt_options) { }; -_ol_.inherits(_ol_style_Circle_, _ol_style_RegularShape_); +inherits(_ol_style_Circle_, _ol_style_RegularShape_); /** diff --git a/src/ol/style/Fill.js b/src/ol/style/Fill.js index f6555d1ea5..9387c2acd7 100644 --- a/src/ol/style/Fill.js +++ b/src/ol/style/Fill.js @@ -1,7 +1,7 @@ /** * @module ol/style/Fill */ -import _ol_ from '../index.js'; +import {getUid} from '../index.js'; import _ol_color_ from '../color.js'; /** @@ -74,7 +74,7 @@ _ol_style_Fill_.prototype.getChecksum = function() { this.color_ instanceof CanvasPattern || this.color_ instanceof CanvasGradient ) { - this.checksum_ = _ol_.getUid(this.color_).toString(); + this.checksum_ = getUid(this.color_).toString(); } else { this.checksum_ = 'f' + (this.color_ ? _ol_color_.asString(this.color_) : '-'); diff --git a/src/ol/style/Icon.js b/src/ol/style/Icon.js index cec4b495c0..056d451fed 100644 --- a/src/ol/style/Icon.js +++ b/src/ol/style/Icon.js @@ -1,7 +1,7 @@ /** * @module ol/style/Icon */ -import _ol_ from '../index.js'; +import {getUid, inherits} from '../index.js'; import _ol_ImageState_ from '../ImageState.js'; import _ol_asserts_ from '../asserts.js'; import _ol_color_ from '../color.js'; @@ -86,7 +86,7 @@ var _ol_style_Icon_ = function(opt_options) { 5); // `imgSize` must be set when `image` is provided if ((src === undefined || src.length === 0) && image) { - src = image.src || _ol_.getUid(image).toString(); + src = image.src || getUid(image).toString(); } _ol_asserts_.assert(src !== undefined && src.length > 0, 6); // A defined and non-empty `src` or `image` must be provided @@ -173,7 +173,7 @@ var _ol_style_Icon_ = function(opt_options) { }; -_ol_.inherits(_ol_style_Icon_, _ol_style_Image_); +inherits(_ol_style_Icon_, _ol_style_Image_); /** diff --git a/src/ol/style/IconImage.js b/src/ol/style/IconImage.js index aeb141881e..910a1b94f0 100644 --- a/src/ol/style/IconImage.js +++ b/src/ol/style/IconImage.js @@ -1,7 +1,7 @@ /** * @module ol/style/IconImage */ -import _ol_ from '../index.js'; +import {inherits} from '../index.js'; import _ol_dom_ from '../dom.js'; import _ol_events_ from '../events.js'; import _ol_events_EventTarget_ from '../events/EventTarget.js'; @@ -89,7 +89,7 @@ var _ol_style_IconImage_ = function(image, src, size, crossOrigin, imageState, }; -_ol_.inherits(_ol_style_IconImage_, _ol_events_EventTarget_); +inherits(_ol_style_IconImage_, _ol_events_EventTarget_); /** diff --git a/src/ol/style/RegularShape.js b/src/ol/style/RegularShape.js index 28166b4f33..380200b867 100644 --- a/src/ol/style/RegularShape.js +++ b/src/ol/style/RegularShape.js @@ -1,7 +1,7 @@ /** * @module ol/style/RegularShape */ -import _ol_ from '../index.js'; +import {inherits} from '../index.js'; import _ol_colorlike_ from '../colorlike.js'; import _ol_dom_ from '../dom.js'; import _ol_has_ from '../has.js'; @@ -135,7 +135,7 @@ var _ol_style_RegularShape_ = function(options) { }); }; -_ol_.inherits(_ol_style_RegularShape_, _ol_style_Image_); +inherits(_ol_style_RegularShape_, _ol_style_Image_); /** diff --git a/src/ol/style/Stroke.js b/src/ol/style/Stroke.js index 0ff0f6041e..4b9cf27eb6 100644 --- a/src/ol/style/Stroke.js +++ b/src/ol/style/Stroke.js @@ -1,7 +1,7 @@ /** * @module ol/style/Stroke */ -import _ol_ from '../index.js'; +import {getUid} from '../index.js'; /** * @classdesc @@ -257,7 +257,7 @@ _ol_style_Stroke_.prototype.getChecksum = function() { if (typeof this.color_ === 'string') { this.checksum_ += this.color_; } else { - this.checksum_ += _ol_.getUid(this.color_).toString(); + this.checksum_ += getUid(this.color_).toString(); } } else { this.checksum_ += '-'; diff --git a/src/ol/tilegrid.js b/src/ol/tilegrid.js index 7b4edccbec..30fcb5fd11 100644 --- a/src/ol/tilegrid.js +++ b/src/ol/tilegrid.js @@ -1,7 +1,7 @@ /** * @module ol/tilegrid */ -import _ol_ from './index.js'; +import {DEFAULT_MAX_ZOOM, DEFAULT_TILE_SIZE} from './index.js'; import _ol_size_ from './size.js'; import _ol_extent_ from './extent.js'; import _ol_extent_Corner_ from './extent/Corner.js'; @@ -50,9 +50,9 @@ _ol_tilegrid_.wrapX = function(tileGrid, tileCoord, projection) { /** * @param {ol.Extent} extent Extent. * @param {number=} opt_maxZoom Maximum zoom level (default is - * ol.DEFAULT_MAX_ZOOM). + * DEFAULT_MAX_ZOOM). * @param {number|ol.Size=} opt_tileSize Tile size (default uses - * ol.DEFAULT_TILE_SIZE). + * DEFAULT_TILE_SIZE). * @param {ol.extent.Corner=} opt_corner Extent corner (default is * ol.extent.Corner.TOP_LEFT). * @return {!ol.tilegrid.TileGrid} TileGrid instance. @@ -98,20 +98,20 @@ _ol_tilegrid_.createXYZ = function(opt_options) { * Create a resolutions array from an extent. A zoom factor of 2 is assumed. * @param {ol.Extent} extent Extent. * @param {number=} opt_maxZoom Maximum zoom level (default is - * ol.DEFAULT_MAX_ZOOM). + * DEFAULT_MAX_ZOOM). * @param {number|ol.Size=} opt_tileSize Tile size (default uses - * ol.DEFAULT_TILE_SIZE). + * DEFAULT_TILE_SIZE). * @return {!Array.} Resolutions array. */ _ol_tilegrid_.resolutionsFromExtent = function(extent, opt_maxZoom, opt_tileSize) { var maxZoom = opt_maxZoom !== undefined ? - opt_maxZoom : _ol_.DEFAULT_MAX_ZOOM; + opt_maxZoom : DEFAULT_MAX_ZOOM; var height = _ol_extent_.getHeight(extent); var width = _ol_extent_.getWidth(extent); var tileSize = _ol_size_.toSize(opt_tileSize !== undefined ? - opt_tileSize : _ol_.DEFAULT_TILE_SIZE); + opt_tileSize : DEFAULT_TILE_SIZE); var maxResolution = Math.max( width / tileSize[0], height / tileSize[1]); @@ -127,9 +127,9 @@ _ol_tilegrid_.resolutionsFromExtent = function(extent, opt_maxZoom, opt_tileSize /** * @param {ol.ProjectionLike} projection Projection. * @param {number=} opt_maxZoom Maximum zoom level (default is - * ol.DEFAULT_MAX_ZOOM). + * DEFAULT_MAX_ZOOM). * @param {number|ol.Size=} opt_tileSize Tile size (default uses - * ol.DEFAULT_TILE_SIZE). + * DEFAULT_TILE_SIZE). * @param {ol.extent.Corner=} opt_corner Extent corner (default is * ol.extent.Corner.BOTTOM_LEFT). * @return {!ol.tilegrid.TileGrid} TileGrid instance. diff --git a/src/ol/tilegrid/TileGrid.js b/src/ol/tilegrid/TileGrid.js index 8c83add519..e57728e603 100644 --- a/src/ol/tilegrid/TileGrid.js +++ b/src/ol/tilegrid/TileGrid.js @@ -1,7 +1,7 @@ /** * @module ol/tilegrid/TileGrid */ -import _ol_ from '../index.js'; +import {DEFAULT_TILE_SIZE} from '../index.js'; import _ol_asserts_ from '../asserts.js'; import _ol_TileRange_ from '../TileRange.js'; import _ol_array_ from '../array.js'; @@ -112,7 +112,7 @@ var _ol_tilegrid_TileGrid_ = function(options) { */ this.tileSize_ = options.tileSize !== undefined ? options.tileSize : - !this.tileSizes_ ? _ol_.DEFAULT_TILE_SIZE : null; + !this.tileSizes_ ? DEFAULT_TILE_SIZE : null; _ol_asserts_.assert( (!this.tileSize_ && this.tileSizes_) || (this.tileSize_ && !this.tileSizes_), diff --git a/src/ol/tilegrid/WMTS.js b/src/ol/tilegrid/WMTS.js index 80ed2fc946..0ea363fad3 100644 --- a/src/ol/tilegrid/WMTS.js +++ b/src/ol/tilegrid/WMTS.js @@ -1,7 +1,7 @@ /** * @module ol/tilegrid/WMTS */ -import _ol_ from '../index.js'; +import {inherits} from '../index.js'; import _ol_array_ from '../array.js'; import _ol_proj_ from '../proj.js'; import _ol_tilegrid_TileGrid_ from '../tilegrid/TileGrid.js'; @@ -35,7 +35,7 @@ var _ol_tilegrid_WMTS_ = function(options) { }); }; -_ol_.inherits(_ol_tilegrid_WMTS_, _ol_tilegrid_TileGrid_); +inherits(_ol_tilegrid_WMTS_, _ol_tilegrid_TileGrid_); /** diff --git a/src/ol/webgl/Context.js b/src/ol/webgl/Context.js index 880a1d4ede..ac82e843d6 100644 --- a/src/ol/webgl/Context.js +++ b/src/ol/webgl/Context.js @@ -1,7 +1,7 @@ /** * @module ol/webgl/Context */ -import _ol_ from '../index.js'; +import {WEBGL_EXTENSIONS, getUid, inherits} from '../index.js'; import _ol_Disposable_ from '../Disposable.js'; import _ol_array_ from '../array.js'; import _ol_events_ from '../events.js'; @@ -78,7 +78,7 @@ var _ol_webgl_Context_ = function(canvas, gl) { * @type {boolean} */ this.hasOESElementIndexUint = _ol_array_.includes( - _ol_.WEBGL_EXTENSIONS, 'OES_element_index_uint'); + WEBGL_EXTENSIONS, 'OES_element_index_uint'); // use the OES_element_index_uint extension if available if (this.hasOESElementIndexUint) { @@ -92,7 +92,7 @@ var _ol_webgl_Context_ = function(canvas, gl) { }; -_ol_.inherits(_ol_webgl_Context_, _ol_Disposable_); +inherits(_ol_webgl_Context_, _ol_Disposable_); /** @@ -105,7 +105,7 @@ _ol_.inherits(_ol_webgl_Context_, _ol_Disposable_); _ol_webgl_Context_.prototype.bindBuffer = function(target, buf) { var gl = this.getGL(); var arr = buf.getArray(); - var bufferKey = String(_ol_.getUid(buf)); + var bufferKey = String(getUid(buf)); if (bufferKey in this.bufferCache_) { var bufferCacheEntry = this.bufferCache_[bufferKey]; gl.bindBuffer(target, bufferCacheEntry.buffer); @@ -133,7 +133,7 @@ _ol_webgl_Context_.prototype.bindBuffer = function(target, buf) { */ _ol_webgl_Context_.prototype.deleteBuffer = function(buf) { var gl = this.getGL(); - var bufferKey = String(_ol_.getUid(buf)); + var bufferKey = String(getUid(buf)); var bufferCacheEntry = this.bufferCache_[bufferKey]; if (!gl.isContextLost()) { gl.deleteBuffer(bufferCacheEntry.buffer); @@ -204,7 +204,7 @@ _ol_webgl_Context_.prototype.getHitDetectionFramebuffer = function() { * @return {WebGLShader} Shader. */ _ol_webgl_Context_.prototype.getShader = function(shaderObject) { - var shaderKey = String(_ol_.getUid(shaderObject)); + var shaderKey = String(getUid(shaderObject)); if (shaderKey in this.shaderCache_) { return this.shaderCache_[shaderKey]; } else { @@ -229,7 +229,7 @@ _ol_webgl_Context_.prototype.getShader = function(shaderObject) { _ol_webgl_Context_.prototype.getProgram = function( fragmentShaderObject, vertexShaderObject) { var programKey = - _ol_.getUid(fragmentShaderObject) + '/' + _ol_.getUid(vertexShaderObject); + getUid(fragmentShaderObject) + '/' + getUid(vertexShaderObject); if (programKey in this.programCache_) { return this.programCache_[programKey]; } else { diff --git a/src/ol/webgl/Fragment.js b/src/ol/webgl/Fragment.js index 4a3eb1e11a..be02e2fd65 100644 --- a/src/ol/webgl/Fragment.js +++ b/src/ol/webgl/Fragment.js @@ -1,7 +1,7 @@ /** * @module ol/webgl/Fragment */ -import _ol_ from '../index.js'; +import {inherits} from '../index.js'; import _ol_webgl_ from '../webgl.js'; import _ol_webgl_Shader_ from '../webgl/Shader.js'; @@ -15,7 +15,7 @@ var _ol_webgl_Fragment_ = function(source) { _ol_webgl_Shader_.call(this, source); }; -_ol_.inherits(_ol_webgl_Fragment_, _ol_webgl_Shader_); +inherits(_ol_webgl_Fragment_, _ol_webgl_Shader_); /** diff --git a/src/ol/webgl/Vertex.js b/src/ol/webgl/Vertex.js index d71f7d55a8..e204ce7989 100644 --- a/src/ol/webgl/Vertex.js +++ b/src/ol/webgl/Vertex.js @@ -1,7 +1,7 @@ /** * @module ol/webgl/Vertex */ -import _ol_ from '../index.js'; +import {inherits} from '../index.js'; import _ol_webgl_ from '../webgl.js'; import _ol_webgl_Shader_ from '../webgl/Shader.js'; @@ -15,7 +15,7 @@ var _ol_webgl_Vertex_ = function(source) { _ol_webgl_Shader_.call(this, source); }; -_ol_.inherits(_ol_webgl_Vertex_, _ol_webgl_Shader_); +inherits(_ol_webgl_Vertex_, _ol_webgl_Shader_); /** diff --git a/src/ol/webgl/shader.mustache b/src/ol/webgl/shader.mustache index ff5e494886..4e224c0dce 100644 --- a/src/ol/webgl/shader.mustache +++ b/src/ol/webgl/shader.mustache @@ -1,16 +1,16 @@ // This file is automatically generated, do not edit. // Run `make shaders` to generate, and commit the result. -import _ol_ from '../../index.js'; +import {DEBUG_WEBGL} from '../../index.js'; import _ol_webgl_Fragment_ from '../../webgl/Fragment.js'; import _ol_webgl_Vertex_ from '../../webgl/Vertex.js'; var {{namespace}} = {}; -{{namespace}}.fragment = new _ol_webgl_Fragment_(_ol_.DEBUG_WEBGL ? +{{namespace}}.fragment = new _ol_webgl_Fragment_(DEBUG_WEBGL ? 'precision mediump float;\n{{{originalFragmentSource}}}' : 'precision mediump float;{{{fragmentSource}}}'); -{{namespace}}.vertex = new _ol_webgl_Vertex_(_ol_.DEBUG_WEBGL ? +{{namespace}}.vertex = new _ol_webgl_Vertex_(DEBUG_WEBGL ? '{{{originalVertexSource}}}' : '{{{vertexSource}}}'); diff --git a/src/ol/webgl/shaderlocations.mustache b/src/ol/webgl/shaderlocations.mustache index 1278783e5b..53553b326f 100644 --- a/src/ol/webgl/shaderlocations.mustache +++ b/src/ol/webgl/shaderlocations.mustache @@ -1,7 +1,7 @@ // This file is automatically generated, do not edit // Run `make shaders` to generate, and commit the result. -import _ol_ from '../../../index.js'; +import {DEBUG_WEBGL} from '../../../index.js'; /** * @constructor @@ -16,7 +16,7 @@ import _ol_ from '../../../index.js'; * @type {WebGLUniformLocation} */ this.{{originalName}} = gl.getUniformLocation( - program, _ol_.DEBUG_WEBGL ? '{{originalName}}' : '{{shortName}}'); + program, DEBUG_WEBGL ? '{{originalName}}' : '{{shortName}}'); {{/uniforms}} {{#attributes}} @@ -24,7 +24,7 @@ import _ol_ from '../../../index.js'; * @type {number} */ this.{{originalName}} = gl.getAttribLocation( - program, _ol_.DEBUG_WEBGL ? '{{originalName}}' : '{{shortName}}'); + program, DEBUG_WEBGL ? '{{originalName}}' : '{{shortName}}'); {{/attributes}} }; diff --git a/test/spec/ol/assertionerror.test.js b/test/spec/ol/assertionerror.test.js index 7c1699d5dc..70a7d9c14b 100644 --- a/test/spec/ol/assertionerror.test.js +++ b/test/spec/ol/assertionerror.test.js @@ -1,4 +1,4 @@ -import _ol_ from '../../../src/ol/index.js'; +import {VERSION} from '../../../src/ol/index.js'; import _ol_AssertionError_ from '../../../src/ol/AssertionError.js'; describe('ol.AssertionError', function() { @@ -9,7 +9,7 @@ describe('ol.AssertionError', function() { it('generates a message with a versioned url', function() { var error = new _ol_AssertionError_(42); - var path = _ol_.VERSION ? _ol_.VERSION.split('-')[0] : 'latest'; + var path = VERSION ? VERSION.split('-')[0] : 'latest'; expect(error.message).to.be('Assertion failed. See https://openlayers.org/en/' + path + '/doc/errors/#42 for details.'); }); diff --git a/test/spec/ol/color.test.js b/test/spec/ol/color.test.js index 5708eabd34..72120dd27d 100644 --- a/test/spec/ol/color.test.js +++ b/test/spec/ol/color.test.js @@ -1,6 +1,4 @@ import _ol_color_ from '../../../src/ol/color.js'; -import _ol_ from '../../../src/ol/index.js'; - describe('ol.color', function() { @@ -65,12 +63,6 @@ describe('ol.color', function() { spy.restore(); }); - if (_ol_.ENABLE_NAMED_COLORS) { - it('can parse named colors', function() { - expect(_ol_color_.fromString('red')).to.eql([255, 0, 0, 1]); - }); - } - it('can parse 3-digit hex colors', function() { expect(_ol_color_.fromString('#087')).to.eql([0, 136, 119, 1]); }); diff --git a/test/spec/ol/index.test.js b/test/spec/ol/index.test.js index efac6b7e92..b1c364ddc4 100644 --- a/test/spec/ol/index.test.js +++ b/test/spec/ol/index.test.js @@ -1,20 +1,20 @@ -import _ol_ from '../../../src/ol/index.js'; +import {getUid} from '../../../src/ol/index.js'; describe('getUid()', function() { it('is constant once generated', function() { var a = {}; - expect(_ol_.getUid(a)).to.be(_ol_.getUid(a)); + expect(getUid(a)).to.be(getUid(a)); }); it('generates a strictly increasing sequence', function() { var a = {}, b = {}, c = {}; - _ol_.getUid(a); - _ol_.getUid(c); - _ol_.getUid(b); + getUid(a); + getUid(c); + getUid(b); //uid order should be a < c < b - expect(_ol_.getUid(a)).to.be.lessThan(_ol_.getUid(c)); - expect(_ol_.getUid(c)).to.be.lessThan(_ol_.getUid(b)); - expect(_ol_.getUid(a)).to.be.lessThan(_ol_.getUid(b)); + expect(getUid(a)).to.be.lessThan(getUid(c)); + expect(getUid(c)).to.be.lessThan(getUid(b)); + expect(getUid(a)).to.be.lessThan(getUid(b)); }); }); diff --git a/test/spec/ol/interaction/draganddrop.test.js b/test/spec/ol/interaction/draganddrop.test.js index d2b0370944..31305e4f98 100644 --- a/test/spec/ol/interaction/draganddrop.test.js +++ b/test/spec/ol/interaction/draganddrop.test.js @@ -1,4 +1,4 @@ -import _ol_ from '../../../../src/ol/index.js'; +import {inherits} from '../../../../src/ol/index.js'; import _ol_View_ from '../../../../src/ol/View.js'; import _ol_events_Event_ from '../../../../src/ol/events/Event.js'; import _ol_events_EventTarget_ from '../../../../src/ol/events/EventTarget.js'; @@ -101,7 +101,7 @@ where('FileReader').describe('ol.interaction.DragAndDrop', function() { this.dispatchEvent('load'); }; }; - _ol_.inherits(FileReader, _ol_events_EventTarget_); + inherits(FileReader, _ol_events_EventTarget_); }); afterEach(function() { diff --git a/test/spec/ol/layer/group.test.js b/test/spec/ol/layer/group.test.js index a35bf368de..4a6841ad5c 100644 --- a/test/spec/ol/layer/group.test.js +++ b/test/spec/ol/layer/group.test.js @@ -1,4 +1,4 @@ -import _ol_ from '../../../../src/ol/index.js'; +import {getUid} from '../../../../src/ol/index.js'; import _ol_array_ from '../../../../src/ol/array.js'; import _ol_Collection_ from '../../../../src/ol/Collection.js'; import _ol_extent_ from '../../../../src/ol/extent.js'; @@ -293,7 +293,7 @@ describe('ol.layer.Group', function() { layers.push(layer); expect(Object.keys(layerGroup.listenerKeys_).length).to.eql(1); - var listeners = layerGroup.listenerKeys_[_ol_.getUid(layer)]; + var listeners = layerGroup.listenerKeys_[getUid(layer)]; expect(listeners.length).to.eql(2); expect(typeof listeners[0]).to.be('object'); expect(typeof listeners[1]).to.be('object'); diff --git a/test/spec/ol/layer/layer.test.js b/test/spec/ol/layer/layer.test.js index e8430ef1f3..cd121fc3e4 100644 --- a/test/spec/ol/layer/layer.test.js +++ b/test/spec/ol/layer/layer.test.js @@ -1,4 +1,4 @@ -import _ol_ from '../../../../src/ol/index.js'; +import {getUid} from '../../../../src/ol/index.js'; import _ol_Map_ from '../../../../src/ol/Map.js'; import _ol_layer_Layer_ from '../../../../src/ol/layer/Layer.js'; import _ol_proj_ from '../../../../src/ol/proj.js'; @@ -404,7 +404,7 @@ describe('ol.layer.Layer', function() { expect(frameState.layerStatesArray.length).to.be(1); var layerState = frameState.layerStatesArray[0]; expect(layerState.layer).to.equal(layer); - expect(frameState.layerStates[_ol_.getUid(layer)]).to.equal(layerState); + expect(frameState.layerStates[getUid(layer)]).to.equal(layerState); }); }); diff --git a/test/spec/ol/net.test.js b/test/spec/ol/net.test.js index 531df511ce..e749addde1 100644 --- a/test/spec/ol/net.test.js +++ b/test/spec/ol/net.test.js @@ -1,4 +1,4 @@ -import _ol_ from '../../../src/ol/index.js'; +import {getUid} from '../../../src/ol/index.js'; import _ol_net_ from '../../../src/ol/net.js'; describe('ol.net', function() { @@ -17,7 +17,7 @@ describe('ol.net', function() { expect(removeChild.called).to.be(true); done(); }; - key = 'olc_' + _ol_.getUid(callback); + key = 'olc_' + getUid(callback); return callback; } diff --git a/test/spec/ol/render/webgl/circlereplay.test.js b/test/spec/ol/render/webgl/circlereplay.test.js index 7462c5b1eb..d35a852de6 100644 --- a/test/spec/ol/render/webgl/circlereplay.test.js +++ b/test/spec/ol/render/webgl/circlereplay.test.js @@ -1,4 +1,4 @@ -import _ol_ from '../../../../../src/ol/index.js'; +import {getUid} from '../../../../../src/ol/index.js'; import _ol_Feature_ from '../../../../../src/ol/Feature.js'; import _ol_geom_Circle_ from '../../../../../src/ol/geom/Circle.js'; import _ol_render_webgl_CircleReplay_ from '../../../../../src/ol/render/webgl/CircleReplay.js'; @@ -232,7 +232,7 @@ describe('ol.render.webgl.CircleReplay', function() { replay.drawCircle(feature3.getGeometry(), feature3); replay.startIndices.push(replay.indices.length); var skippedFeatHash = {}; - skippedFeatHash[_ol_.getUid(feature2).toString()] = true; + skippedFeatHash[getUid(feature2).toString()] = true; replay.drawReplay(gl, context, skippedFeatHash, false); expect(replay.setFillStyle_.calledOnce).to.be(true); diff --git a/test/spec/ol/render/webgl/linestringreplay.test.js b/test/spec/ol/render/webgl/linestringreplay.test.js index 3bc1e5941b..cd5533cbcf 100644 --- a/test/spec/ol/render/webgl/linestringreplay.test.js +++ b/test/spec/ol/render/webgl/linestringreplay.test.js @@ -1,4 +1,4 @@ -import _ol_ from '../../../../../src/ol/index.js'; +import {getUid} from '../../../../../src/ol/index.js'; import _ol_Feature_ from '../../../../../src/ol/Feature.js'; import _ol_geom_LineString_ from '../../../../../src/ol/geom/LineString.js'; import _ol_geom_MultiLineString_ from '../../../../../src/ol/geom/MultiLineString.js'; @@ -351,7 +351,7 @@ describe('ol.render.webgl.LineStringReplay', function() { replay.drawLineString(feature3.getGeometry(), feature3); replay.startIndices.push(replay.indices.length); var skippedFeatHash = {}; - skippedFeatHash[_ol_.getUid(feature2).toString()] = true; + skippedFeatHash[getUid(feature2).toString()] = true; replay.drawReplay(gl, context, skippedFeatHash, false); expect(replay.setStrokeStyle_.calledOnce).to.be(true); diff --git a/test/spec/ol/render/webgl/polygonreplay.test.js b/test/spec/ol/render/webgl/polygonreplay.test.js index 53901ef26f..e0a462dc31 100644 --- a/test/spec/ol/render/webgl/polygonreplay.test.js +++ b/test/spec/ol/render/webgl/polygonreplay.test.js @@ -1,4 +1,4 @@ -import _ol_ from '../../../../../src/ol/index.js'; +import {getUid} from '../../../../../src/ol/index.js'; import _ol_Feature_ from '../../../../../src/ol/Feature.js'; import _ol_geom_MultiPolygon_ from '../../../../../src/ol/geom/MultiPolygon.js'; import _ol_geom_Polygon_ from '../../../../../src/ol/geom/Polygon.js'; @@ -460,7 +460,7 @@ describe('ol.render.webgl.PolygonReplay', function() { replay.drawPolygon(feature3.getGeometry(), feature3); replay.startIndices.push(replay.indices.length); var skippedFeatHash = {}; - skippedFeatHash[_ol_.getUid(feature2).toString()] = true; + skippedFeatHash[getUid(feature2).toString()] = true; replay.drawReplay(gl, context, skippedFeatHash, false); expect(replay.setFillStyle_.calledOnce).to.be(true); diff --git a/test/spec/ol/renderer/canvas/map.test.js b/test/spec/ol/renderer/canvas/map.test.js index 244cab1160..191487b4ad 100644 --- a/test/spec/ol/renderer/canvas/map.test.js +++ b/test/spec/ol/renderer/canvas/map.test.js @@ -1,4 +1,4 @@ -import _ol_ from '../../../../../src/ol/index.js'; +import {getUid} from '../../../../../src/ol/index.js'; import _ol_Feature_ from '../../../../../src/ol/Feature.js'; import _ol_Map_ from '../../../../../src/ol/Map.js'; import _ol_View_ from '../../../../../src/ol/View.js'; @@ -181,7 +181,7 @@ describe('ol.renderer.canvas.Map', function() { layerRenderer.getImage = function() { return null; }; - renderer.layerRenderers_[_ol_.getUid(layer)] = layerRenderer; + renderer.layerRenderers_[getUid(layer)] = layerRenderer; }); }); diff --git a/test/spec/ol/renderer/canvas/replay.test.js b/test/spec/ol/renderer/canvas/replay.test.js index 2803fed89b..0463a83dc3 100644 --- a/test/spec/ol/renderer/canvas/replay.test.js +++ b/test/spec/ol/renderer/canvas/replay.test.js @@ -1,4 +1,4 @@ -import _ol_ from '../../../../../src/ol/index.js'; +import {getUid} from '../../../../../src/ol/index.js'; import _ol_Feature_ from '../../../../../src/ol/Feature.js'; import _ol_geom_GeometryCollection_ from '../../../../../src/ol/geom/GeometryCollection.js'; import _ol_geom_LineString_ from '../../../../../src/ol/geom/LineString.js'; @@ -139,7 +139,7 @@ describe('ol.render.canvas.ReplayGroup', function() { _ol_renderer_vector_.renderFeature(replay, feature2, style2, 1); _ol_renderer_vector_.renderFeature(replay, feature3, style2, 1); var skippedUids = {}; - skippedUids[_ol_.getUid(feature1)] = true; + skippedUids[getUid(feature1)] = true; replay.replay(context, transform, 0, skippedUids); expect(fillCount).to.be(1); expect(strokeCount).to.be(1); @@ -151,7 +151,7 @@ describe('ol.render.canvas.ReplayGroup', function() { _ol_renderer_vector_.renderFeature(replay, feature2, style1, 1); _ol_renderer_vector_.renderFeature(replay, feature3, style2, 1); var skippedUids = {}; - skippedUids[_ol_.getUid(feature3)] = true; + skippedUids[getUid(feature3)] = true; replay.replay(context, transform, 0, skippedUids); expect(fillCount).to.be(1); expect(strokeCount).to.be(1); @@ -163,8 +163,8 @@ describe('ol.render.canvas.ReplayGroup', function() { _ol_renderer_vector_.renderFeature(replay, feature2, style1, 1); _ol_renderer_vector_.renderFeature(replay, feature3, style2, 1); var skippedUids = {}; - skippedUids[_ol_.getUid(feature1)] = true; - skippedUids[_ol_.getUid(feature2)] = true; + skippedUids[getUid(feature1)] = true; + skippedUids[getUid(feature2)] = true; replay.replay(context, transform, 0, skippedUids); expect(fillCount).to.be(1); expect(strokeCount).to.be(1); diff --git a/test/spec/ol/renderer/canvas/vectorlayer.test.js b/test/spec/ol/renderer/canvas/vectorlayer.test.js index 93c5a22248..a5ca134e03 100644 --- a/test/spec/ol/renderer/canvas/vectorlayer.test.js +++ b/test/spec/ol/renderer/canvas/vectorlayer.test.js @@ -1,4 +1,4 @@ -import _ol_ from '../../../../../src/ol/index.js'; +import {getUid} from '../../../../../src/ol/index.js'; import _ol_Feature_ from '../../../../../src/ol/Feature.js'; import _ol_Map_ from '../../../../../src/ol/Map.js'; import _ol_View_ from '../../../../../src/ol/View.js'; @@ -210,7 +210,7 @@ describe('ol.renderer.canvas.VectorLayer', function() { rotation: 0 } }; - frameState.layerStates[_ol_.getUid(layer)] = {}; + frameState.layerStates[getUid(layer)] = {}; renderer.forEachFeatureAtCoordinate( coordinate, frameState, 0, spy, undefined); expect(spy.callCount).to.be(1); diff --git a/test/spec/ol/renderer/canvas/vectortilelayer.test.js b/test/spec/ol/renderer/canvas/vectortilelayer.test.js index 39c72abef0..d8c0515de8 100644 --- a/test/spec/ol/renderer/canvas/vectortilelayer.test.js +++ b/test/spec/ol/renderer/canvas/vectortilelayer.test.js @@ -1,4 +1,4 @@ -import _ol_ from '../../../../../src/ol/index.js'; +import {getUid, inherits} from '../../../../../src/ol/index.js'; import _ol_obj_ from '../../../../../src/ol/obj.js'; import _ol_Feature_ from '../../../../../src/ol/Feature.js'; import _ol_Map_ from '../../../../../src/ol/Map.js'; @@ -66,7 +66,7 @@ describe('ol.renderer.canvas.VectorTileLayer', function() { this.setProjection(_ol_proj_.get('EPSG:4326')); tileCallback(this); }; - _ol_.inherits(TileClass, _ol_VectorTile_); + inherits(TileClass, _ol_VectorTile_); source = new _ol_source_VectorTile_({ format: new _ol_format_MVT_(), tileClass: TileClass, @@ -305,7 +305,7 @@ describe('ol.renderer.canvas.VectorTileLayer', function() { this.sourceTiles_[key] = sourceTile; this.wrappedTileCoord = arguments[0]; }; - _ol_.inherits(TileClass, _ol_VectorImageTile_); + inherits(TileClass, _ol_VectorImageTile_); beforeEach(function() { replayGroup = {}; @@ -336,7 +336,7 @@ describe('ol.renderer.canvas.VectorTileLayer', function() { rotation: 0 } }; - frameState.layerStates[_ol_.getUid(layer)] = {}; + frameState.layerStates[getUid(layer)] = {}; renderer.renderedTiles = [new TileClass([0, 0, -1])]; renderer.forEachFeatureAtCoordinate( coordinate, frameState, 0, spy, undefined); diff --git a/test/spec/ol/renderer/vector.test.js b/test/spec/ol/renderer/vector.test.js index bfb18c48a4..5a3382dcfd 100644 --- a/test/spec/ol/renderer/vector.test.js +++ b/test/spec/ol/renderer/vector.test.js @@ -1,4 +1,4 @@ -import _ol_ from '../../../../src/ol/index.js'; +import {nullFunction} from '../../../../src/ol/index.js'; import _ol_events_ from '../../../../src/ol/events.js'; import _ol_geom_LineString_ from '../../../../src/ol/geom/LineString.js'; import _ol_geom_Point_ from '../../../../src/ol/geom/Point.js'; @@ -77,7 +77,7 @@ describe('ol.renderer.vector', function() { var imageReplay = replayGroup.getReplay( style.getZIndex(), 'Image'); var setImageStyleSpy = sinon.spy(imageReplay, 'setImageStyle'); - var drawPointSpy = sinon.stub(imageReplay, 'drawPoint').callsFake(_ol_.nullFunction); + var drawPointSpy = sinon.stub(imageReplay, 'drawPoint').callsFake(nullFunction); _ol_renderer_vector_.renderFeature(replayGroup, feature, style, squaredTolerance, listener, listenerThis); expect(setImageStyleSpy.called).to.be(false); @@ -90,7 +90,7 @@ describe('ol.renderer.vector', function() { var imageReplay = replayGroup.getReplay( style.getZIndex(), 'Image'); var setImageStyleSpy = sinon.spy(imageReplay, 'setImageStyle'); - var drawMultiPointSpy = sinon.stub(imageReplay, 'drawMultiPoint').callsFake(_ol_.nullFunction); + var drawMultiPointSpy = sinon.stub(imageReplay, 'drawMultiPoint').callsFake(nullFunction); _ol_renderer_vector_.renderFeature(replayGroup, feature, style, squaredTolerance, listener, listenerThis); expect(setImageStyleSpy.called).to.be(false); @@ -104,7 +104,7 @@ describe('ol.renderer.vector', function() { style.getZIndex(), 'LineString'); var setFillStrokeStyleSpy = sinon.spy(lineStringReplay, 'setFillStrokeStyle'); - var drawLineStringSpy = sinon.stub(lineStringReplay, 'drawLineString').callsFake(_ol_.nullFunction); + var drawLineStringSpy = sinon.stub(lineStringReplay, 'drawLineString').callsFake(nullFunction); _ol_renderer_vector_.renderFeature(replayGroup, feature, style, squaredTolerance, listener, listenerThis); expect(setFillStrokeStyleSpy.called).to.be(true); @@ -119,7 +119,7 @@ describe('ol.renderer.vector', function() { style.getZIndex(), 'LineString'); var setFillStrokeStyleSpy = sinon.spy(lineStringReplay, 'setFillStrokeStyle'); - var drawMultiLineStringSpy = sinon.stub(lineStringReplay, 'drawMultiLineString').callsFake(_ol_.nullFunction); + var drawMultiLineStringSpy = sinon.stub(lineStringReplay, 'drawMultiLineString').callsFake(nullFunction); _ol_renderer_vector_.renderFeature(replayGroup, feature, style, squaredTolerance, listener, listenerThis); expect(setFillStrokeStyleSpy.called).to.be(true); @@ -135,7 +135,7 @@ describe('ol.renderer.vector', function() { style.getZIndex(), 'Polygon'); var setFillStrokeStyleSpy = sinon.spy(polygonReplay, 'setFillStrokeStyle'); - var drawPolygonSpy = sinon.stub(polygonReplay, 'drawPolygon').callsFake(_ol_.nullFunction); + var drawPolygonSpy = sinon.stub(polygonReplay, 'drawPolygon').callsFake(nullFunction); _ol_renderer_vector_.renderFeature(replayGroup, feature, style, squaredTolerance, listener, listenerThis); expect(setFillStrokeStyleSpy.called).to.be(true); @@ -151,7 +151,7 @@ describe('ol.renderer.vector', function() { style.getZIndex(), 'Polygon'); var setFillStrokeStyleSpy = sinon.spy(polygonReplay, 'setFillStrokeStyle'); - var drawMultiPolygonSpy = sinon.stub(polygonReplay, 'drawMultiPolygon').callsFake(_ol_.nullFunction); + var drawMultiPolygonSpy = sinon.stub(polygonReplay, 'drawMultiPolygon').callsFake(nullFunction); _ol_renderer_vector_.renderFeature(replayGroup, feature, style, squaredTolerance, listener, listenerThis); expect(setFillStrokeStyleSpy.called).to.be(true); diff --git a/test/spec/ol/source/tile.test.js b/test/spec/ol/source/tile.test.js index 65d3b96cbc..71579746eb 100644 --- a/test/spec/ol/source/tile.test.js +++ b/test/spec/ol/source/tile.test.js @@ -1,4 +1,4 @@ -import _ol_ from '../../../../src/ol/index.js'; +import {inherits} from '../../../../src/ol/index.js'; import _ol_Tile_ from '../../../../src/ol/Tile.js'; import _ol_TileRange_ from '../../../../src/ol/TileRange.js'; import _ol_proj_ from '../../../../src/ol/proj.js'; @@ -35,7 +35,7 @@ var MockTile = function(tileStates) { } }; -_ol_.inherits(MockTile, _ol_source_Tile_); +inherits(MockTile, _ol_source_Tile_); /** diff --git a/test/spec/ol/source/zoomify.test.js b/test/spec/ol/source/zoomify.test.js index 0d9591ce3e..3d21657ca7 100644 --- a/test/spec/ol/source/zoomify.test.js +++ b/test/spec/ol/source/zoomify.test.js @@ -1,4 +1,4 @@ -import _ol_ from '../../../../src/ol/index.js'; +import {DEFAULT_TILE_SIZE} from '../../../../src/ol/index.js'; import _ol_events_ from '../../../../src/ol/events.js'; import _ol_proj_Projection_ from '../../../../src/ol/proj/Projection.js'; import _ol_source_Zoomify_ from '../../../../src/ol/source/Zoomify.js'; @@ -162,7 +162,7 @@ describe('ol.source.Zoomify', function() { it('has expected tileSize', function() { var sources = [getZoomifySource(), getZoomifySourceWith1024pxTiles()]; - var expectedTileSizes = [_ol_.DEFAULT_TILE_SIZE, 1024]; + var expectedTileSizes = [DEFAULT_TILE_SIZE, 1024]; for (var i = 0; i < sources.length; i++) { var tileGrid = sources[i].getTileGrid(); expect(tileGrid.getTileSize()).to.eql(expectedTileSizes[i]); diff --git a/test/spec/ol/style/icon.test.js b/test/spec/ol/style/icon.test.js index 66f9e97088..fc1728fcb5 100644 --- a/test/spec/ol/style/icon.test.js +++ b/test/spec/ol/style/icon.test.js @@ -1,4 +1,4 @@ -import _ol_ from '../../../../src/ol/index.js'; +import {getUid} from '../../../../src/ol/index.js'; import _ol_style_ from '../../../../src/ol/style.js'; import _ol_style_Icon_ from '../../../../src/ol/style/Icon.js'; import _ol_style_IconImage_ from '../../../../src/ol/style/IconImage.js'; @@ -18,7 +18,7 @@ describe('ol.style.Icon', function() { imgSize: size }); expect(_ol_style_IconImage_.get( - canvas, _ol_.getUid(canvas), size, '').getImage()).to.eql(canvas); + canvas, getUid(canvas), size, '').getImage()).to.eql(canvas); }); it('imgSize overrides img.width and img.height', function(done) { diff --git a/test/spec/ol/style/iconimagecache.test.js b/test/spec/ol/style/iconimagecache.test.js index 7f518706dc..d1f2a7ded8 100644 --- a/test/spec/ol/style/iconimagecache.test.js +++ b/test/spec/ol/style/iconimagecache.test.js @@ -1,4 +1,4 @@ -import _ol_ from '../../../../src/ol/index.js'; +import {nullFunction} from '../../../../src/ol/index.js'; import _ol_events_ from '../../../../src/ol/events.js'; import _ol_style_ from '../../../../src/ol/style.js'; import _ol_style_IconImage_ from '../../../../src/ol/style/IconImage.js'; @@ -46,15 +46,13 @@ describe('ol.style.IconImageCache', function() { src = '0'; iconImage = new _ol_style_IconImage_(null, src); - _ol_events_.listen(iconImage, 'change', - _ol_.nullFunction, false); + _ol_events_.listen(iconImage, 'change', nullFunction, false); cache.set(src, null, null, iconImage); expect(cache.cacheSize_).to.eql(4); src = '4'; iconImage = new _ol_style_IconImage_(null, src); - _ol_events_.listen(iconImage, 'change', - _ol_.nullFunction, false); + _ol_events_.listen(iconImage, 'change', nullFunction, false); cache.set(src, null, null, iconImage); expect(cache.cacheSize_).to.eql(5); diff --git a/test/spec/ol/tile.test.js b/test/spec/ol/tile.test.js index 1fffdc2fd2..7c796392cb 100644 --- a/test/spec/ol/tile.test.js +++ b/test/spec/ol/tile.test.js @@ -1,4 +1,4 @@ -import _ol_ from '../../../src/ol/index.js'; +import {getUid} from '../../../src/ol/index.js'; import _ol_ImageTile_ from '../../../src/ol/ImageTile.js'; import _ol_Tile_ from '../../../src/ol/Tile.js'; import _ol_TileState_ from '../../../src/ol/TileState.js'; @@ -59,11 +59,11 @@ describe('ol.Tile', function() { beforeEach(function() { var tileCoord = [0, 0, 0]; head = new _ol_ImageTile_(tileCoord, _ol_TileState_.IDLE); - _ol_.getUid(head); + getUid(head); var addToChain = function(tile, state) { var next = new _ol_ImageTile_(tileCoord, state); - _ol_.getUid(next); + getUid(next); tile.interimTile = next; return next; }; @@ -112,7 +112,7 @@ describe('ol.Tile', function() { head.refreshInterimChain(); while (head.interimTile !== null) { //use property of ol.getUid returning increasing id's. - expect(_ol_.getUid(head) < _ol_.getUid(head.interimTile)); + expect(getUid(head) < getUid(head.interimTile)); head = head.interimTile; } done(); diff --git a/test/spec/ol/tilegrid/tilegrid.test.js b/test/spec/ol/tilegrid/tilegrid.test.js index 4110375af2..346c9d8b95 100644 --- a/test/spec/ol/tilegrid/tilegrid.test.js +++ b/test/spec/ol/tilegrid/tilegrid.test.js @@ -1,4 +1,4 @@ -import _ol_ from '../../../../src/ol/index.js'; +import {DEFAULT_MAX_ZOOM, DEFAULT_TILE_SIZE} from '../../../../src/ol/index.js'; import _ol_TileRange_ from '../../../../src/ol/TileRange.js'; import _ol_extent_ from '../../../../src/ol/extent.js'; import _ol_proj_ from '../../../../src/ol/proj.js'; @@ -280,7 +280,7 @@ describe('ol.tilegrid.TileGrid', function() { expect(grid).to.be.a(_ol_tilegrid_TileGrid_); var resolutions = grid.getResolutions(); - expect(resolutions.length).to.be(_ol_.DEFAULT_MAX_ZOOM + 1); + expect(resolutions.length).to.be(DEFAULT_MAX_ZOOM + 1); expect(grid.getOrigin()).to.eql([-100, 100]); }); }); @@ -313,7 +313,7 @@ describe('ol.tilegrid.TileGrid', function() { expect(grid).to.be.a(_ol_tilegrid_TileGrid_); var resolutions = grid.getResolutions(); - expect(resolutions.length).to.be(_ol_.DEFAULT_MAX_ZOOM + 1); + expect(resolutions.length).to.be(DEFAULT_MAX_ZOOM + 1); }); it('accepts a number of zoom levels', function() { @@ -341,7 +341,7 @@ describe('ol.tilegrid.TileGrid', function() { var resolutions = grid.getResolutions(); expect(resolutions[5]).to.be( 360 * _ol_proj_.METERS_PER_UNIT['degrees'] / - _ol_.DEFAULT_TILE_SIZE / Math.pow(2, 5)); + DEFAULT_TILE_SIZE / Math.pow(2, 5)); }); it('assumes origin is top-left', function() { @@ -397,8 +397,8 @@ describe('ol.tilegrid.TileGrid', function() { expect(tileGrid.getExtent()).to.eql( _ol_proj_.get('EPSG:3857').getExtent()); expect(tileGrid.getMinZoom()).to.equal(0); - expect(tileGrid.getMaxZoom()).to.equal(_ol_.DEFAULT_MAX_ZOOM); - expect(tileGrid.getTileSize()).to.equal(_ol_.DEFAULT_TILE_SIZE); + expect(tileGrid.getMaxZoom()).to.equal(DEFAULT_MAX_ZOOM); + expect(tileGrid.getTileSize()).to.equal(DEFAULT_TILE_SIZE); }); it('respects configuration options', function() { @@ -424,7 +424,7 @@ describe('ol.tilegrid.TileGrid', function() { expect(grid).to.be.a(_ol_tilegrid_TileGrid_); var resolutions = grid.getResolutions(); - expect(resolutions.length).to.be(_ol_.DEFAULT_MAX_ZOOM + 1); + expect(resolutions.length).to.be(DEFAULT_MAX_ZOOM + 1); expect(grid.getTileSize()).to.eql(256); }); diff --git a/test/spec/ol/view.test.js b/test/spec/ol/view.test.js index dbec56420d..063cc05074 100644 --- a/test/spec/ol/view.test.js +++ b/test/spec/ol/view.test.js @@ -1,4 +1,3 @@ -import _ol_ from '../../../src/ol/index.js'; import _ol_Map_ from '../../../src/ol/Map.js'; import _ol_View_ from '../../../src/ol/View.js'; import _ol_ViewHint_ from '../../../src/ol/ViewHint.js'; @@ -1017,29 +1016,6 @@ describe('ol.View', function() { }); }); - describe('#getZoom() - custom ol.DEFAULT_MIN_ZOOM', function() { - var defaultMinZoom = _ol_.DEFAULT_MIN_ZOOM; - - afterEach(function() { - _ol_.DEFAULT_MIN_ZOOM = defaultMinZoom; - }); - - it('respects custom ol.DEFAULT_MIN_ZOOM', function() { - _ol_.DEFAULT_MIN_ZOOM = 2; - - var view = new _ol_View_(); - - view.setZoom(1); - expect(view.getZoom()).to.be(2); - - view.setZoom(2); - expect(view.getZoom()).to.be(2); - - view.setZoom(3); - expect(view.getZoom()).to.be(3); - }); - }); - describe('#getZoom() - overspecified', function() { it('gives maxResolution precedence over minZoom', function() {