Lint removal
This commit is contained in:
@@ -5,6 +5,13 @@ import {getUid, inherits} from './util.js';
|
|||||||
import Tile from './Tile.js';
|
import Tile from './Tile.js';
|
||||||
import TileState from './TileState.js';
|
import TileState from './TileState.js';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @const
|
||||||
|
* @type {module:ol/extent~Extent}
|
||||||
|
*/
|
||||||
|
const DEFAULT_EXTENT = [0, 0, 4096, 4096];
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {function(new: module:ol/VectorTile, module:ol/tilecoord~TileCoord,
|
* @typedef {function(new: module:ol/VectorTile, module:ol/tilecoord~TileCoord,
|
||||||
* module:ol/TileState, string, ?string, module:ol/Tile~LoadFunction)} TileClass
|
* module:ol/TileState, string, ?string, module:ol/Tile~LoadFunction)} TileClass
|
||||||
@@ -236,11 +243,4 @@ class VectorTile {
|
|||||||
|
|
||||||
inherits(VectorTile, Tile);
|
inherits(VectorTile, Tile);
|
||||||
|
|
||||||
/**
|
|
||||||
* @const
|
|
||||||
* @type {module:ol/extent~Extent}
|
|
||||||
*/
|
|
||||||
const DEFAULT_EXTENT = [0, 0, 4096, 4096];
|
|
||||||
|
|
||||||
|
|
||||||
export default VectorTile;
|
export default VectorTile;
|
||||||
|
|||||||
@@ -20,6 +20,18 @@ import {createElementNS, getAllTextContent, makeArrayPusher, makeChildAppender,
|
|||||||
const schemaLocation = GMLNS + ' http://schemas.opengis.net/gml/2.1.2/feature.xsd';
|
const schemaLocation = GMLNS + ' http://schemas.opengis.net/gml/2.1.2/feature.xsd';
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @const
|
||||||
|
* @type {Object.<string, string>}
|
||||||
|
*/
|
||||||
|
const MULTIGEOMETRY_TO_MEMBER_NODENAME = {
|
||||||
|
'MultiLineString': 'lineStringMember',
|
||||||
|
'MultiCurve': 'curveMember',
|
||||||
|
'MultiPolygon': 'polygonMember',
|
||||||
|
'MultiSurface': 'surfaceMember'
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @classdesc
|
* @classdesc
|
||||||
* Feature format for reading and writing data in the GML format,
|
* Feature format for reading and writing data in the GML format,
|
||||||
@@ -576,18 +588,6 @@ class GML2 {
|
|||||||
inherits(GML2, GMLBase);
|
inherits(GML2, GMLBase);
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @const
|
|
||||||
* @type {Object.<string, string>}
|
|
||||||
*/
|
|
||||||
const MULTIGEOMETRY_TO_MEMBER_NODENAME = {
|
|
||||||
'MultiLineString': 'lineStringMember',
|
|
||||||
'MultiCurve': 'curveMember',
|
|
||||||
'MultiPolygon': 'polygonMember',
|
|
||||||
'MultiSurface': 'surfaceMember'
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
||||||
|
|||||||
@@ -30,6 +30,18 @@ const schemaLocation = GMLNS +
|
|||||||
'1.0.0/gmlsf.xsd';
|
'1.0.0/gmlsf.xsd';
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @const
|
||||||
|
* @type {Object.<string, string>}
|
||||||
|
*/
|
||||||
|
const MULTIGEOMETRY_TO_MEMBER_NODENAME = {
|
||||||
|
'MultiLineString': 'lineStringMember',
|
||||||
|
'MultiCurve': 'curveMember',
|
||||||
|
'MultiPolygon': 'polygonMember',
|
||||||
|
'MultiSurface': 'surfaceMember'
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @classdesc
|
* @classdesc
|
||||||
* Feature format for reading and writing data in the GML format
|
* Feature format for reading and writing data in the GML format
|
||||||
@@ -1088,18 +1100,6 @@ GML3.prototype.SEGMENTS_PARSERS_ = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @const
|
|
||||||
* @type {Object.<string, string>}
|
|
||||||
*/
|
|
||||||
const MULTIGEOMETRY_TO_MEMBER_NODENAME = {
|
|
||||||
'MultiLineString': 'lineStringMember',
|
|
||||||
'MultiCurve': 'curveMember',
|
|
||||||
'MultiPolygon': 'polygonMember',
|
|
||||||
'MultiSurface': 'surfaceMember'
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Encode an array of features in GML 3.1.1 Simple Features.
|
* Encode an array of features in GML 3.1.1 Simple Features.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -29,6 +29,20 @@ import {getAllTextContent, getAttributeNS, makeArrayPusher, makeReplacer, parseN
|
|||||||
export const GMLNS = 'http://www.opengis.net/gml';
|
export const GMLNS = 'http://www.opengis.net/gml';
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A regular expression that matches if a string only contains whitespace
|
||||||
|
* characters. It will e.g. match `''`, `' '`, `'\n'` etc. The non-breaking
|
||||||
|
* space (0xa0) is explicitly included as IE doesn't include it in its
|
||||||
|
* definition of `\s`.
|
||||||
|
*
|
||||||
|
* Information from `goog.string.isEmptyOrWhitespace`: https://github.com/google/closure-library/blob/e877b1e/closure/goog/string/string.js#L156-L160
|
||||||
|
*
|
||||||
|
* @const
|
||||||
|
* @type {RegExp}
|
||||||
|
*/
|
||||||
|
const ONLY_WHITESPACE_RE = /^[\s\xa0]*$/;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {Object} Options
|
* @typedef {Object} Options
|
||||||
* @property {Object.<string, string>|string} [featureNS] Feature
|
* @property {Object.<string, string>|string} [featureNS] Feature
|
||||||
@@ -458,20 +472,6 @@ class GMLBase {
|
|||||||
inherits(GMLBase, XMLFeature);
|
inherits(GMLBase, XMLFeature);
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* A regular expression that matches if a string only contains whitespace
|
|
||||||
* characters. It will e.g. match `''`, `' '`, `'\n'` etc. The non-breaking
|
|
||||||
* space (0xa0) is explicitly included as IE doesn't include it in its
|
|
||||||
* definition of `\s`.
|
|
||||||
*
|
|
||||||
* Information from `goog.string.isEmptyOrWhitespace`: https://github.com/google/closure-library/blob/e877b1e/closure/goog/string/string.js#L156-L160
|
|
||||||
*
|
|
||||||
* @const
|
|
||||||
* @type {RegExp}
|
|
||||||
*/
|
|
||||||
const ONLY_WHITESPACE_RE = /^[\s\xa0]*$/;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
||||||
|
|||||||
@@ -18,6 +18,71 @@ import {createElementNS, makeArrayPusher, makeArraySerializer, makeChildAppender
|
|||||||
XML_SCHEMA_INSTANCE_URI} from '../xml.js';
|
XML_SCHEMA_INSTANCE_URI} from '../xml.js';
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @const
|
||||||
|
* @type {Array.<null|string>}
|
||||||
|
*/
|
||||||
|
const NAMESPACE_URIS = [
|
||||||
|
null,
|
||||||
|
'http://www.topografix.com/GPX/1/0',
|
||||||
|
'http://www.topografix.com/GPX/1/1'
|
||||||
|
];
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @const
|
||||||
|
* @type {string}
|
||||||
|
*/
|
||||||
|
const SCHEMA_LOCATION = 'http://www.topografix.com/GPX/1/1 ' +
|
||||||
|
'http://www.topografix.com/GPX/1/1/gpx.xsd';
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @const
|
||||||
|
* @type {Object.<string, function(Node, Array.<*>): (module:ol/Feature|undefined)>}
|
||||||
|
*/
|
||||||
|
const FEATURE_READER = {
|
||||||
|
'rte': readRte,
|
||||||
|
'trk': readTrk,
|
||||||
|
'wpt': readWpt
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @const
|
||||||
|
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
||||||
|
*/
|
||||||
|
const GPX_PARSERS = makeStructureNS(
|
||||||
|
NAMESPACE_URIS, {
|
||||||
|
'rte': makeArrayPusher(readRte),
|
||||||
|
'trk': makeArrayPusher(readTrk),
|
||||||
|
'wpt': makeArrayPusher(readWpt)
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @const
|
||||||
|
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
||||||
|
*/
|
||||||
|
const LINK_PARSERS = makeStructureNS(
|
||||||
|
NAMESPACE_URIS, {
|
||||||
|
'text': makeObjectPropertySetter(readString, 'linkText'),
|
||||||
|
'type': makeObjectPropertySetter(readString, 'linkType')
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @const
|
||||||
|
* @type {Object.<string, Object.<string, module:ol/xml~Serializer>>}
|
||||||
|
*/
|
||||||
|
const GPX_SERIALIZERS = makeStructureNS(
|
||||||
|
NAMESPACE_URIS, {
|
||||||
|
'rte': makeChildAppender(writeRte),
|
||||||
|
'trk': makeChildAppender(writeTrk),
|
||||||
|
'wpt': makeChildAppender(writeWpt)
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {Object} Options
|
* @typedef {Object} Options
|
||||||
* @property {function(module:ol/Feature, Node)} [readExtensions] Callback function
|
* @property {function(module:ol/Feature, Node)} [readExtensions] Callback function
|
||||||
@@ -150,59 +215,6 @@ class GPX {
|
|||||||
inherits(GPX, XMLFeature);
|
inherits(GPX, XMLFeature);
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @const
|
|
||||||
* @type {Array.<null|string>}
|
|
||||||
*/
|
|
||||||
const NAMESPACE_URIS = [
|
|
||||||
null,
|
|
||||||
'http://www.topografix.com/GPX/1/0',
|
|
||||||
'http://www.topografix.com/GPX/1/1'
|
|
||||||
];
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @const
|
|
||||||
* @type {string}
|
|
||||||
*/
|
|
||||||
const SCHEMA_LOCATION = 'http://www.topografix.com/GPX/1/1 ' +
|
|
||||||
'http://www.topografix.com/GPX/1/1/gpx.xsd';
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @const
|
|
||||||
* @type {Object.<string, function(Node, Array.<*>): (module:ol/Feature|undefined)>}
|
|
||||||
*/
|
|
||||||
const FEATURE_READER = {
|
|
||||||
'rte': readRte,
|
|
||||||
'trk': readTrk,
|
|
||||||
'wpt': readWpt
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @const
|
|
||||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
|
||||||
*/
|
|
||||||
const GPX_PARSERS = makeStructureNS(
|
|
||||||
NAMESPACE_URIS, {
|
|
||||||
'rte': makeArrayPusher(readRte),
|
|
||||||
'trk': makeArrayPusher(readTrk),
|
|
||||||
'wpt': makeArrayPusher(readWpt)
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @const
|
|
||||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
|
||||||
*/
|
|
||||||
const LINK_PARSERS = makeStructureNS(
|
|
||||||
NAMESPACE_URIS, {
|
|
||||||
'text': makeObjectPropertySetter(readString, 'linkText'),
|
|
||||||
'type': makeObjectPropertySetter(readString, 'linkType')
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
||||||
@@ -466,18 +478,6 @@ function GPX_NODE_FACTORY(value, objectStack, opt_nodeName) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @const
|
|
||||||
* @type {Object.<string, Object.<string, module:ol/xml~Serializer>>}
|
|
||||||
*/
|
|
||||||
const GPX_SERIALIZERS = makeStructureNS(
|
|
||||||
NAMESPACE_URIS, {
|
|
||||||
'rte': makeChildAppender(writeRte),
|
|
||||||
'trk': makeChildAppender(writeTrk),
|
|
||||||
'wpt': makeChildAppender(writeWpt)
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Array.<number>} flatCoordinates Flat coordinates.
|
* @param {Array.<number>} flatCoordinates Flat coordinates.
|
||||||
* @param {module:ol/format/GPX~LayoutOptions} layoutOptions Layout options.
|
* @param {module:ol/format/GPX~LayoutOptions} layoutOptions Layout options.
|
||||||
|
|||||||
@@ -19,6 +19,36 @@ const IGCZ = {
|
|||||||
NONE: 'none'
|
NONE: 'none'
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @const
|
||||||
|
* @type {RegExp}
|
||||||
|
*/
|
||||||
|
const B_RECORD_RE =
|
||||||
|
/^B(\d{2})(\d{2})(\d{2})(\d{2})(\d{5})([NS])(\d{3})(\d{5})([EW])([AV])(\d{5})(\d{5})/;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @const
|
||||||
|
* @type {RegExp}
|
||||||
|
*/
|
||||||
|
const H_RECORD_RE = /^H.([A-Z]{3}).*?:(.*)/;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @const
|
||||||
|
* @type {RegExp}
|
||||||
|
*/
|
||||||
|
const HFDTE_RECORD_RE = /^HFDTE(\d{2})(\d{2})(\d{2})/;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A regular expression matching the newline characters `\r\n`, `\r` and `\n`.
|
||||||
|
*
|
||||||
|
* @const
|
||||||
|
* @type {RegExp}
|
||||||
|
*/
|
||||||
|
const NEWLINE_RE = /\r\n|\r|\n/;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {Object} Options
|
* @typedef {Object} Options
|
||||||
@@ -170,37 +200,6 @@ class IGC {
|
|||||||
inherits(IGC, TextFeature);
|
inherits(IGC, TextFeature);
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @const
|
|
||||||
* @type {RegExp}
|
|
||||||
*/
|
|
||||||
const B_RECORD_RE =
|
|
||||||
/^B(\d{2})(\d{2})(\d{2})(\d{2})(\d{5})([NS])(\d{3})(\d{5})([EW])([AV])(\d{5})(\d{5})/;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @const
|
|
||||||
* @type {RegExp}
|
|
||||||
*/
|
|
||||||
const H_RECORD_RE = /^H.([A-Z]{3}).*?:(.*)/;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @const
|
|
||||||
* @type {RegExp}
|
|
||||||
*/
|
|
||||||
const HFDTE_RECORD_RE = /^HFDTE(\d{2})(\d{2})(\d{2})/;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* A regular expression matching the newline characters `\r\n`, `\r` and `\n`.
|
|
||||||
*
|
|
||||||
* @const
|
|
||||||
* @type {RegExp}
|
|
||||||
*/
|
|
||||||
const NEWLINE_RE = /\r\n|\r|\n/;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Read the feature from the IGC source.
|
* Read the feature from the IGC source.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -48,6 +48,143 @@ import {createElementNS, getAllTextContent, isDocument, isNode, makeArrayExtende
|
|||||||
* @property {Array.<number>} whens
|
* @property {Array.<number>} whens
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @const
|
||||||
|
* @type {Array.<string>}
|
||||||
|
*/
|
||||||
|
const GX_NAMESPACE_URIS = [
|
||||||
|
'http://www.google.com/kml/ext/2.2'
|
||||||
|
];
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @const
|
||||||
|
* @type {Array.<null|string>}
|
||||||
|
*/
|
||||||
|
const NAMESPACE_URIS = [
|
||||||
|
null,
|
||||||
|
'http://earth.google.com/kml/2.0',
|
||||||
|
'http://earth.google.com/kml/2.1',
|
||||||
|
'http://earth.google.com/kml/2.2',
|
||||||
|
'http://www.opengis.net/kml/2.2'
|
||||||
|
];
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @const
|
||||||
|
* @type {string}
|
||||||
|
*/
|
||||||
|
const SCHEMA_LOCATION = 'http://www.opengis.net/kml/2.2 ' +
|
||||||
|
'https://developers.google.com/kml/schema/kml22gx.xsd';
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @type {Object.<string, module:ol/style/IconAnchorUnits>}
|
||||||
|
*/
|
||||||
|
const ICON_ANCHOR_UNITS_MAP = {
|
||||||
|
'fraction': IconAnchorUnits.FRACTION,
|
||||||
|
'pixels': IconAnchorUnits.PIXELS,
|
||||||
|
'insetPixels': IconAnchorUnits.PIXELS
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @const
|
||||||
|
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
||||||
|
*/
|
||||||
|
const PLACEMARK_PARSERS = makeStructureNS(
|
||||||
|
NAMESPACE_URIS, {
|
||||||
|
'ExtendedData': extendedDataParser,
|
||||||
|
'Region': regionParser,
|
||||||
|
'MultiGeometry': makeObjectPropertySetter(
|
||||||
|
readMultiGeometry, 'geometry'),
|
||||||
|
'LineString': makeObjectPropertySetter(
|
||||||
|
readLineString, 'geometry'),
|
||||||
|
'LinearRing': makeObjectPropertySetter(
|
||||||
|
readLinearRing, 'geometry'),
|
||||||
|
'Point': makeObjectPropertySetter(
|
||||||
|
readPoint, 'geometry'),
|
||||||
|
'Polygon': makeObjectPropertySetter(
|
||||||
|
readPolygon, 'geometry'),
|
||||||
|
'Style': makeObjectPropertySetter(readStyle),
|
||||||
|
'StyleMap': placemarkStyleMapParser,
|
||||||
|
'address': makeObjectPropertySetter(readString),
|
||||||
|
'description': makeObjectPropertySetter(readString),
|
||||||
|
'name': makeObjectPropertySetter(readString),
|
||||||
|
'open': makeObjectPropertySetter(readBoolean),
|
||||||
|
'phoneNumber': makeObjectPropertySetter(readString),
|
||||||
|
'styleUrl': makeObjectPropertySetter(readURI),
|
||||||
|
'visibility': makeObjectPropertySetter(readBoolean)
|
||||||
|
}, makeStructureNS(
|
||||||
|
GX_NAMESPACE_URIS, {
|
||||||
|
'MultiTrack': makeObjectPropertySetter(
|
||||||
|
readGxMultiTrack, 'geometry'),
|
||||||
|
'Track': makeObjectPropertySetter(
|
||||||
|
readGxTrack, 'geometry')
|
||||||
|
}
|
||||||
|
));
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @const
|
||||||
|
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
||||||
|
*/
|
||||||
|
const NETWORK_LINK_PARSERS = makeStructureNS(
|
||||||
|
NAMESPACE_URIS, {
|
||||||
|
'ExtendedData': extendedDataParser,
|
||||||
|
'Region': regionParser,
|
||||||
|
'Link': linkParser,
|
||||||
|
'address': makeObjectPropertySetter(readString),
|
||||||
|
'description': makeObjectPropertySetter(readString),
|
||||||
|
'name': makeObjectPropertySetter(readString),
|
||||||
|
'open': makeObjectPropertySetter(readBoolean),
|
||||||
|
'phoneNumber': makeObjectPropertySetter(readString),
|
||||||
|
'visibility': makeObjectPropertySetter(readBoolean)
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @const
|
||||||
|
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
||||||
|
*/
|
||||||
|
const LINK_PARSERS = makeStructureNS(
|
||||||
|
NAMESPACE_URIS, {
|
||||||
|
'href': makeObjectPropertySetter(readURI)
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @const
|
||||||
|
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
||||||
|
*/
|
||||||
|
const REGION_PARSERS = makeStructureNS(
|
||||||
|
NAMESPACE_URIS, {
|
||||||
|
'LatLonAltBox': latLonAltBoxParser,
|
||||||
|
'Lod': lodParser
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @const
|
||||||
|
* @type {Object.<string, Array.<string>>}
|
||||||
|
*/
|
||||||
|
const KML_SEQUENCE = makeStructureNS(
|
||||||
|
NAMESPACE_URIS, [
|
||||||
|
'Document', 'Placemark'
|
||||||
|
]);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @const
|
||||||
|
* @type {Object.<string, Object.<string, module:ol/xml~Serializer>>}
|
||||||
|
*/
|
||||||
|
const KML_SERIALIZERS = makeStructureNS(
|
||||||
|
NAMESPACE_URIS, {
|
||||||
|
'Document': makeChildAppender(writeDocument),
|
||||||
|
'Placemark': makeChildAppender(writePlacemark)
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {module:ol/color~Color}
|
* @type {module:ol/color~Color}
|
||||||
*/
|
*/
|
||||||
@@ -713,46 +850,6 @@ class KML {
|
|||||||
inherits(KML, XMLFeature);
|
inherits(KML, XMLFeature);
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @const
|
|
||||||
* @type {Array.<string>}
|
|
||||||
*/
|
|
||||||
const GX_NAMESPACE_URIS = [
|
|
||||||
'http://www.google.com/kml/ext/2.2'
|
|
||||||
];
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @const
|
|
||||||
* @type {Array.<null|string>}
|
|
||||||
*/
|
|
||||||
const NAMESPACE_URIS = [
|
|
||||||
null,
|
|
||||||
'http://earth.google.com/kml/2.0',
|
|
||||||
'http://earth.google.com/kml/2.1',
|
|
||||||
'http://earth.google.com/kml/2.2',
|
|
||||||
'http://www.opengis.net/kml/2.2'
|
|
||||||
];
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @const
|
|
||||||
* @type {string}
|
|
||||||
*/
|
|
||||||
const SCHEMA_LOCATION = 'http://www.opengis.net/kml/2.2 ' +
|
|
||||||
'https://developers.google.com/kml/schema/kml22gx.xsd';
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @type {Object.<string, module:ol/style/IconAnchorUnits>}
|
|
||||||
*/
|
|
||||||
const ICON_ANCHOR_UNITS_MAP = {
|
|
||||||
'fraction': IconAnchorUnits.FRACTION,
|
|
||||||
'pixels': IconAnchorUnits.PIXELS,
|
|
||||||
'insetPixels': IconAnchorUnits.PIXELS
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/style/Style|undefined} foundStyle Style.
|
* @param {module:ol/style/Style|undefined} foundStyle Style.
|
||||||
* @param {string} name Name.
|
* @param {string} name Name.
|
||||||
@@ -1723,17 +1820,6 @@ function extendedDataParser(node, objectStack) {
|
|||||||
parseNode(EXTENDED_DATA_PARSERS, node, objectStack);
|
parseNode(EXTENDED_DATA_PARSERS, node, objectStack);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @const
|
|
||||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
|
||||||
*/
|
|
||||||
const REGION_PARSERS = makeStructureNS(
|
|
||||||
NAMESPACE_URIS, {
|
|
||||||
'LatLonAltBox': latLonAltBoxParser,
|
|
||||||
'Lod': lodParser
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array.<*>} objectStack Object stack.
|
||||||
@@ -1955,34 +2041,6 @@ function outerBoundaryIsParser(node, objectStack) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @const
|
|
||||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
|
||||||
*/
|
|
||||||
const NETWORK_LINK_PARSERS = makeStructureNS(
|
|
||||||
NAMESPACE_URIS, {
|
|
||||||
'ExtendedData': extendedDataParser,
|
|
||||||
'Region': regionParser,
|
|
||||||
'Link': linkParser,
|
|
||||||
'address': makeObjectPropertySetter(readString),
|
|
||||||
'description': makeObjectPropertySetter(readString),
|
|
||||||
'name': makeObjectPropertySetter(readString),
|
|
||||||
'open': makeObjectPropertySetter(readBoolean),
|
|
||||||
'phoneNumber': makeObjectPropertySetter(readString),
|
|
||||||
'visibility': makeObjectPropertySetter(readBoolean)
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @const
|
|
||||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
|
||||||
*/
|
|
||||||
const LINK_PARSERS = makeStructureNS(
|
|
||||||
NAMESPACE_URIS, {
|
|
||||||
'href': makeObjectPropertySetter(readURI)
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array.<*>} objectStack Object stack.
|
||||||
@@ -2006,43 +2064,6 @@ function whenParser(node, objectStack) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @const
|
|
||||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
|
||||||
*/
|
|
||||||
const PLACEMARK_PARSERS = makeStructureNS(
|
|
||||||
NAMESPACE_URIS, {
|
|
||||||
'ExtendedData': extendedDataParser,
|
|
||||||
'Region': regionParser,
|
|
||||||
'MultiGeometry': makeObjectPropertySetter(
|
|
||||||
readMultiGeometry, 'geometry'),
|
|
||||||
'LineString': makeObjectPropertySetter(
|
|
||||||
readLineString, 'geometry'),
|
|
||||||
'LinearRing': makeObjectPropertySetter(
|
|
||||||
readLinearRing, 'geometry'),
|
|
||||||
'Point': makeObjectPropertySetter(
|
|
||||||
readPoint, 'geometry'),
|
|
||||||
'Polygon': makeObjectPropertySetter(
|
|
||||||
readPolygon, 'geometry'),
|
|
||||||
'Style': makeObjectPropertySetter(readStyle),
|
|
||||||
'StyleMap': placemarkStyleMapParser,
|
|
||||||
'address': makeObjectPropertySetter(readString),
|
|
||||||
'description': makeObjectPropertySetter(readString),
|
|
||||||
'name': makeObjectPropertySetter(readString),
|
|
||||||
'open': makeObjectPropertySetter(readBoolean),
|
|
||||||
'phoneNumber': makeObjectPropertySetter(readString),
|
|
||||||
'styleUrl': makeObjectPropertySetter(readURI),
|
|
||||||
'visibility': makeObjectPropertySetter(readBoolean)
|
|
||||||
}, makeStructureNS(
|
|
||||||
GX_NAMESPACE_URIS, {
|
|
||||||
'MultiTrack': makeObjectPropertySetter(
|
|
||||||
readGxMultiTrack, 'geometry'),
|
|
||||||
'Track': makeObjectPropertySetter(
|
|
||||||
readGxTrack, 'geometry')
|
|
||||||
}
|
|
||||||
));
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Read the first feature from a KML source. MultiGeometries are converted into
|
* Read the first feature from a KML source. MultiGeometries are converted into
|
||||||
* GeometryCollections if they are a mix of geometry types, and into MultiPoint/
|
* GeometryCollections if they are a mix of geometry types, and into MultiPoint/
|
||||||
@@ -2941,27 +2962,6 @@ function writeVec2(node, vec2) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @const
|
|
||||||
* @type {Object.<string, Array.<string>>}
|
|
||||||
*/
|
|
||||||
const KML_SEQUENCE = makeStructureNS(
|
|
||||||
NAMESPACE_URIS, [
|
|
||||||
'Document', 'Placemark'
|
|
||||||
]);
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @const
|
|
||||||
* @type {Object.<string, Object.<string, module:ol/xml~Serializer>>}
|
|
||||||
*/
|
|
||||||
const KML_SERIALIZERS = makeStructureNS(
|
|
||||||
NAMESPACE_URIS, {
|
|
||||||
'Document': makeChildAppender(writeDocument),
|
|
||||||
'Placemark': makeChildAppender(writePlacemark)
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Encode an array of features in the KML format. GeometryCollections, MultiPoints,
|
* Encode an array of features in the KML format. GeometryCollections, MultiPoints,
|
||||||
* MultiLineStrings, and MultiPolygons are output as MultiGeometries.
|
* MultiLineStrings, and MultiPolygons are output as MultiGeometries.
|
||||||
|
|||||||
@@ -15,6 +15,36 @@ import {isEmpty} from '../obj.js';
|
|||||||
import {get as getProjection} from '../proj.js';
|
import {get as getProjection} from '../proj.js';
|
||||||
import {pushParseAndPop, makeStructureNS} from '../xml.js';
|
import {pushParseAndPop, makeStructureNS} from '../xml.js';
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @const
|
||||||
|
* @type {Array.<null>}
|
||||||
|
*/
|
||||||
|
const NAMESPACE_URIS = [null];
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @const
|
||||||
|
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
||||||
|
*/
|
||||||
|
const WAY_PARSERS = makeStructureNS(
|
||||||
|
NAMESPACE_URIS, {
|
||||||
|
'nd': readNd,
|
||||||
|
'tag': readTag
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @const
|
||||||
|
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
||||||
|
*/
|
||||||
|
const PARSERS = makeStructureNS(
|
||||||
|
NAMESPACE_URIS, {
|
||||||
|
'node': readNode,
|
||||||
|
'way': readWay
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @classdesc
|
* @classdesc
|
||||||
* Feature format for reading data in the
|
* Feature format for reading data in the
|
||||||
@@ -96,35 +126,6 @@ class OSMXML {
|
|||||||
inherits(OSMXML, XMLFeature);
|
inherits(OSMXML, XMLFeature);
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @const
|
|
||||||
* @type {Array.<null>}
|
|
||||||
*/
|
|
||||||
const NAMESPACE_URIS = [null];
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @const
|
|
||||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
|
||||||
*/
|
|
||||||
const WAY_PARSERS = makeStructureNS(
|
|
||||||
NAMESPACE_URIS, {
|
|
||||||
'nd': readNd,
|
|
||||||
'tag': readTag
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @const
|
|
||||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
|
||||||
*/
|
|
||||||
const PARSERS = makeStructureNS(
|
|
||||||
NAMESPACE_URIS, {
|
|
||||||
'node': readNode,
|
|
||||||
'way': readWay
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
||||||
|
|||||||
@@ -7,6 +7,26 @@ import XML from '../format/XML.js';
|
|||||||
import {readString} from '../format/xsd.js';
|
import {readString} from '../format/xsd.js';
|
||||||
import {makeObjectPropertyPusher, makeObjectPropertySetter, makeStructureNS, pushParseAndPop} from '../xml.js';
|
import {makeObjectPropertyPusher, makeObjectPropertySetter, makeStructureNS, pushParseAndPop} from '../xml.js';
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @const
|
||||||
|
* @type {Array.<null|string>}
|
||||||
|
*/
|
||||||
|
const NAMESPACE_URIS = [null, 'http://www.opengis.net/ows/1.1'];
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @const
|
||||||
|
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
||||||
|
*/
|
||||||
|
const PARSERS = makeStructureNS(
|
||||||
|
NAMESPACE_URIS, {
|
||||||
|
'ServiceIdentification': makeObjectPropertySetter(readServiceIdentification),
|
||||||
|
'ServiceProvider': makeObjectPropertySetter(readServiceProvider),
|
||||||
|
'OperationsMetadata': makeObjectPropertySetter(readOperationsMetadata)
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @constructor
|
* @constructor
|
||||||
* @extends {module:ol/format/XML}
|
* @extends {module:ol/format/XML}
|
||||||
@@ -41,25 +61,6 @@ class OWS {
|
|||||||
inherits(OWS, XML);
|
inherits(OWS, XML);
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @const
|
|
||||||
* @type {Array.<null|string>}
|
|
||||||
*/
|
|
||||||
const NAMESPACE_URIS = [null, 'http://www.opengis.net/ows/1.1'];
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @const
|
|
||||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
|
||||||
*/
|
|
||||||
const PARSERS = makeStructureNS(
|
|
||||||
NAMESPACE_URIS, {
|
|
||||||
'ServiceIdentification': makeObjectPropertySetter(readServiceIdentification),
|
|
||||||
'ServiceProvider': makeObjectPropertySetter(readServiceProvider),
|
|
||||||
'OperationsMetadata': makeObjectPropertySetter(readOperationsMetadata)
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
||||||
|
|||||||
@@ -17,6 +17,69 @@ import {createElementNS, isDocument, isNode, makeArrayPusher, makeChildAppender,
|
|||||||
pushParseAndPop, pushSerializeAndPop, XML_SCHEMA_INSTANCE_URI} from '../xml.js';
|
pushParseAndPop, pushSerializeAndPop, XML_SCHEMA_INSTANCE_URI} from '../xml.js';
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @const
|
||||||
|
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
||||||
|
*/
|
||||||
|
const FEATURE_COLLECTION_PARSERS = {
|
||||||
|
'http://www.opengis.net/gml': {
|
||||||
|
'boundedBy': makeObjectPropertySetter(
|
||||||
|
GMLBase.prototype.readGeometryElement, 'bounds')
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @const
|
||||||
|
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
||||||
|
*/
|
||||||
|
const TRANSACTION_SUMMARY_PARSERS = {
|
||||||
|
'http://www.opengis.net/wfs': {
|
||||||
|
'totalInserted': makeObjectPropertySetter(readNonNegativeInteger),
|
||||||
|
'totalUpdated': makeObjectPropertySetter(readNonNegativeInteger),
|
||||||
|
'totalDeleted': makeObjectPropertySetter(readNonNegativeInteger)
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @const
|
||||||
|
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
||||||
|
*/
|
||||||
|
const TRANSACTION_RESPONSE_PARSERS = {
|
||||||
|
'http://www.opengis.net/wfs': {
|
||||||
|
'TransactionSummary': makeObjectPropertySetter(
|
||||||
|
readTransactionSummary, 'transactionSummary'),
|
||||||
|
'InsertResults': makeObjectPropertySetter(
|
||||||
|
readInsertResults, 'insertIds')
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @type {Object.<string, Object.<string, module:ol/xml~Serializer>>}
|
||||||
|
*/
|
||||||
|
const QUERY_SERIALIZERS = {
|
||||||
|
'http://www.opengis.net/wfs': {
|
||||||
|
'PropertyName': makeChildAppender(writeStringTextNode)
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @type {Object.<string, Object.<string, module:ol/xml~Serializer>>}
|
||||||
|
*/
|
||||||
|
const TRANSACTION_SERIALIZERS = {
|
||||||
|
'http://www.opengis.net/wfs': {
|
||||||
|
'Insert': makeChildAppender(writeFeature),
|
||||||
|
'Update': makeChildAppender(writeUpdate),
|
||||||
|
'Delete': makeChildAppender(writeDelete),
|
||||||
|
'Property': makeChildAppender(writeProperty),
|
||||||
|
'Native': makeChildAppender(writeNative)
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {Object} Options
|
* @typedef {Object} Options
|
||||||
* @property {Object.<string, string>|string} [featureNS] The namespace URI used for features.
|
* @property {Object.<string, string>|string} [featureNS] The namespace URI used for features.
|
||||||
@@ -487,31 +550,6 @@ inherits(WFS, XMLFeature);
|
|||||||
WFS.prototype.readFeatures;
|
WFS.prototype.readFeatures;
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @const
|
|
||||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
|
||||||
*/
|
|
||||||
const FEATURE_COLLECTION_PARSERS = {
|
|
||||||
'http://www.opengis.net/gml': {
|
|
||||||
'boundedBy': makeObjectPropertySetter(
|
|
||||||
GMLBase.prototype.readGeometryElement, 'bounds')
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @const
|
|
||||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
|
||||||
*/
|
|
||||||
const TRANSACTION_SUMMARY_PARSERS = {
|
|
||||||
'http://www.opengis.net/wfs': {
|
|
||||||
'totalInserted': makeObjectPropertySetter(readNonNegativeInteger),
|
|
||||||
'totalUpdated': makeObjectPropertySetter(readNonNegativeInteger),
|
|
||||||
'totalDeleted': makeObjectPropertySetter(readNonNegativeInteger)
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array.<*>} objectStack Object stack.
|
||||||
@@ -567,30 +605,6 @@ function readInsertResults(node, objectStack) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @const
|
|
||||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
|
||||||
*/
|
|
||||||
const TRANSACTION_RESPONSE_PARSERS = {
|
|
||||||
'http://www.opengis.net/wfs': {
|
|
||||||
'TransactionSummary': makeObjectPropertySetter(
|
|
||||||
readTransactionSummary, 'transactionSummary'),
|
|
||||||
'InsertResults': makeObjectPropertySetter(
|
|
||||||
readInsertResults, 'insertIds')
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @type {Object.<string, Object.<string, module:ol/xml~Serializer>>}
|
|
||||||
*/
|
|
||||||
const QUERY_SERIALIZERS = {
|
|
||||||
'http://www.opengis.net/wfs': {
|
|
||||||
'PropertyName': makeChildAppender(writeStringTextNode)
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/Feature} feature Feature.
|
* @param {module:ol/Feature} feature Feature.
|
||||||
@@ -663,20 +677,6 @@ function writeDelete(node, feature, objectStack) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @type {Object.<string, Object.<string, module:ol/xml~Serializer>>}
|
|
||||||
*/
|
|
||||||
const TRANSACTION_SERIALIZERS = {
|
|
||||||
'http://www.opengis.net/wfs': {
|
|
||||||
'Insert': makeChildAppender(writeFeature),
|
|
||||||
'Update': makeChildAppender(writeUpdate),
|
|
||||||
'Delete': makeChildAppender(writeDelete),
|
|
||||||
'Property': makeChildAppender(writeProperty),
|
|
||||||
'Native': makeChildAppender(writeNative)
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/Feature} feature Feature.
|
* @param {module:ol/Feature} feature Feature.
|
||||||
|
|||||||
@@ -17,6 +17,19 @@ import Polygon from '../geom/Polygon.js';
|
|||||||
import SimpleGeometry from '../geom/SimpleGeometry.js';
|
import SimpleGeometry from '../geom/SimpleGeometry.js';
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @enum {function (new:module:ol/geom/Geometry, Array, module:ol/geom/GeometryLayout)}
|
||||||
|
*/
|
||||||
|
const GeometryConstructor = {
|
||||||
|
'POINT': Point,
|
||||||
|
'LINESTRING': LineString,
|
||||||
|
'POLYGON': Polygon,
|
||||||
|
'MULTIPOINT': MultiPoint,
|
||||||
|
'MULTILINESTRING': MultiLineString,
|
||||||
|
'MULTIPOLYGON': MultiPolygon
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {Object} Options
|
* @typedef {Object} Options
|
||||||
* @property {boolean} [splitCollection=false] Whether to split GeometryCollections into
|
* @property {boolean} [splitCollection=false] Whether to split GeometryCollections into
|
||||||
@@ -521,12 +534,42 @@ class Parser {
|
|||||||
const geometries = this.parseGeometryCollectionText_();
|
const geometries = this.parseGeometryCollectionText_();
|
||||||
return new GeometryCollection(geometries);
|
return new GeometryCollection(geometries);
|
||||||
} else {
|
} else {
|
||||||
const parser = GeometryParser[geomType];
|
|
||||||
const ctor = GeometryConstructor[geomType];
|
const ctor = GeometryConstructor[geomType];
|
||||||
if (!parser || !ctor) {
|
if (!ctor) {
|
||||||
throw new Error('Invalid geometry type: ' + geomType);
|
throw new Error('Invalid geometry type: ' + geomType);
|
||||||
}
|
}
|
||||||
let coordinates = parser.call(this);
|
|
||||||
|
let coordinates;
|
||||||
|
switch (geomType) {
|
||||||
|
case GeometryType.POINT: {
|
||||||
|
coordinates = this.parsePointText_();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case GeometryType.LINESTRING: {
|
||||||
|
coordinates = this.parseLineStringText_();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case GeometryType.POLYGON: {
|
||||||
|
coordinates = Parser.prototype.parsePolygonText_();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case GeometryType.MULTIPOINT: {
|
||||||
|
coordinates = Parser.prototype.parseMultiPointText_();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case GeometryType.MULTILINESTRING: {
|
||||||
|
coordinates = Parser.prototype.parseMultiLineStringText_();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case GeometryType.MULTIPOLYGON: {
|
||||||
|
coordinates = Parser.prototype.parseMultiPolygonText_();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default: {
|
||||||
|
throw new Error('Invalid geometry type: ' + geomType);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!coordinates) {
|
if (!coordinates) {
|
||||||
if (ctor === GeometryConstructor[GeometryType.POINT]) {
|
if (ctor === GeometryConstructor[GeometryType.POINT]) {
|
||||||
coordinates = [NaN, NaN];
|
coordinates = [NaN, NaN];
|
||||||
@@ -541,6 +584,7 @@ class Parser {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @classdesc
|
* @classdesc
|
||||||
* Geometry format for reading and writing data in the `WellKnownText` (WKT)
|
* Geometry format for reading and writing data in the `WellKnownText` (WKT)
|
||||||
@@ -855,32 +899,6 @@ WKT.prototype.readFeatures;
|
|||||||
WKT.prototype.readGeometry;
|
WKT.prototype.readGeometry;
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @enum {function (new:module:ol/geom/Geometry, Array, module:ol/geom/GeometryLayout)}
|
|
||||||
*/
|
|
||||||
const GeometryConstructor = {
|
|
||||||
'POINT': Point,
|
|
||||||
'LINESTRING': LineString,
|
|
||||||
'POLYGON': Polygon,
|
|
||||||
'MULTIPOINT': MultiPoint,
|
|
||||||
'MULTILINESTRING': MultiLineString,
|
|
||||||
'MULTIPOLYGON': MultiPolygon
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @enum {(function(): Array)}
|
|
||||||
*/
|
|
||||||
const GeometryParser = {
|
|
||||||
'POINT': Parser.prototype.parsePointText_,
|
|
||||||
'LINESTRING': Parser.prototype.parseLineStringText_,
|
|
||||||
'POLYGON': Parser.prototype.parsePolygonText_,
|
|
||||||
'MULTIPOINT': Parser.prototype.parseMultiPointText_,
|
|
||||||
'MULTILINESTRING': Parser.prototype.parseMultiLineStringText_,
|
|
||||||
'MULTIPOLYGON': Parser.prototype.parseMultiPolygonText_
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Encode a feature as a WKT string.
|
* Encode a feature as a WKT string.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -9,6 +9,39 @@ import {makeArrayPusher, makeObjectPropertyPusher, makeObjectPropertySetter,
|
|||||||
makeStructureNS, pushParseAndPop} from '../xml.js';
|
makeStructureNS, pushParseAndPop} from '../xml.js';
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @const
|
||||||
|
* @type {Array.<null|string>}
|
||||||
|
*/
|
||||||
|
const NAMESPACE_URIS = [
|
||||||
|
null,
|
||||||
|
'http://www.opengis.net/wms'
|
||||||
|
];
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @const
|
||||||
|
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
||||||
|
*/
|
||||||
|
const PARSERS = makeStructureNS(
|
||||||
|
NAMESPACE_URIS, {
|
||||||
|
'Service': makeObjectPropertySetter(readService),
|
||||||
|
'Capability': makeObjectPropertySetter(readCapability)
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @const
|
||||||
|
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
||||||
|
*/
|
||||||
|
const CAPABILITY_PARSERS = makeStructureNS(
|
||||||
|
NAMESPACE_URIS, {
|
||||||
|
'Request': makeObjectPropertySetter(readRequest),
|
||||||
|
'Exception': makeObjectPropertySetter(readException),
|
||||||
|
'Layer': makeObjectPropertySetter(readCapabilityLayer)
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @classdesc
|
* @classdesc
|
||||||
* Format for reading WMS capabilities data
|
* Format for reading WMS capabilities data
|
||||||
@@ -55,39 +88,6 @@ class WMSCapabilities {
|
|||||||
inherits(WMSCapabilities, XML);
|
inherits(WMSCapabilities, XML);
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @const
|
|
||||||
* @type {Array.<null|string>}
|
|
||||||
*/
|
|
||||||
const NAMESPACE_URIS = [
|
|
||||||
null,
|
|
||||||
'http://www.opengis.net/wms'
|
|
||||||
];
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @const
|
|
||||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
|
||||||
*/
|
|
||||||
const PARSERS = makeStructureNS(
|
|
||||||
NAMESPACE_URIS, {
|
|
||||||
'Service': makeObjectPropertySetter(readService),
|
|
||||||
'Capability': makeObjectPropertySetter(readCapability)
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @const
|
|
||||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
|
||||||
*/
|
|
||||||
const CAPABILITY_PARSERS = makeStructureNS(
|
|
||||||
NAMESPACE_URIS, {
|
|
||||||
'Request': makeObjectPropertySetter(readRequest),
|
|
||||||
'Exception': makeObjectPropertySetter(readException),
|
|
||||||
'Layer': makeObjectPropertySetter(readCapabilityLayer)
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
||||||
|
|||||||
@@ -15,6 +15,20 @@ import {makeArrayPusher, makeStructureNS, pushParseAndPop} from '../xml.js';
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @const
|
||||||
|
* @type {string}
|
||||||
|
*/
|
||||||
|
const featureIdentifier = '_feature';
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @const
|
||||||
|
* @type {string}
|
||||||
|
*/
|
||||||
|
const layerIdentifier = '_layer';
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @classdesc
|
* @classdesc
|
||||||
* Format for reading WMSGetFeatureInfo format. It uses
|
* Format for reading WMSGetFeatureInfo format. It uses
|
||||||
@@ -159,20 +173,6 @@ class WMSGetFeatureInfo {
|
|||||||
inherits(WMSGetFeatureInfo, XMLFeature);
|
inherits(WMSGetFeatureInfo, XMLFeature);
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @const
|
|
||||||
* @type {string}
|
|
||||||
*/
|
|
||||||
const featureIdentifier = '_feature';
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @const
|
|
||||||
* @type {string}
|
|
||||||
*/
|
|
||||||
const layerIdentifier = '_layer';
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Read all features from a WMSGetFeatureInfo response.
|
* Read all features from a WMSGetFeatureInfo response.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -10,6 +10,37 @@ import {readString, readNonNegativeInteger, readDecimal} from '../format/xsd.js'
|
|||||||
import {pushParseAndPop, makeStructureNS,
|
import {pushParseAndPop, makeStructureNS,
|
||||||
makeObjectPropertySetter, makeObjectPropertyPusher, makeArrayPusher} from '../xml.js';
|
makeObjectPropertySetter, makeObjectPropertyPusher, makeArrayPusher} from '../xml.js';
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @const
|
||||||
|
* @type {Array.<null|string>}
|
||||||
|
*/
|
||||||
|
const NAMESPACE_URIS = [
|
||||||
|
null,
|
||||||
|
'http://www.opengis.net/wmts/1.0'
|
||||||
|
];
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @const
|
||||||
|
* @type {Array.<null|string>}
|
||||||
|
*/
|
||||||
|
const OWS_NAMESPACE_URIS = [
|
||||||
|
null,
|
||||||
|
'http://www.opengis.net/ows/1.1'
|
||||||
|
];
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @const
|
||||||
|
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
||||||
|
*/
|
||||||
|
const PARSERS = makeStructureNS(
|
||||||
|
NAMESPACE_URIS, {
|
||||||
|
'Contents': makeObjectPropertySetter(readContents)
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @classdesc
|
* @classdesc
|
||||||
* Format for reading WMTS capabilities data.
|
* Format for reading WMTS capabilities data.
|
||||||
@@ -59,36 +90,6 @@ class WMTSCapabilities {
|
|||||||
inherits(WMTSCapabilities, XML);
|
inherits(WMTSCapabilities, XML);
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @const
|
|
||||||
* @type {Array.<null|string>}
|
|
||||||
*/
|
|
||||||
const NAMESPACE_URIS = [
|
|
||||||
null,
|
|
||||||
'http://www.opengis.net/wmts/1.0'
|
|
||||||
];
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @const
|
|
||||||
* @type {Array.<null|string>}
|
|
||||||
*/
|
|
||||||
const OWS_NAMESPACE_URIS = [
|
|
||||||
null,
|
|
||||||
'http://www.opengis.net/ows/1.1'
|
|
||||||
];
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @const
|
|
||||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
|
||||||
*/
|
|
||||||
const PARSERS = makeStructureNS(
|
|
||||||
NAMESPACE_URIS, {
|
|
||||||
'Contents': makeObjectPropertySetter(readContents)
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
||||||
|
|||||||
@@ -11,6 +11,12 @@ 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';
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @type {module:ol/transform~Transform}
|
||||||
|
*/
|
||||||
|
const tmpTransform = createTransform();
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @classdesc
|
* @classdesc
|
||||||
* Abstract base class; normally only used for creating subclasses and not
|
* Abstract base class; normally only used for creating subclasses and not
|
||||||
@@ -248,12 +254,6 @@ class Geometry {
|
|||||||
inherits(Geometry, BaseObject);
|
inherits(Geometry, BaseObject);
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @type {module:ol/transform~Transform}
|
|
||||||
*/
|
|
||||||
const tmpTransform = createTransform();
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {number} x X.
|
* @param {number} x X.
|
||||||
* @param {number} y Y.
|
* @param {number} y Y.
|
||||||
|
|||||||
@@ -24,6 +24,21 @@ import RBush from '../structs/RBush.js';
|
|||||||
import {createEditingStyle} from '../style/Style.js';
|
import {createEditingStyle} from '../style/Style.js';
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The segment index assigned to a circle's center when
|
||||||
|
* breaking up a circle into ModifySegmentDataType segments.
|
||||||
|
* @type {number}
|
||||||
|
*/
|
||||||
|
const CIRCLE_CENTER_INDEX = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The segment index assigned to a circle's circumference when
|
||||||
|
* breaking up a circle into ModifySegmentDataType segments.
|
||||||
|
* @type {number}
|
||||||
|
*/
|
||||||
|
const CIRCLE_CIRCUMFERENCE_INDEX = 1;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @enum {string}
|
* @enum {string}
|
||||||
*/
|
*/
|
||||||
@@ -958,21 +973,6 @@ class Modify {
|
|||||||
inherits(Modify, PointerInteraction);
|
inherits(Modify, PointerInteraction);
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The segment index assigned to a circle's center when
|
|
||||||
* breaking up a circle into ModifySegmentDataType segments.
|
|
||||||
* @type {number}
|
|
||||||
*/
|
|
||||||
const CIRCLE_CENTER_INDEX = 0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The segment index assigned to a circle's circumference when
|
|
||||||
* breaking up a circle into ModifySegmentDataType segments.
|
|
||||||
* @type {number}
|
|
||||||
*/
|
|
||||||
const CIRCLE_CIRCUMFERENCE_INDEX = 1;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/interaction/Modify~SegmentData} a The first segment data.
|
* @param {module:ol/interaction/Modify~SegmentData} a The first segment data.
|
||||||
* @param {module:ol/interaction/Modify~SegmentData} b The second segment data.
|
* @param {module:ol/interaction/Modify~SegmentData} b The second segment data.
|
||||||
|
|||||||
@@ -289,9 +289,8 @@ inherits(Heatmap, VectorLayer);
|
|||||||
/**
|
/**
|
||||||
* @param {Array.<string>} colors A list of colored.
|
* @param {Array.<string>} colors A list of colored.
|
||||||
* @return {Uint8ClampedArray} An array.
|
* @return {Uint8ClampedArray} An array.
|
||||||
* @private
|
|
||||||
*/
|
*/
|
||||||
const createGradient = function(colors) {
|
function createGradient(colors) {
|
||||||
const width = 1;
|
const width = 1;
|
||||||
const height = 256;
|
const height = 256;
|
||||||
const context = createCanvasContext2D(width, height);
|
const context = createCanvasContext2D(width, height);
|
||||||
@@ -306,7 +305,7 @@ const createGradient = function(colors) {
|
|||||||
context.fillRect(0, 0, width, height);
|
context.fillRect(0, 0, width, height);
|
||||||
|
|
||||||
return context.getImageData(0, 0, width, height).data;
|
return context.getImageData(0, 0, width, height).data;
|
||||||
};
|
}
|
||||||
|
|
||||||
|
|
||||||
export default Heatmap;
|
export default Heatmap;
|
||||||
|
|||||||
@@ -34,6 +34,27 @@
|
|||||||
import {inherits} from '../util.js';
|
import {inherits} from '../util.js';
|
||||||
import EventSource from '../pointer/EventSource.js';
|
import EventSource from '../pointer/EventSource.js';
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @type {number}
|
||||||
|
*/
|
||||||
|
export const POINTER_ID = 1;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @type {string}
|
||||||
|
*/
|
||||||
|
export const POINTER_TYPE = 'mouse';
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Radius around touchend that swallows mouse events.
|
||||||
|
*
|
||||||
|
* @type {number}
|
||||||
|
*/
|
||||||
|
const DEDUP_DIST = 25;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/pointer/PointerEventHandler} dispatcher Event handler.
|
* @param {module:ol/pointer/PointerEventHandler} dispatcher Event handler.
|
||||||
* @constructor
|
* @constructor
|
||||||
@@ -195,26 +216,6 @@ class MouseSource {
|
|||||||
inherits(MouseSource, EventSource);
|
inherits(MouseSource, EventSource);
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @type {number}
|
|
||||||
*/
|
|
||||||
export const POINTER_ID = 1;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @type {string}
|
|
||||||
*/
|
|
||||||
export const POINTER_TYPE = 'mouse';
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Radius around touchend that swallows mouse events.
|
|
||||||
*
|
|
||||||
* @type {number}
|
|
||||||
*/
|
|
||||||
const DEDUP_DIST = 25;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a copy of the original event that will be used
|
* Creates a copy of the original event that will be used
|
||||||
* for the fake pointer event.
|
* for the fake pointer event.
|
||||||
|
|||||||
@@ -34,6 +34,20 @@
|
|||||||
import {inherits} from '../util.js';
|
import {inherits} from '../util.js';
|
||||||
import EventSource from '../pointer/EventSource.js';
|
import EventSource from '../pointer/EventSource.js';
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @const
|
||||||
|
* @type {Array.<string>}
|
||||||
|
*/
|
||||||
|
const POINTER_TYPES = [
|
||||||
|
'',
|
||||||
|
'unavailable',
|
||||||
|
'touch',
|
||||||
|
'pen',
|
||||||
|
'mouse'
|
||||||
|
];
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/pointer/PointerEventHandler} dispatcher Event handler.
|
* @param {module:ol/pointer/PointerEventHandler} dispatcher Event handler.
|
||||||
* @constructor
|
* @constructor
|
||||||
@@ -172,17 +186,4 @@ class MsSource {
|
|||||||
|
|
||||||
inherits(MsSource, EventSource);
|
inherits(MsSource, EventSource);
|
||||||
|
|
||||||
/**
|
|
||||||
* @const
|
|
||||||
* @type {Array.<string>}
|
|
||||||
*/
|
|
||||||
const POINTER_TYPES = [
|
|
||||||
'',
|
|
||||||
'unavailable',
|
|
||||||
'touch',
|
|
||||||
'pen',
|
|
||||||
'mouse'
|
|
||||||
];
|
|
||||||
|
|
||||||
|
|
||||||
export default MsSource;
|
export default MsSource;
|
||||||
|
|||||||
@@ -34,6 +34,14 @@
|
|||||||
import {inherits} from '../util.js';
|
import {inherits} from '../util.js';
|
||||||
import Event from '../events/Event.js';
|
import Event from '../events/Event.js';
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Is the `buttons` property supported?
|
||||||
|
* @type {boolean}
|
||||||
|
*/
|
||||||
|
let HAS_BUTTONS = false;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A class for pointer events.
|
* A class for pointer events.
|
||||||
*
|
*
|
||||||
@@ -256,13 +264,6 @@ class PointerEvent {
|
|||||||
inherits(PointerEvent, Event);
|
inherits(PointerEvent, Event);
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Is the `buttons` property supported?
|
|
||||||
* @type {boolean}
|
|
||||||
*/
|
|
||||||
let HAS_BUTTONS = false;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if the `buttons` property is supported.
|
* Checks if the `buttons` property is supported.
|
||||||
*/
|
*/
|
||||||
@@ -274,4 +275,5 @@ let HAS_BUTTONS = false;
|
|||||||
// pass
|
// pass
|
||||||
}
|
}
|
||||||
})();
|
})();
|
||||||
|
|
||||||
export default PointerEvent;
|
export default PointerEvent;
|
||||||
|
|||||||
@@ -42,6 +42,47 @@ import NativeSource from '../pointer/NativeSource.js';
|
|||||||
import PointerEvent from '../pointer/PointerEvent.js';
|
import PointerEvent from '../pointer/PointerEvent.js';
|
||||||
import TouchSource from '../pointer/TouchSource.js';
|
import TouchSource from '../pointer/TouchSource.js';
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Properties to copy when cloning an event, with default values.
|
||||||
|
* @type {Array.<Array>}
|
||||||
|
*/
|
||||||
|
const CLONE_PROPS = [
|
||||||
|
// MouseEvent
|
||||||
|
['bubbles', false],
|
||||||
|
['cancelable', false],
|
||||||
|
['view', null],
|
||||||
|
['detail', null],
|
||||||
|
['screenX', 0],
|
||||||
|
['screenY', 0],
|
||||||
|
['clientX', 0],
|
||||||
|
['clientY', 0],
|
||||||
|
['ctrlKey', false],
|
||||||
|
['altKey', false],
|
||||||
|
['shiftKey', false],
|
||||||
|
['metaKey', false],
|
||||||
|
['button', 0],
|
||||||
|
['relatedTarget', null],
|
||||||
|
// DOM Level 3
|
||||||
|
['buttons', 0],
|
||||||
|
// PointerEvent
|
||||||
|
['pointerId', 0],
|
||||||
|
['width', 0],
|
||||||
|
['height', 0],
|
||||||
|
['pressure', 0],
|
||||||
|
['tiltX', 0],
|
||||||
|
['tiltY', 0],
|
||||||
|
['pointerType', ''],
|
||||||
|
['hwTimestamp', 0],
|
||||||
|
['isPrimary', false],
|
||||||
|
// event instance
|
||||||
|
['type', ''],
|
||||||
|
['target', null],
|
||||||
|
['currentTarget', null],
|
||||||
|
['which', 0]
|
||||||
|
];
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @constructor
|
* @constructor
|
||||||
* @extends {module:ol/events/EventTarget}
|
* @extends {module:ol/events/EventTarget}
|
||||||
@@ -377,44 +418,4 @@ class PointerEventHandler {
|
|||||||
|
|
||||||
inherits(PointerEventHandler, EventTarget);
|
inherits(PointerEventHandler, EventTarget);
|
||||||
|
|
||||||
/**
|
|
||||||
* Properties to copy when cloning an event, with default values.
|
|
||||||
* @type {Array.<Array>}
|
|
||||||
*/
|
|
||||||
const CLONE_PROPS = [
|
|
||||||
// MouseEvent
|
|
||||||
['bubbles', false],
|
|
||||||
['cancelable', false],
|
|
||||||
['view', null],
|
|
||||||
['detail', null],
|
|
||||||
['screenX', 0],
|
|
||||||
['screenY', 0],
|
|
||||||
['clientX', 0],
|
|
||||||
['clientY', 0],
|
|
||||||
['ctrlKey', false],
|
|
||||||
['altKey', false],
|
|
||||||
['shiftKey', false],
|
|
||||||
['metaKey', false],
|
|
||||||
['button', 0],
|
|
||||||
['relatedTarget', null],
|
|
||||||
// DOM Level 3
|
|
||||||
['buttons', 0],
|
|
||||||
// PointerEvent
|
|
||||||
['pointerId', 0],
|
|
||||||
['width', 0],
|
|
||||||
['height', 0],
|
|
||||||
['pressure', 0],
|
|
||||||
['tiltX', 0],
|
|
||||||
['tiltY', 0],
|
|
||||||
['pointerType', ''],
|
|
||||||
['hwTimestamp', 0],
|
|
||||||
['isPrimary', false],
|
|
||||||
// event instance
|
|
||||||
['type', ''],
|
|
||||||
['target', null],
|
|
||||||
['currentTarget', null],
|
|
||||||
['which', 0]
|
|
||||||
];
|
|
||||||
|
|
||||||
|
|
||||||
export default PointerEventHandler;
|
export default PointerEventHandler;
|
||||||
|
|||||||
@@ -37,6 +37,18 @@ import EventSource from '../pointer/EventSource.js';
|
|||||||
import {POINTER_ID} from '../pointer/MouseSource.js';
|
import {POINTER_ID} from '../pointer/MouseSource.js';
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @type {number}
|
||||||
|
*/
|
||||||
|
const CLICK_COUNT_TIMEOUT = 200;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @type {string}
|
||||||
|
*/
|
||||||
|
const POINTER_TYPE = 'touch';
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @constructor
|
* @constructor
|
||||||
* @param {module:ol/pointer/PointerEventHandler} dispatcher The event handler.
|
* @param {module:ol/pointer/PointerEventHandler} dispatcher The event handler.
|
||||||
@@ -411,15 +423,4 @@ class TouchSource {
|
|||||||
inherits(TouchSource, EventSource);
|
inherits(TouchSource, EventSource);
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @type {number}
|
|
||||||
*/
|
|
||||||
const CLICK_COUNT_TIMEOUT = 200;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @type {string}
|
|
||||||
*/
|
|
||||||
const POINTER_TYPE = 'touch';
|
|
||||||
|
|
||||||
export default TouchSource;
|
export default TouchSource;
|
||||||
|
|||||||
@@ -12,6 +12,13 @@ import {get as getProjection} from '../proj.js';
|
|||||||
import {transform2D} from '../geom/flat/transform.js';
|
import {transform2D} from '../geom/flat/transform.js';
|
||||||
import {create as createTransform, compose as composeTransform} from '../transform.js';
|
import {create as createTransform, compose as composeTransform} from '../transform.js';
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @type {module:ol/transform~Transform}
|
||||||
|
*/
|
||||||
|
const tmpTransform = createTransform();
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Lightweight, read-only, {@link module:ol/Feature~Feature} and {@link module:ol/geom/Geometry~Geometry} like
|
* Lightweight, read-only, {@link module:ol/Feature~Feature} and {@link module:ol/geom/Geometry~Geometry} like
|
||||||
* structure, optimized for vector tile rendering and styling. Geometry access
|
* structure, optimized for vector tile rendering and styling. Geometry access
|
||||||
@@ -233,12 +240,6 @@ class RenderFeature {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @type {module:ol/transform~Transform}
|
|
||||||
*/
|
|
||||||
const tmpTransform = createTransform();
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return {Array.<number>|Array.<Array.<number>>} Ends or endss.
|
* @return {Array.<number>|Array.<Array.<number>>} Ends or endss.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -28,6 +28,19 @@ import {
|
|||||||
setFromArray as transformSetFromArray
|
setFromArray as transformSetFromArray
|
||||||
} from '../../transform.js';
|
} from '../../transform.js';
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @type {module:ol/extent~Extent}
|
||||||
|
*/
|
||||||
|
const tmpExtent = createEmpty();
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @type {!module:ol/transform~Transform}
|
||||||
|
*/
|
||||||
|
const tmpTransform = createTransform();
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @constructor
|
* @constructor
|
||||||
* @extends {module:ol/render/VectorContext}
|
* @extends {module:ol/render/VectorContext}
|
||||||
@@ -1072,18 +1085,6 @@ class CanvasReplay {
|
|||||||
inherits(CanvasReplay, VectorContext);
|
inherits(CanvasReplay, VectorContext);
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @type {module:ol/extent~Extent}
|
|
||||||
*/
|
|
||||||
const tmpExtent = createEmpty();
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @type {!module:ol/transform~Transform}
|
|
||||||
*/
|
|
||||||
const tmpTransform = createTransform();
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* FIXME empty description for jsdoc
|
* FIXME empty description for jsdoc
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -11,6 +11,18 @@ import TileImage from '../source/TileImage.js';
|
|||||||
import {createOrUpdate, quadKey} from '../tilecoord.js';
|
import {createOrUpdate, quadKey} from '../tilecoord.js';
|
||||||
import {createXYZ, extentFromProjection} from '../tilegrid.js';
|
import {createXYZ, extentFromProjection} from '../tilegrid.js';
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The attribution containing a link to the Microsoft® Bing™ Maps Platform APIs’
|
||||||
|
* Terms Of Use.
|
||||||
|
* @const
|
||||||
|
* @type {string}
|
||||||
|
*/
|
||||||
|
const TOS_ATTRIBUTION = '<a class="ol-attribution-bing-tos" ' +
|
||||||
|
'href="https://www.microsoft.com/maps/product/terms.html">' +
|
||||||
|
'Terms of Use</a>';
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {Object} Options
|
* @typedef {Object} Options
|
||||||
* @property {number} [cacheSize=2048] Cache size.
|
* @property {number} [cacheSize=2048] Cache size.
|
||||||
@@ -213,16 +225,4 @@ class BingMaps {
|
|||||||
|
|
||||||
inherits(BingMaps, TileImage);
|
inherits(BingMaps, TileImage);
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The attribution containing a link to the Microsoft® Bing™ Maps Platform APIs’
|
|
||||||
* Terms Of Use.
|
|
||||||
* @const
|
|
||||||
* @type {string}
|
|
||||||
*/
|
|
||||||
const TOS_ATTRIBUTION = '<a class="ol-attribution-bing-tos" ' +
|
|
||||||
'href="https://www.microsoft.com/maps/product/terms.html">' +
|
|
||||||
'Terms of Use</a>';
|
|
||||||
|
|
||||||
|
|
||||||
export default BingMaps;
|
export default BingMaps;
|
||||||
|
|||||||
@@ -17,6 +17,14 @@ import WMSServerType from '../source/WMSServerType.js';
|
|||||||
import {compareVersions} from '../string.js';
|
import {compareVersions} from '../string.js';
|
||||||
import {appendParams} from '../uri.js';
|
import {appendParams} from '../uri.js';
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @const
|
||||||
|
* @type {module:ol/size~Size}
|
||||||
|
*/
|
||||||
|
const GETFEATUREINFO_IMAGE_SIZE = [101, 101];
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {Object} Options
|
* @typedef {Object} Options
|
||||||
* @property {module:ol/source/Source~AttributionLike} [attributions] Attributions.
|
* @property {module:ol/source/Source~AttributionLike} [attributions] Attributions.
|
||||||
@@ -380,11 +388,4 @@ class ImageWMS {
|
|||||||
inherits(ImageWMS, ImageSource);
|
inherits(ImageWMS, ImageSource);
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @const
|
|
||||||
* @type {module:ol/size~Size}
|
|
||||||
*/
|
|
||||||
const GETFEATUREINFO_IMAGE_SIZE = [101, 101];
|
|
||||||
|
|
||||||
|
|
||||||
export default ImageWMS;
|
export default ImageWMS;
|
||||||
|
|||||||
@@ -11,6 +11,13 @@ import {toSize} from '../size.js';
|
|||||||
import {createOrUpdate as createOrUpdateTileCoord} from '../tilecoord.js';
|
import {createOrUpdate as createOrUpdateTileCoord} from '../tilecoord.js';
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @private
|
||||||
|
* @type {module:ol/tilecoord~TileCoord}
|
||||||
|
*/
|
||||||
|
const tmpTileCoord = [0, 0, 0];
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {Object} Options
|
* @typedef {Object} Options
|
||||||
* @property {module:ol/extent~Extent} [extent] Extent for the tile grid. No tiles outside this
|
* @property {module:ol/extent~Extent} [extent] Extent for the tile grid. No tiles outside this
|
||||||
@@ -544,11 +551,4 @@ class TileGrid {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @private
|
|
||||||
* @type {module:ol/tilecoord~TileCoord}
|
|
||||||
*/
|
|
||||||
const tmpTileCoord = [0, 0, 0];
|
|
||||||
|
|
||||||
|
|
||||||
export default TileGrid;
|
export default TileGrid;
|
||||||
|
|||||||
Reference in New Issue
Block a user