@@ -1,6 +1,6 @@
|
||||
import Geolocation from '../src/ol/Geolocation.js';
|
||||
import Map from '../src/ol/Map.js';
|
||||
import _ol_Overlay_ from '../src/ol/Overlay.js';
|
||||
import Overlay from '../src/ol/Overlay.js';
|
||||
import View from '../src/ol/View.js';
|
||||
import {defaults as defaultControls} from '../src/ol/control.js';
|
||||
import LineString from '../src/ol/geom/LineString.js';
|
||||
@@ -32,7 +32,7 @@ var map = new Map({
|
||||
|
||||
// Geolocation marker
|
||||
var markerEl = document.getElementById('geolocation_marker');
|
||||
var marker = new _ol_Overlay_({
|
||||
var marker = new Overlay({
|
||||
positioning: 'center-center',
|
||||
element: markerEl,
|
||||
stopEvent: false
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import Feature from '../src/ol/Feature.js';
|
||||
import Map from '../src/ol/Map.js';
|
||||
import _ol_Overlay_ from '../src/ol/Overlay.js';
|
||||
import Overlay from '../src/ol/Overlay.js';
|
||||
import View from '../src/ol/View.js';
|
||||
import Point from '../src/ol/geom/Point.js';
|
||||
import TileLayer from '../src/ol/layer/Tile.js';
|
||||
@@ -55,7 +55,7 @@ var map = new Map({
|
||||
|
||||
var element = document.getElementById('popup');
|
||||
|
||||
var popup = new _ol_Overlay_({
|
||||
var popup = new Overlay({
|
||||
element: element,
|
||||
positioning: 'bottom-center',
|
||||
stopEvent: false,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import Map from '../src/ol/Map.js';
|
||||
import Observable from '../src/ol/Observable.js';
|
||||
import _ol_Overlay_ from '../src/ol/Overlay.js';
|
||||
import Overlay from '../src/ol/Overlay.js';
|
||||
import {getArea, getLength} from '../src/ol/sphere.js';
|
||||
import View from '../src/ol/View.js';
|
||||
import LineString from '../src/ol/geom/LineString.js';
|
||||
@@ -252,7 +252,7 @@ function createHelpTooltip() {
|
||||
}
|
||||
helpTooltipElement = document.createElement('div');
|
||||
helpTooltipElement.className = 'tooltip hidden';
|
||||
helpTooltip = new _ol_Overlay_({
|
||||
helpTooltip = new Overlay({
|
||||
element: helpTooltipElement,
|
||||
offset: [15, 0],
|
||||
positioning: 'center-left'
|
||||
@@ -270,7 +270,7 @@ function createMeasureTooltip() {
|
||||
}
|
||||
measureTooltipElement = document.createElement('div');
|
||||
measureTooltipElement.className = 'tooltip tooltip-measure';
|
||||
measureTooltip = new _ol_Overlay_({
|
||||
measureTooltip = new Overlay({
|
||||
element: measureTooltipElement,
|
||||
offset: [0, -15],
|
||||
positioning: 'bottom-center'
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import Map from '../src/ol/Map.js';
|
||||
import _ol_Overlay_ from '../src/ol/Overlay.js';
|
||||
import Overlay from '../src/ol/Overlay.js';
|
||||
import View from '../src/ol/View.js';
|
||||
import _ol_coordinate_ from '../src/ol/coordinate.js';
|
||||
import TileLayer from '../src/ol/layer/Tile.js';
|
||||
@@ -23,7 +23,7 @@ var map = new Map({
|
||||
var pos = fromLonLat([16.3725, 48.208889]);
|
||||
|
||||
// Vienna marker
|
||||
var marker = new _ol_Overlay_({
|
||||
var marker = new Overlay({
|
||||
position: pos,
|
||||
positioning: 'center-center',
|
||||
element: document.getElementById('marker'),
|
||||
@@ -32,14 +32,14 @@ var marker = new _ol_Overlay_({
|
||||
map.addOverlay(marker);
|
||||
|
||||
// Vienna label
|
||||
var vienna = new _ol_Overlay_({
|
||||
var vienna = new Overlay({
|
||||
position: pos,
|
||||
element: document.getElementById('vienna')
|
||||
});
|
||||
map.addOverlay(vienna);
|
||||
|
||||
// Popup showing the position the user clicked
|
||||
var popup = new _ol_Overlay_({
|
||||
var popup = new Overlay({
|
||||
element: document.getElementById('popup')
|
||||
});
|
||||
map.addOverlay(popup);
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
import Map from '../src/ol/Map.js';
|
||||
import View from '../src/ol/View.js';
|
||||
import {defaults as defaultInteractions} from '../src/ol/interaction.js';
|
||||
import _ol_interaction_PinchZoom_ from '../src/ol/interaction/PinchZoom.js';
|
||||
import PinchZoom from '../src/ol/interaction/PinchZoom.js';
|
||||
import TileLayer from '../src/ol/layer/Tile.js';
|
||||
import OSM from '../src/ol/source/OSM.js';
|
||||
|
||||
|
||||
var map = new Map({
|
||||
interactions: defaultInteractions({pinchZoom: false}).extend([
|
||||
new _ol_interaction_PinchZoom_({
|
||||
new PinchZoom({
|
||||
constrainResolution: true // force zooming to a integer zoom
|
||||
})
|
||||
]),
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import Map from '../src/ol/Map.js';
|
||||
import _ol_Overlay_ from '../src/ol/Overlay.js';
|
||||
import Overlay from '../src/ol/Overlay.js';
|
||||
import View from '../src/ol/View.js';
|
||||
import _ol_coordinate_ from '../src/ol/coordinate.js';
|
||||
import TileLayer from '../src/ol/layer/Tile.js';
|
||||
@@ -18,7 +18,7 @@ var closer = document.getElementById('popup-closer');
|
||||
/**
|
||||
* Create an overlay to anchor the popup to the map.
|
||||
*/
|
||||
var overlay = new _ol_Overlay_({
|
||||
var overlay = new Overlay({
|
||||
element: container,
|
||||
autoPan: true,
|
||||
autoPanAnimation: {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import Map from '../src/ol/Map.js';
|
||||
import _ol_Overlay_ from '../src/ol/Overlay.js';
|
||||
import Overlay from '../src/ol/Overlay.js';
|
||||
import View from '../src/ol/View.js';
|
||||
import TileLayer from '../src/ol/layer/Tile.js';
|
||||
import TileJSON from '../src/ol/source/TileJSON.js';
|
||||
@@ -36,7 +36,7 @@ var infoElement = document.getElementById('country-info');
|
||||
var flagElement = document.getElementById('country-flag');
|
||||
var nameElement = document.getElementById('country-name');
|
||||
|
||||
var infoOverlay = new _ol_Overlay_({
|
||||
var infoOverlay = new Overlay({
|
||||
element: infoElement,
|
||||
offset: [15, 15],
|
||||
stopEvent: false
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @module ol/Geolocation
|
||||
*/
|
||||
import {inherits} from './index.js';
|
||||
import _ol_GeolocationProperty_ from './GeolocationProperty.js';
|
||||
import GeolocationProperty from './GeolocationProperty.js';
|
||||
import BaseObject from './Object.js';
|
||||
import _ol_events_ from './events.js';
|
||||
import EventType from './events/EventType.js';
|
||||
@@ -79,10 +79,10 @@ var Geolocation = function(opt_options) {
|
||||
this.watchId_ = undefined;
|
||||
|
||||
_ol_events_.listen(
|
||||
this, BaseObject.getChangeEventType(_ol_GeolocationProperty_.PROJECTION),
|
||||
this, BaseObject.getChangeEventType(GeolocationProperty.PROJECTION),
|
||||
this.handleProjectionChanged_, this);
|
||||
_ol_events_.listen(
|
||||
this, BaseObject.getChangeEventType(_ol_GeolocationProperty_.TRACKING),
|
||||
this, BaseObject.getChangeEventType(GeolocationProperty.TRACKING),
|
||||
this.handleTrackingChanged_, this);
|
||||
|
||||
if (options.projection !== undefined) {
|
||||
@@ -117,8 +117,7 @@ Geolocation.prototype.handleProjectionChanged_ = function() {
|
||||
this.transform_ = getTransformFromProjections(
|
||||
getProjection('EPSG:4326'), projection);
|
||||
if (this.position_) {
|
||||
this.set(
|
||||
_ol_GeolocationProperty_.POSITION, this.transform_(this.position_));
|
||||
this.set(GeolocationProperty.POSITION, this.transform_(this.position_));
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -149,13 +148,13 @@ Geolocation.prototype.handleTrackingChanged_ = function() {
|
||||
*/
|
||||
Geolocation.prototype.positionChange_ = function(position) {
|
||||
var coords = position.coords;
|
||||
this.set(_ol_GeolocationProperty_.ACCURACY, coords.accuracy);
|
||||
this.set(_ol_GeolocationProperty_.ALTITUDE,
|
||||
this.set(GeolocationProperty.ACCURACY, coords.accuracy);
|
||||
this.set(GeolocationProperty.ALTITUDE,
|
||||
coords.altitude === null ? undefined : coords.altitude);
|
||||
this.set(_ol_GeolocationProperty_.ALTITUDE_ACCURACY,
|
||||
this.set(GeolocationProperty.ALTITUDE_ACCURACY,
|
||||
coords.altitudeAccuracy === null ?
|
||||
undefined : coords.altitudeAccuracy);
|
||||
this.set(_ol_GeolocationProperty_.HEADING, coords.heading === null ?
|
||||
this.set(GeolocationProperty.HEADING, coords.heading === null ?
|
||||
undefined : toRadians(coords.heading));
|
||||
if (!this.position_) {
|
||||
this.position_ = [coords.longitude, coords.latitude];
|
||||
@@ -164,12 +163,12 @@ Geolocation.prototype.positionChange_ = function(position) {
|
||||
this.position_[1] = coords.latitude;
|
||||
}
|
||||
var projectedPosition = this.transform_(this.position_);
|
||||
this.set(_ol_GeolocationProperty_.POSITION, projectedPosition);
|
||||
this.set(_ol_GeolocationProperty_.SPEED,
|
||||
this.set(GeolocationProperty.POSITION, projectedPosition);
|
||||
this.set(GeolocationProperty.SPEED,
|
||||
coords.speed === null ? undefined : coords.speed);
|
||||
var geometry = circularPolygon(this.position_, coords.accuracy);
|
||||
geometry.applyTransform(this.transform_);
|
||||
this.set(_ol_GeolocationProperty_.ACCURACY_GEOMETRY, geometry);
|
||||
this.set(GeolocationProperty.ACCURACY_GEOMETRY, geometry);
|
||||
this.changed();
|
||||
};
|
||||
|
||||
@@ -199,7 +198,7 @@ Geolocation.prototype.positionError_ = function(error) {
|
||||
*/
|
||||
Geolocation.prototype.getAccuracy = function() {
|
||||
return (
|
||||
/** @type {number|undefined} */ this.get(_ol_GeolocationProperty_.ACCURACY)
|
||||
/** @type {number|undefined} */ this.get(GeolocationProperty.ACCURACY)
|
||||
);
|
||||
};
|
||||
|
||||
@@ -212,7 +211,7 @@ Geolocation.prototype.getAccuracy = function() {
|
||||
*/
|
||||
Geolocation.prototype.getAccuracyGeometry = function() {
|
||||
return (
|
||||
/** @type {?ol.geom.Polygon} */ this.get(_ol_GeolocationProperty_.ACCURACY_GEOMETRY) || null
|
||||
/** @type {?ol.geom.Polygon} */ this.get(GeolocationProperty.ACCURACY_GEOMETRY) || null
|
||||
);
|
||||
};
|
||||
|
||||
@@ -226,7 +225,7 @@ Geolocation.prototype.getAccuracyGeometry = function() {
|
||||
*/
|
||||
Geolocation.prototype.getAltitude = function() {
|
||||
return (
|
||||
/** @type {number|undefined} */ this.get(_ol_GeolocationProperty_.ALTITUDE)
|
||||
/** @type {number|undefined} */ this.get(GeolocationProperty.ALTITUDE)
|
||||
);
|
||||
};
|
||||
|
||||
@@ -240,7 +239,7 @@ Geolocation.prototype.getAltitude = function() {
|
||||
*/
|
||||
Geolocation.prototype.getAltitudeAccuracy = function() {
|
||||
return (
|
||||
/** @type {number|undefined} */ this.get(_ol_GeolocationProperty_.ALTITUDE_ACCURACY)
|
||||
/** @type {number|undefined} */ this.get(GeolocationProperty.ALTITUDE_ACCURACY)
|
||||
);
|
||||
};
|
||||
|
||||
@@ -253,7 +252,7 @@ Geolocation.prototype.getAltitudeAccuracy = function() {
|
||||
*/
|
||||
Geolocation.prototype.getHeading = function() {
|
||||
return (
|
||||
/** @type {number|undefined} */ this.get(_ol_GeolocationProperty_.HEADING)
|
||||
/** @type {number|undefined} */ this.get(GeolocationProperty.HEADING)
|
||||
);
|
||||
};
|
||||
|
||||
@@ -267,7 +266,7 @@ Geolocation.prototype.getHeading = function() {
|
||||
*/
|
||||
Geolocation.prototype.getPosition = function() {
|
||||
return (
|
||||
/** @type {ol.Coordinate|undefined} */ this.get(_ol_GeolocationProperty_.POSITION)
|
||||
/** @type {ol.Coordinate|undefined} */ this.get(GeolocationProperty.POSITION)
|
||||
);
|
||||
};
|
||||
|
||||
@@ -281,7 +280,7 @@ Geolocation.prototype.getPosition = function() {
|
||||
*/
|
||||
Geolocation.prototype.getProjection = function() {
|
||||
return (
|
||||
/** @type {ol.proj.Projection|undefined} */ this.get(_ol_GeolocationProperty_.PROJECTION)
|
||||
/** @type {ol.proj.Projection|undefined} */ this.get(GeolocationProperty.PROJECTION)
|
||||
);
|
||||
};
|
||||
|
||||
@@ -295,7 +294,7 @@ Geolocation.prototype.getProjection = function() {
|
||||
*/
|
||||
Geolocation.prototype.getSpeed = function() {
|
||||
return (
|
||||
/** @type {number|undefined} */ this.get(_ol_GeolocationProperty_.SPEED)
|
||||
/** @type {number|undefined} */ this.get(GeolocationProperty.SPEED)
|
||||
);
|
||||
};
|
||||
|
||||
@@ -308,7 +307,7 @@ Geolocation.prototype.getSpeed = function() {
|
||||
*/
|
||||
Geolocation.prototype.getTracking = function() {
|
||||
return (
|
||||
/** @type {boolean} */ this.get(_ol_GeolocationProperty_.TRACKING)
|
||||
/** @type {boolean} */ this.get(GeolocationProperty.TRACKING)
|
||||
);
|
||||
};
|
||||
|
||||
@@ -324,7 +323,7 @@ Geolocation.prototype.getTracking = function() {
|
||||
*/
|
||||
Geolocation.prototype.getTrackingOptions = function() {
|
||||
return (
|
||||
/** @type {GeolocationPositionOptions|undefined} */ this.get(_ol_GeolocationProperty_.TRACKING_OPTIONS)
|
||||
/** @type {GeolocationPositionOptions|undefined} */ this.get(GeolocationProperty.TRACKING_OPTIONS)
|
||||
);
|
||||
};
|
||||
|
||||
@@ -337,7 +336,7 @@ Geolocation.prototype.getTrackingOptions = function() {
|
||||
* @api
|
||||
*/
|
||||
Geolocation.prototype.setProjection = function(projection) {
|
||||
this.set(_ol_GeolocationProperty_.PROJECTION, getProjection(projection));
|
||||
this.set(GeolocationProperty.PROJECTION, getProjection(projection));
|
||||
};
|
||||
|
||||
|
||||
@@ -348,7 +347,7 @@ Geolocation.prototype.setProjection = function(projection) {
|
||||
* @api
|
||||
*/
|
||||
Geolocation.prototype.setTracking = function(tracking) {
|
||||
this.set(_ol_GeolocationProperty_.TRACKING, tracking);
|
||||
this.set(GeolocationProperty.TRACKING, tracking);
|
||||
};
|
||||
|
||||
|
||||
@@ -362,6 +361,6 @@ Geolocation.prototype.setTracking = function(tracking) {
|
||||
* @api
|
||||
*/
|
||||
Geolocation.prototype.setTrackingOptions = function(options) {
|
||||
this.set(_ol_GeolocationProperty_.TRACKING_OPTIONS, options);
|
||||
this.set(GeolocationProperty.TRACKING_OPTIONS, options);
|
||||
};
|
||||
export default Geolocation;
|
||||
|
||||
@@ -9,7 +9,7 @@ import MapBrowserEventHandler from './MapBrowserEventHandler.js';
|
||||
import MapBrowserEventType from './MapBrowserEventType.js';
|
||||
import MapEvent from './MapEvent.js';
|
||||
import MapEventType from './MapEventType.js';
|
||||
import _ol_MapProperty_ from './MapProperty.js';
|
||||
import MapProperty from './MapProperty.js';
|
||||
import BaseObject from './Object.js';
|
||||
import ObjectEventType from './ObjectEventType.js';
|
||||
import TileQueue from './TileQueue.js';
|
||||
@@ -337,13 +337,13 @@ var PluggableMap = function(options) {
|
||||
this.skippedFeatureUids_ = {};
|
||||
|
||||
_ol_events_.listen(
|
||||
this, BaseObject.getChangeEventType(_ol_MapProperty_.LAYERGROUP),
|
||||
this, BaseObject.getChangeEventType(MapProperty.LAYERGROUP),
|
||||
this.handleLayerGroupChanged_, this);
|
||||
_ol_events_.listen(this, BaseObject.getChangeEventType(_ol_MapProperty_.VIEW),
|
||||
_ol_events_.listen(this, BaseObject.getChangeEventType(MapProperty.VIEW),
|
||||
this.handleViewChanged_, this);
|
||||
_ol_events_.listen(this, BaseObject.getChangeEventType(_ol_MapProperty_.SIZE),
|
||||
_ol_events_.listen(this, BaseObject.getChangeEventType(MapProperty.SIZE),
|
||||
this.handleSizeChanged_, this);
|
||||
_ol_events_.listen(this, BaseObject.getChangeEventType(_ol_MapProperty_.TARGET),
|
||||
_ol_events_.listen(this, BaseObject.getChangeEventType(MapProperty.TARGET),
|
||||
this.handleTargetChanged_, this);
|
||||
|
||||
// setProperties will trigger the rendering of the map if the map
|
||||
@@ -661,7 +661,7 @@ PluggableMap.prototype.getEventPixel = function(event) {
|
||||
*/
|
||||
PluggableMap.prototype.getTarget = function() {
|
||||
return (
|
||||
/** @type {Element|string|undefined} */ this.get(_ol_MapProperty_.TARGET)
|
||||
/** @type {Element|string|undefined} */ this.get(MapProperty.TARGET)
|
||||
);
|
||||
};
|
||||
|
||||
@@ -759,7 +759,7 @@ PluggableMap.prototype.getInteractions = function() {
|
||||
*/
|
||||
PluggableMap.prototype.getLayerGroup = function() {
|
||||
return (
|
||||
/** @type {ol.layer.Group} */ this.get(_ol_MapProperty_.LAYERGROUP)
|
||||
/** @type {ol.layer.Group} */ this.get(MapProperty.LAYERGROUP)
|
||||
);
|
||||
};
|
||||
|
||||
@@ -810,7 +810,7 @@ PluggableMap.prototype.getRenderer = function() {
|
||||
*/
|
||||
PluggableMap.prototype.getSize = function() {
|
||||
return (
|
||||
/** @type {ol.Size|undefined} */ this.get(_ol_MapProperty_.SIZE)
|
||||
/** @type {ol.Size|undefined} */ this.get(MapProperty.SIZE)
|
||||
);
|
||||
};
|
||||
|
||||
@@ -824,7 +824,7 @@ PluggableMap.prototype.getSize = function() {
|
||||
*/
|
||||
PluggableMap.prototype.getView = function() {
|
||||
return (
|
||||
/** @type {ol.View} */ this.get(_ol_MapProperty_.VIEW)
|
||||
/** @type {ol.View} */ this.get(MapProperty.VIEW)
|
||||
);
|
||||
};
|
||||
|
||||
@@ -1287,7 +1287,7 @@ PluggableMap.prototype.renderFrame_ = function(time) {
|
||||
* @api
|
||||
*/
|
||||
PluggableMap.prototype.setLayerGroup = function(layerGroup) {
|
||||
this.set(_ol_MapProperty_.LAYERGROUP, layerGroup);
|
||||
this.set(MapProperty.LAYERGROUP, layerGroup);
|
||||
};
|
||||
|
||||
|
||||
@@ -1298,7 +1298,7 @@ PluggableMap.prototype.setLayerGroup = function(layerGroup) {
|
||||
* @api
|
||||
*/
|
||||
PluggableMap.prototype.setSize = function(size) {
|
||||
this.set(_ol_MapProperty_.SIZE, size);
|
||||
this.set(MapProperty.SIZE, size);
|
||||
};
|
||||
|
||||
|
||||
@@ -1310,7 +1310,7 @@ PluggableMap.prototype.setSize = function(size) {
|
||||
* @api
|
||||
*/
|
||||
PluggableMap.prototype.setTarget = function(target) {
|
||||
this.set(_ol_MapProperty_.TARGET, target);
|
||||
this.set(MapProperty.TARGET, target);
|
||||
};
|
||||
|
||||
|
||||
@@ -1321,7 +1321,7 @@ PluggableMap.prototype.setTarget = function(target) {
|
||||
* @api
|
||||
*/
|
||||
PluggableMap.prototype.setView = function(view) {
|
||||
this.set(_ol_MapProperty_.VIEW, view);
|
||||
this.set(MapProperty.VIEW, view);
|
||||
};
|
||||
|
||||
|
||||
@@ -1406,11 +1406,11 @@ function createOptionsInternal(options) {
|
||||
|
||||
var layerGroup = (options.layers instanceof _ol_layer_Group_) ?
|
||||
options.layers : new _ol_layer_Group_({layers: options.layers});
|
||||
values[_ol_MapProperty_.LAYERGROUP] = layerGroup;
|
||||
values[MapProperty.LAYERGROUP] = layerGroup;
|
||||
|
||||
values[_ol_MapProperty_.TARGET] = options.target;
|
||||
values[MapProperty.TARGET] = options.target;
|
||||
|
||||
values[_ol_MapProperty_.VIEW] = options.view !== undefined ?
|
||||
values[MapProperty.VIEW] = options.view !== undefined ?
|
||||
options.view : new View();
|
||||
|
||||
/**
|
||||
|
||||
@@ -5,7 +5,7 @@ import {inherits} from '../index.js';
|
||||
import _ol_Collection_ from '../Collection.js';
|
||||
import PluggableMap from '../PluggableMap.js';
|
||||
import MapEventType from '../MapEventType.js';
|
||||
import _ol_MapProperty_ from '../MapProperty.js';
|
||||
import MapProperty from '../MapProperty.js';
|
||||
import BaseObject from '../Object.js';
|
||||
import ObjectEventType from '../ObjectEventType.js';
|
||||
import Overlay from '../Overlay.js';
|
||||
@@ -252,7 +252,7 @@ OverviewMap.prototype.setMap = function(map) {
|
||||
* @private
|
||||
*/
|
||||
OverviewMap.prototype.handleMapPropertyChange_ = function(event) {
|
||||
if (event.key === _ol_MapProperty_.VIEW) {
|
||||
if (event.key === MapProperty.VIEW) {
|
||||
var oldView = /** @type {ol.View} */ (event.oldValue);
|
||||
if (oldView) {
|
||||
this.unbindView_(oldView);
|
||||
|
||||
@@ -7,11 +7,11 @@ import DoubleClickZoom from './interaction/DoubleClickZoom.js';
|
||||
import DragPan from './interaction/DragPan.js';
|
||||
import DragRotate from './interaction/DragRotate.js';
|
||||
import DragZoom from './interaction/DragZoom.js';
|
||||
import _ol_interaction_KeyboardPan_ from './interaction/KeyboardPan.js';
|
||||
import _ol_interaction_KeyboardZoom_ from './interaction/KeyboardZoom.js';
|
||||
import KeyboardPan from './interaction/KeyboardPan.js';
|
||||
import KeyboardZoom from './interaction/KeyboardZoom.js';
|
||||
import MouseWheelZoom from './interaction/MouseWheelZoom.js';
|
||||
import _ol_interaction_PinchRotate_ from './interaction/PinchRotate.js';
|
||||
import _ol_interaction_PinchZoom_ from './interaction/PinchZoom.js';
|
||||
import PinchRotate from './interaction/PinchRotate.js';
|
||||
import PinchZoom from './interaction/PinchZoom.js';
|
||||
|
||||
|
||||
/**
|
||||
@@ -70,12 +70,12 @@ export function defaults(opt_options) {
|
||||
var pinchRotate = options.pinchRotate !== undefined ? options.pinchRotate :
|
||||
true;
|
||||
if (pinchRotate) {
|
||||
interactions.push(new _ol_interaction_PinchRotate_());
|
||||
interactions.push(new PinchRotate());
|
||||
}
|
||||
|
||||
var pinchZoom = options.pinchZoom !== undefined ? options.pinchZoom : true;
|
||||
if (pinchZoom) {
|
||||
interactions.push(new _ol_interaction_PinchZoom_({
|
||||
interactions.push(new PinchZoom({
|
||||
constrainResolution: options.constrainResolution,
|
||||
duration: options.zoomDuration
|
||||
}));
|
||||
@@ -83,8 +83,8 @@ export function defaults(opt_options) {
|
||||
|
||||
var keyboard = options.keyboard !== undefined ? options.keyboard : true;
|
||||
if (keyboard) {
|
||||
interactions.push(new _ol_interaction_KeyboardPan_());
|
||||
interactions.push(new _ol_interaction_KeyboardZoom_({
|
||||
interactions.push(new KeyboardPan());
|
||||
interactions.push(new KeyboardZoom({
|
||||
delta: options.zoomDelta,
|
||||
duration: options.zoomDuration
|
||||
}));
|
||||
|
||||
@@ -21,7 +21,7 @@ import Point from '../geom/Point.js';
|
||||
import Polygon, {fromCircle, makeRegular} from '../geom/Polygon.js';
|
||||
import DrawEventType from '../interaction/DrawEventType.js';
|
||||
import _ol_interaction_Pointer_ from '../interaction/Pointer.js';
|
||||
import _ol_interaction_Property_ from '../interaction/Property.js';
|
||||
import InteractionProperty from '../interaction/Property.js';
|
||||
import VectorLayer from '../layer/Vector.js';
|
||||
import VectorSource from '../source/Vector.js';
|
||||
import _ol_style_Style_ from '../style/Style.js';
|
||||
@@ -285,7 +285,7 @@ var Draw = function(options) {
|
||||
}
|
||||
|
||||
_ol_events_.listen(this,
|
||||
BaseObject.getChangeEventType(_ol_interaction_Property_.ACTIVE),
|
||||
BaseObject.getChangeEventType(InteractionProperty.ACTIVE),
|
||||
this.updateState_, this);
|
||||
|
||||
};
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
import {inherits} from '../index.js';
|
||||
import BaseObject from '../Object.js';
|
||||
import {easeOut, linear} from '../easing.js';
|
||||
import _ol_interaction_Property_ from '../interaction/Property.js';
|
||||
import InteractionProperty from '../interaction/Property.js';
|
||||
import {clamp} from '../math.js';
|
||||
|
||||
|
||||
@@ -67,9 +67,7 @@ inherits(Interaction, BaseObject);
|
||||
* @api
|
||||
*/
|
||||
Interaction.prototype.getActive = function() {
|
||||
return (
|
||||
/** @type {boolean} */ this.get(_ol_interaction_Property_.ACTIVE)
|
||||
);
|
||||
return (/** @type {boolean} */ this.get(InteractionProperty.ACTIVE));
|
||||
};
|
||||
|
||||
|
||||
@@ -90,7 +88,7 @@ Interaction.prototype.getMap = function() {
|
||||
* @api
|
||||
*/
|
||||
Interaction.prototype.setActive = function(active) {
|
||||
this.set(_ol_interaction_Property_.ACTIVE, active);
|
||||
this.set(InteractionProperty.ACTIVE, active);
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -25,10 +25,10 @@ import Interaction from '../interaction/Interaction.js';
|
||||
* @param {olx.interaction.KeyboardPanOptions=} opt_options Options.
|
||||
* @api
|
||||
*/
|
||||
var _ol_interaction_KeyboardPan_ = function(opt_options) {
|
||||
var KeyboardPan = function(opt_options) {
|
||||
|
||||
Interaction.call(this, {
|
||||
handleEvent: _ol_interaction_KeyboardPan_.handleEvent
|
||||
handleEvent: KeyboardPan.handleEvent
|
||||
});
|
||||
|
||||
var options = opt_options || {};
|
||||
@@ -65,7 +65,7 @@ var _ol_interaction_KeyboardPan_ = function(opt_options) {
|
||||
|
||||
};
|
||||
|
||||
inherits(_ol_interaction_KeyboardPan_, Interaction);
|
||||
inherits(KeyboardPan, Interaction);
|
||||
|
||||
/**
|
||||
* Handles the {@link ol.MapBrowserEvent map browser event} if it was a
|
||||
@@ -76,7 +76,7 @@ inherits(_ol_interaction_KeyboardPan_, Interaction);
|
||||
* @this {ol.interaction.KeyboardPan}
|
||||
* @api
|
||||
*/
|
||||
_ol_interaction_KeyboardPan_.handleEvent = function(mapBrowserEvent) {
|
||||
KeyboardPan.handleEvent = function(mapBrowserEvent) {
|
||||
var stopEvent = false;
|
||||
if (mapBrowserEvent.type == EventType.KEYDOWN) {
|
||||
var keyEvent = mapBrowserEvent.originalEvent;
|
||||
@@ -108,4 +108,4 @@ _ol_interaction_KeyboardPan_.handleEvent = function(mapBrowserEvent) {
|
||||
}
|
||||
return !stopEvent;
|
||||
};
|
||||
export default _ol_interaction_KeyboardPan_;
|
||||
export default KeyboardPan;
|
||||
|
||||
@@ -23,10 +23,10 @@ import Interaction from '../interaction/Interaction.js';
|
||||
* @extends {ol.interaction.Interaction}
|
||||
* @api
|
||||
*/
|
||||
var _ol_interaction_KeyboardZoom_ = function(opt_options) {
|
||||
var KeyboardZoom = function(opt_options) {
|
||||
|
||||
Interaction.call(this, {
|
||||
handleEvent: _ol_interaction_KeyboardZoom_.handleEvent
|
||||
handleEvent: KeyboardZoom.handleEvent
|
||||
});
|
||||
|
||||
var options = opt_options ? opt_options : {};
|
||||
@@ -52,7 +52,7 @@ var _ol_interaction_KeyboardZoom_ = function(opt_options) {
|
||||
|
||||
};
|
||||
|
||||
inherits(_ol_interaction_KeyboardZoom_, Interaction);
|
||||
inherits(KeyboardZoom, Interaction);
|
||||
|
||||
|
||||
/**
|
||||
@@ -64,7 +64,7 @@ inherits(_ol_interaction_KeyboardZoom_, Interaction);
|
||||
* @this {ol.interaction.KeyboardZoom}
|
||||
* @api
|
||||
*/
|
||||
_ol_interaction_KeyboardZoom_.handleEvent = function(mapBrowserEvent) {
|
||||
KeyboardZoom.handleEvent = function(mapBrowserEvent) {
|
||||
var stopEvent = false;
|
||||
if (mapBrowserEvent.type == EventType.KEYDOWN ||
|
||||
mapBrowserEvent.type == EventType.KEYPRESS) {
|
||||
@@ -83,4 +83,4 @@ _ol_interaction_KeyboardZoom_.handleEvent = function(mapBrowserEvent) {
|
||||
}
|
||||
return !stopEvent;
|
||||
};
|
||||
export default _ol_interaction_KeyboardZoom_;
|
||||
export default KeyboardZoom;
|
||||
|
||||
@@ -18,12 +18,12 @@ import RotationConstraint from '../RotationConstraint.js';
|
||||
* @param {olx.interaction.PinchRotateOptions=} opt_options Options.
|
||||
* @api
|
||||
*/
|
||||
var _ol_interaction_PinchRotate_ = function(opt_options) {
|
||||
var PinchRotate = function(opt_options) {
|
||||
|
||||
_ol_interaction_Pointer_.call(this, {
|
||||
handleDownEvent: _ol_interaction_PinchRotate_.handleDownEvent_,
|
||||
handleDragEvent: _ol_interaction_PinchRotate_.handleDragEvent_,
|
||||
handleUpEvent: _ol_interaction_PinchRotate_.handleUpEvent_
|
||||
handleDownEvent: PinchRotate.handleDownEvent_,
|
||||
handleDragEvent: PinchRotate.handleDragEvent_,
|
||||
handleUpEvent: PinchRotate.handleUpEvent_
|
||||
});
|
||||
|
||||
var options = opt_options || {};
|
||||
@@ -66,7 +66,7 @@ var _ol_interaction_PinchRotate_ = function(opt_options) {
|
||||
|
||||
};
|
||||
|
||||
inherits(_ol_interaction_PinchRotate_, _ol_interaction_Pointer_);
|
||||
inherits(PinchRotate, _ol_interaction_Pointer_);
|
||||
|
||||
|
||||
/**
|
||||
@@ -74,7 +74,7 @@ inherits(_ol_interaction_PinchRotate_, _ol_interaction_Pointer_);
|
||||
* @this {ol.interaction.PinchRotate}
|
||||
* @private
|
||||
*/
|
||||
_ol_interaction_PinchRotate_.handleDragEvent_ = function(mapBrowserEvent) {
|
||||
PinchRotate.handleDragEvent_ = function(mapBrowserEvent) {
|
||||
var rotationDelta = 0.0;
|
||||
|
||||
var touch0 = this.targetPointers[0];
|
||||
@@ -127,7 +127,7 @@ _ol_interaction_PinchRotate_.handleDragEvent_ = function(mapBrowserEvent) {
|
||||
* @this {ol.interaction.PinchRotate}
|
||||
* @private
|
||||
*/
|
||||
_ol_interaction_PinchRotate_.handleUpEvent_ = function(mapBrowserEvent) {
|
||||
PinchRotate.handleUpEvent_ = function(mapBrowserEvent) {
|
||||
if (this.targetPointers.length < 2) {
|
||||
var map = mapBrowserEvent.map;
|
||||
var view = map.getView();
|
||||
@@ -150,7 +150,7 @@ _ol_interaction_PinchRotate_.handleUpEvent_ = function(mapBrowserEvent) {
|
||||
* @this {ol.interaction.PinchRotate}
|
||||
* @private
|
||||
*/
|
||||
_ol_interaction_PinchRotate_.handleDownEvent_ = function(mapBrowserEvent) {
|
||||
PinchRotate.handleDownEvent_ = function(mapBrowserEvent) {
|
||||
if (this.targetPointers.length >= 2) {
|
||||
var map = mapBrowserEvent.map;
|
||||
this.anchor_ = null;
|
||||
@@ -170,5 +170,5 @@ _ol_interaction_PinchRotate_.handleDownEvent_ = function(mapBrowserEvent) {
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
_ol_interaction_PinchRotate_.prototype.shouldStopEvent = FALSE;
|
||||
export default _ol_interaction_PinchRotate_;
|
||||
PinchRotate.prototype.shouldStopEvent = FALSE;
|
||||
export default PinchRotate;
|
||||
|
||||
@@ -17,12 +17,12 @@ import _ol_interaction_Pointer_ from '../interaction/Pointer.js';
|
||||
* @param {olx.interaction.PinchZoomOptions=} opt_options Options.
|
||||
* @api
|
||||
*/
|
||||
var _ol_interaction_PinchZoom_ = function(opt_options) {
|
||||
var PinchZoom = function(opt_options) {
|
||||
|
||||
_ol_interaction_Pointer_.call(this, {
|
||||
handleDownEvent: _ol_interaction_PinchZoom_.handleDownEvent_,
|
||||
handleDragEvent: _ol_interaction_PinchZoom_.handleDragEvent_,
|
||||
handleUpEvent: _ol_interaction_PinchZoom_.handleUpEvent_
|
||||
handleDownEvent: PinchZoom.handleDownEvent_,
|
||||
handleDragEvent: PinchZoom.handleDragEvent_,
|
||||
handleUpEvent: PinchZoom.handleUpEvent_
|
||||
});
|
||||
|
||||
var options = opt_options ? opt_options : {};
|
||||
@@ -59,7 +59,7 @@ var _ol_interaction_PinchZoom_ = function(opt_options) {
|
||||
|
||||
};
|
||||
|
||||
inherits(_ol_interaction_PinchZoom_, _ol_interaction_Pointer_);
|
||||
inherits(PinchZoom, _ol_interaction_Pointer_);
|
||||
|
||||
|
||||
/**
|
||||
@@ -67,7 +67,7 @@ inherits(_ol_interaction_PinchZoom_, _ol_interaction_Pointer_);
|
||||
* @this {ol.interaction.PinchZoom}
|
||||
* @private
|
||||
*/
|
||||
_ol_interaction_PinchZoom_.handleDragEvent_ = function(mapBrowserEvent) {
|
||||
PinchZoom.handleDragEvent_ = function(mapBrowserEvent) {
|
||||
var scaleDelta = 1.0;
|
||||
|
||||
var touch0 = this.targetPointers[0];
|
||||
@@ -121,7 +121,7 @@ _ol_interaction_PinchZoom_.handleDragEvent_ = function(mapBrowserEvent) {
|
||||
* @this {ol.interaction.PinchZoom}
|
||||
* @private
|
||||
*/
|
||||
_ol_interaction_PinchZoom_.handleUpEvent_ = function(mapBrowserEvent) {
|
||||
PinchZoom.handleUpEvent_ = function(mapBrowserEvent) {
|
||||
if (this.targetPointers.length < 2) {
|
||||
var map = mapBrowserEvent.map;
|
||||
var view = map.getView();
|
||||
@@ -150,7 +150,7 @@ _ol_interaction_PinchZoom_.handleUpEvent_ = function(mapBrowserEvent) {
|
||||
* @this {ol.interaction.PinchZoom}
|
||||
* @private
|
||||
*/
|
||||
_ol_interaction_PinchZoom_.handleDownEvent_ = function(mapBrowserEvent) {
|
||||
PinchZoom.handleDownEvent_ = function(mapBrowserEvent) {
|
||||
if (this.targetPointers.length >= 2) {
|
||||
var map = mapBrowserEvent.map;
|
||||
this.anchor_ = null;
|
||||
@@ -169,5 +169,5 @@ _ol_interaction_PinchZoom_.handleDownEvent_ = function(mapBrowserEvent) {
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
_ol_interaction_PinchZoom_.prototype.shouldStopEvent = FALSE;
|
||||
export default _ol_interaction_PinchZoom_;
|
||||
PinchZoom.prototype.shouldStopEvent = FALSE;
|
||||
export default PinchZoom;
|
||||
|
||||
@@ -9,7 +9,7 @@ import Event from '../events/Event.js';
|
||||
import {TRUE} from '../functions.js';
|
||||
import {includes} from '../array.js';
|
||||
import _ol_interaction_Pointer_ from '../interaction/Pointer.js';
|
||||
import _ol_interaction_Property_ from '../interaction/Property.js';
|
||||
import InteractionProperty from '../interaction/Property.js';
|
||||
import _ol_interaction_TranslateEventType_ from '../interaction/TranslateEventType.js';
|
||||
|
||||
/**
|
||||
@@ -80,7 +80,7 @@ var _ol_interaction_Translate_ = function(opt_options) {
|
||||
this.lastFeature_ = null;
|
||||
|
||||
_ol_events_.listen(this,
|
||||
BaseObject.getChangeEventType(_ol_interaction_Property_.ACTIVE),
|
||||
BaseObject.getChangeEventType(InteractionProperty.ACTIVE),
|
||||
this.handleActiveChanged_, this);
|
||||
|
||||
};
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*/
|
||||
import {inherits} from '../index.js';
|
||||
import BaseObject from '../Object.js';
|
||||
import _ol_layer_Property_ from '../layer/Property.js';
|
||||
import LayerProperty from '../layer/Property.js';
|
||||
import {clamp} from '../math.js';
|
||||
import _ol_obj_ from '../obj.js';
|
||||
|
||||
@@ -29,15 +29,15 @@ var _ol_layer_Base_ = function(options) {
|
||||
* @type {Object.<string, *>}
|
||||
*/
|
||||
var properties = _ol_obj_.assign({}, options);
|
||||
properties[_ol_layer_Property_.OPACITY] =
|
||||
properties[LayerProperty.OPACITY] =
|
||||
options.opacity !== undefined ? options.opacity : 1;
|
||||
properties[_ol_layer_Property_.VISIBLE] =
|
||||
properties[LayerProperty.VISIBLE] =
|
||||
options.visible !== undefined ? options.visible : true;
|
||||
properties[_ol_layer_Property_.Z_INDEX] =
|
||||
properties[LayerProperty.Z_INDEX] =
|
||||
options.zIndex !== undefined ? options.zIndex : 0;
|
||||
properties[_ol_layer_Property_.MAX_RESOLUTION] =
|
||||
properties[LayerProperty.MAX_RESOLUTION] =
|
||||
options.maxResolution !== undefined ? options.maxResolution : Infinity;
|
||||
properties[_ol_layer_Property_.MIN_RESOLUTION] =
|
||||
properties[LayerProperty.MIN_RESOLUTION] =
|
||||
options.minResolution !== undefined ? options.minResolution : 0;
|
||||
|
||||
this.setProperties(properties);
|
||||
@@ -115,7 +115,7 @@ _ol_layer_Base_.prototype.getLayerStatesArray = function(opt_states) {};
|
||||
*/
|
||||
_ol_layer_Base_.prototype.getExtent = function() {
|
||||
return (
|
||||
/** @type {ol.Extent|undefined} */ this.get(_ol_layer_Property_.EXTENT)
|
||||
/** @type {ol.Extent|undefined} */ this.get(LayerProperty.EXTENT)
|
||||
);
|
||||
};
|
||||
|
||||
@@ -128,7 +128,7 @@ _ol_layer_Base_.prototype.getExtent = function() {
|
||||
*/
|
||||
_ol_layer_Base_.prototype.getMaxResolution = function() {
|
||||
return (
|
||||
/** @type {number} */ this.get(_ol_layer_Property_.MAX_RESOLUTION)
|
||||
/** @type {number} */ this.get(LayerProperty.MAX_RESOLUTION)
|
||||
);
|
||||
};
|
||||
|
||||
@@ -141,7 +141,7 @@ _ol_layer_Base_.prototype.getMaxResolution = function() {
|
||||
*/
|
||||
_ol_layer_Base_.prototype.getMinResolution = function() {
|
||||
return (
|
||||
/** @type {number} */ this.get(_ol_layer_Property_.MIN_RESOLUTION)
|
||||
/** @type {number} */ this.get(LayerProperty.MIN_RESOLUTION)
|
||||
);
|
||||
};
|
||||
|
||||
@@ -154,7 +154,7 @@ _ol_layer_Base_.prototype.getMinResolution = function() {
|
||||
*/
|
||||
_ol_layer_Base_.prototype.getOpacity = function() {
|
||||
return (
|
||||
/** @type {number} */ this.get(_ol_layer_Property_.OPACITY)
|
||||
/** @type {number} */ this.get(LayerProperty.OPACITY)
|
||||
);
|
||||
};
|
||||
|
||||
@@ -174,7 +174,7 @@ _ol_layer_Base_.prototype.getSourceState = function() {};
|
||||
*/
|
||||
_ol_layer_Base_.prototype.getVisible = function() {
|
||||
return (
|
||||
/** @type {boolean} */ this.get(_ol_layer_Property_.VISIBLE)
|
||||
/** @type {boolean} */ this.get(LayerProperty.VISIBLE)
|
||||
);
|
||||
};
|
||||
|
||||
@@ -188,7 +188,7 @@ _ol_layer_Base_.prototype.getVisible = function() {
|
||||
*/
|
||||
_ol_layer_Base_.prototype.getZIndex = function() {
|
||||
return (
|
||||
/** @type {number} */ this.get(_ol_layer_Property_.Z_INDEX)
|
||||
/** @type {number} */ this.get(LayerProperty.Z_INDEX)
|
||||
);
|
||||
};
|
||||
|
||||
@@ -201,7 +201,7 @@ _ol_layer_Base_.prototype.getZIndex = function() {
|
||||
* @api
|
||||
*/
|
||||
_ol_layer_Base_.prototype.setExtent = function(extent) {
|
||||
this.set(_ol_layer_Property_.EXTENT, extent);
|
||||
this.set(LayerProperty.EXTENT, extent);
|
||||
};
|
||||
|
||||
|
||||
@@ -212,7 +212,7 @@ _ol_layer_Base_.prototype.setExtent = function(extent) {
|
||||
* @api
|
||||
*/
|
||||
_ol_layer_Base_.prototype.setMaxResolution = function(maxResolution) {
|
||||
this.set(_ol_layer_Property_.MAX_RESOLUTION, maxResolution);
|
||||
this.set(LayerProperty.MAX_RESOLUTION, maxResolution);
|
||||
};
|
||||
|
||||
|
||||
@@ -223,7 +223,7 @@ _ol_layer_Base_.prototype.setMaxResolution = function(maxResolution) {
|
||||
* @api
|
||||
*/
|
||||
_ol_layer_Base_.prototype.setMinResolution = function(minResolution) {
|
||||
this.set(_ol_layer_Property_.MIN_RESOLUTION, minResolution);
|
||||
this.set(LayerProperty.MIN_RESOLUTION, minResolution);
|
||||
};
|
||||
|
||||
|
||||
@@ -234,7 +234,7 @@ _ol_layer_Base_.prototype.setMinResolution = function(minResolution) {
|
||||
* @api
|
||||
*/
|
||||
_ol_layer_Base_.prototype.setOpacity = function(opacity) {
|
||||
this.set(_ol_layer_Property_.OPACITY, opacity);
|
||||
this.set(LayerProperty.OPACITY, opacity);
|
||||
};
|
||||
|
||||
|
||||
@@ -245,7 +245,7 @@ _ol_layer_Base_.prototype.setOpacity = function(opacity) {
|
||||
* @api
|
||||
*/
|
||||
_ol_layer_Base_.prototype.setVisible = function(visible) {
|
||||
this.set(_ol_layer_Property_.VISIBLE, visible);
|
||||
this.set(LayerProperty.VISIBLE, visible);
|
||||
};
|
||||
|
||||
|
||||
@@ -257,6 +257,6 @@ _ol_layer_Base_.prototype.setVisible = function(visible) {
|
||||
* @api
|
||||
*/
|
||||
_ol_layer_Base_.prototype.setZIndex = function(zindex) {
|
||||
this.set(_ol_layer_Property_.Z_INDEX, zindex);
|
||||
this.set(LayerProperty.Z_INDEX, zindex);
|
||||
};
|
||||
export default _ol_layer_Base_;
|
||||
|
||||
@@ -6,7 +6,7 @@ import EventType from '../events/EventType.js';
|
||||
import {getUid, inherits} from '../index.js';
|
||||
import BaseObject from '../Object.js';
|
||||
import _ol_layer_Base_ from '../layer/Base.js';
|
||||
import _ol_layer_Property_ from '../layer/Property.js';
|
||||
import LayerProperty from '../layer/Property.js';
|
||||
import _ol_obj_ from '../obj.js';
|
||||
import RenderEventType from '../render/EventType.js';
|
||||
import SourceState from '../source/State.js';
|
||||
@@ -63,7 +63,7 @@ var _ol_layer_Layer_ = function(options) {
|
||||
}
|
||||
|
||||
_ol_events_.listen(this,
|
||||
BaseObject.getChangeEventType(_ol_layer_Property_.SOURCE),
|
||||
BaseObject.getChangeEventType(LayerProperty.SOURCE),
|
||||
this.handleSourcePropertyChange_, this);
|
||||
|
||||
var source = options.source ? options.source : null;
|
||||
@@ -114,7 +114,7 @@ _ol_layer_Layer_.prototype.getLayerStatesArray = function(opt_states) {
|
||||
* @api
|
||||
*/
|
||||
_ol_layer_Layer_.prototype.getSource = function() {
|
||||
var source = this.get(_ol_layer_Property_.SOURCE);
|
||||
var source = this.get(LayerProperty.SOURCE);
|
||||
return /** @type {ol.source.Source} */ (source) || null;
|
||||
};
|
||||
|
||||
@@ -200,6 +200,6 @@ _ol_layer_Layer_.prototype.setMap = function(map) {
|
||||
* @api
|
||||
*/
|
||||
_ol_layer_Layer_.prototype.setSource = function(source) {
|
||||
this.set(_ol_layer_Property_.SOURCE, source);
|
||||
this.set(LayerProperty.SOURCE, source);
|
||||
};
|
||||
export default _ol_layer_Layer_;
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
* @struct
|
||||
* @api
|
||||
*/
|
||||
var _ol_render_VectorContext_ = function() {
|
||||
var VectorContext = function() {
|
||||
};
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ var _ol_render_VectorContext_ = function() {
|
||||
* @param {ol.Feature|ol.render.Feature} feature Feature.
|
||||
* @param {Function} renderer Renderer.
|
||||
*/
|
||||
_ol_render_VectorContext_.prototype.drawCustom = function(geometry, feature, renderer) {};
|
||||
VectorContext.prototype.drawCustom = function(geometry, feature, renderer) {};
|
||||
|
||||
|
||||
/**
|
||||
@@ -28,7 +28,7 @@ _ol_render_VectorContext_.prototype.drawCustom = function(geometry, feature, ren
|
||||
*
|
||||
* @param {ol.geom.Geometry} geometry The geometry to render.
|
||||
*/
|
||||
_ol_render_VectorContext_.prototype.drawGeometry = function(geometry) {};
|
||||
VectorContext.prototype.drawGeometry = function(geometry) {};
|
||||
|
||||
|
||||
/**
|
||||
@@ -36,21 +36,21 @@ _ol_render_VectorContext_.prototype.drawGeometry = function(geometry) {};
|
||||
*
|
||||
* @param {ol.style.Style} style The rendering style.
|
||||
*/
|
||||
_ol_render_VectorContext_.prototype.setStyle = function(style) {};
|
||||
VectorContext.prototype.setStyle = function(style) {};
|
||||
|
||||
|
||||
/**
|
||||
* @param {ol.geom.Circle} circleGeometry Circle geometry.
|
||||
* @param {ol.Feature} feature Feature.
|
||||
*/
|
||||
_ol_render_VectorContext_.prototype.drawCircle = function(circleGeometry, feature) {};
|
||||
VectorContext.prototype.drawCircle = function(circleGeometry, feature) {};
|
||||
|
||||
|
||||
/**
|
||||
* @param {ol.Feature} feature Feature.
|
||||
* @param {ol.style.Style} style Style.
|
||||
*/
|
||||
_ol_render_VectorContext_.prototype.drawFeature = function(feature, style) {};
|
||||
VectorContext.prototype.drawFeature = function(feature, style) {};
|
||||
|
||||
|
||||
/**
|
||||
@@ -58,7 +58,7 @@ _ol_render_VectorContext_.prototype.drawFeature = function(feature, style) {};
|
||||
* collection.
|
||||
* @param {ol.Feature} feature Feature.
|
||||
*/
|
||||
_ol_render_VectorContext_.prototype.drawGeometryCollection = function(geometryCollectionGeometry, feature) {};
|
||||
VectorContext.prototype.drawGeometryCollection = function(geometryCollectionGeometry, feature) {};
|
||||
|
||||
|
||||
/**
|
||||
@@ -66,7 +66,7 @@ _ol_render_VectorContext_.prototype.drawGeometryCollection = function(geometryCo
|
||||
* string geometry.
|
||||
* @param {ol.Feature|ol.render.Feature} feature Feature.
|
||||
*/
|
||||
_ol_render_VectorContext_.prototype.drawLineString = function(lineStringGeometry, feature) {};
|
||||
VectorContext.prototype.drawLineString = function(lineStringGeometry, feature) {};
|
||||
|
||||
|
||||
/**
|
||||
@@ -74,7 +74,7 @@ _ol_render_VectorContext_.prototype.drawLineString = function(lineStringGeometry
|
||||
* MultiLineString geometry.
|
||||
* @param {ol.Feature|ol.render.Feature} feature Feature.
|
||||
*/
|
||||
_ol_render_VectorContext_.prototype.drawMultiLineString = function(multiLineStringGeometry, feature) {};
|
||||
VectorContext.prototype.drawMultiLineString = function(multiLineStringGeometry, feature) {};
|
||||
|
||||
|
||||
/**
|
||||
@@ -82,21 +82,21 @@ _ol_render_VectorContext_.prototype.drawMultiLineString = function(multiLineStri
|
||||
* geometry.
|
||||
* @param {ol.Feature|ol.render.Feature} feature Feature.
|
||||
*/
|
||||
_ol_render_VectorContext_.prototype.drawMultiPoint = function(multiPointGeometry, feature) {};
|
||||
VectorContext.prototype.drawMultiPoint = function(multiPointGeometry, feature) {};
|
||||
|
||||
|
||||
/**
|
||||
* @param {ol.geom.MultiPolygon} multiPolygonGeometry MultiPolygon geometry.
|
||||
* @param {ol.Feature|ol.render.Feature} feature Feature.
|
||||
*/
|
||||
_ol_render_VectorContext_.prototype.drawMultiPolygon = function(multiPolygonGeometry, feature) {};
|
||||
VectorContext.prototype.drawMultiPolygon = function(multiPolygonGeometry, feature) {};
|
||||
|
||||
|
||||
/**
|
||||
* @param {ol.geom.Point|ol.render.Feature} pointGeometry Point geometry.
|
||||
* @param {ol.Feature|ol.render.Feature} feature Feature.
|
||||
*/
|
||||
_ol_render_VectorContext_.prototype.drawPoint = function(pointGeometry, feature) {};
|
||||
VectorContext.prototype.drawPoint = function(pointGeometry, feature) {};
|
||||
|
||||
|
||||
/**
|
||||
@@ -104,33 +104,33 @@ _ol_render_VectorContext_.prototype.drawPoint = function(pointGeometry, feature)
|
||||
* geometry.
|
||||
* @param {ol.Feature|ol.render.Feature} feature Feature.
|
||||
*/
|
||||
_ol_render_VectorContext_.prototype.drawPolygon = function(polygonGeometry, feature) {};
|
||||
VectorContext.prototype.drawPolygon = function(polygonGeometry, feature) {};
|
||||
|
||||
|
||||
/**
|
||||
* @param {ol.geom.Geometry|ol.render.Feature} geometry Geometry.
|
||||
* @param {ol.Feature|ol.render.Feature} feature Feature.
|
||||
*/
|
||||
_ol_render_VectorContext_.prototype.drawText = function(geometry, feature) {};
|
||||
VectorContext.prototype.drawText = function(geometry, feature) {};
|
||||
|
||||
|
||||
/**
|
||||
* @param {ol.style.Fill} fillStyle Fill style.
|
||||
* @param {ol.style.Stroke} strokeStyle Stroke style.
|
||||
*/
|
||||
_ol_render_VectorContext_.prototype.setFillStrokeStyle = function(fillStyle, strokeStyle) {};
|
||||
VectorContext.prototype.setFillStrokeStyle = function(fillStyle, strokeStyle) {};
|
||||
|
||||
|
||||
/**
|
||||
* @param {ol.style.Image} imageStyle Image style.
|
||||
* @param {ol.DeclutterGroup=} opt_declutterGroup Declutter.
|
||||
*/
|
||||
_ol_render_VectorContext_.prototype.setImageStyle = function(imageStyle, opt_declutterGroup) {};
|
||||
VectorContext.prototype.setImageStyle = function(imageStyle, opt_declutterGroup) {};
|
||||
|
||||
|
||||
/**
|
||||
* @param {ol.style.Text} textStyle Text style.
|
||||
* @param {ol.DeclutterGroup=} opt_declutterGroup Declutter.
|
||||
*/
|
||||
_ol_render_VectorContext_.prototype.setTextStyle = function(textStyle, opt_declutterGroup) {};
|
||||
export default _ol_render_VectorContext_;
|
||||
VectorContext.prototype.setTextStyle = function(textStyle, opt_declutterGroup) {};
|
||||
export default VectorContext;
|
||||
|
||||
@@ -13,7 +13,7 @@ import GeometryType from '../../geom/GeometryType.js';
|
||||
import SimpleGeometry from '../../geom/SimpleGeometry.js';
|
||||
import _ol_geom_flat_transform_ from '../../geom/flat/transform.js';
|
||||
import _ol_has_ from '../../has.js';
|
||||
import _ol_render_VectorContext_ from '../VectorContext.js';
|
||||
import VectorContext from '../VectorContext.js';
|
||||
import _ol_render_canvas_ from '../canvas.js';
|
||||
import _ol_transform_ from '../../transform.js';
|
||||
|
||||
@@ -36,7 +36,7 @@ import _ol_transform_ from '../../transform.js';
|
||||
* @struct
|
||||
*/
|
||||
var _ol_render_canvas_Immediate_ = function(context, pixelRatio, extent, transform, viewRotation) {
|
||||
_ol_render_VectorContext_.call(this);
|
||||
VectorContext.call(this);
|
||||
|
||||
/**
|
||||
* @private
|
||||
@@ -238,7 +238,7 @@ var _ol_render_canvas_Immediate_ = function(context, pixelRatio, extent, transfo
|
||||
|
||||
};
|
||||
|
||||
inherits(_ol_render_canvas_Immediate_, _ol_render_VectorContext_);
|
||||
inherits(_ol_render_canvas_Immediate_, VectorContext);
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -14,7 +14,7 @@ import _ol_geom_flat_textpath_ from '../../geom/flat/textpath.js';
|
||||
import _ol_geom_flat_transform_ from '../../geom/flat/transform.js';
|
||||
import _ol_has_ from '../../has.js';
|
||||
import _ol_obj_ from '../../obj.js';
|
||||
import _ol_render_VectorContext_ from '../VectorContext.js';
|
||||
import VectorContext from '../VectorContext.js';
|
||||
import _ol_render_canvas_ from '../canvas.js';
|
||||
import _ol_render_canvas_Instruction_ from '../canvas/Instruction.js';
|
||||
import _ol_render_replay_ from '../replay.js';
|
||||
@@ -32,7 +32,7 @@ import _ol_transform_ from '../../transform.js';
|
||||
* @struct
|
||||
*/
|
||||
var _ol_render_canvas_Replay_ = function(tolerance, maxExtent, resolution, pixelRatio, overlaps, declutterTree) {
|
||||
_ol_render_VectorContext_.call(this);
|
||||
VectorContext.call(this);
|
||||
|
||||
/**
|
||||
* @type {?}
|
||||
@@ -168,7 +168,7 @@ var _ol_render_canvas_Replay_ = function(tolerance, maxExtent, resolution, pixel
|
||||
this.resetTransform_ = _ol_transform_.create();
|
||||
};
|
||||
|
||||
inherits(_ol_render_canvas_Replay_, _ol_render_VectorContext_);
|
||||
inherits(_ol_render_canvas_Replay_, VectorContext);
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -5,7 +5,7 @@ import {inherits} from '../../index.js';
|
||||
import {intersects} from '../../extent.js';
|
||||
import GeometryType from '../../geom/GeometryType.js';
|
||||
import ReplayType from '../ReplayType.js';
|
||||
import _ol_render_VectorContext_ from '../VectorContext.js';
|
||||
import VectorContext from '../VectorContext.js';
|
||||
import _ol_render_webgl_ReplayGroup_ from '../webgl/ReplayGroup.js';
|
||||
|
||||
/**
|
||||
@@ -21,7 +21,7 @@ import _ol_render_webgl_ReplayGroup_ from '../webgl/ReplayGroup.js';
|
||||
* @struct
|
||||
*/
|
||||
var _ol_render_webgl_Immediate_ = function(context, center, resolution, rotation, size, extent, pixelRatio) {
|
||||
_ol_render_VectorContext_.call(this);
|
||||
VectorContext.call(this);
|
||||
|
||||
/**
|
||||
* @private
|
||||
@@ -84,7 +84,7 @@ var _ol_render_webgl_Immediate_ = function(context, center, resolution, rotation
|
||||
|
||||
};
|
||||
|
||||
inherits(_ol_render_webgl_Immediate_, _ol_render_VectorContext_);
|
||||
inherits(_ol_render_webgl_Immediate_, VectorContext);
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*/
|
||||
import {inherits} from '../../index.js';
|
||||
import {getCenter} from '../../extent.js';
|
||||
import _ol_render_VectorContext_ from '../VectorContext.js';
|
||||
import VectorContext from '../VectorContext.js';
|
||||
import _ol_transform_ from '../../transform.js';
|
||||
import {create, fromTransform} from '../../vec/mat4.js';
|
||||
import _ol_webgl_ from '../../webgl.js';
|
||||
@@ -17,7 +17,7 @@ import _ol_webgl_ from '../../webgl.js';
|
||||
* @struct
|
||||
*/
|
||||
var _ol_render_webgl_Replay_ = function(tolerance, maxExtent) {
|
||||
_ol_render_VectorContext_.call(this);
|
||||
VectorContext.call(this);
|
||||
|
||||
/**
|
||||
* @protected
|
||||
@@ -113,7 +113,7 @@ var _ol_render_webgl_Replay_ = function(tolerance, maxExtent) {
|
||||
|
||||
};
|
||||
|
||||
inherits(_ol_render_webgl_Replay_, _ol_render_VectorContext_);
|
||||
inherits(_ol_render_webgl_Replay_, VectorContext);
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -16,7 +16,7 @@ import SourceState from '../source/State.js';
|
||||
* @param {ol.layer.Layer} layer Layer.
|
||||
* @struct
|
||||
*/
|
||||
var _ol_renderer_Layer_ = function(layer) {
|
||||
var LayerRenderer = function(layer) {
|
||||
|
||||
Observable.call(this);
|
||||
|
||||
@@ -29,7 +29,7 @@ var _ol_renderer_Layer_ = function(layer) {
|
||||
|
||||
};
|
||||
|
||||
inherits(_ol_renderer_Layer_, Observable);
|
||||
inherits(LayerRenderer, Observable);
|
||||
|
||||
|
||||
/**
|
||||
@@ -42,7 +42,7 @@ inherits(_ol_renderer_Layer_, Observable);
|
||||
* @return {T|undefined} Callback result.
|
||||
* @template S,T
|
||||
*/
|
||||
_ol_renderer_Layer_.prototype.forEachFeatureAtCoordinate = nullFunction;
|
||||
LayerRenderer.prototype.forEachFeatureAtCoordinate = nullFunction;
|
||||
|
||||
|
||||
/**
|
||||
@@ -50,7 +50,7 @@ _ol_renderer_Layer_.prototype.forEachFeatureAtCoordinate = nullFunction;
|
||||
* @param {olx.FrameState} frameState Frame state.
|
||||
* @return {boolean} Is there a feature at the given coordinate?
|
||||
*/
|
||||
_ol_renderer_Layer_.prototype.hasFeatureAtCoordinate = FALSE;
|
||||
LayerRenderer.prototype.hasFeatureAtCoordinate = FALSE;
|
||||
|
||||
|
||||
/**
|
||||
@@ -64,7 +64,7 @@ _ol_renderer_Layer_.prototype.hasFeatureAtCoordinate = FALSE;
|
||||
* lookup.
|
||||
* @protected
|
||||
*/
|
||||
_ol_renderer_Layer_.prototype.createLoadedTileFinder = function(source, projection, tiles) {
|
||||
LayerRenderer.prototype.createLoadedTileFinder = function(source, projection, tiles) {
|
||||
return (
|
||||
/**
|
||||
* @param {number} zoom Zoom level.
|
||||
@@ -86,7 +86,7 @@ _ol_renderer_Layer_.prototype.createLoadedTileFinder = function(source, projecti
|
||||
/**
|
||||
* @return {ol.layer.Layer} Layer.
|
||||
*/
|
||||
_ol_renderer_Layer_.prototype.getLayer = function() {
|
||||
LayerRenderer.prototype.getLayer = function() {
|
||||
return this.layer_;
|
||||
};
|
||||
|
||||
@@ -96,7 +96,7 @@ _ol_renderer_Layer_.prototype.getLayer = function() {
|
||||
* @param {ol.events.Event} event Image change event.
|
||||
* @private
|
||||
*/
|
||||
_ol_renderer_Layer_.prototype.handleImageChange_ = function(event) {
|
||||
LayerRenderer.prototype.handleImageChange_ = function(event) {
|
||||
var image = /** @type {ol.Image} */ (event.target);
|
||||
if (image.getState() === ImageState.LOADED) {
|
||||
this.renderIfReadyAndVisible();
|
||||
@@ -112,7 +112,7 @@ _ol_renderer_Layer_.prototype.handleImageChange_ = function(event) {
|
||||
* otherwise.
|
||||
* @protected
|
||||
*/
|
||||
_ol_renderer_Layer_.prototype.loadImage = function(image) {
|
||||
LayerRenderer.prototype.loadImage = function(image) {
|
||||
var imageState = image.getState();
|
||||
if (imageState != ImageState.LOADED && imageState != ImageState.ERROR) {
|
||||
_ol_events_.listen(image, EventType.CHANGE, this.handleImageChange_, this);
|
||||
@@ -128,7 +128,7 @@ _ol_renderer_Layer_.prototype.loadImage = function(image) {
|
||||
/**
|
||||
* @protected
|
||||
*/
|
||||
_ol_renderer_Layer_.prototype.renderIfReadyAndVisible = function() {
|
||||
LayerRenderer.prototype.renderIfReadyAndVisible = function() {
|
||||
var layer = this.getLayer();
|
||||
if (layer.getVisible() && layer.getSourceState() == SourceState.READY) {
|
||||
this.changed();
|
||||
@@ -141,7 +141,7 @@ _ol_renderer_Layer_.prototype.renderIfReadyAndVisible = function() {
|
||||
* @param {ol.source.Tile} tileSource Tile source.
|
||||
* @protected
|
||||
*/
|
||||
_ol_renderer_Layer_.prototype.scheduleExpireCache = function(frameState, tileSource) {
|
||||
LayerRenderer.prototype.scheduleExpireCache = function(frameState, tileSource) {
|
||||
if (tileSource.canExpireCache()) {
|
||||
/**
|
||||
* @param {ol.source.Tile} tileSource Tile source.
|
||||
@@ -170,7 +170,7 @@ _ol_renderer_Layer_.prototype.scheduleExpireCache = function(frameState, tileSou
|
||||
* @param {ol.TileRange} tileRange Tile range.
|
||||
* @protected
|
||||
*/
|
||||
_ol_renderer_Layer_.prototype.updateUsedTiles = function(usedTiles, tileSource, z, tileRange) {
|
||||
LayerRenderer.prototype.updateUsedTiles = function(usedTiles, tileSource, z, tileRange) {
|
||||
// FIXME should we use tilesToDrawByZ instead?
|
||||
var tileSourceKey = getUid(tileSource).toString();
|
||||
var zKey = z.toString();
|
||||
@@ -207,7 +207,7 @@ _ol_renderer_Layer_.prototype.updateUsedTiles = function(usedTiles, tileSource,
|
||||
* @protected
|
||||
* @template T
|
||||
*/
|
||||
_ol_renderer_Layer_.prototype.manageTilePyramid = function(
|
||||
LayerRenderer.prototype.manageTilePyramid = function(
|
||||
frameState, tileSource, tileGrid, pixelRatio, projection, extent,
|
||||
currentZ, preload, opt_tileCallback, opt_this) {
|
||||
var tileSourceKey = getUid(tileSource).toString();
|
||||
@@ -242,4 +242,4 @@ _ol_renderer_Layer_.prototype.manageTilePyramid = function(
|
||||
}
|
||||
}
|
||||
};
|
||||
export default _ol_renderer_Layer_;
|
||||
export default LayerRenderer;
|
||||
|
||||
@@ -20,7 +20,7 @@ import _ol_transform_ from '../transform.js';
|
||||
* @param {ol.PluggableMap} map Map.
|
||||
* @struct
|
||||
*/
|
||||
var _ol_renderer_Map_ = function(container, map) {
|
||||
var MapRenderer = function(container, map) {
|
||||
|
||||
Disposable.call(this);
|
||||
|
||||
@@ -45,14 +45,14 @@ var _ol_renderer_Map_ = function(container, map) {
|
||||
|
||||
};
|
||||
|
||||
inherits(_ol_renderer_Map_, Disposable);
|
||||
inherits(MapRenderer, Disposable);
|
||||
|
||||
|
||||
/**
|
||||
* @param {olx.FrameState} frameState FrameState.
|
||||
* @protected
|
||||
*/
|
||||
_ol_renderer_Map_.prototype.calculateMatrices2D = function(frameState) {
|
||||
MapRenderer.prototype.calculateMatrices2D = function(frameState) {
|
||||
var viewState = frameState.viewState;
|
||||
var coordinateToPixelTransform = frameState.coordinateToPixelTransform;
|
||||
var pixelToCoordinateTransform = frameState.pixelToCoordinateTransform;
|
||||
@@ -71,7 +71,7 @@ _ol_renderer_Map_.prototype.calculateMatrices2D = function(frameState) {
|
||||
/**
|
||||
* Removes all layer renderers.
|
||||
*/
|
||||
_ol_renderer_Map_.prototype.removeLayerRenderers = function() {
|
||||
MapRenderer.prototype.removeLayerRenderers = function() {
|
||||
for (var key in this.layerRenderers_) {
|
||||
this.removeLayerRendererByKey_(key).dispose();
|
||||
}
|
||||
@@ -83,7 +83,7 @@ _ol_renderer_Map_.prototype.removeLayerRenderers = function() {
|
||||
* @param {olx.FrameState} frameState Frame state.
|
||||
* @private
|
||||
*/
|
||||
_ol_renderer_Map_.expireIconCache_ = function(map, frameState) {
|
||||
MapRenderer.expireIconCache_ = function(map, frameState) {
|
||||
iconImageCache.expire();
|
||||
};
|
||||
|
||||
@@ -103,7 +103,7 @@ _ol_renderer_Map_.expireIconCache_ = function(map, frameState) {
|
||||
* @return {T|undefined} Callback result.
|
||||
* @template S,T,U
|
||||
*/
|
||||
_ol_renderer_Map_.prototype.forEachFeatureAtCoordinate = function(coordinate, frameState, hitTolerance, callback, thisArg,
|
||||
MapRenderer.prototype.forEachFeatureAtCoordinate = function(coordinate, frameState, hitTolerance, callback, thisArg,
|
||||
layerFilter, thisArg2) {
|
||||
var result;
|
||||
var viewState = frameState.viewState;
|
||||
@@ -173,7 +173,7 @@ _ol_renderer_Map_.prototype.forEachFeatureAtCoordinate = function(coordinate, fr
|
||||
* @return {T|undefined} Callback result.
|
||||
* @template S,T,U
|
||||
*/
|
||||
_ol_renderer_Map_.prototype.forEachLayerAtPixel = function(pixel, frameState, callback, thisArg,
|
||||
MapRenderer.prototype.forEachLayerAtPixel = function(pixel, frameState, callback, thisArg,
|
||||
layerFilter, thisArg2) {};
|
||||
|
||||
|
||||
@@ -189,7 +189,7 @@ _ol_renderer_Map_.prototype.forEachLayerAtPixel = function(pixel, frameState, ca
|
||||
* @return {boolean} Is there a feature at the given coordinate?
|
||||
* @template U
|
||||
*/
|
||||
_ol_renderer_Map_.prototype.hasFeatureAtCoordinate = function(coordinate, frameState, hitTolerance, layerFilter, thisArg) {
|
||||
MapRenderer.prototype.hasFeatureAtCoordinate = function(coordinate, frameState, hitTolerance, layerFilter, thisArg) {
|
||||
var hasFeature = this.forEachFeatureAtCoordinate(
|
||||
coordinate, frameState, hitTolerance, TRUE, this, layerFilter, thisArg);
|
||||
|
||||
@@ -202,7 +202,7 @@ _ol_renderer_Map_.prototype.hasFeatureAtCoordinate = function(coordinate, frameS
|
||||
* @protected
|
||||
* @return {ol.renderer.Layer} Layer renderer.
|
||||
*/
|
||||
_ol_renderer_Map_.prototype.getLayerRenderer = function(layer) {
|
||||
MapRenderer.prototype.getLayerRenderer = function(layer) {
|
||||
var layerKey = getUid(layer).toString();
|
||||
if (layerKey in this.layerRenderers_) {
|
||||
return this.layerRenderers_[layerKey];
|
||||
@@ -234,7 +234,7 @@ _ol_renderer_Map_.prototype.getLayerRenderer = function(layer) {
|
||||
* @protected
|
||||
* @return {ol.renderer.Layer} Layer renderer.
|
||||
*/
|
||||
_ol_renderer_Map_.prototype.getLayerRendererByKey = function(layerKey) {
|
||||
MapRenderer.prototype.getLayerRendererByKey = function(layerKey) {
|
||||
return this.layerRenderers_[layerKey];
|
||||
};
|
||||
|
||||
@@ -243,7 +243,7 @@ _ol_renderer_Map_.prototype.getLayerRendererByKey = function(layerKey) {
|
||||
* @protected
|
||||
* @return {Object.<string, ol.renderer.Layer>} Layer renderers.
|
||||
*/
|
||||
_ol_renderer_Map_.prototype.getLayerRenderers = function() {
|
||||
MapRenderer.prototype.getLayerRenderers = function() {
|
||||
return this.layerRenderers_;
|
||||
};
|
||||
|
||||
@@ -251,7 +251,7 @@ _ol_renderer_Map_.prototype.getLayerRenderers = function() {
|
||||
/**
|
||||
* @return {ol.PluggableMap} Map.
|
||||
*/
|
||||
_ol_renderer_Map_.prototype.getMap = function() {
|
||||
MapRenderer.prototype.getMap = function() {
|
||||
return this.map_;
|
||||
};
|
||||
|
||||
@@ -260,14 +260,14 @@ _ol_renderer_Map_.prototype.getMap = function() {
|
||||
* @abstract
|
||||
* @return {ol.renderer.Type} Type
|
||||
*/
|
||||
_ol_renderer_Map_.prototype.getType = function() {};
|
||||
MapRenderer.prototype.getType = function() {};
|
||||
|
||||
|
||||
/**
|
||||
* Handle changes in a layer renderer.
|
||||
* @private
|
||||
*/
|
||||
_ol_renderer_Map_.prototype.handleLayerRendererChange_ = function() {
|
||||
MapRenderer.prototype.handleLayerRendererChange_ = function() {
|
||||
this.map_.render();
|
||||
};
|
||||
|
||||
@@ -277,7 +277,7 @@ _ol_renderer_Map_.prototype.handleLayerRendererChange_ = function() {
|
||||
* @return {ol.renderer.Layer} Layer renderer.
|
||||
* @private
|
||||
*/
|
||||
_ol_renderer_Map_.prototype.removeLayerRendererByKey_ = function(layerKey) {
|
||||
MapRenderer.prototype.removeLayerRendererByKey_ = function(layerKey) {
|
||||
var layerRenderer = this.layerRenderers_[layerKey];
|
||||
delete this.layerRenderers_[layerKey];
|
||||
|
||||
@@ -292,7 +292,7 @@ _ol_renderer_Map_.prototype.removeLayerRendererByKey_ = function(layerKey) {
|
||||
* Render.
|
||||
* @param {?olx.FrameState} frameState Frame state.
|
||||
*/
|
||||
_ol_renderer_Map_.prototype.renderFrame = nullFunction;
|
||||
MapRenderer.prototype.renderFrame = nullFunction;
|
||||
|
||||
|
||||
/**
|
||||
@@ -300,7 +300,7 @@ _ol_renderer_Map_.prototype.renderFrame = nullFunction;
|
||||
* @param {olx.FrameState} frameState Frame state.
|
||||
* @private
|
||||
*/
|
||||
_ol_renderer_Map_.prototype.removeUnusedLayerRenderers_ = function(map, frameState) {
|
||||
MapRenderer.prototype.removeUnusedLayerRenderers_ = function(map, frameState) {
|
||||
var layerKey;
|
||||
for (layerKey in this.layerRenderers_) {
|
||||
if (!frameState || !(layerKey in frameState.layerStates)) {
|
||||
@@ -314,9 +314,9 @@ _ol_renderer_Map_.prototype.removeUnusedLayerRenderers_ = function(map, frameSta
|
||||
* @param {olx.FrameState} frameState Frame state.
|
||||
* @protected
|
||||
*/
|
||||
_ol_renderer_Map_.prototype.scheduleExpireIconCache = function(frameState) {
|
||||
MapRenderer.prototype.scheduleExpireIconCache = function(frameState) {
|
||||
frameState.postRenderFunctions.push(
|
||||
/** @type {ol.PostRenderFunction} */ (_ol_renderer_Map_.expireIconCache_)
|
||||
/** @type {ol.PostRenderFunction} */ (MapRenderer.expireIconCache_)
|
||||
);
|
||||
};
|
||||
|
||||
@@ -325,7 +325,7 @@ _ol_renderer_Map_.prototype.scheduleExpireIconCache = function(frameState) {
|
||||
* @param {!olx.FrameState} frameState Frame state.
|
||||
* @protected
|
||||
*/
|
||||
_ol_renderer_Map_.prototype.scheduleRemoveUnusedLayerRenderers = function(frameState) {
|
||||
MapRenderer.prototype.scheduleRemoveUnusedLayerRenderers = function(frameState) {
|
||||
var layerKey;
|
||||
for (layerKey in this.layerRenderers_) {
|
||||
if (!(layerKey in frameState.layerStates)) {
|
||||
@@ -343,7 +343,7 @@ _ol_renderer_Map_.prototype.scheduleRemoveUnusedLayerRenderers = function(frameS
|
||||
* @param {ol.LayerState} state2 Second layer state.
|
||||
* @return {number} The zIndex difference.
|
||||
*/
|
||||
_ol_renderer_Map_.sortByZIndex = function(state1, state2) {
|
||||
MapRenderer.sortByZIndex = function(state1, state2) {
|
||||
return state1.zIndex - state2.zIndex;
|
||||
};
|
||||
export default _ol_renderer_Map_;
|
||||
export default MapRenderer;
|
||||
|
||||
@@ -5,7 +5,7 @@ import {inherits, nullFunction} from '../../index.js';
|
||||
import _ol_coordinate_ from '../../coordinate.js';
|
||||
import {createCanvasContext2D} from '../../dom.js';
|
||||
import {containsExtent, intersects} from '../../extent.js';
|
||||
import _ol_renderer_canvas_Layer_ from '../canvas/Layer.js';
|
||||
import CanvasLayerRenderer from '../canvas/Layer.js';
|
||||
import _ol_transform_ from '../../transform.js';
|
||||
|
||||
/**
|
||||
@@ -16,7 +16,7 @@ import _ol_transform_ from '../../transform.js';
|
||||
*/
|
||||
var _ol_renderer_canvas_IntermediateCanvas_ = function(layer) {
|
||||
|
||||
_ol_renderer_canvas_Layer_.call(this, layer);
|
||||
CanvasLayerRenderer.call(this, layer);
|
||||
|
||||
/**
|
||||
* @protected
|
||||
@@ -32,7 +32,7 @@ var _ol_renderer_canvas_IntermediateCanvas_ = function(layer) {
|
||||
|
||||
};
|
||||
|
||||
inherits(_ol_renderer_canvas_IntermediateCanvas_, _ol_renderer_canvas_Layer_);
|
||||
inherits(_ol_renderer_canvas_IntermediateCanvas_, CanvasLayerRenderer);
|
||||
|
||||
|
||||
/**
|
||||
@@ -126,7 +126,7 @@ _ol_renderer_canvas_IntermediateCanvas_.prototype.forEachLayerAtCoordinate = fun
|
||||
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);
|
||||
return CanvasLayerRenderer.prototype.forEachLayerAtCoordinate.apply(this, arguments);
|
||||
} else {
|
||||
var pixel = _ol_transform_.apply(this.coordinateToCanvasPixelTransform, coordinate.slice());
|
||||
_ol_coordinate_.scale(pixel, frameState.viewState.resolution / this.renderedResolution);
|
||||
|
||||
@@ -8,7 +8,7 @@ import _ol_render_Event_ from '../../render/Event.js';
|
||||
import RenderEventType from '../../render/EventType.js';
|
||||
import _ol_render_canvas_ from '../../render/canvas.js';
|
||||
import _ol_render_canvas_Immediate_ from '../../render/canvas/Immediate.js';
|
||||
import _ol_renderer_Layer_ from '../Layer.js';
|
||||
import LayerRenderer from '../Layer.js';
|
||||
import _ol_transform_ from '../../transform.js';
|
||||
|
||||
/**
|
||||
@@ -17,9 +17,9 @@ import _ol_transform_ from '../../transform.js';
|
||||
* @extends {ol.renderer.Layer}
|
||||
* @param {ol.layer.Layer} layer Layer.
|
||||
*/
|
||||
var _ol_renderer_canvas_Layer_ = function(layer) {
|
||||
var CanvasLayerRenderer = function(layer) {
|
||||
|
||||
_ol_renderer_Layer_.call(this, layer);
|
||||
LayerRenderer.call(this, layer);
|
||||
|
||||
/**
|
||||
* @protected
|
||||
@@ -35,7 +35,7 @@ var _ol_renderer_canvas_Layer_ = function(layer) {
|
||||
|
||||
};
|
||||
|
||||
inherits(_ol_renderer_canvas_Layer_, _ol_renderer_Layer_);
|
||||
inherits(CanvasLayerRenderer, LayerRenderer);
|
||||
|
||||
|
||||
/**
|
||||
@@ -44,7 +44,7 @@ inherits(_ol_renderer_canvas_Layer_, _ol_renderer_Layer_);
|
||||
* @param {ol.Extent} extent Clip extent.
|
||||
* @protected
|
||||
*/
|
||||
_ol_renderer_canvas_Layer_.prototype.clip = function(context, frameState, extent) {
|
||||
CanvasLayerRenderer.prototype.clip = function(context, frameState, extent) {
|
||||
var pixelRatio = frameState.pixelRatio;
|
||||
var width = frameState.size[0] * pixelRatio;
|
||||
var height = frameState.size[1] * pixelRatio;
|
||||
@@ -78,7 +78,7 @@ _ol_renderer_canvas_Layer_.prototype.clip = function(context, frameState, extent
|
||||
* @param {ol.Transform=} opt_transform Transform.
|
||||
* @private
|
||||
*/
|
||||
_ol_renderer_canvas_Layer_.prototype.dispatchComposeEvent_ = function(type, context, frameState, opt_transform) {
|
||||
CanvasLayerRenderer.prototype.dispatchComposeEvent_ = function(type, context, frameState, opt_transform) {
|
||||
var layer = this.getLayer();
|
||||
if (layer.hasListener(type)) {
|
||||
var width = frameState.size[0] * frameState.pixelRatio;
|
||||
@@ -107,7 +107,7 @@ _ol_renderer_canvas_Layer_.prototype.dispatchComposeEvent_ = function(type, cont
|
||||
* @return {T|undefined} Callback result.
|
||||
* @template S,T,U
|
||||
*/
|
||||
_ol_renderer_canvas_Layer_.prototype.forEachLayerAtCoordinate = function(coordinate, frameState, callback, thisArg) {
|
||||
CanvasLayerRenderer.prototype.forEachLayerAtCoordinate = function(coordinate, frameState, callback, thisArg) {
|
||||
var hasFeature = this.forEachFeatureAtCoordinate(coordinate, frameState, 0, TRUE, this);
|
||||
|
||||
if (hasFeature) {
|
||||
@@ -125,7 +125,7 @@ _ol_renderer_canvas_Layer_.prototype.forEachLayerAtCoordinate = function(coordin
|
||||
* @param {ol.Transform=} opt_transform Transform.
|
||||
* @protected
|
||||
*/
|
||||
_ol_renderer_canvas_Layer_.prototype.postCompose = function(context, frameState, layerState, opt_transform) {
|
||||
CanvasLayerRenderer.prototype.postCompose = function(context, frameState, layerState, opt_transform) {
|
||||
this.dispatchComposeEvent_(RenderEventType.POSTCOMPOSE, context, frameState, opt_transform);
|
||||
};
|
||||
|
||||
@@ -136,7 +136,7 @@ _ol_renderer_canvas_Layer_.prototype.postCompose = function(context, frameState,
|
||||
* @param {ol.Transform=} opt_transform Transform.
|
||||
* @protected
|
||||
*/
|
||||
_ol_renderer_canvas_Layer_.prototype.preCompose = function(context, frameState, opt_transform) {
|
||||
CanvasLayerRenderer.prototype.preCompose = function(context, frameState, opt_transform) {
|
||||
this.dispatchComposeEvent_(RenderEventType.PRECOMPOSE, context, frameState, opt_transform);
|
||||
};
|
||||
|
||||
@@ -147,7 +147,7 @@ _ol_renderer_canvas_Layer_.prototype.preCompose = function(context, frameState,
|
||||
* @param {ol.Transform=} opt_transform Transform.
|
||||
* @protected
|
||||
*/
|
||||
_ol_renderer_canvas_Layer_.prototype.dispatchRenderEvent = function(context, frameState, opt_transform) {
|
||||
CanvasLayerRenderer.prototype.dispatchRenderEvent = function(context, frameState, opt_transform) {
|
||||
this.dispatchComposeEvent_(RenderEventType.RENDER, context, frameState, opt_transform);
|
||||
};
|
||||
|
||||
@@ -158,7 +158,7 @@ _ol_renderer_canvas_Layer_.prototype.dispatchRenderEvent = function(context, fra
|
||||
* @protected
|
||||
* @return {!ol.Transform} Transform.
|
||||
*/
|
||||
_ol_renderer_canvas_Layer_.prototype.getTransform = function(frameState, offsetX) {
|
||||
CanvasLayerRenderer.prototype.getTransform = function(frameState, offsetX) {
|
||||
var viewState = frameState.viewState;
|
||||
var pixelRatio = frameState.pixelRatio;
|
||||
var dx1 = pixelRatio * frameState.size[0] / 2;
|
||||
@@ -178,7 +178,7 @@ _ol_renderer_canvas_Layer_.prototype.getTransform = function(frameState, offsetX
|
||||
* @param {ol.LayerState} layerState Layer state.
|
||||
* @param {CanvasRenderingContext2D} context Context.
|
||||
*/
|
||||
_ol_renderer_canvas_Layer_.prototype.composeFrame = function(frameState, layerState, context) {};
|
||||
CanvasLayerRenderer.prototype.composeFrame = function(frameState, layerState, context) {};
|
||||
|
||||
/**
|
||||
* @abstract
|
||||
@@ -186,5 +186,5 @@ _ol_renderer_canvas_Layer_.prototype.composeFrame = function(frameState, layerSt
|
||||
* @param {ol.LayerState} layerState Layer state.
|
||||
* @return {boolean} whether composeFrame should be called.
|
||||
*/
|
||||
_ol_renderer_canvas_Layer_.prototype.prepareFrame = function(frameState, layerState) {};
|
||||
export default _ol_renderer_canvas_Layer_;
|
||||
CanvasLayerRenderer.prototype.prepareFrame = function(frameState, layerState) {};
|
||||
export default CanvasLayerRenderer;
|
||||
|
||||
@@ -13,7 +13,7 @@ import _ol_render_Event_ from '../../render/Event.js';
|
||||
import RenderEventType from '../../render/EventType.js';
|
||||
import _ol_render_canvas_ from '../../render/canvas.js';
|
||||
import _ol_render_canvas_Immediate_ from '../../render/canvas/Immediate.js';
|
||||
import _ol_renderer_Map_ from '../Map.js';
|
||||
import MapRenderer from '../Map.js';
|
||||
import RendererType from '../Type.js';
|
||||
import SourceState from '../../source/State.js';
|
||||
|
||||
@@ -26,7 +26,7 @@ import SourceState from '../../source/State.js';
|
||||
*/
|
||||
var CanvasMapRenderer = function(container, map) {
|
||||
|
||||
_ol_renderer_Map_.call(this, container, map);
|
||||
MapRenderer.call(this, container, map);
|
||||
|
||||
/**
|
||||
* @private
|
||||
@@ -60,7 +60,7 @@ var CanvasMapRenderer = function(container, map) {
|
||||
|
||||
};
|
||||
|
||||
inherits(CanvasMapRenderer, _ol_renderer_Map_);
|
||||
inherits(CanvasMapRenderer, MapRenderer);
|
||||
|
||||
|
||||
/**
|
||||
@@ -166,7 +166,7 @@ CanvasMapRenderer.prototype.renderFrame = function(frameState) {
|
||||
this.dispatchComposeEvent_(RenderEventType.PRECOMPOSE, frameState);
|
||||
|
||||
var layerStatesArray = frameState.layerStatesArray;
|
||||
stableSort(layerStatesArray, _ol_renderer_Map_.sortByZIndex);
|
||||
stableSort(layerStatesArray, MapRenderer.sortByZIndex);
|
||||
|
||||
if (rotation) {
|
||||
context.save();
|
||||
|
||||
@@ -13,7 +13,7 @@ import RenderEventType from '../../render/EventType.js';
|
||||
import _ol_render_canvas_ from '../../render/canvas.js';
|
||||
import _ol_render_canvas_ReplayGroup_ from '../../render/canvas/ReplayGroup.js';
|
||||
import RendererType from '../Type.js';
|
||||
import _ol_renderer_canvas_Layer_ from '../canvas/Layer.js';
|
||||
import CanvasLayerRenderer from '../canvas/Layer.js';
|
||||
import _ol_renderer_vector_ from '../vector.js';
|
||||
|
||||
/**
|
||||
@@ -24,7 +24,7 @@ import _ol_renderer_vector_ from '../vector.js';
|
||||
*/
|
||||
var CanvasVectorLayerRenderer = function(vectorLayer) {
|
||||
|
||||
_ol_renderer_canvas_Layer_.call(this, vectorLayer);
|
||||
CanvasLayerRenderer.call(this, vectorLayer);
|
||||
|
||||
/**
|
||||
* Declutter tree.
|
||||
@@ -83,7 +83,7 @@ var CanvasVectorLayerRenderer = function(vectorLayer) {
|
||||
|
||||
};
|
||||
|
||||
inherits(CanvasVectorLayerRenderer, _ol_renderer_canvas_Layer_);
|
||||
inherits(CanvasVectorLayerRenderer, CanvasLayerRenderer);
|
||||
|
||||
|
||||
/**
|
||||
@@ -113,7 +113,7 @@ CanvasVectorLayerRenderer['create'] = function(mapRenderer, layer) {
|
||||
*/
|
||||
CanvasVectorLayerRenderer.prototype.disposeInternal = function() {
|
||||
_ol_events_.unlisten(_ol_render_canvas_.labelCache, EventType.CLEAR, this.handleFontsChanged_, this);
|
||||
_ol_renderer_canvas_Layer_.prototype.disposeInternal.call(this);
|
||||
CanvasLayerRenderer.prototype.disposeInternal.call(this);
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ import {createCanvasContext2D} from '../../dom.js';
|
||||
import {getIntersection, isEmpty} from '../../extent.js';
|
||||
import {TRUE} from '../../functions.js';
|
||||
import RendererType from '../Type.js';
|
||||
import _ol_renderer_webgl_Layer_ from '../webgl/Layer.js';
|
||||
import WebGLLayerRenderer from '../webgl/Layer.js';
|
||||
import _ol_transform_ from '../../transform.js';
|
||||
import _ol_webgl_ from '../../webgl.js';
|
||||
import _ol_webgl_Context_ from '../../webgl/Context.js';
|
||||
@@ -23,7 +23,7 @@ import _ol_webgl_Context_ from '../../webgl/Context.js';
|
||||
*/
|
||||
var WebGLImageLayerRenderer = function(mapRenderer, imageLayer) {
|
||||
|
||||
_ol_renderer_webgl_Layer_.call(this, mapRenderer, imageLayer);
|
||||
WebGLLayerRenderer.call(this, mapRenderer, imageLayer);
|
||||
|
||||
/**
|
||||
* The last rendered image.
|
||||
@@ -46,7 +46,7 @@ var WebGLImageLayerRenderer = function(mapRenderer, imageLayer) {
|
||||
|
||||
};
|
||||
|
||||
inherits(WebGLImageLayerRenderer, _ol_renderer_webgl_Layer_);
|
||||
inherits(WebGLImageLayerRenderer, WebGLLayerRenderer);
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -5,7 +5,7 @@ import {inherits} from '../../index.js';
|
||||
import _ol_render_Event_ from '../../render/Event.js';
|
||||
import RenderEventType from '../../render/EventType.js';
|
||||
import _ol_render_webgl_Immediate_ from '../../render/webgl/Immediate.js';
|
||||
import _ol_renderer_Layer_ from '../Layer.js';
|
||||
import LayerRenderer from '../Layer.js';
|
||||
import _ol_renderer_webgl_defaultmapshader_ from '../webgl/defaultmapshader.js';
|
||||
import _ol_renderer_webgl_defaultmapshader_Locations_ from '../webgl/defaultmapshader/Locations.js';
|
||||
import _ol_transform_ from '../../transform.js';
|
||||
@@ -21,9 +21,9 @@ import _ol_webgl_Context_ from '../../webgl/Context.js';
|
||||
* @param {ol.renderer.webgl.Map} mapRenderer Map renderer.
|
||||
* @param {ol.layer.Layer} layer Layer.
|
||||
*/
|
||||
var _ol_renderer_webgl_Layer_ = function(mapRenderer, layer) {
|
||||
var WebGLLayerRenderer = function(mapRenderer, layer) {
|
||||
|
||||
_ol_renderer_Layer_.call(this, layer);
|
||||
LayerRenderer.call(this, layer);
|
||||
|
||||
/**
|
||||
* @protected
|
||||
@@ -86,7 +86,7 @@ var _ol_renderer_webgl_Layer_ = function(mapRenderer, layer) {
|
||||
|
||||
};
|
||||
|
||||
inherits(_ol_renderer_webgl_Layer_, _ol_renderer_Layer_);
|
||||
inherits(WebGLLayerRenderer, LayerRenderer);
|
||||
|
||||
|
||||
/**
|
||||
@@ -94,7 +94,7 @@ inherits(_ol_renderer_webgl_Layer_, _ol_renderer_Layer_);
|
||||
* @param {number} framebufferDimension Framebuffer dimension.
|
||||
* @protected
|
||||
*/
|
||||
_ol_renderer_webgl_Layer_.prototype.bindFramebuffer = function(frameState, framebufferDimension) {
|
||||
WebGLLayerRenderer.prototype.bindFramebuffer = function(frameState, framebufferDimension) {
|
||||
|
||||
var gl = this.mapRenderer.getGL();
|
||||
|
||||
@@ -140,7 +140,7 @@ _ol_renderer_webgl_Layer_.prototype.bindFramebuffer = function(frameState, frame
|
||||
* @param {ol.LayerState} layerState Layer state.
|
||||
* @param {ol.webgl.Context} context Context.
|
||||
*/
|
||||
_ol_renderer_webgl_Layer_.prototype.composeFrame = function(frameState, layerState, context) {
|
||||
WebGLLayerRenderer.prototype.composeFrame = function(frameState, layerState, context) {
|
||||
|
||||
this.dispatchComposeEvent_(RenderEventType.PRECOMPOSE, context, frameState);
|
||||
|
||||
@@ -189,7 +189,7 @@ _ol_renderer_webgl_Layer_.prototype.composeFrame = function(frameState, layerSta
|
||||
* @param {olx.FrameState} frameState Frame state.
|
||||
* @private
|
||||
*/
|
||||
_ol_renderer_webgl_Layer_.prototype.dispatchComposeEvent_ = function(type, context, frameState) {
|
||||
WebGLLayerRenderer.prototype.dispatchComposeEvent_ = function(type, context, frameState) {
|
||||
var layer = this.getLayer();
|
||||
if (layer.hasListener(type)) {
|
||||
var viewState = frameState.viewState;
|
||||
@@ -212,7 +212,7 @@ _ol_renderer_webgl_Layer_.prototype.dispatchComposeEvent_ = function(type, conte
|
||||
/**
|
||||
* @return {!ol.Transform} Matrix.
|
||||
*/
|
||||
_ol_renderer_webgl_Layer_.prototype.getTexCoordMatrix = function() {
|
||||
WebGLLayerRenderer.prototype.getTexCoordMatrix = function() {
|
||||
return this.texCoordMatrix;
|
||||
};
|
||||
|
||||
@@ -220,7 +220,7 @@ _ol_renderer_webgl_Layer_.prototype.getTexCoordMatrix = function() {
|
||||
/**
|
||||
* @return {WebGLTexture} Texture.
|
||||
*/
|
||||
_ol_renderer_webgl_Layer_.prototype.getTexture = function() {
|
||||
WebGLLayerRenderer.prototype.getTexture = function() {
|
||||
return this.texture;
|
||||
};
|
||||
|
||||
@@ -228,7 +228,7 @@ _ol_renderer_webgl_Layer_.prototype.getTexture = function() {
|
||||
/**
|
||||
* @return {!ol.Transform} Matrix.
|
||||
*/
|
||||
_ol_renderer_webgl_Layer_.prototype.getProjectionMatrix = function() {
|
||||
WebGLLayerRenderer.prototype.getProjectionMatrix = function() {
|
||||
return this.projectionMatrix;
|
||||
};
|
||||
|
||||
@@ -236,7 +236,7 @@ _ol_renderer_webgl_Layer_.prototype.getProjectionMatrix = function() {
|
||||
/**
|
||||
* Handle webglcontextlost.
|
||||
*/
|
||||
_ol_renderer_webgl_Layer_.prototype.handleWebGLContextLost = function() {
|
||||
WebGLLayerRenderer.prototype.handleWebGLContextLost = function() {
|
||||
this.texture = null;
|
||||
this.framebuffer = null;
|
||||
this.framebufferDimension = undefined;
|
||||
@@ -250,7 +250,7 @@ _ol_renderer_webgl_Layer_.prototype.handleWebGLContextLost = function() {
|
||||
* @param {ol.webgl.Context} context Context.
|
||||
* @return {boolean} whether composeFrame should be called.
|
||||
*/
|
||||
_ol_renderer_webgl_Layer_.prototype.prepareFrame = function(frameState, layerState, context) {};
|
||||
WebGLLayerRenderer.prototype.prepareFrame = function(frameState, layerState, context) {};
|
||||
|
||||
|
||||
/**
|
||||
@@ -263,5 +263,5 @@ _ol_renderer_webgl_Layer_.prototype.prepareFrame = function(frameState, layerSta
|
||||
* @return {T|undefined} Callback result.
|
||||
* @template S,T,U
|
||||
*/
|
||||
_ol_renderer_webgl_Layer_.prototype.forEachLayerAtPixel = function(pixel, frameState, callback, thisArg) {};
|
||||
export default _ol_renderer_webgl_Layer_;
|
||||
WebGLLayerRenderer.prototype.forEachLayerAtPixel = function(pixel, frameState, callback, thisArg) {};
|
||||
export default WebGLLayerRenderer;
|
||||
|
||||
@@ -12,7 +12,7 @@ import _ol_layer_Layer_ from '../../layer/Layer.js';
|
||||
import _ol_render_Event_ from '../../render/Event.js';
|
||||
import RenderEventType from '../../render/EventType.js';
|
||||
import _ol_render_webgl_Immediate_ from '../../render/webgl/Immediate.js';
|
||||
import _ol_renderer_Map_ from '../Map.js';
|
||||
import MapRenderer from '../Map.js';
|
||||
import RendererType from '../Type.js';
|
||||
import SourceState from '../../source/State.js';
|
||||
import LRUCache from '../../structs/LRUCache.js';
|
||||
@@ -36,7 +36,7 @@ var WEBGL_TEXTURE_CACHE_HIGH_WATER_MARK = 1024;
|
||||
* @api
|
||||
*/
|
||||
var WebGLMapRenderer = function(container, map) {
|
||||
_ol_renderer_Map_.call(this, container, map);
|
||||
MapRenderer.call(this, container, map);
|
||||
|
||||
/**
|
||||
* @private
|
||||
@@ -166,7 +166,7 @@ var WebGLMapRenderer = function(container, map) {
|
||||
this.initializeGL_();
|
||||
};
|
||||
|
||||
inherits(WebGLMapRenderer, _ol_renderer_Map_);
|
||||
inherits(WebGLMapRenderer, MapRenderer);
|
||||
|
||||
|
||||
/**
|
||||
@@ -301,7 +301,7 @@ WebGLMapRenderer.prototype.disposeInternal = function() {
|
||||
});
|
||||
}
|
||||
this.context_.dispose();
|
||||
_ol_renderer_Map_.prototype.disposeInternal.call(this);
|
||||
MapRenderer.prototype.disposeInternal.call(this);
|
||||
};
|
||||
|
||||
|
||||
@@ -443,7 +443,7 @@ WebGLMapRenderer.prototype.renderFrame = function(frameState) {
|
||||
/** @type {Array.<ol.LayerState>} */
|
||||
var layerStatesToDraw = [];
|
||||
var layerStatesArray = frameState.layerStatesArray;
|
||||
stableSort(layerStatesArray, _ol_renderer_Map_.sortByZIndex);
|
||||
stableSort(layerStatesArray, MapRenderer.sortByZIndex);
|
||||
|
||||
var viewResolution = frameState.viewState.resolution;
|
||||
var i, ii, layerRenderer, layerState;
|
||||
|
||||
@@ -12,7 +12,7 @@ import {numberSafeCompareFunction} from '../../array.js';
|
||||
import {createEmpty, intersects} from '../../extent.js';
|
||||
import {roundUpToPowerOfTwo} from '../../math.js';
|
||||
import RendererType from '../Type.js';
|
||||
import _ol_renderer_webgl_Layer_ from '../webgl/Layer.js';
|
||||
import WebGLLayerRenderer from '../webgl/Layer.js';
|
||||
import _ol_renderer_webgl_tilelayershader_ from '../webgl/tilelayershader.js';
|
||||
import _ol_renderer_webgl_tilelayershader_Locations_ from '../webgl/tilelayershader/Locations.js';
|
||||
import _ol_size_ from '../../size.js';
|
||||
@@ -29,7 +29,7 @@ import _ol_webgl_Buffer_ from '../../webgl/Buffer.js';
|
||||
*/
|
||||
var WebGLTileLayerRenderer = function(mapRenderer, tileLayer) {
|
||||
|
||||
_ol_renderer_webgl_Layer_.call(this, mapRenderer, tileLayer);
|
||||
WebGLLayerRenderer.call(this, mapRenderer, tileLayer);
|
||||
|
||||
/**
|
||||
* @private
|
||||
@@ -86,7 +86,7 @@ var WebGLTileLayerRenderer = function(mapRenderer, tileLayer) {
|
||||
|
||||
};
|
||||
|
||||
inherits(WebGLTileLayerRenderer, _ol_renderer_webgl_Layer_);
|
||||
inherits(WebGLTileLayerRenderer, WebGLLayerRenderer);
|
||||
|
||||
|
||||
/**
|
||||
@@ -120,7 +120,7 @@ WebGLTileLayerRenderer['create'] = function(mapRenderer, layer) {
|
||||
WebGLTileLayerRenderer.prototype.disposeInternal = function() {
|
||||
var context = this.mapRenderer.getContext();
|
||||
context.deleteBuffer(this.renderArrayBuffer_);
|
||||
_ol_renderer_webgl_Layer_.prototype.disposeInternal.call(this);
|
||||
WebGLLayerRenderer.prototype.disposeInternal.call(this);
|
||||
};
|
||||
|
||||
|
||||
@@ -156,7 +156,7 @@ WebGLTileLayerRenderer.prototype.createLoadedTileFinder = function(source, proje
|
||||
* @inheritDoc
|
||||
*/
|
||||
WebGLTileLayerRenderer.prototype.handleWebGLContextLost = function() {
|
||||
_ol_renderer_webgl_Layer_.prototype.handleWebGLContextLost.call(this);
|
||||
WebGLLayerRenderer.prototype.handleWebGLContextLost.call(this);
|
||||
this.locations_ = null;
|
||||
};
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ import {buffer, containsExtent, createEmpty} from '../../extent.js';
|
||||
import _ol_render_webgl_ReplayGroup_ from '../../render/webgl/ReplayGroup.js';
|
||||
import RendererType from '../Type.js';
|
||||
import _ol_renderer_vector_ from '../vector.js';
|
||||
import _ol_renderer_webgl_Layer_ from '../webgl/Layer.js';
|
||||
import WebGLLayerRenderer from '../webgl/Layer.js';
|
||||
import _ol_transform_ from '../../transform.js';
|
||||
|
||||
/**
|
||||
@@ -20,7 +20,7 @@ import _ol_transform_ from '../../transform.js';
|
||||
*/
|
||||
var WebGLVectorLayerRenderer = function(mapRenderer, vectorLayer) {
|
||||
|
||||
_ol_renderer_webgl_Layer_.call(this, mapRenderer, vectorLayer);
|
||||
WebGLLayerRenderer.call(this, mapRenderer, vectorLayer);
|
||||
|
||||
/**
|
||||
* @private
|
||||
@@ -67,7 +67,7 @@ var WebGLVectorLayerRenderer = function(mapRenderer, vectorLayer) {
|
||||
|
||||
};
|
||||
|
||||
inherits(WebGLVectorLayerRenderer, _ol_renderer_webgl_Layer_);
|
||||
inherits(WebGLVectorLayerRenderer, WebGLLayerRenderer);
|
||||
|
||||
|
||||
/**
|
||||
@@ -128,7 +128,7 @@ WebGLVectorLayerRenderer.prototype.disposeInternal = function() {
|
||||
replayGroup.getDeleteResourcesFunction(context)();
|
||||
this.replayGroup_ = null;
|
||||
}
|
||||
_ol_renderer_webgl_Layer_.prototype.disposeInternal.call(this);
|
||||
WebGLLayerRenderer.prototype.disposeInternal.call(this);
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ import LineString from '../../../src/ol/geom/LineString.js';
|
||||
import Point from '../../../src/ol/geom/Point.js';
|
||||
import Polygon from '../../../src/ol/geom/Polygon.js';
|
||||
import _ol_render_ from '../../../src/ol/render.js';
|
||||
import _ol_render_VectorContext_ from '../../../src/ol/render/VectorContext.js';
|
||||
import VectorContext from '../../../src/ol/render/VectorContext.js';
|
||||
import _ol_render_canvas_Immediate_ from '../../../src/ol/render/canvas/Immediate.js';
|
||||
import _ol_style_Circle_ from '../../../src/ol/style/Circle.js';
|
||||
import _ol_style_Fill_ from '../../../src/ol/style/Fill.js';
|
||||
@@ -22,7 +22,7 @@ describe('ol.render', function() {
|
||||
pixelRatio: 1,
|
||||
size: [100, 100]
|
||||
});
|
||||
expect(vectorContext).to.be.a(_ol_render_VectorContext_);
|
||||
expect(vectorContext).to.be.a(VectorContext);
|
||||
expect(vectorContext).to.be.a(_ol_render_canvas_Immediate_);
|
||||
});
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import * as _ol_extent_ from '../../../../src/ol/extent.js';
|
||||
import _ol_layer_Group_ from '../../../../src/ol/layer/Group.js';
|
||||
import _ol_layer_Layer_ from '../../../../src/ol/layer/Layer.js';
|
||||
import _ol_obj_ from '../../../../src/ol/obj.js';
|
||||
import _ol_renderer_Map_ from '../../../../src/ol/renderer/Map.js';
|
||||
import MapRenderer from '../../../../src/ol/renderer/Map.js';
|
||||
import Source from '../../../../src/ol/source/Source.js';
|
||||
|
||||
|
||||
@@ -452,7 +452,7 @@ describe('ol.layer.Group', function() {
|
||||
|
||||
var layerStatesArray = layerGroup.getLayerStatesArray();
|
||||
var initialArray = layerStatesArray.slice();
|
||||
stableSort(layerStatesArray, _ol_renderer_Map_.sortByZIndex);
|
||||
stableSort(layerStatesArray, MapRenderer.sortByZIndex);
|
||||
expect(layerStatesArray[0]).to.eql(initialArray[0]);
|
||||
expect(layerStatesArray[1]).to.eql(initialArray[1]);
|
||||
|
||||
@@ -480,7 +480,7 @@ describe('ol.layer.Group', function() {
|
||||
|
||||
var layerStatesArray = layerGroup.getLayerStatesArray();
|
||||
var initialArray = layerStatesArray.slice();
|
||||
stableSort(layerStatesArray, _ol_renderer_Map_.sortByZIndex);
|
||||
stableSort(layerStatesArray, MapRenderer.sortByZIndex);
|
||||
expect(layerStatesArray[0]).to.eql(initialArray[3]);
|
||||
expect(layerStatesArray[1]).to.eql(initialArray[0]);
|
||||
expect(layerStatesArray[2]).to.eql(initialArray[2]);
|
||||
|
||||
@@ -9,7 +9,7 @@ import {defaults as defaultInteractions} from '../../../src/ol/interaction.js';
|
||||
import DoubleClickZoom from '../../../src/ol/interaction/DoubleClickZoom.js';
|
||||
import Interaction from '../../../src/ol/interaction/Interaction.js';
|
||||
import MouseWheelZoom from '../../../src/ol/interaction/MouseWheelZoom.js';
|
||||
import _ol_interaction_PinchZoom_ from '../../../src/ol/interaction/PinchZoom.js';
|
||||
import PinchZoom from '../../../src/ol/interaction/PinchZoom.js';
|
||||
import TileLayer from '../../../src/ol/layer/Tile.js';
|
||||
import VectorLayer from '../../../src/ol/layer/Vector.js';
|
||||
import _ol_renderer_canvas_IntermediateCanvas_ from '../../../src/ol/renderer/canvas/IntermediateCanvas.js';
|
||||
@@ -509,7 +509,7 @@ describe('ol.Map', function() {
|
||||
options.pinchZoom = true;
|
||||
var interactions = defaultInteractions(options);
|
||||
expect(interactions.getLength()).to.eql(1);
|
||||
expect(interactions.item(0)).to.be.a(_ol_interaction_PinchZoom_);
|
||||
expect(interactions.item(0)).to.be.a(PinchZoom);
|
||||
expect(interactions.item(0).constrainResolution_).to.eql(false);
|
||||
});
|
||||
});
|
||||
@@ -521,7 +521,7 @@ describe('ol.Map', function() {
|
||||
options.constrainResolution = true;
|
||||
var interactions = defaultInteractions(options);
|
||||
expect(interactions.getLength()).to.eql(2);
|
||||
expect(interactions.item(0)).to.be.a(_ol_interaction_PinchZoom_);
|
||||
expect(interactions.item(0)).to.be.a(PinchZoom);
|
||||
expect(interactions.item(0).constrainResolution_).to.eql(true);
|
||||
expect(interactions.item(1)).to.be.a(MouseWheelZoom);
|
||||
expect(interactions.item(1).constrainResolution_).to.eql(true);
|
||||
|
||||
@@ -6,7 +6,7 @@ import MultiPoint from '../../../../../src/ol/geom/MultiPoint.js';
|
||||
import MultiPolygon from '../../../../../src/ol/geom/MultiPolygon.js';
|
||||
import Point from '../../../../../src/ol/geom/Point.js';
|
||||
import Polygon from '../../../../../src/ol/geom/Polygon.js';
|
||||
import _ol_render_VectorContext_ from '../../../../../src/ol/render/VectorContext.js';
|
||||
import VectorContext from '../../../../../src/ol/render/VectorContext.js';
|
||||
import _ol_render_canvas_Immediate_ from '../../../../../src/ol/render/canvas/Immediate.js';
|
||||
import _ol_style_Circle_ from '../../../../../src/ol/style/Circle.js';
|
||||
import _ol_style_Fill_ from '../../../../../src/ol/style/Fill.js';
|
||||
@@ -32,7 +32,7 @@ describe('ol.render.canvas.Immediate', function() {
|
||||
it('creates an instance', function() {
|
||||
var instance = new _ol_render_canvas_Immediate_();
|
||||
expect(instance).to.be.a(_ol_render_canvas_Immediate_);
|
||||
expect(instance).to.be.a(_ol_render_VectorContext_);
|
||||
expect(instance).to.be.a(VectorContext);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import _ol_transform_ from '../../../../../src/ol/transform.js';
|
||||
import ImageLayer from '../../../../../src/ol/layer/Image.js';
|
||||
import _ol_renderer_Map_ from '../../../../../src/ol/renderer/Map.js';
|
||||
import MapRenderer from '../../../../../src/ol/renderer/Map.js';
|
||||
import _ol_renderer_canvas_IntermediateCanvas_ from '../../../../../src/ol/renderer/canvas/IntermediateCanvas.js';
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ describe('ol.renderer.canvas.IntermediateCanvas', function() {
|
||||
renderer.getImageTransform = function() {
|
||||
return _ol_transform_.create();
|
||||
};
|
||||
_ol_renderer_Map_.prototype.calculateMatrices2D(frameState);
|
||||
MapRenderer.prototype.calculateMatrices2D(frameState);
|
||||
layerState = layer.getLayerState();
|
||||
context = {
|
||||
save: sinon.spy(),
|
||||
|
||||
@@ -5,7 +5,7 @@ import View from '../../../../../src/ol/View.js';
|
||||
import Point from '../../../../../src/ol/geom/Point.js';
|
||||
import TileLayer from '../../../../../src/ol/layer/Tile.js';
|
||||
import VectorLayer from '../../../../../src/ol/layer/Vector.js';
|
||||
import _ol_renderer_canvas_Layer_ from '../../../../../src/ol/renderer/canvas/Layer.js';
|
||||
import CanvasLayerRenderer from '../../../../../src/ol/renderer/canvas/Layer.js';
|
||||
import CanvasMapRenderer from '../../../../../src/ol/renderer/canvas/Map.js';
|
||||
import VectorSource from '../../../../../src/ol/source/Vector.js';
|
||||
import _ol_style_Icon_ from '../../../../../src/ol/style/Icon.js';
|
||||
@@ -174,7 +174,7 @@ describe('ol.renderer.canvas.Map', function() {
|
||||
});
|
||||
renderer = map.getRenderer();
|
||||
renderer.layerRenderers_ = {};
|
||||
var layerRenderer = new _ol_renderer_canvas_Layer_(layer);
|
||||
var layerRenderer = new CanvasLayerRenderer(layer);
|
||||
layerRenderer.prepareFrame = function() {
|
||||
return true;
|
||||
};
|
||||
|
||||
@@ -2,7 +2,7 @@ import Map from '../../../../../src/ol/Map.js';
|
||||
import View from '../../../../../src/ol/View.js';
|
||||
import TileLayer from '../../../../../src/ol/layer/Tile.js';
|
||||
import {get as getProjection} from '../../../../../src/ol/proj.js';
|
||||
import _ol_renderer_Map_ from '../../../../../src/ol/renderer/Map.js';
|
||||
import MapRenderer from '../../../../../src/ol/renderer/Map.js';
|
||||
import CanvasTileLayerRenderer from '../../../../../src/ol/renderer/canvas/TileLayer.js';
|
||||
import TileWMS from '../../../../../src/ol/source/TileWMS.js';
|
||||
import XYZ from '../../../../../src/ol/source/XYZ.js';
|
||||
@@ -97,7 +97,7 @@ describe('ol.renderer.canvas.TileLayer', function() {
|
||||
renderer.getImageTransform = function() {
|
||||
return _ol_transform_.create();
|
||||
};
|
||||
_ol_renderer_Map_.prototype.calculateMatrices2D(frameState);
|
||||
MapRenderer.prototype.calculateMatrices2D(frameState);
|
||||
var layerState = layer.getLayerState();
|
||||
var canvas = document.createElement('canvas');
|
||||
canvas.width = 200;
|
||||
|
||||
@@ -3,7 +3,7 @@ import Map from '../../../../src/ol/Map.js';
|
||||
import View from '../../../../src/ol/View.js';
|
||||
import _ol_layer_Layer_ from '../../../../src/ol/layer/Layer.js';
|
||||
import TileLayer from '../../../../src/ol/layer/Tile.js';
|
||||
import _ol_renderer_Layer_ from '../../../../src/ol/renderer/Layer.js';
|
||||
import LayerRenderer from '../../../../src/ol/renderer/Layer.js';
|
||||
import XYZ from '../../../../src/ol/source/XYZ.js';
|
||||
import _ol_tilecoord_ from '../../../../src/ol/tilecoord.js';
|
||||
|
||||
@@ -14,7 +14,7 @@ describe('ol.renderer.Layer', function() {
|
||||
|
||||
beforeEach(function() {
|
||||
var layer = new _ol_layer_Layer_({});
|
||||
renderer = new _ol_renderer_Layer_(layer);
|
||||
renderer = new LayerRenderer(layer);
|
||||
});
|
||||
|
||||
describe('#loadImage', function() {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import Disposable from '../../../../src/ol/Disposable.js';
|
||||
import Map from '../../../../src/ol/Map.js';
|
||||
import _ol_renderer_Map_ from '../../../../src/ol/renderer/Map.js';
|
||||
import MapRenderer from '../../../../src/ol/renderer/Map.js';
|
||||
|
||||
|
||||
describe('ol.renderer.Map', function() {
|
||||
@@ -9,8 +9,8 @@ describe('ol.renderer.Map', function() {
|
||||
|
||||
it('createst an instance', function() {
|
||||
var map = new Map({});
|
||||
var renderer = new _ol_renderer_Map_(null, map);
|
||||
expect(renderer).to.be.a(_ol_renderer_Map_);
|
||||
var renderer = new MapRenderer(null, map);
|
||||
expect(renderer).to.be.a(MapRenderer);
|
||||
expect(renderer).to.be.a(Disposable);
|
||||
renderer.dispose();
|
||||
map.dispose();
|
||||
|
||||
Reference in New Issue
Block a user