Add an offset property to ol.Overlay

Replaces "offsetX" and "offsetY" by an ol.Object "offset" property.
This commit is contained in:
Éric Lemoine
2014-06-18 22:11:07 +02:00
parent cc51060170
commit d1d8d5f96c
2 changed files with 73 additions and 33 deletions

View File

@@ -203,12 +203,11 @@ olx.MapOptions.prototype.view;
/**
* Object literal with config options for the overlay.
* @typedef {{element: (Element|undefined),
* offset: (Array.<number>|undefined),
* position: (ol.Coordinate|undefined),
* positioning: (ol.OverlayPositioning|string|undefined),
* stopEvent: (boolean|undefined),
* insertFirst: (boolean|undefined),
* offsetX: (number|undefined),
* offsetY: (number|undefined)}}
* insertFirst: (boolean|undefined)}}
* @todo api
*/
olx.OverlayOptions;
@@ -221,6 +220,16 @@ olx.OverlayOptions;
olx.OverlayOptions.prototype.element;
/**
* Offsets in pixels used when positioning the overlay. The fist element in the
* array is the horizontal offset. A positive value shifts the overlay right.
* The second element in the array is the vertical offset. A positive value
* shifts the overlay down. Default is `[0, 0]`.
* @type {Array.<number>|undefined}
*/
olx.OverlayOptions.prototype.offset;
/**
* The overlay position in map projection.
* @type {ol.Coordinate|undefined}
@@ -254,22 +263,6 @@ olx.OverlayOptions.prototype.stopEvent;
olx.OverlayOptions.prototype.insertFirst;
/**
* Horizontal offset in pixels. A positive will shift the overlay right. Default
* is `0`.
* @type {number|undefined}
*/
olx.OverlayOptions.prototype.offsetX;
/**
* Vertical offset in pixels. A positive will shift the overlay down. Default is
* `0`.
* @type {number|undefined}
*/
olx.OverlayOptions.prototype.offsetY;
/**
* Object literal with config options for the Proj4js projection.
* @typedef {{code: string,