No olx and ol types for ol/interaction/Translate
This commit is contained in:
@@ -5,47 +5,6 @@
|
|||||||
let olx;
|
let olx;
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @typedef {{
|
|
||||||
* features: (ol.Collection.<module:ol/Feature~Feature>|undefined),
|
|
||||||
* layers: (undefined|Array.<ol.layer.Layer>|function(ol.layer.Layer): boolean),
|
|
||||||
* hitTolerance: (number|undefined)
|
|
||||||
* }}
|
|
||||||
*/
|
|
||||||
olx.interaction.TranslateOptions;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Only features contained in this collection will be able to be translated. If
|
|
||||||
* not specified, all features on the map will be able to be translated.
|
|
||||||
* @type {ol.Collection.<module:ol/Feature~Feature>|undefined}
|
|
||||||
* @api
|
|
||||||
*/
|
|
||||||
olx.interaction.TranslateOptions.prototype.features;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* A list of layers from which features should be
|
|
||||||
* translated. Alternatively, a filter function can be provided. The
|
|
||||||
* function will be called for each layer in the map and should return
|
|
||||||
* `true` for layers that you want to be translatable. If the option is
|
|
||||||
* absent, all visible layers will be considered translatable.
|
|
||||||
* @type {undefined|Array.<ol.layer.Layer>|function(ol.layer.Layer): boolean}
|
|
||||||
* @api
|
|
||||||
*/
|
|
||||||
olx.interaction.TranslateOptions.prototype.layers;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Hit-detection tolerance. Pixels inside the radius around the given position
|
|
||||||
* will be checked for features. This only works for the canvas renderer and
|
|
||||||
* not for WebGL. Default is `0`.
|
|
||||||
* @type {number|undefined}
|
|
||||||
* @api
|
|
||||||
*/
|
|
||||||
olx.interaction.TranslateOptions.prototype.hitTolerance;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {{opacity: (number|undefined),
|
* @typedef {{opacity: (number|undefined),
|
||||||
* visible: (boolean|undefined),
|
* visible: (boolean|undefined),
|
||||||
|
|||||||
@@ -1,19 +1,4 @@
|
|||||||
|
|
||||||
/**
|
|
||||||
* @typedef {Object} interaction_TranslateOptions
|
|
||||||
* @property {ol.Collection.<module:ol/Feature~Feature>|undefined} features Only features contained in this collection will be able to be translated. If
|
|
||||||
* not specified, all features on the map will be able to be translated.
|
|
||||||
* @property {undefined|Array.<ol.layer.Layer>|function(ol.layer.Layer): boolean} layers A list of layers from which features should be
|
|
||||||
* translated. Alternatively, a filter function can be provided. The
|
|
||||||
* function will be called for each layer in the map and should return
|
|
||||||
* `true` for layers that you want to be translatable. If the option is
|
|
||||||
* absent, all visible layers will be considered translatable.
|
|
||||||
* @property {number|undefined} hitTolerance Hit-detection tolerance. Pixels inside the radius around the given position
|
|
||||||
* will be checked for features. This only works for the canvas renderer and
|
|
||||||
* not for WebGL. Default is `0`.
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {Object} layer_BaseOptions
|
* @typedef {Object} layer_BaseOptions
|
||||||
* @property {number|undefined} opacity Opacity (0, 1). Default is `1`.
|
* @property {number|undefined} opacity Opacity (0, 1). Default is `1`.
|
||||||
|
|||||||
@@ -37,16 +37,31 @@ const TranslateEventType = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @typedef {Object} interaction_TranslateOptions
|
||||||
|
* @property {module:ol/collection/Collection~Collection.<module:ol/Feature~Feature>|undefined} features Only features contained in this collection will be able to be translated. If
|
||||||
|
* not specified, all features on the map will be able to be translated.
|
||||||
|
* @property {undefined|Array.<module:ol/layer/Layer~Layer>|function(module:ol/layer/Layer~Layer): boolean} layers A list of layers from which features should be
|
||||||
|
* translated. Alternatively, a filter function can be provided. The
|
||||||
|
* function will be called for each layer in the map and should return
|
||||||
|
* `true` for layers that you want to be translatable. If the option is
|
||||||
|
* absent, all visible layers will be considered translatable.
|
||||||
|
* @property {number|undefined} hitTolerance Hit-detection tolerance. Pixels inside the radius around the given position
|
||||||
|
* will be checked for features. This only works for the canvas renderer and
|
||||||
|
* not for WebGL. Default is `0`.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @classdesc
|
* @classdesc
|
||||||
* Events emitted by {@link ol.interaction.Translate} instances are instances of
|
* Events emitted by {@link module:ol/interaction/Translate~Translate} instances
|
||||||
* this type.
|
* are instances of this type.
|
||||||
*
|
*
|
||||||
* @constructor
|
* @constructor
|
||||||
* @extends {ol.events.Event}
|
* @extends {module:ol/events/Event~Event}
|
||||||
* @implements {oli.interaction.TranslateEvent}
|
* @implements {oli.interaction.TranslateEvent}
|
||||||
* @param {ol.interaction.TranslateEventType} type Type.
|
* @param {module:ol/interaction/Translate~TranslateEventType} type Type.
|
||||||
* @param {ol.Collection.<module:ol/Feature~Feature>} features The features translated.
|
* @param {module:ol/collection/Collection~Collection.<module:ol/Feature~Feature>} features The features translated.
|
||||||
* @param {module:ol/coordinate~Coordinate} coordinate The event coordinate.
|
* @param {module:ol/coordinate~Coordinate} coordinate The event coordinate.
|
||||||
*/
|
*/
|
||||||
export const TranslateEvent = function(type, features, coordinate) {
|
export const TranslateEvent = function(type, features, coordinate) {
|
||||||
@@ -55,7 +70,7 @@ export const TranslateEvent = function(type, features, coordinate) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* The features being translated.
|
* The features being translated.
|
||||||
* @type {ol.Collection.<module:ol/Feature~Feature>}
|
* @type {module:ol/collection/Collection~Collection.<module:ol/Feature~Feature>}
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
this.features = features;
|
this.features = features;
|
||||||
@@ -77,8 +92,8 @@ inherits(TranslateEvent, Event);
|
|||||||
* Interaction for translating (moving) features.
|
* Interaction for translating (moving) features.
|
||||||
*
|
*
|
||||||
* @constructor
|
* @constructor
|
||||||
* @extends {ol.interaction.Pointer}
|
* @extends {module:ol/interaction/Pointer~Pointer}
|
||||||
* @fires ol.interaction.TranslateEvent
|
* @fires module:ol/interaction/Translate~TranslateEvent
|
||||||
* @param {olx.interaction.TranslateOptions=} opt_options Options.
|
* @param {olx.interaction.TranslateOptions=} opt_options Options.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
@@ -101,12 +116,12 @@ const Translate = function(opt_options) {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {ol.Collection.<module:ol/Feature~Feature>}
|
* @type {module:ol/collection/Collection~Collection.<module:ol/Feature~Feature>}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
this.features_ = options.features !== undefined ? options.features : null;
|
this.features_ = options.features !== undefined ? options.features : null;
|
||||||
|
|
||||||
/** @type {function(ol.layer.Layer): boolean} */
|
/** @type {function(module:ol/layer/Layer~Layer): boolean} */
|
||||||
let layerFilter;
|
let layerFilter;
|
||||||
if (options.layers) {
|
if (options.layers) {
|
||||||
if (typeof options.layers === 'function') {
|
if (typeof options.layers === 'function') {
|
||||||
@@ -123,7 +138,7 @@ const Translate = function(opt_options) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @type {function(ol.layer.Layer): boolean}
|
* @type {function(module:ol/layer/Layer~Layer): boolean}
|
||||||
*/
|
*/
|
||||||
this.layerFilter_ = layerFilter;
|
this.layerFilter_ = layerFilter;
|
||||||
|
|
||||||
@@ -149,9 +164,9 @@ inherits(Translate, PointerInteraction);
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {ol.MapBrowserPointerEvent} event Event.
|
* @param {module:ol/MapBrowserPointerEvent~MapBrowserPointerEvent} event Event.
|
||||||
* @return {boolean} Start drag sequence?
|
* @return {boolean} Start drag sequence?
|
||||||
* @this {ol.interaction.Translate}
|
* @this {module:ol/interaction/Translate~Translate}
|
||||||
*/
|
*/
|
||||||
function handleDownEvent(event) {
|
function handleDownEvent(event) {
|
||||||
this.lastFeature_ = this.featuresAtPixel_(event.pixel, event.map);
|
this.lastFeature_ = this.featuresAtPixel_(event.pixel, event.map);
|
||||||
@@ -172,9 +187,9 @@ function handleDownEvent(event) {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {ol.MapBrowserPointerEvent} event Event.
|
* @param {module:ol/MapBrowserPointerEvent~MapBrowserPointerEvent} event Event.
|
||||||
* @return {boolean} Stop drag sequence?
|
* @return {boolean} Stop drag sequence?
|
||||||
* @this {ol.interaction.Translate}
|
* @this {module:ol/interaction/Translate~Translate}
|
||||||
*/
|
*/
|
||||||
function handleUpEvent(event) {
|
function handleUpEvent(event) {
|
||||||
if (this.lastCoordinate_) {
|
if (this.lastCoordinate_) {
|
||||||
@@ -194,8 +209,8 @@ function handleUpEvent(event) {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {ol.MapBrowserPointerEvent} event Event.
|
* @param {module:ol/MapBrowserPointerEvent~MapBrowserPointerEvent} event Event.
|
||||||
* @this {ol.interaction.Translate}
|
* @this {module:ol/interaction/Translate~Translate}
|
||||||
*/
|
*/
|
||||||
function handleDragEvent(event) {
|
function handleDragEvent(event) {
|
||||||
if (this.lastCoordinate_) {
|
if (this.lastCoordinate_) {
|
||||||
@@ -222,7 +237,7 @@ function handleDragEvent(event) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/MapBrowserEvent~MapBrowserEvent} event Event.
|
* @param {module:ol/MapBrowserEvent~MapBrowserEvent} event Event.
|
||||||
* @this {ol.interaction.Translate}
|
* @this {module:ol/interaction/Translate~Translate}
|
||||||
*/
|
*/
|
||||||
function handleMoveEvent(event) {
|
function handleMoveEvent(event) {
|
||||||
const elem = event.map.getViewport();
|
const elem = event.map.getViewport();
|
||||||
@@ -242,7 +257,7 @@ function handleMoveEvent(event) {
|
|||||||
* Tests to see if the given coordinates intersects any of our selected
|
* Tests to see if the given coordinates intersects any of our selected
|
||||||
* features.
|
* features.
|
||||||
* @param {module:ol~Pixel} pixel Pixel coordinate to test for intersection.
|
* @param {module:ol~Pixel} pixel Pixel coordinate to test for intersection.
|
||||||
* @param {ol.PluggableMap} map Map to test the intersection on.
|
* @param {module:ol/PluggableMap~PluggableMap} map Map to test the intersection on.
|
||||||
* @return {module:ol/Feature~Feature} Returns the feature found at the specified pixel
|
* @return {module:ol/Feature~Feature} Returns the feature found at the specified pixel
|
||||||
* coordinates.
|
* coordinates.
|
||||||
* @private
|
* @private
|
||||||
@@ -301,7 +316,7 @@ Translate.prototype.handleActiveChanged_ = function() {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {ol.PluggableMap} oldMap Old map.
|
* @param {module:ol/PluggableMap~PluggableMap} oldMap Old map.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
Translate.prototype.updateState_ = function(oldMap) {
|
Translate.prototype.updateState_ = function(oldMap) {
|
||||||
|
|||||||
Reference in New Issue
Block a user