Fix enum types
This commit is contained in:
@@ -25,7 +25,7 @@ const Property = {
|
|||||||
* @constructor
|
* @constructor
|
||||||
* @extends {module:ol/events/Event~Event}
|
* @extends {module:ol/events/Event~Event}
|
||||||
* @implements {oli.CollectionEvent}
|
* @implements {oli.CollectionEvent}
|
||||||
* @param {module:ol/CollectionEventType~CollectionEventType} type Type.
|
* @param {module:ol/CollectionEventType} type Type.
|
||||||
* @param {*=} opt_element Element.
|
* @param {*=} opt_element Element.
|
||||||
*/
|
*/
|
||||||
export const CollectionEvent = function(type, opt_element) {
|
export const CollectionEvent = function(type, opt_element) {
|
||||||
|
|||||||
+1
-1
@@ -605,7 +605,7 @@ Graticule.prototype.getParallels = function() {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/render/Event~Event} e Event.
|
* @param {module:ol/render/Event~RenderEvent} e Event.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
Graticule.prototype.handlePostCompose_ = function(e) {
|
Graticule.prototype.handlePostCompose_ = function(e) {
|
||||||
|
|||||||
+2
-2
@@ -62,8 +62,8 @@ import CanvasVectorTileLayerRenderer from './renderer/canvas/VectorTileLayer.js'
|
|||||||
* @param {module:ol/PluggableMap~MapOptions} options Map options.
|
* @param {module:ol/PluggableMap~MapOptions} options Map options.
|
||||||
* @fires module:ol/MapBrowserEvent~MapBrowserEvent
|
* @fires module:ol/MapBrowserEvent~MapBrowserEvent
|
||||||
* @fires module:ol/MapEvent~MapEvent
|
* @fires module:ol/MapEvent~MapEvent
|
||||||
* @fires module:ol/render/Event~Event#postcompose
|
* @fires module:ol/render/Event~RenderEvent#postcompose
|
||||||
* @fires module:ol/render/Event~Event#precompose
|
* @fires module:ol/render/Event~RenderEvent#precompose
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
const Map = function(options) {
|
const Map = function(options) {
|
||||||
|
|||||||
@@ -136,8 +136,8 @@ import {create as createTransform, apply as applyTransform} from './transform.js
|
|||||||
* @param {module:ol/PluggableMap~MapOptions} options Map options.
|
* @param {module:ol/PluggableMap~MapOptions} options Map options.
|
||||||
* @fires module:ol/MapBrowserEvent~MapBrowserEvent
|
* @fires module:ol/MapBrowserEvent~MapBrowserEvent
|
||||||
* @fires module:ol/MapEvent~MapEvent
|
* @fires module:ol/MapEvent~MapEvent
|
||||||
* @fires module:ol/render/Event~Event#postcompose
|
* @fires module:ol/render/Event~RenderEvent#postcompose
|
||||||
* @fires module:ol/render/Event~Event#precompose
|
* @fires module:ol/render/Event~RenderEvent#precompose
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
const PluggableMap = function(options) {
|
const PluggableMap = function(options) {
|
||||||
|
|||||||
+2
-2
@@ -62,8 +62,8 @@ import WebGLVectorLayerRenderer from './renderer/webgl/VectorLayer.js';
|
|||||||
* @param {module:ol/PluggableMap~MapOptions} options Map options.
|
* @param {module:ol/PluggableMap~MapOptions} options Map options.
|
||||||
* @fires module:ol/MapBrowserEvent~MapBrowserEvent
|
* @fires module:ol/MapBrowserEvent~MapBrowserEvent
|
||||||
* @fires module:ol/MapEvent~MapEvent
|
* @fires module:ol/MapEvent~MapEvent
|
||||||
* @fires module:ol/render/Event~Event#postcompose
|
* @fires module:ol/render/Event~RenderEvent#postcompose
|
||||||
* @fires module:ol/render/Event~Event#precompose
|
* @fires module:ol/render/Event~RenderEvent#precompose
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
const WebGLMap = function(options) {
|
const WebGLMap = function(options) {
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ import {get as getProjection} from '../proj.js';
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object.<module:ol/geom/GeometryType~GeometryType, function(EsriJSONGeometry): module:ol/geom/Geometry~Geometry>}
|
* @type {Object.<module:ol/geom/GeometryType, function(EsriJSONGeometry): module:ol/geom/Geometry~Geometry>}
|
||||||
*/
|
*/
|
||||||
const GEOMETRY_READERS = {};
|
const GEOMETRY_READERS = {};
|
||||||
GEOMETRY_READERS[GeometryType.POINT] = readPointGeometry;
|
GEOMETRY_READERS[GeometryType.POINT] = readPointGeometry;
|
||||||
@@ -90,7 +90,7 @@ function readGeometry(object, opt_options) {
|
|||||||
if (!object) {
|
if (!object) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
/** @type {module:ol/geom/GeometryType~GeometryType} */
|
/** @type {module:ol/geom/GeometryType} */
|
||||||
let type;
|
let type;
|
||||||
if (typeof object.x === 'number' && typeof object.y === 'number') {
|
if (typeof object.x === 'number' && typeof object.y === 'number') {
|
||||||
type = GeometryType.POINT;
|
type = GeometryType.POINT;
|
||||||
|
|||||||
@@ -125,7 +125,7 @@ FeatureFormat.prototype.getLastExtent = function() {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @abstract
|
* @abstract
|
||||||
* @return {module:ol/format/FormatType~FormatType} Format.
|
* @return {module:ol/format/FormatType} Format.
|
||||||
*/
|
*/
|
||||||
FeatureFormat.prototype.getType = function() {};
|
FeatureFormat.prototype.getType = function() {};
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ import RenderFeature from '../render/Feature.js';
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {Object} Options
|
* @typedef {Object} Options
|
||||||
* @property {function((module:ol/geom/Geometry~Geometry|Object.<string,*>)=)|function(module:ol/geom/GeometryType~GeometryType,Array.<number>,(Array.<number>|Array.<Array.<number>>),Object.<string,*>,number)} [featureClass]
|
* @property {function((module:ol/geom/Geometry~Geometry|Object.<string,*>)=)|function(module:ol/geom/GeometryType,Array.<number>,(Array.<number>|Array.<Array.<number>>),Object.<string,*>,number)} [featureClass]
|
||||||
* Class for features returned by {@link ol.format.MVT#readFeatures}. Set to
|
* Class for features returned by {@link ol.format.MVT#readFeatures}. Set to
|
||||||
* {@link module:ol/Feature~Feature} to get full editing and geometry support at the cost of
|
* {@link module:ol/Feature~Feature} to get full editing and geometry support at the cost of
|
||||||
* decreased rendering performance. The default is {@link module:ol/render/Feature~RenderFeature},
|
* decreased rendering performance. The default is {@link module:ol/render/Feature~RenderFeature},
|
||||||
@@ -64,7 +64,7 @@ const MVT = function(opt_options) {
|
|||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @type {function((module:ol/geom/Geometry~Geometry|Object.<string,*>)=)|
|
* @type {function((module:ol/geom/Geometry~Geometry|Object.<string,*>)=)|
|
||||||
* function(module:ol/geom/GeometryType~GeometryType,Array.<number>,
|
* function(module:ol/geom/GeometryType,Array.<number>,
|
||||||
* (Array.<number>|Array.<Array.<number>>),Object.<string,*>,number)}
|
* (Array.<number>|Array.<Array.<number>>),Object.<string,*>,number)}
|
||||||
*/
|
*/
|
||||||
this.featureClass_ = options.featureClass ?
|
this.featureClass_ = options.featureClass ?
|
||||||
@@ -272,10 +272,10 @@ MVT.prototype.readRawGeometry_ = function(pbf, feature, flatCoordinates, ends) {
|
|||||||
* @param {number} type The raw feature's geometry type
|
* @param {number} type The raw feature's geometry type
|
||||||
* @param {number} numEnds Number of ends of the flat coordinates of the
|
* @param {number} numEnds Number of ends of the flat coordinates of the
|
||||||
* geometry.
|
* geometry.
|
||||||
* @return {module:ol/geom/GeometryType~GeometryType} The geometry type.
|
* @return {module:ol/geom/GeometryType} The geometry type.
|
||||||
*/
|
*/
|
||||||
function getGeometryType(type, numEnds) {
|
function getGeometryType(type, numEnds) {
|
||||||
/** @type {module:ol/geom/GeometryType~GeometryType} */
|
/** @type {module:ol/geom/GeometryType} */
|
||||||
let geometryType;
|
let geometryType;
|
||||||
if (type === 1) {
|
if (type === 1) {
|
||||||
geometryType = numEnds === 1 ?
|
geometryType = numEnds === 1 ?
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import {get as getProjection, getTransform} from '../proj.js';
|
|||||||
import Units from '../proj/Units.js';
|
import Units from '../proj/Units.js';
|
||||||
import {create as createTransform, compose as composeTransform} from '../transform.js';
|
import {create as createTransform, compose as composeTransform} from '../transform.js';
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @classdesc
|
* @classdesc
|
||||||
* Abstract base class; normally only used for creating subclasses and not
|
* Abstract base class; normally only used for creating subclasses and not
|
||||||
@@ -203,7 +204,7 @@ Geometry.prototype.getSimplifiedGeometry = function(squaredTolerance) {};
|
|||||||
/**
|
/**
|
||||||
* Get the type of this geometry.
|
* Get the type of this geometry.
|
||||||
* @abstract
|
* @abstract
|
||||||
* @return {module:ol/geom/GeometryType~GeometryType} Geometry type.
|
* @return {module:ol/geom/GeometryType} Geometry type.
|
||||||
*/
|
*/
|
||||||
Geometry.prototype.getType = function() {};
|
Geometry.prototype.getType = function() {};
|
||||||
|
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ import {createEditingStyle} from '../style/Style.js';
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {Object} Options
|
* @typedef {Object} Options
|
||||||
* @property {module:ol/geom/GeometryType~GeometryType} type Geometry type of
|
* @property {module:ol/geom/GeometryType} type Geometry type of
|
||||||
* the geometries being drawn with this instance.
|
* the geometries being drawn with this instance.
|
||||||
* @property {number} [clickTolerance=6] The maximum distance in pixels between
|
* @property {number} [clickTolerance=6] The maximum distance in pixels between
|
||||||
* "down" and "up" for a "up" event to be considered a "click" event and
|
* "down" and "up" for a "up" event to be considered a "click" event and
|
||||||
@@ -222,10 +222,10 @@ const Draw = function(options) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Geometry type.
|
* Geometry type.
|
||||||
* @type {module:ol/geom/GeometryType~GeometryType}
|
* @type {module:ol/geom/GeometryType}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
this.type_ = /** @type {module:ol/geom/GeometryType~GeometryType} */ (options.type);
|
this.type_ = /** @type {module:ol/geom/GeometryType} */ (options.type);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Drawing mode (derived from geometry type.
|
* Drawing mode (derived from geometry type.
|
||||||
@@ -1008,7 +1008,7 @@ export function createBox() {
|
|||||||
/**
|
/**
|
||||||
* Get the drawing mode. The mode for mult-part geometries is the same as for
|
* Get the drawing mode. The mode for mult-part geometries is the same as for
|
||||||
* their single-part cousins.
|
* their single-part cousins.
|
||||||
* @param {module:ol/geom/GeometryType~GeometryType} type Geometry type.
|
* @param {module:ol/geom/GeometryType} type Geometry type.
|
||||||
* @return {module:ol/interaction/Draw~Mode} Drawing mode.
|
* @return {module:ol/interaction/Draw~Mode} Drawing mode.
|
||||||
*/
|
*/
|
||||||
function getMode(type) {
|
function getMode(type) {
|
||||||
|
|||||||
@@ -23,12 +23,12 @@ import {createEditingStyle} from '../style/Style.js';
|
|||||||
* initial extent.
|
* initial extent.
|
||||||
* @property {module:ol/style/Style~Style|Array.<module:ol/style/Style~Style>|module:ol/style~StyleFunction} [boxStyle]
|
* @property {module:ol/style/Style~Style|Array.<module:ol/style/Style~Style>|module:ol/style~StyleFunction} [boxStyle]
|
||||||
* Style for the drawn extent box. Defaults to
|
* Style for the drawn extent box. Defaults to
|
||||||
* {@link module:ol/style/Style~createEditing()[module:ol/geom/GeometryType~GeometryType.POLYGON]}
|
* {@link module:ol/style/Style~createEditing()[module:ol/geom/GeometryType.POLYGON]}
|
||||||
* @property {number} [pixelTolerance=10] Pixel tolerance for considering the
|
* @property {number} [pixelTolerance=10] Pixel tolerance for considering the
|
||||||
* pointer close enough to a segment or vertex for editing.
|
* pointer close enough to a segment or vertex for editing.
|
||||||
* @property {module:ol/style/Style~Style|Array.<module:ol/style/Style~Style>|module:ol/style~StyleFunction} [pointerStyle]
|
* @property {module:ol/style/Style~Style|Array.<module:ol/style/Style~Style>|module:ol/style~StyleFunction} [pointerStyle]
|
||||||
* Style for the cursor used to draw the extent. Defaults to
|
* Style for the cursor used to draw the extent. Defaults to
|
||||||
* {@link module:ol/style/Style~createEditing()[module:ol/geom/GeometryType~GeometryType.POINT]}
|
* {@link module:ol/style/Style~createEditing()[module:ol/geom/GeometryType.POINT]}
|
||||||
* @property {boolean} [wrapX=false] Wrap the drawn extent across multiple maps
|
* @property {boolean} [wrapX=false] Wrap the drawn extent across multiple maps
|
||||||
* in the X direction? Only affects visuals, not functionality.
|
* in the X direction? Only affects visuals, not functionality.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ const BaseLayer = function(options) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* The layer type.
|
* The layer type.
|
||||||
* @type {module:ol/LayerType~LayerType}
|
* @type {module:ol/LayerType}
|
||||||
* @protected;
|
* @protected;
|
||||||
*/
|
*/
|
||||||
this.type;
|
this.type;
|
||||||
@@ -81,7 +81,7 @@ inherits(BaseLayer, BaseObject);
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the layer type (used when creating a layer renderer).
|
* Get the layer type (used when creating a layer renderer).
|
||||||
* @return {module:ol/LayerType~LayerType} The layer type.
|
* @return {module:ol/LayerType} The layer type.
|
||||||
*/
|
*/
|
||||||
BaseLayer.prototype.getType = function() {
|
BaseLayer.prototype.getType = function() {
|
||||||
return this.type;
|
return this.type;
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ const ImageLayer = function(opt_options) {
|
|||||||
/**
|
/**
|
||||||
* The layer type.
|
* The layer type.
|
||||||
* @protected
|
* @protected
|
||||||
* @type {module:ol/LayerType~LayerType}
|
* @type {module:ol/LayerType}
|
||||||
*/
|
*/
|
||||||
this.type = LayerType.IMAGE;
|
this.type = LayerType.IMAGE;
|
||||||
|
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ const TileLayer = function(opt_options) {
|
|||||||
/**
|
/**
|
||||||
* The layer type.
|
* The layer type.
|
||||||
* @protected
|
* @protected
|
||||||
* @type {module:ol/LayerType~LayerType}
|
* @type {module:ol/LayerType}
|
||||||
*/
|
*/
|
||||||
this.type = LayerType.TILE;
|
this.type = LayerType.TILE;
|
||||||
|
|
||||||
|
|||||||
+19
-3
@@ -27,7 +27,7 @@ import {createDefaultStyle, toFunction as toStyleFunction} from '../style/Style.
|
|||||||
* @property {number} [renderBuffer=100] The buffer in pixels around the viewport extent used by the
|
* @property {number} [renderBuffer=100] The buffer in pixels around the viewport extent used by the
|
||||||
* renderer when getting features from the vector source for the rendering or hit-detection.
|
* renderer when getting features from the vector source for the rendering or hit-detection.
|
||||||
* Recommended value: the size of the largest symbol, line width or label.
|
* Recommended value: the size of the largest symbol, line width or label.
|
||||||
* @property {module:ol/layer/VectorRenderType~VectorRenderType|string} [renderMode='vector'] Render mode for vector layers:
|
* @property {module:ol/layer/VectorRenderType|string} [renderMode='vector'] Render mode for vector layers:
|
||||||
* * `'image'`: Vector layers are rendered as images. Great performance, but point symbols and
|
* * `'image'`: Vector layers are rendered as images. Great performance, but point symbols and
|
||||||
* texts are always rotated with the view and pixels are scaled during zoom animations.
|
* texts are always rotated with the view and pixels are scaled during zoom animations.
|
||||||
* * `'vector'`: Vector layers are rendered as vectors. Most accurate rendering even during
|
* * `'vector'`: Vector layers are rendered as vectors. Most accurate rendering even during
|
||||||
@@ -52,6 +52,22 @@ import {createDefaultStyle, toFunction as toStyleFunction} from '../style/Style.
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @enum {string}
|
||||||
|
* Render mode for vector layers:
|
||||||
|
* * `'image'`: Vector layers are rendered as images. Great performance, but
|
||||||
|
* point symbols and texts are always rotated with the view and pixels are
|
||||||
|
* scaled during zoom animations.
|
||||||
|
* * `'vector'`: Vector layers are rendered as vectors. Most accurate rendering
|
||||||
|
* even during animations, but slower performance.
|
||||||
|
* @api
|
||||||
|
*/
|
||||||
|
export const RenderType = {
|
||||||
|
IMAGE: 'image',
|
||||||
|
VECTOR: 'vector'
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @enum {string}
|
* @enum {string}
|
||||||
* @private
|
* @private
|
||||||
@@ -138,7 +154,7 @@ const VectorLayer = function(opt_options) {
|
|||||||
/**
|
/**
|
||||||
* The layer type.
|
* The layer type.
|
||||||
* @protected
|
* @protected
|
||||||
* @type {module:ol/LayerType~LayerType}
|
* @type {module:ol/LayerType}
|
||||||
*/
|
*/
|
||||||
this.type = LayerType.VECTOR;
|
this.type = LayerType.VECTOR;
|
||||||
|
|
||||||
@@ -258,7 +274,7 @@ VectorLayer.prototype.setStyle = function(style) {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return {module:ol/layer/VectorRenderType~VectorRenderType|string} The render mode.
|
* @return {module:ol/layer/VectorRenderType|string} The render mode.
|
||||||
*/
|
*/
|
||||||
VectorLayer.prototype.getRenderMode = function() {
|
VectorLayer.prototype.getRenderMode = function() {
|
||||||
return this.renderMode_;
|
return this.renderMode_;
|
||||||
|
|||||||
@@ -10,6 +10,26 @@ import VectorTileRenderType from '../layer/VectorTileRenderType.js';
|
|||||||
import {assign} from '../obj.js';
|
import {assign} from '../obj.js';
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @enum {string}
|
||||||
|
* Render mode for vector tiles:
|
||||||
|
* * `'image'`: Vector tiles are rendered as images. Great performance, but
|
||||||
|
* point symbols and texts are always rotated with the view and pixels are
|
||||||
|
* scaled during zoom animations.
|
||||||
|
* * `'hybrid'`: Polygon and line elements are rendered as images, so pixels
|
||||||
|
* are scaled during zoom animations. Point symbols and texts are accurately
|
||||||
|
* rendered as vectors and can stay upright on rotated views.
|
||||||
|
* * `'vector'`: Vector tiles are rendered as vectors. Most accurate rendering
|
||||||
|
* even during animations, but slower performance than the other options.
|
||||||
|
* @api
|
||||||
|
*/
|
||||||
|
export const RenderType = {
|
||||||
|
IMAGE: 'image',
|
||||||
|
HYBRID: 'hybrid',
|
||||||
|
VECTOR: 'vector'
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {Object} Options
|
* @typedef {Object} Options
|
||||||
* @property {number} [opacity=1] Opacity (0, 1).
|
* @property {number} [opacity=1] Opacity (0, 1).
|
||||||
@@ -30,7 +50,7 @@ import {assign} from '../obj.js';
|
|||||||
* Recommended value: Vector tiles are usually generated with a buffer, so this value should match
|
* Recommended value: Vector tiles are usually generated with a buffer, so this value should match
|
||||||
* the largest possible buffer of the used tiles. It should be at least the size of the largest
|
* the largest possible buffer of the used tiles. It should be at least the size of the largest
|
||||||
* point symbol or line width.
|
* point symbol or line width.
|
||||||
* @property {module:ol/layer/VectorRenderType~VectorRenderType|string} [renderMode='hybrid'] Render mode for vector tiles:
|
* @property {module:ol/layer/VectorTileRenderType|string} [renderMode='hybrid'] Render mode for vector tiles:
|
||||||
* * `'image'`: Vector tiles are rendered as images. Great performance, but point symbols and texts
|
* * `'image'`: Vector tiles are rendered as images. Great performance, but point symbols and texts
|
||||||
* are always rotated with the view and pixels are scaled during zoom animations.
|
* are always rotated with the view and pixels are scaled during zoom animations.
|
||||||
* * `'hybrid'`: Polygon and line elements are rendered as images, so pixels are scaled during zoom
|
* * `'hybrid'`: Polygon and line elements are rendered as images, so pixels are scaled during zoom
|
||||||
@@ -71,7 +91,7 @@ import {assign} from '../obj.js';
|
|||||||
/**
|
/**
|
||||||
* @classdesc
|
* @classdesc
|
||||||
* Layer for vector tile data that is rendered client-side.
|
* Layer for vector tile data that is rendered client-side.
|
||||||
* Note that any property set in the options is set as a {@link }
|
* Note that any property set in the options is set as a {@link module:ol/Object~BaseObject
|
||||||
* property on the layer object; for example, setting `title: 'My Title'` in the
|
* property on the layer object; for example, setting `title: 'My Title'` in the
|
||||||
* options means that `title` is observable, and has get/set accessors.
|
* options means that `title` is observable, and has get/set accessors.
|
||||||
*
|
*
|
||||||
@@ -107,7 +127,7 @@ const VectorTileLayer = function(opt_options) {
|
|||||||
/**
|
/**
|
||||||
* The layer type.
|
* The layer type.
|
||||||
* @protected
|
* @protected
|
||||||
* @type {module:ol/LayerType~LayerType}
|
* @type {module:ol/LayerType}
|
||||||
*/
|
*/
|
||||||
this.type = LayerType.VECTOR_TILE;
|
this.type = LayerType.VECTOR_TILE;
|
||||||
|
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ import {create as createTransform, compose as composeTransform} from '../transfo
|
|||||||
* through the API is limited to getting the type and extent of the geometry.
|
* through the API is limited to getting the type and extent of the geometry.
|
||||||
*
|
*
|
||||||
* @constructor
|
* @constructor
|
||||||
* @param {module:ol/geom/GeometryType~GeometryType} type Geometry type.
|
* @param {module:ol/geom/GeometryType} type Geometry type.
|
||||||
* @param {Array.<number>} flatCoordinates Flat coordinates. These always need
|
* @param {Array.<number>} flatCoordinates Flat coordinates. These always need
|
||||||
* to be right-handed for polygons.
|
* to be right-handed for polygons.
|
||||||
* @param {Array.<number>|Array.<Array.<number>>} ends Ends or Endss.
|
* @param {Array.<number>|Array.<Array.<number>>} ends Ends or Endss.
|
||||||
@@ -39,7 +39,7 @@ const RenderFeature = function(type, flatCoordinates, ends, properties, id) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @type {module:ol/geom/GeometryType~GeometryType}
|
* @type {module:ol/geom/GeometryType}
|
||||||
*/
|
*/
|
||||||
this.type_ = type;
|
this.type_ = type;
|
||||||
|
|
||||||
@@ -249,7 +249,7 @@ RenderFeature.prototype.getStyleFunction = UNDEFINED;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the type of this feature's geometry.
|
* Get the type of this feature's geometry.
|
||||||
* @return {module:ol/geom/GeometryType~GeometryType} Geometry type.
|
* @return {module:ol/geom/GeometryType} Geometry type.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
RenderFeature.prototype.getType = function() {
|
RenderFeature.prototype.getType = function() {
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ const SIMPLIFY_TOLERANCE = 0.5;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object.<module:ol/geom/GeometryType~GeometryType,
|
* @type {Object.<module:ol/geom/GeometryType,
|
||||||
* function(module:ol/render/ReplayGroup~ReplayGroup, module:ol/geom/Geometry~Geometry,
|
* function(module:ol/render/ReplayGroup~ReplayGroup, module:ol/geom/Geometry~Geometry,
|
||||||
* module:ol/style/Style~Style, Object)>}
|
* module:ol/style/Style~Style, Object)>}
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -380,10 +380,10 @@ export function createDefaultStyle(feature, resolution) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Default styles for editing features.
|
* Default styles for editing features.
|
||||||
* @return {Object.<module:ol/geom/GeometryType~GeometryType, Array.<module:ol/style/Style~Style>>} Styles
|
* @return {Object.<module:ol/geom/GeometryType, Array.<module:ol/style/Style~Style>>} Styles
|
||||||
*/
|
*/
|
||||||
export function createEditingStyle() {
|
export function createEditingStyle() {
|
||||||
/** @type {Object.<module:ol/geom/GeometryType~GeometryType, Array.<module:ol/style/Style~Style>>} */
|
/** @type {Object.<module:ol/geom/GeometryType, Array.<module:ol/style/Style~Style>>} */
|
||||||
const styles = {};
|
const styles = {};
|
||||||
const white = [255, 255, 255, 1];
|
const white = [255, 255, 255, 1];
|
||||||
const blue = [0, 153, 255, 1];
|
const blue = [0, 153, 255, 1];
|
||||||
|
|||||||
+12
-12
@@ -28,16 +28,16 @@
|
|||||||
* var white = [255, 255, 255, 1];
|
* var white = [255, 255, 255, 1];
|
||||||
* var blue = [0, 153, 255, 1];
|
* var blue = [0, 153, 255, 1];
|
||||||
* var width = 3;
|
* var width = 3;
|
||||||
* styles[module:ol/geom/GeometryType~GeometryType.POLYGON] = [
|
* styles[module:ol/geom/GeometryType.POLYGON] = [
|
||||||
* new ol.style.Style({
|
* new ol.style.Style({
|
||||||
* fill: new ol.style.Fill({
|
* fill: new ol.style.Fill({
|
||||||
* color: [255, 255, 255, 0.5]
|
* color: [255, 255, 255, 0.5]
|
||||||
* })
|
* })
|
||||||
* })
|
* })
|
||||||
* ];
|
* ];
|
||||||
* styles[module:ol/geom/GeometryType~GeometryType.MULTI_POLYGON] =
|
* styles[module:ol/geom/GeometryType.MULTI_POLYGON] =
|
||||||
* styles[module:ol/geom/GeometryType~GeometryType.POLYGON];
|
* styles[module:ol/geom/GeometryType.POLYGON];
|
||||||
* styles[module:ol/geom/GeometryType~GeometryType.LINE_STRING] = [
|
* styles[module:ol/geom/GeometryType.LINE_STRING] = [
|
||||||
* new ol.style.Style({
|
* new ol.style.Style({
|
||||||
* stroke: new ol.style.Stroke({
|
* stroke: new ol.style.Stroke({
|
||||||
* color: white,
|
* color: white,
|
||||||
@@ -51,9 +51,9 @@
|
|||||||
* })
|
* })
|
||||||
* })
|
* })
|
||||||
* ];
|
* ];
|
||||||
* styles[module:ol/geom/GeometryType~GeometryType.MULTI_LINE_STRING] =
|
* styles[module:ol/geom/GeometryType.MULTI_LINE_STRING] =
|
||||||
* styles[module:ol/geom/GeometryType~GeometryType.LINE_STRING];
|
* styles[module:ol/geom/GeometryType.LINE_STRING];
|
||||||
* styles[module:ol/geom/GeometryType~GeometryType.POINT] = [
|
* styles[module:ol/geom/GeometryType.POINT] = [
|
||||||
* new ol.style.Style({
|
* new ol.style.Style({
|
||||||
* image: new ol.style.Circle({
|
* image: new ol.style.Circle({
|
||||||
* radius: width * 2,
|
* radius: width * 2,
|
||||||
@@ -68,11 +68,11 @@
|
|||||||
* zIndex: Infinity
|
* zIndex: Infinity
|
||||||
* })
|
* })
|
||||||
* ];
|
* ];
|
||||||
* styles[module:ol/geom/GeometryType~GeometryType.MULTI_POINT] =
|
* styles[module:ol/geom/GeometryType.MULTI_POINT] =
|
||||||
* styles[module:ol/geom/GeometryType~GeometryType.POINT];
|
* styles[module:ol/geom/GeometryType.POINT];
|
||||||
* styles[module:ol/geom/GeometryType~GeometryType.GEOMETRY_COLLECTION] =
|
* styles[module:ol/geom/GeometryType.GEOMETRY_COLLECTION] =
|
||||||
* styles[module:ol/geom/GeometryType~GeometryType.POLYGON].concat(
|
* styles[module:ol/geom/GeometryType.POLYGON].concat(
|
||||||
* styles[module:ol/geom/GeometryType~GeometryType.POINT]
|
* styles[module:ol/geom/GeometryType.POINT]
|
||||||
* );
|
* );
|
||||||
*```
|
*```
|
||||||
*
|
*
|
||||||
|
|||||||
Reference in New Issue
Block a user