/*!
*
* iclient-ol.(https://iclient.supermap.io)
* Copyright© 2000 - 2021 SuperMap Software Co.Ltd
* license: Apache-2.0
* version: v10.1.1
*
*/
/******/ (function() { // webpackBootstrap
/******/ var __webpack_modules__ = ({
/***/ 898:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
module.exports = __webpack_require__(70);
/***/ }),
/***/ 937:
/***/ (function(module) {
(function (self) {
'use strict'; // if __disableNativeFetch is set to true, the it will always polyfill fetch
// with Ajax.
if (!self.__disableNativeFetch && self.fetch) {
return;
}
function normalizeName(name) {
if (typeof name !== 'string') {
name = String(name);
}
if (/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(name)) {
throw new TypeError('Invalid character in header field name');
}
return name.toLowerCase();
}
function normalizeValue(value) {
if (typeof value !== 'string') {
value = String(value);
}
return value;
}
function Headers(headers) {
this.map = {};
if (headers instanceof Headers) {
headers.forEach(function (value, name) {
this.append(name, value);
}, this);
} else if (headers) {
Object.getOwnPropertyNames(headers).forEach(function (name) {
this.append(name, headers[name]);
}, this);
}
}
Headers.prototype.append = function (name, value) {
name = normalizeName(name);
value = normalizeValue(value);
var list = this.map[name];
if (!list) {
list = [];
this.map[name] = list;
}
list.push(value);
};
Headers.prototype['delete'] = function (name) {
delete this.map[normalizeName(name)];
};
Headers.prototype.get = function (name) {
var values = this.map[normalizeName(name)];
return values ? values[0] : null;
};
Headers.prototype.getAll = function (name) {
return this.map[normalizeName(name)] || [];
};
Headers.prototype.has = function (name) {
return this.map.hasOwnProperty(normalizeName(name));
};
Headers.prototype.set = function (name, value) {
this.map[normalizeName(name)] = [normalizeValue(value)];
};
Headers.prototype.forEach = function (callback, thisArg) {
Object.getOwnPropertyNames(this.map).forEach(function (name) {
this.map[name].forEach(function (value) {
callback.call(thisArg, value, name, this);
}, this);
}, this);
};
function consumed(body) {
if (body.bodyUsed) {
return Promise.reject(new TypeError('Already read'));
}
body.bodyUsed = true;
}
function fileReaderReady(reader) {
return new Promise(function (resolve, reject) {
reader.onload = function () {
resolve(reader.result);
};
reader.onerror = function () {
reject(reader.error);
};
});
}
function readBlobAsArrayBuffer(blob) {
var reader = new FileReader();
reader.readAsArrayBuffer(blob);
return fileReaderReady(reader);
}
function readBlobAsText(blob, options) {
var reader = new FileReader();
var contentType = options.headers.map['content-type'] ? options.headers.map['content-type'].toString() : '';
var regex = /charset\=[0-9a-zA-Z\-\_]*;?/;
var _charset = blob.type.match(regex) || contentType.match(regex);
var args = [blob];
if (_charset) {
args.push(_charset[0].replace(/^charset\=/, '').replace(/;$/, ''));
}
reader.readAsText.apply(reader, args);
return fileReaderReady(reader);
}
var support = {
blob: 'FileReader' in self && 'Blob' in self && function () {
try {
new Blob();
return true;
} catch (e) {
return false;
}
}(),
formData: 'FormData' in self,
arrayBuffer: 'ArrayBuffer' in self
};
function Body() {
this.bodyUsed = false;
this._initBody = function (body, options) {
this._bodyInit = body;
if (typeof body === 'string') {
this._bodyText = body;
} else if (support.blob && Blob.prototype.isPrototypeOf(body)) {
this._bodyBlob = body;
this._options = options;
} else if (support.formData && FormData.prototype.isPrototypeOf(body)) {
this._bodyFormData = body;
} else if (!body) {
this._bodyText = '';
} else if (support.arrayBuffer && ArrayBuffer.prototype.isPrototypeOf(body)) {// Only support ArrayBuffers for POST method.
// Receiving ArrayBuffers happens via Blobs, instead.
} else {
throw new Error('unsupported BodyInit type');
}
};
if (support.blob) {
this.blob = function () {
var rejected = consumed(this);
if (rejected) {
return rejected;
}
if (this._bodyBlob) {
return Promise.resolve(this._bodyBlob);
} else if (this._bodyFormData) {
throw new Error('could not read FormData body as blob');
} else {
return Promise.resolve(new Blob([this._bodyText]));
}
};
this.arrayBuffer = function () {
return this.blob().then(readBlobAsArrayBuffer);
};
this.text = function () {
var rejected = consumed(this);
if (rejected) {
return rejected;
}
if (this._bodyBlob) {
return readBlobAsText(this._bodyBlob, this._options);
} else if (this._bodyFormData) {
throw new Error('could not read FormData body as text');
} else {
return Promise.resolve(this._bodyText);
}
};
} else {
this.text = function () {
var rejected = consumed(this);
return rejected ? rejected : Promise.resolve(this._bodyText);
};
}
if (support.formData) {
this.formData = function () {
return this.text().then(decode);
};
}
this.json = function () {
return this.text().then(JSON.parse);
};
return this;
} // HTTP methods whose capitalization should be normalized
var methods = ['DELETE', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT'];
function normalizeMethod(method) {
var upcased = method.toUpperCase();
return methods.indexOf(upcased) > -1 ? upcased : method;
}
function Request(input, options) {
options = options || {};
var body = options.body;
if (Request.prototype.isPrototypeOf(input)) {
if (input.bodyUsed) {
throw new TypeError('Already read');
}
this.url = input.url;
this.credentials = input.credentials;
if (!options.headers) {
this.headers = new Headers(input.headers);
}
this.method = input.method;
this.mode = input.mode;
if (!body) {
body = input._bodyInit;
input.bodyUsed = true;
}
} else {
this.url = input;
}
this.credentials = options.credentials || this.credentials || 'omit';
if (options.headers || !this.headers) {
this.headers = new Headers(options.headers);
}
this.method = normalizeMethod(options.method || this.method || 'GET');
this.mode = options.mode || this.mode || null;
this.referrer = null;
if ((this.method === 'GET' || this.method === 'HEAD') && body) {
throw new TypeError('Body not allowed for GET or HEAD requests');
}
this._initBody(body, options);
}
Request.prototype.clone = function () {
return new Request(this);
};
function decode(body) {
var form = new FormData();
body.trim().split('&').forEach(function (bytes) {
if (bytes) {
var split = bytes.split('=');
var name = split.shift().replace(/\+/g, ' ');
var value = split.join('=').replace(/\+/g, ' ');
form.append(decodeURIComponent(name), decodeURIComponent(value));
}
});
return form;
}
function headers(xhr) {
var head = new Headers();
var pairs = xhr.getAllResponseHeaders().trim().split('\n');
pairs.forEach(function (header) {
var split = header.trim().split(':');
var key = split.shift().trim();
var value = split.join(':').trim();
head.append(key, value);
});
return head;
}
Body.call(Request.prototype);
function Response(bodyInit, options) {
if (!options) {
options = {};
}
this._initBody(bodyInit, options);
this.type = 'default';
this.status = options.status;
this.ok = this.status >= 200 && this.status < 300;
this.statusText = options.statusText;
this.headers = options.headers instanceof Headers ? options.headers : new Headers(options.headers);
this.url = options.url || '';
}
Body.call(Response.prototype);
Response.prototype.clone = function () {
return new Response(this._bodyInit, {
status: this.status,
statusText: this.statusText,
headers: new Headers(this.headers),
url: this.url
});
};
Response.error = function () {
var response = new Response(null, {
status: 0,
statusText: ''
});
response.type = 'error';
return response;
};
var redirectStatuses = [301, 302, 303, 307, 308];
Response.redirect = function (url, status) {
if (redirectStatuses.indexOf(status) === -1) {
throw new RangeError('Invalid status code');
}
return new Response(null, {
status: status,
headers: {
location: url
}
});
};
self.Headers = Headers;
self.Request = Request;
self.Response = Response;
self.fetch = function (input, init) {
return new Promise(function (resolve, reject) {
var request;
if (Request.prototype.isPrototypeOf(input) && !init) {
request = input;
} else {
request = new Request(input, init);
}
var xhr = new XMLHttpRequest();
function responseURL() {
if ('responseURL' in xhr) {
return xhr.responseURL;
} // Avoid security warnings on getResponseHeader when not allowed by CORS
if (/^X-Request-URL:/m.test(xhr.getAllResponseHeaders())) {
return xhr.getResponseHeader('X-Request-URL');
}
return;
}
var __onLoadHandled = false;
function onload() {
if (xhr.readyState !== 4) {
return;
}
var status = xhr.status === 1223 ? 204 : xhr.status;
if (status < 100 || status > 599) {
if (__onLoadHandled) {
return;
} else {
__onLoadHandled = true;
}
reject(new TypeError('Network request failed'));
return;
}
var options = {
status: status,
statusText: xhr.statusText,
headers: headers(xhr),
url: responseURL()
};
var body = 'response' in xhr ? xhr.response : xhr.responseText;
if (__onLoadHandled) {
return;
} else {
__onLoadHandled = true;
}
resolve(new Response(body, options));
}
xhr.onreadystatechange = onload;
xhr.onload = onload;
xhr.onerror = function () {
if (__onLoadHandled) {
return;
} else {
__onLoadHandled = true;
}
reject(new TypeError('Network request failed'));
};
xhr.open(request.method, request.url, true); // `withCredentials` should be setted after calling `.open` in IE10
// http://stackoverflow.com/a/19667959/1219343
try {
if (request.credentials === 'include') {
if ('withCredentials' in xhr) {
xhr.withCredentials = true;
} else {
console && console.warn && console.warn('withCredentials is not supported, you can ignore this warning');
}
}
} catch (e) {
console && console.warn && console.warn('set withCredentials error:' + e);
}
if ('responseType' in xhr && support.blob) {
xhr.responseType = 'blob';
}
request.headers.forEach(function (value, name) {
xhr.setRequestHeader(name, value);
});
xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit);
});
};
self.fetch.polyfill = true; // Support CommonJS
if ( true && module.exports) {
module.exports = self.fetch;
}
})(typeof self !== 'undefined' ? self : this);
/***/ }),
/***/ 238:
/***/ (function(module, exports) {
var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (global, factory) {
if (true) {
!(__WEBPACK_AMD_DEFINE_ARRAY__ = [exports, module], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
__WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
(__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
} else { var mod; }
})(this, function (exports, module) {
'use strict';
var defaultOptions = {
timeout: 5000,
jsonpCallback: 'callback',
jsonpCallbackFunction: null
};
function generateCallbackFunction() {
return 'jsonp_' + Date.now() + '_' + Math.ceil(Math.random() * 100000);
}
function clearFunction(functionName) {
// IE8 throws an exception when you try to delete a property on window
// http://stackoverflow.com/a/1824228/751089
try {
delete window[functionName];
} catch (e) {
window[functionName] = undefined;
}
}
function removeScript(scriptId) {
var script = document.getElementById(scriptId);
if (script) {
document.getElementsByTagName('head')[0].removeChild(script);
}
}
function fetchJsonp(_url) {
var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; // to avoid param reassign
var url = _url;
var timeout = options.timeout || defaultOptions.timeout;
var jsonpCallback = options.jsonpCallback || defaultOptions.jsonpCallback;
var timeoutId = undefined;
return new Promise(function (resolve, reject) {
var callbackFunction = options.jsonpCallbackFunction || generateCallbackFunction();
var scriptId = jsonpCallback + '_' + callbackFunction;
window[callbackFunction] = function (response) {
resolve({
ok: true,
// keep consistent with fetch API
json: function json() {
return Promise.resolve(response);
}
});
if (timeoutId) clearTimeout(timeoutId);
removeScript(scriptId);
clearFunction(callbackFunction);
}; // Check if the user set their own params, and if not add a ? to start a list of params
url += url.indexOf('?') === -1 ? '?' : '&';
var jsonpScript = document.createElement('script');
jsonpScript.setAttribute('src', '' + url + jsonpCallback + '=' + callbackFunction);
if (options.charset) {
jsonpScript.setAttribute('charset', options.charset);
}
jsonpScript.id = scriptId;
document.getElementsByTagName('head')[0].appendChild(jsonpScript);
timeoutId = setTimeout(function () {
reject(new Error('JSONP request to ' + _url + ' timed out'));
clearFunction(callbackFunction);
removeScript(scriptId);
window[callbackFunction] = function () {
clearFunction(callbackFunction);
};
}, timeout); // Caught if got 404/500
jsonpScript.onerror = function () {
reject(new Error('JSONP request to ' + _url + ' failed'));
clearFunction(callbackFunction);
removeScript(scriptId);
if (timeoutId) clearTimeout(timeoutId);
};
});
} // export as global function
/*
let local;
if (typeof global !== 'undefined') {
local = global;
} else if (typeof self !== 'undefined') {
local = self;
} else {
try {
local = Function('return this')();
} catch (e) {
throw new Error('polyfill failed because global object is unavailable in this environment');
}
}
local.fetchJsonp = fetchJsonp;
*/
module.exports = fetchJsonp;
});
/***/ }),
/***/ 944:
/***/ (function(module, exports, __webpack_require__) {
/* module decorator */ module = __webpack_require__.nmd(module);
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
/**
* lodash (Custom Build)
* Build: `lodash modularize exports="npm" -o ./`
* Copyright jQuery Foundation and other contributors
* Released under MIT license
* Based on Underscore.js 1.8.3
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
*/
/** Used as the size to enable large array optimizations. */
var LARGE_ARRAY_SIZE = 200;
/** Used as the `TypeError` message for "Functions" methods. */
var FUNC_ERROR_TEXT = 'Expected a function';
/** Used to stand-in for `undefined` hash values. */
var HASH_UNDEFINED = '__lodash_hash_undefined__';
/** Used to compose bitmasks for comparison styles. */
var UNORDERED_COMPARE_FLAG = 1,
PARTIAL_COMPARE_FLAG = 2;
/** Used as references for various `Number` constants. */
var INFINITY = 1 / 0,
MAX_SAFE_INTEGER = 9007199254740991;
/** `Object#toString` result references. */
var argsTag = '[object Arguments]',
arrayTag = '[object Array]',
boolTag = '[object Boolean]',
dateTag = '[object Date]',
errorTag = '[object Error]',
funcTag = '[object Function]',
genTag = '[object GeneratorFunction]',
mapTag = '[object Map]',
numberTag = '[object Number]',
objectTag = '[object Object]',
promiseTag = '[object Promise]',
regexpTag = '[object RegExp]',
setTag = '[object Set]',
stringTag = '[object String]',
symbolTag = '[object Symbol]',
weakMapTag = '[object WeakMap]';
var arrayBufferTag = '[object ArrayBuffer]',
dataViewTag = '[object DataView]',
float32Tag = '[object Float32Array]',
float64Tag = '[object Float64Array]',
int8Tag = '[object Int8Array]',
int16Tag = '[object Int16Array]',
int32Tag = '[object Int32Array]',
uint8Tag = '[object Uint8Array]',
uint8ClampedTag = '[object Uint8ClampedArray]',
uint16Tag = '[object Uint16Array]',
uint32Tag = '[object Uint32Array]';
/** Used to match property names within property paths. */
var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
reIsPlainProp = /^\w*$/,
reLeadingDot = /^\./,
rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
/**
* Used to match `RegExp`
* [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
*/
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
/** Used to match backslashes in property paths. */
var reEscapeChar = /\\(\\)?/g;
/** Used to detect host constructors (Safari). */
var reIsHostCtor = /^\[object .+?Constructor\]$/;
/** Used to detect unsigned integer values. */
var reIsUint = /^(?:0|[1-9]\d*)$/;
/** Used to identify `toStringTag` values of typed arrays. */
var typedArrayTags = {};
typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true;
typedArrayTags[argsTag] = typedArrayTags[arrayTag] = typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = typedArrayTags[errorTag] = typedArrayTags[funcTag] = typedArrayTags[mapTag] = typedArrayTags[numberTag] = typedArrayTags[objectTag] = typedArrayTags[regexpTag] = typedArrayTags[setTag] = typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false;
/** Detect free variable `global` from Node.js. */
var freeGlobal = (typeof __webpack_require__.g === "undefined" ? "undefined" : _typeof(__webpack_require__.g)) == 'object' && __webpack_require__.g && __webpack_require__.g.Object === Object && __webpack_require__.g;
/** Detect free variable `self`. */
var freeSelf = (typeof self === "undefined" ? "undefined" : _typeof(self)) == 'object' && self && self.Object === Object && self;
/** Used as a reference to the global object. */
var root = freeGlobal || freeSelf || Function('return this')();
/** Detect free variable `exports`. */
var freeExports = ( false ? 0 : _typeof(exports)) == 'object' && exports && !exports.nodeType && exports;
/** Detect free variable `module`. */
var freeModule = freeExports && ( false ? 0 : _typeof(module)) == 'object' && module && !module.nodeType && module;
/** Detect the popular CommonJS extension `module.exports`. */
var moduleExports = freeModule && freeModule.exports === freeExports;
/** Detect free variable `process` from Node.js. */
var freeProcess = moduleExports && freeGlobal.process;
/** Used to access faster Node.js helpers. */
var nodeUtil = function () {
try {
return freeProcess && freeProcess.binding('util');
} catch (e) {}
}();
/* Node.js helper references. */
var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
/**
* A specialized version of `_.some` for arrays without support for iteratee
* shorthands.
*
* @private
* @param {Array} [array] The array to iterate over.
* @param {Function} predicate The function invoked per iteration.
* @returns {boolean} Returns `true` if any element passes the predicate check,
* else `false`.
*/
function arraySome(array, predicate) {
var index = -1,
length = array ? array.length : 0;
while (++index < length) {
if (predicate(array[index], index, array)) {
return true;
}
}
return false;
}
/**
* The base implementation of `_.property` without support for deep paths.
*
* @private
* @param {string} key The key of the property to get.
* @returns {Function} Returns the new accessor function.
*/
function baseProperty(key) {
return function (object) {
return object == null ? undefined : object[key];
};
}
/**
* The base implementation of `_.times` without support for iteratee shorthands
* or max array length checks.
*
* @private
* @param {number} n The number of times to invoke `iteratee`.
* @param {Function} iteratee The function invoked per iteration.
* @returns {Array} Returns the array of results.
*/
function baseTimes(n, iteratee) {
var index = -1,
result = Array(n);
while (++index < n) {
result[index] = iteratee(index);
}
return result;
}
/**
* The base implementation of `_.unary` without support for storing metadata.
*
* @private
* @param {Function} func The function to cap arguments for.
* @returns {Function} Returns the new capped function.
*/
function baseUnary(func) {
return function (value) {
return func(value);
};
}
/**
* Gets the value at `key` of `object`.
*
* @private
* @param {Object} [object] The object to query.
* @param {string} key The key of the property to get.
* @returns {*} Returns the property value.
*/
function getValue(object, key) {
return object == null ? undefined : object[key];
}
/**
* Checks if `value` is a host object in IE < 9.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a host object, else `false`.
*/
function isHostObject(value) {
// Many host objects are `Object` objects that can coerce to strings
// despite having improperly defined `toString` methods.
var result = false;
if (value != null && typeof value.toString != 'function') {
try {
result = !!(value + '');
} catch (e) {}
}
return result;
}
/**
* Converts `map` to its key-value pairs.
*
* @private
* @param {Object} map The map to convert.
* @returns {Array} Returns the key-value pairs.
*/
function mapToArray(map) {
var index = -1,
result = Array(map.size);
map.forEach(function (value, key) {
result[++index] = [key, value];
});
return result;
}
/**
* Creates a unary function that invokes `func` with its argument transformed.
*
* @private
* @param {Function} func The function to wrap.
* @param {Function} transform The argument transform.
* @returns {Function} Returns the new function.
*/
function overArg(func, transform) {
return function (arg) {
return func(transform(arg));
};
}
/**
* Converts `set` to an array of its values.
*
* @private
* @param {Object} set The set to convert.
* @returns {Array} Returns the values.
*/
function setToArray(set) {
var index = -1,
result = Array(set.size);
set.forEach(function (value) {
result[++index] = value;
});
return result;
}
/** Used for built-in method references. */
var arrayProto = Array.prototype,
funcProto = Function.prototype,
objectProto = Object.prototype;
/** Used to detect overreaching core-js shims. */
var coreJsData = root['__core-js_shared__'];
/** Used to detect methods masquerading as native. */
var maskSrcKey = function () {
var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
return uid ? 'Symbol(src)_1.' + uid : '';
}();
/** Used to resolve the decompiled source of functions. */
var funcToString = funcProto.toString;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/**
* Used to resolve the
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
* of values.
*/
var objectToString = objectProto.toString;
/** Used to detect if a method is native. */
var reIsNative = RegExp('^' + funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&').replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$');
/** Built-in value references. */
var _Symbol = root.Symbol,
Uint8Array = root.Uint8Array,
propertyIsEnumerable = objectProto.propertyIsEnumerable,
splice = arrayProto.splice;
/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeKeys = overArg(Object.keys, Object);
/* Built-in method references that are verified to be native. */
var DataView = getNative(root, 'DataView'),
Map = getNative(root, 'Map'),
Promise = getNative(root, 'Promise'),
Set = getNative(root, 'Set'),
WeakMap = getNative(root, 'WeakMap'),
nativeCreate = getNative(Object, 'create');
/** Used to detect maps, sets, and weakmaps. */
var dataViewCtorString = toSource(DataView),
mapCtorString = toSource(Map),
promiseCtorString = toSource(Promise),
setCtorString = toSource(Set),
weakMapCtorString = toSource(WeakMap);
/** Used to convert symbols to primitives and strings. */
var symbolProto = _Symbol ? _Symbol.prototype : undefined,
symbolValueOf = symbolProto ? symbolProto.valueOf : undefined,
symbolToString = symbolProto ? symbolProto.toString : undefined;
/**
* Creates a hash object.
*
* @private
* @constructor
* @param {Array} [entries] The key-value pairs to cache.
*/
function Hash(entries) {
var index = -1,
length = entries ? entries.length : 0;
this.clear();
while (++index < length) {
var entry = entries[index];
this.set(entry[0], entry[1]);
}
}
/**
* Removes all key-value entries from the hash.
*
* @private
* @name clear
* @memberOf Hash
*/
function hashClear() {
this.__data__ = nativeCreate ? nativeCreate(null) : {};
}
/**
* Removes `key` and its value from the hash.
*
* @private
* @name delete
* @memberOf Hash
* @param {Object} hash The hash to modify.
* @param {string} key The key of the value to remove.
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
*/
function hashDelete(key) {
return this.has(key) && delete this.__data__[key];
}
/**
* Gets the hash value for `key`.
*
* @private
* @name get
* @memberOf Hash
* @param {string} key The key of the value to get.
* @returns {*} Returns the entry value.
*/
function hashGet(key) {
var data = this.__data__;
if (nativeCreate) {
var result = data[key];
return result === HASH_UNDEFINED ? undefined : result;
}
return hasOwnProperty.call(data, key) ? data[key] : undefined;
}
/**
* Checks if a hash value for `key` exists.
*
* @private
* @name has
* @memberOf Hash
* @param {string} key The key of the entry to check.
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
*/
function hashHas(key) {
var data = this.__data__;
return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
}
/**
* Sets the hash `key` to `value`.
*
* @private
* @name set
* @memberOf Hash
* @param {string} key The key of the value to set.
* @param {*} value The value to set.
* @returns {Object} Returns the hash instance.
*/
function hashSet(key, value) {
var data = this.__data__;
data[key] = nativeCreate && value === undefined ? HASH_UNDEFINED : value;
return this;
} // Add methods to `Hash`.
Hash.prototype.clear = hashClear;
Hash.prototype['delete'] = hashDelete;
Hash.prototype.get = hashGet;
Hash.prototype.has = hashHas;
Hash.prototype.set = hashSet;
/**
* Creates an list cache object.
*
* @private
* @constructor
* @param {Array} [entries] The key-value pairs to cache.
*/
function ListCache(entries) {
var index = -1,
length = entries ? entries.length : 0;
this.clear();
while (++index < length) {
var entry = entries[index];
this.set(entry[0], entry[1]);
}
}
/**
* Removes all key-value entries from the list cache.
*
* @private
* @name clear
* @memberOf ListCache
*/
function listCacheClear() {
this.__data__ = [];
}
/**
* Removes `key` and its value from the list cache.
*
* @private
* @name delete
* @memberOf ListCache
* @param {string} key The key of the value to remove.
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
*/
function listCacheDelete(key) {
var data = this.__data__,
index = assocIndexOf(data, key);
if (index < 0) {
return false;
}
var lastIndex = data.length - 1;
if (index == lastIndex) {
data.pop();
} else {
splice.call(data, index, 1);
}
return true;
}
/**
* Gets the list cache value for `key`.
*
* @private
* @name get
* @memberOf ListCache
* @param {string} key The key of the value to get.
* @returns {*} Returns the entry value.
*/
function listCacheGet(key) {
var data = this.__data__,
index = assocIndexOf(data, key);
return index < 0 ? undefined : data[index][1];
}
/**
* Checks if a list cache value for `key` exists.
*
* @private
* @name has
* @memberOf ListCache
* @param {string} key The key of the entry to check.
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
*/
function listCacheHas(key) {
return assocIndexOf(this.__data__, key) > -1;
}
/**
* Sets the list cache `key` to `value`.
*
* @private
* @name set
* @memberOf ListCache
* @param {string} key The key of the value to set.
* @param {*} value The value to set.
* @returns {Object} Returns the list cache instance.
*/
function listCacheSet(key, value) {
var data = this.__data__,
index = assocIndexOf(data, key);
if (index < 0) {
data.push([key, value]);
} else {
data[index][1] = value;
}
return this;
} // Add methods to `ListCache`.
ListCache.prototype.clear = listCacheClear;
ListCache.prototype['delete'] = listCacheDelete;
ListCache.prototype.get = listCacheGet;
ListCache.prototype.has = listCacheHas;
ListCache.prototype.set = listCacheSet;
/**
* Creates a map cache object to store key-value pairs.
*
* @private
* @constructor
* @param {Array} [entries] The key-value pairs to cache.
*/
function MapCache(entries) {
var index = -1,
length = entries ? entries.length : 0;
this.clear();
while (++index < length) {
var entry = entries[index];
this.set(entry[0], entry[1]);
}
}
/**
* Removes all key-value entries from the map.
*
* @private
* @name clear
* @memberOf MapCache
*/
function mapCacheClear() {
this.__data__ = {
'hash': new Hash(),
'map': new (Map || ListCache)(),
'string': new Hash()
};
}
/**
* Removes `key` and its value from the map.
*
* @private
* @name delete
* @memberOf MapCache
* @param {string} key The key of the value to remove.
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
*/
function mapCacheDelete(key) {
return getMapData(this, key)['delete'](key);
}
/**
* Gets the map value for `key`.
*
* @private
* @name get
* @memberOf MapCache
* @param {string} key The key of the value to get.
* @returns {*} Returns the entry value.
*/
function mapCacheGet(key) {
return getMapData(this, key).get(key);
}
/**
* Checks if a map value for `key` exists.
*
* @private
* @name has
* @memberOf MapCache
* @param {string} key The key of the entry to check.
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
*/
function mapCacheHas(key) {
return getMapData(this, key).has(key);
}
/**
* Sets the map `key` to `value`.
*
* @private
* @name set
* @memberOf MapCache
* @param {string} key The key of the value to set.
* @param {*} value The value to set.
* @returns {Object} Returns the map cache instance.
*/
function mapCacheSet(key, value) {
getMapData(this, key).set(key, value);
return this;
} // Add methods to `MapCache`.
MapCache.prototype.clear = mapCacheClear;
MapCache.prototype['delete'] = mapCacheDelete;
MapCache.prototype.get = mapCacheGet;
MapCache.prototype.has = mapCacheHas;
MapCache.prototype.set = mapCacheSet;
/**
*
* Creates an array cache object to store unique values.
*
* @private
* @constructor
* @param {Array} [values] The values to cache.
*/
function SetCache(values) {
var index = -1,
length = values ? values.length : 0;
this.__data__ = new MapCache();
while (++index < length) {
this.add(values[index]);
}
}
/**
* Adds `value` to the array cache.
*
* @private
* @name add
* @memberOf SetCache
* @alias push
* @param {*} value The value to cache.
* @returns {Object} Returns the cache instance.
*/
function setCacheAdd(value) {
this.__data__.set(value, HASH_UNDEFINED);
return this;
}
/**
* Checks if `value` is in the array cache.
*
* @private
* @name has
* @memberOf SetCache
* @param {*} value The value to search for.
* @returns {number} Returns `true` if `value` is found, else `false`.
*/
function setCacheHas(value) {
return this.__data__.has(value);
} // Add methods to `SetCache`.
SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
SetCache.prototype.has = setCacheHas;
/**
* Creates a stack cache object to store key-value pairs.
*
* @private
* @constructor
* @param {Array} [entries] The key-value pairs to cache.
*/
function Stack(entries) {
this.__data__ = new ListCache(entries);
}
/**
* Removes all key-value entries from the stack.
*
* @private
* @name clear
* @memberOf Stack
*/
function stackClear() {
this.__data__ = new ListCache();
}
/**
* Removes `key` and its value from the stack.
*
* @private
* @name delete
* @memberOf Stack
* @param {string} key The key of the value to remove.
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
*/
function stackDelete(key) {
return this.__data__['delete'](key);
}
/**
* Gets the stack value for `key`.
*
* @private
* @name get
* @memberOf Stack
* @param {string} key The key of the value to get.
* @returns {*} Returns the entry value.
*/
function stackGet(key) {
return this.__data__.get(key);
}
/**
* Checks if a stack value for `key` exists.
*
* @private
* @name has
* @memberOf Stack
* @param {string} key The key of the entry to check.
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
*/
function stackHas(key) {
return this.__data__.has(key);
}
/**
* Sets the stack `key` to `value`.
*
* @private
* @name set
* @memberOf Stack
* @param {string} key The key of the value to set.
* @param {*} value The value to set.
* @returns {Object} Returns the stack cache instance.
*/
function stackSet(key, value) {
var cache = this.__data__;
if (cache instanceof ListCache) {
var pairs = cache.__data__;
if (!Map || pairs.length < LARGE_ARRAY_SIZE - 1) {
pairs.push([key, value]);
return this;
}
cache = this.__data__ = new MapCache(pairs);
}
cache.set(key, value);
return this;
} // Add methods to `Stack`.
Stack.prototype.clear = stackClear;
Stack.prototype['delete'] = stackDelete;
Stack.prototype.get = stackGet;
Stack.prototype.has = stackHas;
Stack.prototype.set = stackSet;
/**
* Creates an array of the enumerable property names of the array-like `value`.
*
* @private
* @param {*} value The value to query.
* @param {boolean} inherited Specify returning inherited property names.
* @returns {Array} Returns the array of property names.
*/
function arrayLikeKeys(value, inherited) {
// Safari 8.1 makes `arguments.callee` enumerable in strict mode.
// Safari 9 makes `arguments.length` enumerable in strict mode.
var result = isArray(value) || isArguments(value) ? baseTimes(value.length, String) : [];
var length = result.length,
skipIndexes = !!length;
for (var key in value) {
if ((inherited || hasOwnProperty.call(value, key)) && !(skipIndexes && (key == 'length' || isIndex(key, length)))) {
result.push(key);
}
}
return result;
}
/**
* Gets the index at which the `key` is found in `array` of key-value pairs.
*
* @private
* @param {Array} array The array to inspect.
* @param {*} key The key to search for.
* @returns {number} Returns the index of the matched value, else `-1`.
*/
function assocIndexOf(array, key) {
var length = array.length;
while (length--) {
if (eq(array[length][0], key)) {
return length;
}
}
return -1;
}
/**
* The base implementation of `_.get` without support for default values.
*
* @private
* @param {Object} object The object to query.
* @param {Array|string} path The path of the property to get.
* @returns {*} Returns the resolved value.
*/
function baseGet(object, path) {
path = isKey(path, object) ? [path] : castPath(path);
var index = 0,
length = path.length;
while (object != null && index < length) {
object = object[toKey(path[index++])];
}
return index && index == length ? object : undefined;
}
/**
* The base implementation of `getTag`.
*
* @private
* @param {*} value The value to query.
* @returns {string} Returns the `toStringTag`.
*/
function baseGetTag(value) {
return objectToString.call(value);
}
/**
* The base implementation of `_.hasIn` without support for deep paths.
*
* @private
* @param {Object} [object] The object to query.
* @param {Array|string} key The key to check.
* @returns {boolean} Returns `true` if `key` exists, else `false`.
*/
function baseHasIn(object, key) {
return object != null && key in Object(object);
}
/**
* The base implementation of `_.isEqual` which supports partial comparisons
* and tracks traversed objects.
*
* @private
* @param {*} value The value to compare.
* @param {*} other The other value to compare.
* @param {Function} [customizer] The function to customize comparisons.
* @param {boolean} [bitmask] The bitmask of comparison flags.
* The bitmask may be composed of the following flags:
* 1 - Unordered comparison
* 2 - Partial comparison
* @param {Object} [stack] Tracks traversed `value` and `other` objects.
* @returns {boolean} Returns `true` if the values are equivalent, else `false`.
*/
function baseIsEqual(value, other, customizer, bitmask, stack) {
if (value === other) {
return true;
}
if (value == null || other == null || !isObject(value) && !isObjectLike(other)) {
return value !== value && other !== other;
}
return baseIsEqualDeep(value, other, baseIsEqual, customizer, bitmask, stack);
}
/**
* A specialized version of `baseIsEqual` for arrays and objects which performs
* deep comparisons and tracks traversed objects enabling objects with circular
* references to be compared.
*
* @private
* @param {Object} object The object to compare.
* @param {Object} other The other object to compare.
* @param {Function} equalFunc The function to determine equivalents of values.
* @param {Function} [customizer] The function to customize comparisons.
* @param {number} [bitmask] The bitmask of comparison flags. See `baseIsEqual`
* for more details.
* @param {Object} [stack] Tracks traversed `object` and `other` objects.
* @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
*/
function baseIsEqualDeep(object, other, equalFunc, customizer, bitmask, stack) {
var objIsArr = isArray(object),
othIsArr = isArray(other),
objTag = arrayTag,
othTag = arrayTag;
if (!objIsArr) {
objTag = getTag(object);
objTag = objTag == argsTag ? objectTag : objTag;
}
if (!othIsArr) {
othTag = getTag(other);
othTag = othTag == argsTag ? objectTag : othTag;
}
var objIsObj = objTag == objectTag && !isHostObject(object),
othIsObj = othTag == objectTag && !isHostObject(other),
isSameTag = objTag == othTag;
if (isSameTag && !objIsObj) {
stack || (stack = new Stack());
return objIsArr || isTypedArray(object) ? equalArrays(object, other, equalFunc, customizer, bitmask, stack) : equalByTag(object, other, objTag, equalFunc, customizer, bitmask, stack);
}
if (!(bitmask & PARTIAL_COMPARE_FLAG)) {
var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
if (objIsWrapped || othIsWrapped) {
var objUnwrapped = objIsWrapped ? object.value() : object,
othUnwrapped = othIsWrapped ? other.value() : other;
stack || (stack = new Stack());
return equalFunc(objUnwrapped, othUnwrapped, customizer, bitmask, stack);
}
}
if (!isSameTag) {
return false;
}
stack || (stack = new Stack());
return equalObjects(object, other, equalFunc, customizer, bitmask, stack);
}
/**
* The base implementation of `_.isMatch` without support for iteratee shorthands.
*
* @private
* @param {Object} object The object to inspect.
* @param {Object} source The object of property values to match.
* @param {Array} matchData The property names, values, and compare flags to match.
* @param {Function} [customizer] The function to customize comparisons.
* @returns {boolean} Returns `true` if `object` is a match, else `false`.
*/
function baseIsMatch(object, source, matchData, customizer) {
var index = matchData.length,
length = index,
noCustomizer = !customizer;
if (object == null) {
return !length;
}
object = Object(object);
while (index--) {
var data = matchData[index];
if (noCustomizer && data[2] ? data[1] !== object[data[0]] : !(data[0] in object)) {
return false;
}
}
while (++index < length) {
data = matchData[index];
var key = data[0],
objValue = object[key],
srcValue = data[1];
if (noCustomizer && data[2]) {
if (objValue === undefined && !(key in object)) {
return false;
}
} else {
var stack = new Stack();
if (customizer) {
var result = customizer(objValue, srcValue, key, object, source, stack);
}
if (!(result === undefined ? baseIsEqual(srcValue, objValue, customizer, UNORDERED_COMPARE_FLAG | PARTIAL_COMPARE_FLAG, stack) : result)) {
return false;
}
}
}
return true;
}
/**
* The base implementation of `_.isNative` without bad shim checks.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a native function,
* else `false`.
*/
function baseIsNative(value) {
if (!isObject(value) || isMasked(value)) {
return false;
}
var pattern = isFunction(value) || isHostObject(value) ? reIsNative : reIsHostCtor;
return pattern.test(toSource(value));
}
/**
* The base implementation of `_.isTypedArray` without Node.js optimizations.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
*/
function baseIsTypedArray(value) {
return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[objectToString.call(value)];
}
/**
* The base implementation of `_.iteratee`.
*
* @private
* @param {*} [value=_.identity] The value to convert to an iteratee.
* @returns {Function} Returns the iteratee.
*/
function baseIteratee(value) {
// Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.
// See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.
if (typeof value == 'function') {
return value;
}
if (value == null) {
return identity;
}
if (_typeof(value) == 'object') {
return isArray(value) ? baseMatchesProperty(value[0], value[1]) : baseMatches(value);
}
return property(value);
}
/**
* The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
*
* @private
* @param {Object} object The object to query.
* @returns {Array} Returns the array of property names.
*/
function baseKeys(object) {
if (!isPrototype(object)) {
return nativeKeys(object);
}
var result = [];
for (var key in Object(object)) {
if (hasOwnProperty.call(object, key) && key != 'constructor') {
result.push(key);
}
}
return result;
}
/**
* The base implementation of `_.matches` which doesn't clone `source`.
*
* @private
* @param {Object} source The object of property values to match.
* @returns {Function} Returns the new spec function.
*/
function baseMatches(source) {
var matchData = getMatchData(source);
if (matchData.length == 1 && matchData[0][2]) {
return matchesStrictComparable(matchData[0][0], matchData[0][1]);
}
return function (object) {
return object === source || baseIsMatch(object, source, matchData);
};
}
/**
* The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.
*
* @private
* @param {string} path The path of the property to get.
* @param {*} srcValue The value to match.
* @returns {Function} Returns the new spec function.
*/
function baseMatchesProperty(path, srcValue) {
if (isKey(path) && isStrictComparable(srcValue)) {
return matchesStrictComparable(toKey(path), srcValue);
}
return function (object) {
var objValue = get(object, path);
return objValue === undefined && objValue === srcValue ? hasIn(object, path) : baseIsEqual(srcValue, objValue, undefined, UNORDERED_COMPARE_FLAG | PARTIAL_COMPARE_FLAG);
};
}
/**
* A specialized version of `baseProperty` which supports deep paths.
*
* @private
* @param {Array|string} path The path of the property to get.
* @returns {Function} Returns the new accessor function.
*/
function basePropertyDeep(path) {
return function (object) {
return baseGet(object, path);
};
}
/**
* The base implementation of `_.pullAt` without support for individual
* indexes or capturing the removed elements.
*
* @private
* @param {Array} array The array to modify.
* @param {number[]} indexes The indexes of elements to remove.
* @returns {Array} Returns `array`.
*/
function basePullAt(array, indexes) {
var length = array ? indexes.length : 0,
lastIndex = length - 1;
while (length--) {
var index = indexes[length];
if (length == lastIndex || index !== previous) {
var previous = index;
if (isIndex(index)) {
splice.call(array, index, 1);
} else if (!isKey(index, array)) {
var path = castPath(index),
object = parent(array, path);
if (object != null) {
delete object[toKey(last(path))];
}
} else {
delete array[toKey(index)];
}
}
}
return array;
}
/**
* The base implementation of `_.slice` without an iteratee call guard.
*
* @private
* @param {Array} array The array to slice.
* @param {number} [start=0] The start position.
* @param {number} [end=array.length] The end position.
* @returns {Array} Returns the slice of `array`.
*/
function baseSlice(array, start, end) {
var index = -1,
length = array.length;
if (start < 0) {
start = -start > length ? 0 : length + start;
}
end = end > length ? length : end;
if (end < 0) {
end += length;
}
length = start > end ? 0 : end - start >>> 0;
start >>>= 0;
var result = Array(length);
while (++index < length) {
result[index] = array[index + start];
}
return result;
}
/**
* The base implementation of `_.toString` which doesn't convert nullish
* values to empty strings.
*
* @private
* @param {*} value The value to process.
* @returns {string} Returns the string.
*/
function baseToString(value) {
// Exit early for strings to avoid a performance hit in some environments.
if (typeof value == 'string') {
return value;
}
if (isSymbol(value)) {
return symbolToString ? symbolToString.call(value) : '';
}
var result = value + '';
return result == '0' && 1 / value == -INFINITY ? '-0' : result;
}
/**
* Casts `value` to a path array if it's not one.
*
* @private
* @param {*} value The value to inspect.
* @returns {Array} Returns the cast property path array.
*/
function castPath(value) {
return isArray(value) ? value : stringToPath(value);
}
/**
* A specialized version of `baseIsEqualDeep` for arrays with support for
* partial deep comparisons.
*
* @private
* @param {Array} array The array to compare.
* @param {Array} other The other array to compare.
* @param {Function} equalFunc The function to determine equivalents of values.
* @param {Function} customizer The function to customize comparisons.
* @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual`
* for more details.
* @param {Object} stack Tracks traversed `array` and `other` objects.
* @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
*/
function equalArrays(array, other, equalFunc, customizer, bitmask, stack) {
var isPartial = bitmask & PARTIAL_COMPARE_FLAG,
arrLength = array.length,
othLength = other.length;
if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
return false;
} // Assume cyclic values are equal.
var stacked = stack.get(array);
if (stacked && stack.get(other)) {
return stacked == other;
}
var index = -1,
result = true,
seen = bitmask & UNORDERED_COMPARE_FLAG ? new SetCache() : undefined;
stack.set(array, other);
stack.set(other, array); // Ignore non-index properties.
while (++index < arrLength) {
var arrValue = array[index],
othValue = other[index];
if (customizer) {
var compared = isPartial ? customizer(othValue, arrValue, index, other, array, stack) : customizer(arrValue, othValue, index, array, other, stack);
}
if (compared !== undefined) {
if (compared) {
continue;
}
result = false;
break;
} // Recursively compare arrays (susceptible to call stack limits).
if (seen) {
if (!arraySome(other, function (othValue, othIndex) {
if (!seen.has(othIndex) && (arrValue === othValue || equalFunc(arrValue, othValue, customizer, bitmask, stack))) {
return seen.add(othIndex);
}
})) {
result = false;
break;
}
} else if (!(arrValue === othValue || equalFunc(arrValue, othValue, customizer, bitmask, stack))) {
result = false;
break;
}
}
stack['delete'](array);
stack['delete'](other);
return result;
}
/**
* A specialized version of `baseIsEqualDeep` for comparing objects of
* the same `toStringTag`.
*
* **Note:** This function only supports comparing values with tags of
* `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
*
* @private
* @param {Object} object The object to compare.
* @param {Object} other The other object to compare.
* @param {string} tag The `toStringTag` of the objects to compare.
* @param {Function} equalFunc The function to determine equivalents of values.
* @param {Function} customizer The function to customize comparisons.
* @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual`
* for more details.
* @param {Object} stack Tracks traversed `object` and `other` objects.
* @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
*/
function equalByTag(object, other, tag, equalFunc, customizer, bitmask, stack) {
switch (tag) {
case dataViewTag:
if (object.byteLength != other.byteLength || object.byteOffset != other.byteOffset) {
return false;
}
object = object.buffer;
other = other.buffer;
case arrayBufferTag:
if (object.byteLength != other.byteLength || !equalFunc(new Uint8Array(object), new Uint8Array(other))) {
return false;
}
return true;
case boolTag:
case dateTag:
case numberTag:
// Coerce booleans to `1` or `0` and dates to milliseconds.
// Invalid dates are coerced to `NaN`.
return eq(+object, +other);
case errorTag:
return object.name == other.name && object.message == other.message;
case regexpTag:
case stringTag:
// Coerce regexes to strings and treat strings, primitives and objects,
// as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
// for more details.
return object == other + '';
case mapTag:
var convert = mapToArray;
case setTag:
var isPartial = bitmask & PARTIAL_COMPARE_FLAG;
convert || (convert = setToArray);
if (object.size != other.size && !isPartial) {
return false;
} // Assume cyclic values are equal.
var stacked = stack.get(object);
if (stacked) {
return stacked == other;
}
bitmask |= UNORDERED_COMPARE_FLAG; // Recursively compare objects (susceptible to call stack limits).
stack.set(object, other);
var result = equalArrays(convert(object), convert(other), equalFunc, customizer, bitmask, stack);
stack['delete'](object);
return result;
case symbolTag:
if (symbolValueOf) {
return symbolValueOf.call(object) == symbolValueOf.call(other);
}
}
return false;
}
/**
* A specialized version of `baseIsEqualDeep` for objects with support for
* partial deep comparisons.
*
* @private
* @param {Object} object The object to compare.
* @param {Object} other The other object to compare.
* @param {Function} equalFunc The function to determine equivalents of values.
* @param {Function} customizer The function to customize comparisons.
* @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual`
* for more details.
* @param {Object} stack Tracks traversed `object` and `other` objects.
* @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
*/
function equalObjects(object, other, equalFunc, customizer, bitmask, stack) {
var isPartial = bitmask & PARTIAL_COMPARE_FLAG,
objProps = keys(object),
objLength = objProps.length,
othProps = keys(other),
othLength = othProps.length;
if (objLength != othLength && !isPartial) {
return false;
}
var index = objLength;
while (index--) {
var key = objProps[index];
if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
return false;
}
} // Assume cyclic values are equal.
var stacked = stack.get(object);
if (stacked && stack.get(other)) {
return stacked == other;
}
var result = true;
stack.set(object, other);
stack.set(other, object);
var skipCtor = isPartial;
while (++index < objLength) {
key = objProps[index];
var objValue = object[key],
othValue = other[key];
if (customizer) {
var compared = isPartial ? customizer(othValue, objValue, key, other, object, stack) : customizer(objValue, othValue, key, object, other, stack);
} // Recursively compare objects (susceptible to call stack limits).
if (!(compared === undefined ? objValue === othValue || equalFunc(objValue, othValue, customizer, bitmask, stack) : compared)) {
result = false;
break;
}
skipCtor || (skipCtor = key == 'constructor');
}
if (result && !skipCtor) {
var objCtor = object.constructor,
othCtor = other.constructor; // Non `Object` object instances with different constructors are not equal.
if (objCtor != othCtor && 'constructor' in object && 'constructor' in other && !(typeof objCtor == 'function' && objCtor instanceof objCtor && typeof othCtor == 'function' && othCtor instanceof othCtor)) {
result = false;
}
}
stack['delete'](object);
stack['delete'](other);
return result;
}
/**
* Gets the data for `map`.
*
* @private
* @param {Object} map The map to query.
* @param {string} key The reference key.
* @returns {*} Returns the map data.
*/
function getMapData(map, key) {
var data = map.__data__;
return isKeyable(key) ? data[typeof key == 'string' ? 'string' : 'hash'] : data.map;
}
/**
* Gets the property names, values, and compare flags of `object`.
*
* @private
* @param {Object} object The object to query.
* @returns {Array} Returns the match data of `object`.
*/
function getMatchData(object) {
var result = keys(object),
length = result.length;
while (length--) {
var key = result[length],
value = object[key];
result[length] = [key, value, isStrictComparable(value)];
}
return result;
}
/**
* Gets the native function at `key` of `object`.
*
* @private
* @param {Object} object The object to query.
* @param {string} key The key of the method to get.
* @returns {*} Returns the function if it's native, else `undefined`.
*/
function getNative(object, key) {
var value = getValue(object, key);
return baseIsNative(value) ? value : undefined;
}
/**
* Gets the `toStringTag` of `value`.
*
* @private
* @param {*} value The value to query.
* @returns {string} Returns the `toStringTag`.
*/
var getTag = baseGetTag; // Fallback for data views, maps, sets, and weak maps in IE 11,
// for data views in Edge < 14, and promises in Node.js.
if (DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag || Map && getTag(new Map()) != mapTag || Promise && getTag(Promise.resolve()) != promiseTag || Set && getTag(new Set()) != setTag || WeakMap && getTag(new WeakMap()) != weakMapTag) {
getTag = function getTag(value) {
var result = objectToString.call(value),
Ctor = result == objectTag ? value.constructor : undefined,
ctorString = Ctor ? toSource(Ctor) : undefined;
if (ctorString) {
switch (ctorString) {
case dataViewCtorString:
return dataViewTag;
case mapCtorString:
return mapTag;
case promiseCtorString:
return promiseTag;
case setCtorString:
return setTag;
case weakMapCtorString:
return weakMapTag;
}
}
return result;
};
}
/**
* Checks if `path` exists on `object`.
*
* @private
* @param {Object} object The object to query.
* @param {Array|string} path The path to check.
* @param {Function} hasFunc The function to check properties.
* @returns {boolean} Returns `true` if `path` exists, else `false`.
*/
function hasPath(object, path, hasFunc) {
path = isKey(path, object) ? [path] : castPath(path);
var result,
index = -1,
length = path.length;
while (++index < length) {
var key = toKey(path[index]);
if (!(result = object != null && hasFunc(object, key))) {
break;
}
object = object[key];
}
if (result) {
return result;
}
var length = object ? object.length : 0;
return !!length && isLength(length) && isIndex(key, length) && (isArray(object) || isArguments(object));
}
/**
* Checks if `value` is a valid array-like index.
*
* @private
* @param {*} value The value to check.
* @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
* @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
*/
function isIndex(value, length) {
length = length == null ? MAX_SAFE_INTEGER : length;
return !!length && (typeof value == 'number' || reIsUint.test(value)) && value > -1 && value % 1 == 0 && value < length;
}
/**
* Checks if `value` is a property name and not a property path.
*
* @private
* @param {*} value The value to check.
* @param {Object} [object] The object to query keys on.
* @returns {boolean} Returns `true` if `value` is a property name, else `false`.
*/
function isKey(value, object) {
if (isArray(value)) {
return false;
}
var type = _typeof(value);
if (type == 'number' || type == 'symbol' || type == 'boolean' || value == null || isSymbol(value)) {
return true;
}
return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || object != null && value in Object(object);
}
/**
* Checks if `value` is suitable for use as unique object key.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is suitable, else `false`.
*/
function isKeyable(value) {
var type = _typeof(value);
return type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean' ? value !== '__proto__' : value === null;
}
/**
* Checks if `func` has its source masked.
*
* @private
* @param {Function} func The function to check.
* @returns {boolean} Returns `true` if `func` is masked, else `false`.
*/
function isMasked(func) {
return !!maskSrcKey && maskSrcKey in func;
}
/**
* Checks if `value` is likely a prototype object.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
*/
function isPrototype(value) {
var Ctor = value && value.constructor,
proto = typeof Ctor == 'function' && Ctor.prototype || objectProto;
return value === proto;
}
/**
* Checks if `value` is suitable for strict equality comparisons, i.e. `===`.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` if suitable for strict
* equality comparisons, else `false`.
*/
function isStrictComparable(value) {
return value === value && !isObject(value);
}
/**
* A specialized version of `matchesProperty` for source values suitable
* for strict equality comparisons, i.e. `===`.
*
* @private
* @param {string} key The key of the property to get.
* @param {*} srcValue The value to match.
* @returns {Function} Returns the new spec function.
*/
function matchesStrictComparable(key, srcValue) {
return function (object) {
if (object == null) {
return false;
}
return object[key] === srcValue && (srcValue !== undefined || key in Object(object));
};
}
/**
* Gets the parent value at `path` of `object`.
*
* @private
* @param {Object} object The object to query.
* @param {Array} path The path to get the parent value of.
* @returns {*} Returns the parent value.
*/
function parent(object, path) {
return path.length == 1 ? object : baseGet(object, baseSlice(path, 0, -1));
}
/**
* Converts `string` to a property path array.
*
* @private
* @param {string} string The string to convert.
* @returns {Array} Returns the property path array.
*/
var stringToPath = memoize(function (string) {
string = toString(string);
var result = [];
if (reLeadingDot.test(string)) {
result.push('');
}
string.replace(rePropName, function (match, number, quote, string) {
result.push(quote ? string.replace(reEscapeChar, '$1') : number || match);
});
return result;
});
/**
* Converts `value` to a string key if it's not a string or symbol.
*
* @private
* @param {*} value The value to inspect.
* @returns {string|symbol} Returns the key.
*/
function toKey(value) {
if (typeof value == 'string' || isSymbol(value)) {
return value;
}
var result = value + '';
return result == '0' && 1 / value == -INFINITY ? '-0' : result;
}
/**
* Converts `func` to its source code.
*
* @private
* @param {Function} func The function to process.
* @returns {string} Returns the source code.
*/
function toSource(func) {
if (func != null) {
try {
return funcToString.call(func);
} catch (e) {}
try {
return func + '';
} catch (e) {}
}
return '';
}
/**
* Gets the last element of `array`.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Array
* @param {Array} array The array to query.
* @returns {*} Returns the last element of `array`.
* @example
*
* _.last([1, 2, 3]);
* // => 3
*/
function last(array) {
var length = array ? array.length : 0;
return length ? array[length - 1] : undefined;
}
/**
* Removes all elements from `array` that `predicate` returns truthy for
* and returns an array of the removed elements. The predicate is invoked
* with three arguments: (value, index, array).
*
* **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull`
* to pull elements from an array by value.
*
* @static
* @memberOf _
* @since 2.0.0
* @category Array
* @param {Array} array The array to modify.
* @param {Function} [predicate=_.identity]
* The function invoked per iteration.
* @returns {Array} Returns the new array of removed elements.
* @example
*
* var array = [1, 2, 3, 4];
* var evens = _.remove(array, function(n) {
* return n % 2 == 0;
* });
*
* console.log(array);
* // => [1, 3]
*
* console.log(evens);
* // => [2, 4]
*/
function remove(array, predicate) {
var result = [];
if (!(array && array.length)) {
return result;
}
var index = -1,
indexes = [],
length = array.length;
predicate = baseIteratee(predicate, 3);
while (++index < length) {
var value = array[index];
if (predicate(value, index, array)) {
result.push(value);
indexes.push(index);
}
}
basePullAt(array, indexes);
return result;
}
/**
* Creates a function that memoizes the result of `func`. If `resolver` is
* provided, it determines the cache key for storing the result based on the
* arguments provided to the memoized function. By default, the first argument
* provided to the memoized function is used as the map cache key. The `func`
* is invoked with the `this` binding of the memoized function.
*
* **Note:** The cache is exposed as the `cache` property on the memoized
* function. Its creation may be customized by replacing the `_.memoize.Cache`
* constructor with one whose instances implement the
* [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
* method interface of `delete`, `get`, `has`, and `set`.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Function
* @param {Function} func The function to have its output memoized.
* @param {Function} [resolver] The function to resolve the cache key.
* @returns {Function} Returns the new memoized function.
* @example
*
* var object = { 'a': 1, 'b': 2 };
* var other = { 'c': 3, 'd': 4 };
*
* var values = _.memoize(_.values);
* values(object);
* // => [1, 2]
*
* values(other);
* // => [3, 4]
*
* object.a = 2;
* values(object);
* // => [1, 2]
*
* // Modify the result cache.
* values.cache.set(object, ['a', 'b']);
* values(object);
* // => ['a', 'b']
*
* // Replace `_.memoize.Cache`.
* _.memoize.Cache = WeakMap;
*/
function memoize(func, resolver) {
if (typeof func != 'function' || resolver && typeof resolver != 'function') {
throw new TypeError(FUNC_ERROR_TEXT);
}
var memoized = function memoized() {
var args = arguments,
key = resolver ? resolver.apply(this, args) : args[0],
cache = memoized.cache;
if (cache.has(key)) {
return cache.get(key);
}
var result = func.apply(this, args);
memoized.cache = cache.set(key, result);
return result;
};
memoized.cache = new (memoize.Cache || MapCache)();
return memoized;
} // Assign cache to `_.memoize`.
memoize.Cache = MapCache;
/**
* Performs a
* [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
* comparison between two values to determine if they are equivalent.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to compare.
* @param {*} other The other value to compare.
* @returns {boolean} Returns `true` if the values are equivalent, else `false`.
* @example
*
* var object = { 'a': 1 };
* var other = { 'a': 1 };
*
* _.eq(object, object);
* // => true
*
* _.eq(object, other);
* // => false
*
* _.eq('a', 'a');
* // => true
*
* _.eq('a', Object('a'));
* // => false
*
* _.eq(NaN, NaN);
* // => true
*/
function eq(value, other) {
return value === other || value !== value && other !== other;
}
/**
* Checks if `value` is likely an `arguments` object.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is an `arguments` object,
* else `false`.
* @example
*
* _.isArguments(function() { return arguments; }());
* // => true
*
* _.isArguments([1, 2, 3]);
* // => false
*/
function isArguments(value) {
// Safari 8.1 makes `arguments.callee` enumerable in strict mode.
return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') && (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag);
}
/**
* Checks if `value` is classified as an `Array` object.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is an array, else `false`.
* @example
*
* _.isArray([1, 2, 3]);
* // => true
*
* _.isArray(document.body.children);
* // => false
*
* _.isArray('abc');
* // => false
*
* _.isArray(_.noop);
* // => false
*/
var isArray = Array.isArray;
/**
* Checks if `value` is array-like. A value is considered array-like if it's
* not a function and has a `value.length` that's an integer greater than or
* equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is array-like, else `false`.
* @example
*
* _.isArrayLike([1, 2, 3]);
* // => true
*
* _.isArrayLike(document.body.children);
* // => true
*
* _.isArrayLike('abc');
* // => true
*
* _.isArrayLike(_.noop);
* // => false
*/
function isArrayLike(value) {
return value != null && isLength(value.length) && !isFunction(value);
}
/**
* This method is like `_.isArrayLike` except that it also checks if `value`
* is an object.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is an array-like object,
* else `false`.
* @example
*
* _.isArrayLikeObject([1, 2, 3]);
* // => true
*
* _.isArrayLikeObject(document.body.children);
* // => true
*
* _.isArrayLikeObject('abc');
* // => false
*
* _.isArrayLikeObject(_.noop);
* // => false
*/
function isArrayLikeObject(value) {
return isObjectLike(value) && isArrayLike(value);
}
/**
* Checks if `value` is classified as a `Function` object.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a function, else `false`.
* @example
*
* _.isFunction(_);
* // => true
*
* _.isFunction(/abc/);
* // => false
*/
function isFunction(value) {
// The use of `Object#toString` avoids issues with the `typeof` operator
// in Safari 8-9 which returns 'object' for typed array and other constructors.
var tag = isObject(value) ? objectToString.call(value) : '';
return tag == funcTag || tag == genTag;
}
/**
* Checks if `value` is a valid array-like length.
*
* **Note:** This method is loosely based on
* [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
* @example
*
* _.isLength(3);
* // => true
*
* _.isLength(Number.MIN_VALUE);
* // => false
*
* _.isLength(Infinity);
* // => false
*
* _.isLength('3');
* // => false
*/
function isLength(value) {
return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
}
/**
* Checks if `value` is the
* [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
* of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is an object, else `false`.
* @example
*
* _.isObject({});
* // => true
*
* _.isObject([1, 2, 3]);
* // => true
*
* _.isObject(_.noop);
* // => true
*
* _.isObject(null);
* // => false
*/
function isObject(value) {
var type = _typeof(value);
return !!value && (type == 'object' || type == 'function');
}
/**
* Checks if `value` is object-like. A value is object-like if it's not `null`
* and has a `typeof` result of "object".
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is object-like, else `false`.
* @example
*
* _.isObjectLike({});
* // => true
*
* _.isObjectLike([1, 2, 3]);
* // => true
*
* _.isObjectLike(_.noop);
* // => false
*
* _.isObjectLike(null);
* // => false
*/
function isObjectLike(value) {
return !!value && _typeof(value) == 'object';
}
/**
* Checks if `value` is classified as a `Symbol` primitive or object.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
* @example
*
* _.isSymbol(Symbol.iterator);
* // => true
*
* _.isSymbol('abc');
* // => false
*/
function isSymbol(value) {
return _typeof(value) == 'symbol' || isObjectLike(value) && objectToString.call(value) == symbolTag;
}
/**
* Checks if `value` is classified as a typed array.
*
* @static
* @memberOf _
* @since 3.0.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
* @example
*
* _.isTypedArray(new Uint8Array);
* // => true
*
* _.isTypedArray([]);
* // => false
*/
var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
/**
* Converts `value` to a string. An empty string is returned for `null`
* and `undefined` values. The sign of `-0` is preserved.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to process.
* @returns {string} Returns the string.
* @example
*
* _.toString(null);
* // => ''
*
* _.toString(-0);
* // => '-0'
*
* _.toString([1, 2, 3]);
* // => '1,2,3'
*/
function toString(value) {
return value == null ? '' : baseToString(value);
}
/**
* Gets the value at `path` of `object`. If the resolved value is
* `undefined`, the `defaultValue` is returned in its place.
*
* @static
* @memberOf _
* @since 3.7.0
* @category Object
* @param {Object} object The object to query.
* @param {Array|string} path The path of the property to get.
* @param {*} [defaultValue] The value returned for `undefined` resolved values.
* @returns {*} Returns the resolved value.
* @example
*
* var object = { 'a': [{ 'b': { 'c': 3 } }] };
*
* _.get(object, 'a[0].b.c');
* // => 3
*
* _.get(object, ['a', '0', 'b', 'c']);
* // => 3
*
* _.get(object, 'a.b.c', 'default');
* // => 'default'
*/
function get(object, path, defaultValue) {
var result = object == null ? undefined : baseGet(object, path);
return result === undefined ? defaultValue : result;
}
/**
* Checks if `path` is a direct or inherited property of `object`.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Object
* @param {Object} object The object to query.
* @param {Array|string} path The path to check.
* @returns {boolean} Returns `true` if `path` exists, else `false`.
* @example
*
* var object = _.create({ 'a': _.create({ 'b': 2 }) });
*
* _.hasIn(object, 'a');
* // => true
*
* _.hasIn(object, 'a.b');
* // => true
*
* _.hasIn(object, ['a', 'b']);
* // => true
*
* _.hasIn(object, 'b');
* // => false
*/
function hasIn(object, path) {
return object != null && hasPath(object, path, baseHasIn);
}
/**
* Creates an array of the own enumerable property names of `object`.
*
* **Note:** Non-object values are coerced to objects. See the
* [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
* for more details.
*
* @static
* @since 0.1.0
* @memberOf _
* @category Object
* @param {Object} object The object to query.
* @returns {Array} Returns the array of property names.
* @example
*
* function Foo() {
* this.a = 1;
* this.b = 2;
* }
*
* Foo.prototype.c = 3;
*
* _.keys(new Foo);
* // => ['a', 'b'] (iteration order is not guaranteed)
*
* _.keys('hi');
* // => ['0', '1']
*/
function keys(object) {
return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
}
/**
* This method returns the first argument it receives.
*
* @static
* @since 0.1.0
* @memberOf _
* @category Util
* @param {*} value Any value.
* @returns {*} Returns `value`.
* @example
*
* var object = { 'a': 1 };
*
* console.log(_.identity(object) === object);
* // => true
*/
function identity(value) {
return value;
}
/**
* Creates a function that returns the value at `path` of a given object.
*
* @static
* @memberOf _
* @since 2.4.0
* @category Util
* @param {Array|string} path The path of the property to get.
* @returns {Function} Returns the new accessor function.
* @example
*
* var objects = [
* { 'a': { 'b': 2 } },
* { 'a': { 'b': 1 } }
* ];
*
* _.map(objects, _.property('a.b'));
* // => [2, 1]
*
* _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');
* // => [1, 2]
*/
function property(path) {
return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);
}
module.exports = remove;
/***/ }),
/***/ 820:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
/**
* lodash (Custom Build)
* Build: `lodash modularize exports="npm" -o ./`
* Copyright jQuery Foundation and other contributors
* Released under MIT license
* Based on Underscore.js 1.8.3
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
*/
/** Used as references for various `Number` constants. */
var MAX_SAFE_INTEGER = 9007199254740991;
/** `Object#toString` result references. */
var argsTag = '[object Arguments]',
funcTag = '[object Function]',
genTag = '[object GeneratorFunction]',
mapTag = '[object Map]',
objectTag = '[object Object]',
promiseTag = '[object Promise]',
setTag = '[object Set]',
weakMapTag = '[object WeakMap]';
var dataViewTag = '[object DataView]';
/**
* Used to match `RegExp`
* [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
*/
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
/** Used to detect host constructors (Safari). */
var reIsHostCtor = /^\[object .+?Constructor\]$/;
/** Used to detect unsigned integer values. */
var reIsUint = /^(?:0|[1-9]\d*)$/;
/** Detect free variable `global` from Node.js. */
var freeGlobal = (typeof __webpack_require__.g === "undefined" ? "undefined" : _typeof(__webpack_require__.g)) == 'object' && __webpack_require__.g && __webpack_require__.g.Object === Object && __webpack_require__.g;
/** Detect free variable `self`. */
var freeSelf = (typeof self === "undefined" ? "undefined" : _typeof(self)) == 'object' && self && self.Object === Object && self;
/** Used as a reference to the global object. */
var root = freeGlobal || freeSelf || Function('return this')();
/**
* A specialized version of `_.map` for arrays without support for iteratee
* shorthands.
*
* @private
* @param {Array} [array] The array to iterate over.
* @param {Function} iteratee The function invoked per iteration.
* @returns {Array} Returns the new mapped array.
*/
function arrayMap(array, iteratee) {
var index = -1,
length = array ? array.length : 0,
result = Array(length);
while (++index < length) {
result[index] = iteratee(array[index], index, array);
}
return result;
}
/**
* The base implementation of `_.times` without support for iteratee shorthands
* or max array length checks.
*
* @private
* @param {number} n The number of times to invoke `iteratee`.
* @param {Function} iteratee The function invoked per iteration.
* @returns {Array} Returns the array of results.
*/
function baseTimes(n, iteratee) {
var index = -1,
result = Array(n);
while (++index < n) {
result[index] = iteratee(index);
}
return result;
}
/**
* The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array
* of key-value pairs for `object` corresponding to the property names of `props`.
*
* @private
* @param {Object} object The object to query.
* @param {Array} props The property names to get values for.
* @returns {Object} Returns the key-value pairs.
*/
function baseToPairs(object, props) {
return arrayMap(props, function (key) {
return [key, object[key]];
});
}
/**
* Gets the value at `key` of `object`.
*
* @private
* @param {Object} [object] The object to query.
* @param {string} key The key of the property to get.
* @returns {*} Returns the property value.
*/
function getValue(object, key) {
return object == null ? undefined : object[key];
}
/**
* Checks if `value` is a host object in IE < 9.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a host object, else `false`.
*/
function isHostObject(value) {
// Many host objects are `Object` objects that can coerce to strings
// despite having improperly defined `toString` methods.
var result = false;
if (value != null && typeof value.toString != 'function') {
try {
result = !!(value + '');
} catch (e) {}
}
return result;
}
/**
* Converts `map` to its key-value pairs.
*
* @private
* @param {Object} map The map to convert.
* @returns {Array} Returns the key-value pairs.
*/
function mapToArray(map) {
var index = -1,
result = Array(map.size);
map.forEach(function (value, key) {
result[++index] = [key, value];
});
return result;
}
/**
* Creates a unary function that invokes `func` with its argument transformed.
*
* @private
* @param {Function} func The function to wrap.
* @param {Function} transform The argument transform.
* @returns {Function} Returns the new function.
*/
function overArg(func, transform) {
return function (arg) {
return func(transform(arg));
};
}
/**
* Converts `set` to its value-value pairs.
*
* @private
* @param {Object} set The set to convert.
* @returns {Array} Returns the value-value pairs.
*/
function setToPairs(set) {
var index = -1,
result = Array(set.size);
set.forEach(function (value) {
result[++index] = [value, value];
});
return result;
}
/** Used for built-in method references. */
var funcProto = Function.prototype,
objectProto = Object.prototype;
/** Used to detect overreaching core-js shims. */
var coreJsData = root['__core-js_shared__'];
/** Used to detect methods masquerading as native. */
var maskSrcKey = function () {
var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
return uid ? 'Symbol(src)_1.' + uid : '';
}();
/** Used to resolve the decompiled source of functions. */
var funcToString = funcProto.toString;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/**
* Used to resolve the
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
* of values.
*/
var objectToString = objectProto.toString;
/** Used to detect if a method is native. */
var reIsNative = RegExp('^' + funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&').replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$');
/** Built-in value references. */
var propertyIsEnumerable = objectProto.propertyIsEnumerable;
/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeKeys = overArg(Object.keys, Object);
/* Built-in method references that are verified to be native. */
var DataView = getNative(root, 'DataView'),
Map = getNative(root, 'Map'),
Promise = getNative(root, 'Promise'),
Set = getNative(root, 'Set'),
WeakMap = getNative(root, 'WeakMap');
/** Used to detect maps, sets, and weakmaps. */
var dataViewCtorString = toSource(DataView),
mapCtorString = toSource(Map),
promiseCtorString = toSource(Promise),
setCtorString = toSource(Set),
weakMapCtorString = toSource(WeakMap);
/**
* Creates an array of the enumerable property names of the array-like `value`.
*
* @private
* @param {*} value The value to query.
* @param {boolean} inherited Specify returning inherited property names.
* @returns {Array} Returns the array of property names.
*/
function arrayLikeKeys(value, inherited) {
// Safari 8.1 makes `arguments.callee` enumerable in strict mode.
// Safari 9 makes `arguments.length` enumerable in strict mode.
var result = isArray(value) || isArguments(value) ? baseTimes(value.length, String) : [];
var length = result.length,
skipIndexes = !!length;
for (var key in value) {
if ((inherited || hasOwnProperty.call(value, key)) && !(skipIndexes && (key == 'length' || isIndex(key, length)))) {
result.push(key);
}
}
return result;
}
/**
* The base implementation of `getTag`.
*
* @private
* @param {*} value The value to query.
* @returns {string} Returns the `toStringTag`.
*/
function baseGetTag(value) {
return objectToString.call(value);
}
/**
* The base implementation of `_.isNative` without bad shim checks.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a native function,
* else `false`.
*/
function baseIsNative(value) {
if (!isObject(value) || isMasked(value)) {
return false;
}
var pattern = isFunction(value) || isHostObject(value) ? reIsNative : reIsHostCtor;
return pattern.test(toSource(value));
}
/**
* The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
*
* @private
* @param {Object} object The object to query.
* @returns {Array} Returns the array of property names.
*/
function baseKeys(object) {
if (!isPrototype(object)) {
return nativeKeys(object);
}
var result = [];
for (var key in Object(object)) {
if (hasOwnProperty.call(object, key) && key != 'constructor') {
result.push(key);
}
}
return result;
}
/**
* Creates a `_.toPairs` or `_.toPairsIn` function.
*
* @private
* @param {Function} keysFunc The function to get the keys of a given object.
* @returns {Function} Returns the new pairs function.
*/
function createToPairs(keysFunc) {
return function (object) {
var tag = getTag(object);
if (tag == mapTag) {
return mapToArray(object);
}
if (tag == setTag) {
return setToPairs(object);
}
return baseToPairs(object, keysFunc(object));
};
}
/**
* Gets the native function at `key` of `object`.
*
* @private
* @param {Object} object The object to query.
* @param {string} key The key of the method to get.
* @returns {*} Returns the function if it's native, else `undefined`.
*/
function getNative(object, key) {
var value = getValue(object, key);
return baseIsNative(value) ? value : undefined;
}
/**
* Gets the `toStringTag` of `value`.
*
* @private
* @param {*} value The value to query.
* @returns {string} Returns the `toStringTag`.
*/
var getTag = baseGetTag; // Fallback for data views, maps, sets, and weak maps in IE 11,
// for data views in Edge < 14, and promises in Node.js.
if (DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag || Map && getTag(new Map()) != mapTag || Promise && getTag(Promise.resolve()) != promiseTag || Set && getTag(new Set()) != setTag || WeakMap && getTag(new WeakMap()) != weakMapTag) {
getTag = function getTag(value) {
var result = objectToString.call(value),
Ctor = result == objectTag ? value.constructor : undefined,
ctorString = Ctor ? toSource(Ctor) : undefined;
if (ctorString) {
switch (ctorString) {
case dataViewCtorString:
return dataViewTag;
case mapCtorString:
return mapTag;
case promiseCtorString:
return promiseTag;
case setCtorString:
return setTag;
case weakMapCtorString:
return weakMapTag;
}
}
return result;
};
}
/**
* Checks if `value` is a valid array-like index.
*
* @private
* @param {*} value The value to check.
* @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
* @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
*/
function isIndex(value, length) {
length = length == null ? MAX_SAFE_INTEGER : length;
return !!length && (typeof value == 'number' || reIsUint.test(value)) && value > -1 && value % 1 == 0 && value < length;
}
/**
* Checks if `func` has its source masked.
*
* @private
* @param {Function} func The function to check.
* @returns {boolean} Returns `true` if `func` is masked, else `false`.
*/
function isMasked(func) {
return !!maskSrcKey && maskSrcKey in func;
}
/**
* Checks if `value` is likely a prototype object.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
*/
function isPrototype(value) {
var Ctor = value && value.constructor,
proto = typeof Ctor == 'function' && Ctor.prototype || objectProto;
return value === proto;
}
/**
* Converts `func` to its source code.
*
* @private
* @param {Function} func The function to process.
* @returns {string} Returns the source code.
*/
function toSource(func) {
if (func != null) {
try {
return funcToString.call(func);
} catch (e) {}
try {
return func + '';
} catch (e) {}
}
return '';
}
/**
* Checks if `value` is likely an `arguments` object.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is an `arguments` object,
* else `false`.
* @example
*
* _.isArguments(function() { return arguments; }());
* // => true
*
* _.isArguments([1, 2, 3]);
* // => false
*/
function isArguments(value) {
// Safari 8.1 makes `arguments.callee` enumerable in strict mode.
return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') && (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag);
}
/**
* Checks if `value` is classified as an `Array` object.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is an array, else `false`.
* @example
*
* _.isArray([1, 2, 3]);
* // => true
*
* _.isArray(document.body.children);
* // => false
*
* _.isArray('abc');
* // => false
*
* _.isArray(_.noop);
* // => false
*/
var isArray = Array.isArray;
/**
* Checks if `value` is array-like. A value is considered array-like if it's
* not a function and has a `value.length` that's an integer greater than or
* equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is array-like, else `false`.
* @example
*
* _.isArrayLike([1, 2, 3]);
* // => true
*
* _.isArrayLike(document.body.children);
* // => true
*
* _.isArrayLike('abc');
* // => true
*
* _.isArrayLike(_.noop);
* // => false
*/
function isArrayLike(value) {
return value != null && isLength(value.length) && !isFunction(value);
}
/**
* This method is like `_.isArrayLike` except that it also checks if `value`
* is an object.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is an array-like object,
* else `false`.
* @example
*
* _.isArrayLikeObject([1, 2, 3]);
* // => true
*
* _.isArrayLikeObject(document.body.children);
* // => true
*
* _.isArrayLikeObject('abc');
* // => false
*
* _.isArrayLikeObject(_.noop);
* // => false
*/
function isArrayLikeObject(value) {
return isObjectLike(value) && isArrayLike(value);
}
/**
* Checks if `value` is classified as a `Function` object.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a function, else `false`.
* @example
*
* _.isFunction(_);
* // => true
*
* _.isFunction(/abc/);
* // => false
*/
function isFunction(value) {
// The use of `Object#toString` avoids issues with the `typeof` operator
// in Safari 8-9 which returns 'object' for typed array and other constructors.
var tag = isObject(value) ? objectToString.call(value) : '';
return tag == funcTag || tag == genTag;
}
/**
* Checks if `value` is a valid array-like length.
*
* **Note:** This method is loosely based on
* [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
* @example
*
* _.isLength(3);
* // => true
*
* _.isLength(Number.MIN_VALUE);
* // => false
*
* _.isLength(Infinity);
* // => false
*
* _.isLength('3');
* // => false
*/
function isLength(value) {
return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
}
/**
* Checks if `value` is the
* [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
* of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is an object, else `false`.
* @example
*
* _.isObject({});
* // => true
*
* _.isObject([1, 2, 3]);
* // => true
*
* _.isObject(_.noop);
* // => true
*
* _.isObject(null);
* // => false
*/
function isObject(value) {
var type = _typeof(value);
return !!value && (type == 'object' || type == 'function');
}
/**
* Checks if `value` is object-like. A value is object-like if it's not `null`
* and has a `typeof` result of "object".
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is object-like, else `false`.
* @example
*
* _.isObjectLike({});
* // => true
*
* _.isObjectLike([1, 2, 3]);
* // => true
*
* _.isObjectLike(_.noop);
* // => false
*
* _.isObjectLike(null);
* // => false
*/
function isObjectLike(value) {
return !!value && _typeof(value) == 'object';
}
/**
* Creates an array of the own enumerable property names of `object`.
*
* **Note:** Non-object values are coerced to objects. See the
* [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
* for more details.
*
* @static
* @since 0.1.0
* @memberOf _
* @category Object
* @param {Object} object The object to query.
* @returns {Array} Returns the array of property names.
* @example
*
* function Foo() {
* this.a = 1;
* this.b = 2;
* }
*
* Foo.prototype.c = 3;
*
* _.keys(new Foo);
* // => ['a', 'b'] (iteration order is not guaranteed)
*
* _.keys('hi');
* // => ['0', '1']
*/
function keys(object) {
return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
}
/**
* Creates an array of own enumerable string keyed-value pairs for `object`
* which can be consumed by `_.fromPairs`. If `object` is a map or set, its
* entries are returned.
*
* @static
* @memberOf _
* @since 4.0.0
* @alias entries
* @category Object
* @param {Object} object The object to query.
* @returns {Array} Returns the key-value pairs.
* @example
*
* function Foo() {
* this.a = 1;
* this.b = 2;
* }
*
* Foo.prototype.c = 3;
*
* _.toPairs(new Foo);
* // => [['a', 1], ['b', 2]] (iteration order is not guaranteed)
*/
var toPairs = createToPairs(keys);
module.exports = toPairs;
/***/ }),
/***/ 957:
/***/ (function(module, exports, __webpack_require__) {
var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
(function (global, factory) {
( false ? 0 : _typeof(exports)) === 'object' && "object" !== 'undefined' ? factory() : true ? !(__WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
__WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
(__WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __webpack_require__, exports, module)) :
__WEBPACK_AMD_DEFINE_FACTORY__),
__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) : 0;
})(this, function () {
'use strict';
/**
* @this {Promise}
*/
function finallyConstructor(callback) {
var constructor = this.constructor;
return this.then(function (value) {
// @ts-ignore
return constructor.resolve(callback()).then(function () {
return value;
});
}, function (reason) {
// @ts-ignore
return constructor.resolve(callback()).then(function () {
// @ts-ignore
return constructor.reject(reason);
});
});
} // Store setTimeout reference so promise-polyfill will be unaffected by
// other code modifying setTimeout (like sinon.useFakeTimers())
var setTimeoutFunc = setTimeout;
function isArray(x) {
return Boolean(x && typeof x.length !== 'undefined');
}
function noop() {} // Polyfill for Function.prototype.bind
function bind(fn, thisArg) {
return function () {
fn.apply(thisArg, arguments);
};
}
/**
* @constructor
* @param {Function} fn
*/
function Promise(fn) {
if (!(this instanceof Promise)) throw new TypeError('Promises must be constructed via new');
if (typeof fn !== 'function') throw new TypeError('not a function');
/** @type {!number} */
this._state = 0;
/** @type {!boolean} */
this._handled = false;
/** @type {Promise|undefined} */
this._value = undefined;
/** @type {!Array} */
this._deferreds = [];
doResolve(fn, this);
}
function handle(self, deferred) {
while (self._state === 3) {
self = self._value;
}
if (self._state === 0) {
self._deferreds.push(deferred);
return;
}
self._handled = true;
Promise._immediateFn(function () {
var cb = self._state === 1 ? deferred.onFulfilled : deferred.onRejected;
if (cb === null) {
(self._state === 1 ? resolve : reject)(deferred.promise, self._value);
return;
}
var ret;
try {
ret = cb(self._value);
} catch (e) {
reject(deferred.promise, e);
return;
}
resolve(deferred.promise, ret);
});
}
function resolve(self, newValue) {
try {
// Promise Resolution Procedure: https://github.com/promises-aplus/promises-spec#the-promise-resolution-procedure
if (newValue === self) throw new TypeError('A promise cannot be resolved with itself.');
if (newValue && (_typeof(newValue) === 'object' || typeof newValue === 'function')) {
var then = newValue.then;
if (newValue instanceof Promise) {
self._state = 3;
self._value = newValue;
finale(self);
return;
} else if (typeof then === 'function') {
doResolve(bind(then, newValue), self);
return;
}
}
self._state = 1;
self._value = newValue;
finale(self);
} catch (e) {
reject(self, e);
}
}
function reject(self, newValue) {
self._state = 2;
self._value = newValue;
finale(self);
}
function finale(self) {
if (self._state === 2 && self._deferreds.length === 0) {
Promise._immediateFn(function () {
if (!self._handled) {
Promise._unhandledRejectionFn(self._value);
}
});
}
for (var i = 0, len = self._deferreds.length; i < len; i++) {
handle(self, self._deferreds[i]);
}
self._deferreds = null;
}
/**
* @constructor
*/
function Handler(onFulfilled, onRejected, promise) {
this.onFulfilled = typeof onFulfilled === 'function' ? onFulfilled : null;
this.onRejected = typeof onRejected === 'function' ? onRejected : null;
this.promise = promise;
}
/**
* Take a potentially misbehaving resolver function and make sure
* onFulfilled and onRejected are only called once.
*
* Makes no guarantees about asynchrony.
*/
function doResolve(fn, self) {
var done = false;
try {
fn(function (value) {
if (done) return;
done = true;
resolve(self, value);
}, function (reason) {
if (done) return;
done = true;
reject(self, reason);
});
} catch (ex) {
if (done) return;
done = true;
reject(self, ex);
}
}
Promise.prototype['catch'] = function (onRejected) {
return this.then(null, onRejected);
};
Promise.prototype.then = function (onFulfilled, onRejected) {
// @ts-ignore
var prom = new this.constructor(noop);
handle(this, new Handler(onFulfilled, onRejected, prom));
return prom;
};
Promise.prototype['finally'] = finallyConstructor;
Promise.all = function (arr) {
return new Promise(function (resolve, reject) {
if (!isArray(arr)) {
return reject(new TypeError('Promise.all accepts an array'));
}
var args = Array.prototype.slice.call(arr);
if (args.length === 0) return resolve([]);
var remaining = args.length;
function res(i, val) {
try {
if (val && (_typeof(val) === 'object' || typeof val === 'function')) {
var then = val.then;
if (typeof then === 'function') {
then.call(val, function (val) {
res(i, val);
}, reject);
return;
}
}
args[i] = val;
if (--remaining === 0) {
resolve(args);
}
} catch (ex) {
reject(ex);
}
}
for (var i = 0; i < args.length; i++) {
res(i, args[i]);
}
});
};
Promise.resolve = function (value) {
if (value && _typeof(value) === 'object' && value.constructor === Promise) {
return value;
}
return new Promise(function (resolve) {
resolve(value);
});
};
Promise.reject = function (value) {
return new Promise(function (resolve, reject) {
reject(value);
});
};
Promise.race = function (arr) {
return new Promise(function (resolve, reject) {
if (!isArray(arr)) {
return reject(new TypeError('Promise.race accepts an array'));
}
for (var i = 0, len = arr.length; i < len; i++) {
Promise.resolve(arr[i]).then(resolve, reject);
}
});
}; // Use polyfill for setImmediate for performance gains
Promise._immediateFn = // @ts-ignore
typeof setImmediate === 'function' && function (fn) {
// @ts-ignore
setImmediate(fn);
} || function (fn) {
setTimeoutFunc(fn, 0);
};
Promise._unhandledRejectionFn = function _unhandledRejectionFn(err) {
if (typeof console !== 'undefined' && console) {
console.warn('Possible Unhandled Promise Rejection:', err); // eslint-disable-line no-console
}
};
/** @suppress {undefinedVars} */
var globalNS = function () {
// the only reliable means to get the global object is
// `Function('return this')()`
// However, this causes CSP violations in Chrome apps.
if (typeof self !== 'undefined') {
return self;
}
if (typeof window !== 'undefined') {
return window;
}
if (typeof __webpack_require__.g !== 'undefined') {
return __webpack_require__.g;
}
throw new Error('unable to locate global object');
}();
if (!('Promise' in globalNS)) {
globalNS['Promise'] = Promise;
} else if (!globalNS.Promise.prototype['finally']) {
globalNS.Promise.prototype['finally'] = finallyConstructor;
}
});
/***/ }),
/***/ 70:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
/* module decorator */ module = __webpack_require__.nmd(module);
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
/**
* Copyright (c) 2014-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
var runtime = function (exports) {
"use strict";
var Op = Object.prototype;
var hasOwn = Op.hasOwnProperty;
var undefined; // More compressible than void 0.
var $Symbol = typeof Symbol === "function" ? Symbol : {};
var iteratorSymbol = $Symbol.iterator || "@@iterator";
var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
function define(obj, key, value) {
Object.defineProperty(obj, key, {
value: value,
enumerable: true,
configurable: true,
writable: true
});
return obj[key];
}
try {
// IE 8 has a broken Object.defineProperty that only works on DOM objects.
define({}, "");
} catch (err) {
define = function define(obj, key, value) {
return obj[key] = value;
};
}
function wrap(innerFn, outerFn, self, tryLocsList) {
// If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
var generator = Object.create(protoGenerator.prototype);
var context = new Context(tryLocsList || []); // The ._invoke method unifies the implementations of the .next,
// .throw, and .return methods.
generator._invoke = makeInvokeMethod(innerFn, self, context);
return generator;
}
exports.wrap = wrap; // Try/catch helper to minimize deoptimizations. Returns a completion
// record like context.tryEntries[i].completion. This interface could
// have been (and was previously) designed to take a closure to be
// invoked without arguments, but in all the cases we care about we
// already have an existing method we want to call, so there's no need
// to create a new function object. We can even get away with assuming
// the method takes exactly one argument, since that happens to be true
// in every case, so we don't have to touch the arguments object. The
// only additional allocation required is the completion record, which
// has a stable shape and so hopefully should be cheap to allocate.
function tryCatch(fn, obj, arg) {
try {
return {
type: "normal",
arg: fn.call(obj, arg)
};
} catch (err) {
return {
type: "throw",
arg: err
};
}
}
var GenStateSuspendedStart = "suspendedStart";
var GenStateSuspendedYield = "suspendedYield";
var GenStateExecuting = "executing";
var GenStateCompleted = "completed"; // Returning this object from the innerFn has the same effect as
// breaking out of the dispatch switch statement.
var ContinueSentinel = {}; // Dummy constructor functions that we use as the .constructor and
// .constructor.prototype properties for functions that return Generator
// objects. For full spec compliance, you may wish to configure your
// minifier not to mangle the names of these two functions.
function Generator() {}
function GeneratorFunction() {}
function GeneratorFunctionPrototype() {} // This is a polyfill for %IteratorPrototype% for environments that
// don't natively support it.
var IteratorPrototype = {};
IteratorPrototype[iteratorSymbol] = function () {
return this;
};
var getProto = Object.getPrototypeOf;
var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
if (NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
// This environment has a native %IteratorPrototype%; use it instead
// of the polyfill.
IteratorPrototype = NativeIteratorPrototype;
}
var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;
GeneratorFunctionPrototype.constructor = GeneratorFunction;
GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"); // Helper for defining the .next, .throw, and .return methods of the
// Iterator interface in terms of a single ._invoke method.
function defineIteratorMethods(prototype) {
["next", "throw", "return"].forEach(function (method) {
define(prototype, method, function (arg) {
return this._invoke(method, arg);
});
});
}
exports.isGeneratorFunction = function (genFun) {
var ctor = typeof genFun === "function" && genFun.constructor;
return ctor ? ctor === GeneratorFunction || // For the native GeneratorFunction constructor, the best we can
// do is to check its .name property.
(ctor.displayName || ctor.name) === "GeneratorFunction" : false;
};
exports.mark = function (genFun) {
if (Object.setPrototypeOf) {
Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
} else {
genFun.__proto__ = GeneratorFunctionPrototype;
define(genFun, toStringTagSymbol, "GeneratorFunction");
}
genFun.prototype = Object.create(Gp);
return genFun;
}; // Within the body of any async function, `await x` is transformed to
// `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
// `hasOwn.call(value, "__await")` to determine if the yielded value is
// meant to be awaited.
exports.awrap = function (arg) {
return {
__await: arg
};
};
function AsyncIterator(generator, PromiseImpl) {
function invoke(method, arg, resolve, reject) {
var record = tryCatch(generator[method], generator, arg);
if (record.type === "throw") {
reject(record.arg);
} else {
var result = record.arg;
var value = result.value;
if (value && _typeof(value) === "object" && hasOwn.call(value, "__await")) {
return PromiseImpl.resolve(value.__await).then(function (value) {
invoke("next", value, resolve, reject);
}, function (err) {
invoke("throw", err, resolve, reject);
});
}
return PromiseImpl.resolve(value).then(function (unwrapped) {
// When a yielded Promise is resolved, its final value becomes
// the .value of the Promise<{value,done}> result for the
// current iteration.
result.value = unwrapped;
resolve(result);
}, function (error) {
// If a rejected Promise was yielded, throw the rejection back
// into the async generator function so it can be handled there.
return invoke("throw", error, resolve, reject);
});
}
}
var previousPromise;
function enqueue(method, arg) {
function callInvokeWithMethodAndArg() {
return new PromiseImpl(function (resolve, reject) {
invoke(method, arg, resolve, reject);
});
}
return previousPromise = // If enqueue has been called before, then we want to wait until
// all previous Promises have been resolved before calling invoke,
// so that results are always delivered in the correct order. If
// enqueue has not been called before, then it is important to
// call invoke immediately, without waiting on a callback to fire,
// so that the async generator function has the opportunity to do
// any necessary setup in a predictable way. This predictability
// is why the Promise constructor synchronously invokes its
// executor callback, and why async functions synchronously
// execute code before the first await. Since we implement simple
// async functions in terms of async generators, it is especially
// important to get this right, even though it requires care.
previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, // Avoid propagating failures to Promises returned by later
// invocations of the iterator.
callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
} // Define the unified helper method that is used to implement .next,
// .throw, and .return (see defineIteratorMethods).
this._invoke = enqueue;
}
defineIteratorMethods(AsyncIterator.prototype);
AsyncIterator.prototype[asyncIteratorSymbol] = function () {
return this;
};
exports.AsyncIterator = AsyncIterator; // Note that simple async functions are implemented on top of
// AsyncIterator objects; they just return a Promise for the value of
// the final result produced by the iterator.
exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
if (PromiseImpl === void 0) PromiseImpl = Promise;
var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
return exports.isGeneratorFunction(outerFn) ? iter // If outerFn is a generator, return the full iterator.
: iter.next().then(function (result) {
return result.done ? result.value : iter.next();
});
};
function makeInvokeMethod(innerFn, self, context) {
var state = GenStateSuspendedStart;
return function invoke(method, arg) {
if (state === GenStateExecuting) {
throw new Error("Generator is already running");
}
if (state === GenStateCompleted) {
if (method === "throw") {
throw arg;
} // Be forgiving, per 25.3.3.3.3 of the spec:
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
return doneResult();
}
context.method = method;
context.arg = arg;
while (true) {
var delegate = context.delegate;
if (delegate) {
var delegateResult = maybeInvokeDelegate(delegate, context);
if (delegateResult) {
if (delegateResult === ContinueSentinel) continue;
return delegateResult;
}
}
if (context.method === "next") {
// Setting context._sent for legacy support of Babel's
// function.sent implementation.
context.sent = context._sent = context.arg;
} else if (context.method === "throw") {
if (state === GenStateSuspendedStart) {
state = GenStateCompleted;
throw context.arg;
}
context.dispatchException(context.arg);
} else if (context.method === "return") {
context.abrupt("return", context.arg);
}
state = GenStateExecuting;
var record = tryCatch(innerFn, self, context);
if (record.type === "normal") {
// If an exception is thrown from innerFn, we leave state ===
// GenStateExecuting and loop back for another invocation.
state = context.done ? GenStateCompleted : GenStateSuspendedYield;
if (record.arg === ContinueSentinel) {
continue;
}
return {
value: record.arg,
done: context.done
};
} else if (record.type === "throw") {
state = GenStateCompleted; // Dispatch the exception by looping back around to the
// context.dispatchException(context.arg) call above.
context.method = "throw";
context.arg = record.arg;
}
}
};
} // Call delegate.iterator[context.method](context.arg) and handle the
// result, either by returning a { value, done } result from the
// delegate iterator, or by modifying context.method and context.arg,
// setting context.delegate to null, and returning the ContinueSentinel.
function maybeInvokeDelegate(delegate, context) {
var method = delegate.iterator[context.method];
if (method === undefined) {
// A .throw or .return when the delegate iterator has no .throw
// method always terminates the yield* loop.
context.delegate = null;
if (context.method === "throw") {
// Note: ["return"] must be used for ES3 parsing compatibility.
if (delegate.iterator["return"]) {
// If the delegate iterator has a return method, give it a
// chance to clean up.
context.method = "return";
context.arg = undefined;
maybeInvokeDelegate(delegate, context);
if (context.method === "throw") {
// If maybeInvokeDelegate(context) changed context.method from
// "return" to "throw", let that override the TypeError below.
return ContinueSentinel;
}
}
context.method = "throw";
context.arg = new TypeError("The iterator does not provide a 'throw' method");
}
return ContinueSentinel;
}
var record = tryCatch(method, delegate.iterator, context.arg);
if (record.type === "throw") {
context.method = "throw";
context.arg = record.arg;
context.delegate = null;
return ContinueSentinel;
}
var info = record.arg;
if (!info) {
context.method = "throw";
context.arg = new TypeError("iterator result is not an object");
context.delegate = null;
return ContinueSentinel;
}
if (info.done) {
// Assign the result of the finished delegate to the temporary
// variable specified by delegate.resultName (see delegateYield).
context[delegate.resultName] = info.value; // Resume execution at the desired location (see delegateYield).
context.next = delegate.nextLoc; // If context.method was "throw" but the delegate handled the
// exception, let the outer generator proceed normally. If
// context.method was "next", forget context.arg since it has been
// "consumed" by the delegate iterator. If context.method was
// "return", allow the original .return call to continue in the
// outer generator.
if (context.method !== "return") {
context.method = "next";
context.arg = undefined;
}
} else {
// Re-yield the result returned by the delegate method.
return info;
} // The delegate iterator is finished, so forget it and continue with
// the outer generator.
context.delegate = null;
return ContinueSentinel;
} // Define Generator.prototype.{next,throw,return} in terms of the
// unified ._invoke helper method.
defineIteratorMethods(Gp);
define(Gp, toStringTagSymbol, "Generator"); // A Generator should always return itself as the iterator object when the
// @@iterator function is called on it. Some browsers' implementations of the
// iterator prototype chain incorrectly implement this, causing the Generator
// object to not be returned from this call. This ensures that doesn't happen.
// See https://github.com/facebook/regenerator/issues/274 for more details.
Gp[iteratorSymbol] = function () {
return this;
};
Gp.toString = function () {
return "[object Generator]";
};
function pushTryEntry(locs) {
var entry = {
tryLoc: locs[0]
};
if (1 in locs) {
entry.catchLoc = locs[1];
}
if (2 in locs) {
entry.finallyLoc = locs[2];
entry.afterLoc = locs[3];
}
this.tryEntries.push(entry);
}
function resetTryEntry(entry) {
var record = entry.completion || {};
record.type = "normal";
delete record.arg;
entry.completion = record;
}
function Context(tryLocsList) {
// The root entry object (effectively a try statement without a catch
// or a finally block) gives us a place to store values thrown from
// locations where there is no enclosing try statement.
this.tryEntries = [{
tryLoc: "root"
}];
tryLocsList.forEach(pushTryEntry, this);
this.reset(true);
}
exports.keys = function (object) {
var keys = [];
for (var key in object) {
keys.push(key);
}
keys.reverse(); // Rather than returning an object with a next method, we keep
// things simple and return the next function itself.
return function next() {
while (keys.length) {
var key = keys.pop();
if (key in object) {
next.value = key;
next.done = false;
return next;
}
} // To avoid creating an additional object, we just hang the .value
// and .done properties off the next function object itself. This
// also ensures that the minifier will not anonymize the function.
next.done = true;
return next;
};
};
function values(iterable) {
if (iterable) {
var iteratorMethod = iterable[iteratorSymbol];
if (iteratorMethod) {
return iteratorMethod.call(iterable);
}
if (typeof iterable.next === "function") {
return iterable;
}
if (!isNaN(iterable.length)) {
var i = -1,
next = function next() {
while (++i < iterable.length) {
if (hasOwn.call(iterable, i)) {
next.value = iterable[i];
next.done = false;
return next;
}
}
next.value = undefined;
next.done = true;
return next;
};
return next.next = next;
}
} // Return an iterator with no values.
return {
next: doneResult
};
}
exports.values = values;
function doneResult() {
return {
value: undefined,
done: true
};
}
Context.prototype = {
constructor: Context,
reset: function reset(skipTempReset) {
this.prev = 0;
this.next = 0; // Resetting context._sent for legacy support of Babel's
// function.sent implementation.
this.sent = this._sent = undefined;
this.done = false;
this.delegate = null;
this.method = "next";
this.arg = undefined;
this.tryEntries.forEach(resetTryEntry);
if (!skipTempReset) {
for (var name in this) {
// Not sure about the optimal order of these conditions:
if (name.charAt(0) === "t" && hasOwn.call(this, name) && !isNaN(+name.slice(1))) {
this[name] = undefined;
}
}
}
},
stop: function stop() {
this.done = true;
var rootEntry = this.tryEntries[0];
var rootRecord = rootEntry.completion;
if (rootRecord.type === "throw") {
throw rootRecord.arg;
}
return this.rval;
},
dispatchException: function dispatchException(exception) {
if (this.done) {
throw exception;
}
var context = this;
function handle(loc, caught) {
record.type = "throw";
record.arg = exception;
context.next = loc;
if (caught) {
// If the dispatched exception was caught by a catch block,
// then let that catch block handle the exception normally.
context.method = "next";
context.arg = undefined;
}
return !!caught;
}
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
var entry = this.tryEntries[i];
var record = entry.completion;
if (entry.tryLoc === "root") {
// Exception thrown outside of any try block that could handle
// it, so set the completion value of the entire function to
// throw the exception.
return handle("end");
}
if (entry.tryLoc <= this.prev) {
var hasCatch = hasOwn.call(entry, "catchLoc");
var hasFinally = hasOwn.call(entry, "finallyLoc");
if (hasCatch && hasFinally) {
if (this.prev < entry.catchLoc) {
return handle(entry.catchLoc, true);
} else if (this.prev < entry.finallyLoc) {
return handle(entry.finallyLoc);
}
} else if (hasCatch) {
if (this.prev < entry.catchLoc) {
return handle(entry.catchLoc, true);
}
} else if (hasFinally) {
if (this.prev < entry.finallyLoc) {
return handle(entry.finallyLoc);
}
} else {
throw new Error("try statement without catch or finally");
}
}
}
},
abrupt: function abrupt(type, arg) {
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
var entry = this.tryEntries[i];
if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
var finallyEntry = entry;
break;
}
}
if (finallyEntry && (type === "break" || type === "continue") && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc) {
// Ignore the finally entry if control is not jumping to a
// location outside the try/catch block.
finallyEntry = null;
}
var record = finallyEntry ? finallyEntry.completion : {};
record.type = type;
record.arg = arg;
if (finallyEntry) {
this.method = "next";
this.next = finallyEntry.finallyLoc;
return ContinueSentinel;
}
return this.complete(record);
},
complete: function complete(record, afterLoc) {
if (record.type === "throw") {
throw record.arg;
}
if (record.type === "break" || record.type === "continue") {
this.next = record.arg;
} else if (record.type === "return") {
this.rval = this.arg = record.arg;
this.method = "return";
this.next = "end";
} else if (record.type === "normal" && afterLoc) {
this.next = afterLoc;
}
return ContinueSentinel;
},
finish: function finish(finallyLoc) {
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
var entry = this.tryEntries[i];
if (entry.finallyLoc === finallyLoc) {
this.complete(entry.completion, entry.afterLoc);
resetTryEntry(entry);
return ContinueSentinel;
}
}
},
"catch": function _catch(tryLoc) {
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
var entry = this.tryEntries[i];
if (entry.tryLoc === tryLoc) {
var record = entry.completion;
if (record.type === "throw") {
var thrown = record.arg;
resetTryEntry(entry);
}
return thrown;
}
} // The context.catch method must only be called with a location
// argument that corresponds to a known catch block.
throw new Error("illegal catch attempt");
},
delegateYield: function delegateYield(iterable, resultName, nextLoc) {
this.delegate = {
iterator: values(iterable),
resultName: resultName,
nextLoc: nextLoc
};
if (this.method === "next") {
// Deliberately forget the last sent value so that we don't
// accidentally pass it on to the delegate.
this.arg = undefined;
}
return ContinueSentinel;
}
}; // Regardless of whether this script is executing as a CommonJS module
// or not, return the runtime object so that we can declare the variable
// regeneratorRuntime in the outer scope, which allows this module to be
// injected easily by `bin/regenerator --include-runtime script.js`.
return exports;
}( // If this script is executing as a CommonJS module, use module.exports
// as the regeneratorRuntime namespace. Otherwise create a new empty
// object. Either way, the resulting object will be used to initialize
// the regeneratorRuntime variable at the top of this file.
( false ? 0 : _typeof(module)) === "object" ? module.exports : {});
try {
regeneratorRuntime = runtime;
} catch (accidentalStrictMode) {
// This module should not be running in strict mode, so the above
// assignment should always work unless something is misconfigured. Just
// in case runtime.js accidentally runs in strict mode, we can escape
// strict mode using a global Function call. This could conceivably fail
// if a Content Security Policy forbids using Function, but in that case
// the proper solution is to fix the accidental strict mode problem. If
// you've misconfigured your bundler to force strict mode and applied a
// CSP to forbid Function, and you're not willing to fix either of those
// problems, please detail your unique predicament in a GitHub issue.
Function("r", "regeneratorRuntime = r")(runtime);
}
/***/ })
/******/ });
/************************************************************************/
/******/ // The module cache
/******/ var __webpack_module_cache__ = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ // Check if module is in cache
/******/ if(__webpack_module_cache__[moduleId]) {
/******/ return __webpack_module_cache__[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = __webpack_module_cache__[moduleId] = {
/******/ id: moduleId,
/******/ loaded: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.loaded = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/************************************************************************/
/******/ /* webpack/runtime/compat get default export */
/******/ !function() {
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function() { return module['default']; } :
/******/ function() { return module; };
/******/ __webpack_require__.d(getter, { a: getter });
/******/ return getter;
/******/ };
/******/ }();
/******/
/******/ /* webpack/runtime/define property getters */
/******/ !function() {
/******/ // define getter functions for harmony exports
/******/ __webpack_require__.d = function(exports, definition) {
/******/ for(var key in definition) {
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
/******/ }
/******/ }
/******/ };
/******/ }();
/******/
/******/ /* webpack/runtime/global */
/******/ !function() {
/******/ __webpack_require__.g = (function() {
/******/ if (typeof globalThis === 'object') return globalThis;
/******/ try {
/******/ return this || new Function('return this')();
/******/ } catch (e) {
/******/ if (typeof window === 'object') return window;
/******/ }
/******/ })();
/******/ }();
/******/
/******/ /* webpack/runtime/hasOwnProperty shorthand */
/******/ !function() {
/******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }
/******/ }();
/******/
/******/ /* webpack/runtime/node module decorator */
/******/ !function() {
/******/ __webpack_require__.nmd = function(module) {
/******/ module.paths = [];
/******/ if (!module.children) module.children = [];
/******/ return module;
/******/ };
/******/ }();
/******/
/************************************************************************/
!function() {
"use strict";
// UNUSED EXPORTS: AddressMatchService, AggQueryBuilderParameter, AggregationParameter, AggregationQueryBuilderType, AggregationType, AlongLineDirection, AnalystAreaUnit, AnalystSizeUnit, AreaSolarRadiationParameters, ArrayStatistic, AttributesPopContainer, BaiduMap, BufferAnalystParameters, BufferDistance, BufferEndType, BufferRadiusUnit, BufferSetting, BuffersAnalystJobsParameter, BurstPipelineAnalystParameters, ChangeTileVersion, ChartQueryFilterParameter, ChartQueryParameters, ChartService, ChartType, CityTabsPage, ClientType, ClipAnalystMode, ClipParameter, CloverShape, ColorDictionary, ColorGradientType, ColorSpaceType, ColorsPickerUtil, CommonContainer, CommonTheme, ComponentsUtil, ComputeWeightMatrixParameters, DataFlow, DataFlowService, DataFormat, DataItemOrderBy, DataItemType, DataReturnMode, DataReturnOption, DatasetBufferAnalystParameters, DatasetInfo, DatasetOverlayAnalystParameters, DatasetSurfaceAnalystParameters, DatasetThiessenAnalystParameters, DatasourceConnectionInfo, DeafultCanvasStyle, DensityKernelAnalystParameters, DirectionType, DropDownBox, EditFeaturesParameters, EditType, ElasticSearch, EngineType, Exponent, FacilityAnalyst3DParameters, FacilityAnalystSinks3DParameters, FacilityAnalystSources3DParameters, FacilityAnalystStreamParameters, FacilityAnalystTracedown3DParameters, FacilityAnalystTraceup3DParameters, FacilityAnalystUpstream3DParameters, FeatureService, FetchRequest, FieldParameters, FieldService, FieldStatisticsParameters, FileConfig, FileModel, FileReaderUtil, FileTypes, FillGradientMode, FilterAggParameter, FilterField, FilterParameter, FindClosestFacilitiesParameters, FindLocationParameters, FindMTSPPathsParameters, FindPathParameters, FindServiceAreasParameters, FindTSPPathsParameters, GenerateSpatialDataParameters, GeoBoundingBoxQueryBuilderParameter, GeoCodingParameter, GeoDecodingParameter, GeoFeature, GeoHashGridAggParameter, GeoRelationAnalystParameters, GeometryBufferAnalystParameters, GeometryOverlayAnalystParameters, GeometrySurfaceAnalystParameters, GeometryThiessenAnalystParameters, GeometryType, GeoprocessingService, GetFeatureMode, GetFeaturesByBoundsParameters, GetFeaturesByBufferParameters, GetFeaturesByGeometryParameters, GetFeaturesByIDsParameters, GetFeaturesBySQLParameters, GetGridCellInfosParameters, GraduatedMode, Graph, GraphAxesTextDisplayMode, Graphic, GraphicCanvasRenderer, GraphicWebGLRenderer, Grid, GridCellInfosService, GridType, HeatMap, HitCloverShape, IManager, IManagerCreateNodeParam, IManagerServiceBase, IPortal, IPortalAddDataParam, IPortalAddResourceParam, IPortalDataConnectionInfoParam, IPortalDataMetaInfoParam, IPortalDataStoreInfoParam, IPortalQueryParam, IPortalQueryResult, IPortalRegisterServiceParam, IPortalResource, IPortalServiceBase, IPortalShareEntity, IPortalShareParam, IPortalUser, Image, ImageSuperMapRest, IndexTabsPageContainer, InterpolationAlgorithmType, InterpolationAnalystParameters, InterpolationIDWAnalystParameters, InterpolationKrigingAnalystParameters, InterpolationRBFAnalystParameters, JoinItem, JoinType, KernelDensityJobParameter, KeyServiceParameter, Label, LabelBackShape, LabelImageCell, LabelMatrixCell, LabelMixedTextStyle, LabelOverLengthMode, LabelSymbolCell, LabelThemeCell, LayerInfoService, LayerStatus, LayerType, LinkItem, Logo, MapExtend, MapService, MapboxStyles, MappingParameters, Mapv, MapvCanvasLayer, MapvLayer, MathExpressionAnalysisParameters, MeasureMode, MeasureParameters, MeasureService, MessageBox, NavTabsPage, NetworkAnalyst3DService, NetworkAnalystService, Online, OnlineData, OnlineQueryDatasParameter, OnlineServiceBase, OutputSetting, OutputType, OverlapDisplayedOptions, OverlayAnalystParameters, OverlayGeoJobParameter, OverlayGraphic, OverlayOperationType, PaginationContainer, PixelFormat, PointWithMeasure, PopContainer, ProcessingService, QueryByBoundsParameters, QueryByDistanceParameters, QueryByGeometryParameters, QueryBySQLParameters, QueryOption, QueryParameters, QueryService, Range, RangeMode, RankSymbol, Route, RouteCalculateMeasureParameters, RouteLocatorParameters, ScaleLine, SearchMode, SecurityManager, Select, ServerColor, ServerFeature, ServerGeometry, ServerInfo, ServerStyle, ServerTextStyle, ServerTheme, ServerType, ServiceBase, ServiceStatus, SetLayerInfoParameters, SetLayerStatusParameters, SetLayersInfoParameters, SideType, SingleObjectQueryJobsParameter, SmoothMethod, SpatialAnalystService, SpatialQueryMode, SpatialRelationType, StatisticAnalystMode, StatisticMode, StopQueryParameters, StyleMap, StyleUtils, SummaryAttributesJobsParameter, SummaryMeshJobParameter, SummaryRegionJobParameter, SummaryType, SuperMap, SuperMapCloud, SupplyCenter, SupplyCenterType, SurfaceAnalystMethod, SurfaceAnalystParameters, SurfaceAnalystParametersSetting, TerrainCurvatureCalculationParameters, TextAlignment, Theme, ThemeDotDensity, ThemeFeature, ThemeFlow, ThemeGraduatedSymbol, ThemeGraduatedSymbolStyle, ThemeGraph, ThemeGraphAxes, ThemeGraphItem, ThemeGraphSize, ThemeGraphText, ThemeGraphTextFormat, ThemeGraphType, ThemeGridRange, ThemeGridRangeItem, ThemeGridUnique, ThemeGridUniqueItem, ThemeLabel, ThemeLabelAlongLine, ThemeLabelBackground, ThemeLabelItem, ThemeLabelText, ThemeLabelUniqueItem, ThemeMemoryData, ThemeOffset, ThemeParameters, ThemeRange, ThemeRangeItem, ThemeService, ThemeType, ThemeUnique, ThemeUniqueItem, ThiessenAnalystParameters, Tianditu, TileSuperMapRest, TimeFlowControl, TokenServiceParameter, TopologyValidatorJobsParameter, TopologyValidatorRule, TrafficTransferAnalystService, TransferLine, TransferPathParameters, TransferPreference, TransferSolutionParameters, TransferTactic, TransportationAnalystParameter, TransportationAnalystResultSetting, Turf, TurnType, UGCLayer, UGCLayerType, UGCMapLayer, UGCSubLayer, Unique, Unit, UpdateEdgeWeightParameters, UpdateTurnNodeWeightParameters, Util, VariogramMode, Vector, VectorClipJobsParameter, VectorTileStyles, VectorTileSuperMapRest, WebMap, WebPrintingJobService, lineMap, lineStyle, pointMap, pointStyle, polygonMap, polygonStyle
;// CONCATENATED MODULE: external "ol.Observable"
var external_ol_Observable_namespaceObject = ol.Observable;
var external_ol_Observable_default = /*#__PURE__*/__webpack_require__.n(external_ol_Observable_namespaceObject);
;// CONCATENATED MODULE: ./src/openlayers/services/ServiceBase.js
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
/* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
* This program are made available under the terms of the Apache License, Version 2.0
* which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
/**
* @class ol.supermap.ServiceBase
* @category iServer
* @classdesc ol.supermap 的服务基类。
* @param {string} url - 与客户端交互的服务地址。
* @param {Object} options - 参数。
* @param {string} [options.proxy] - 服务代理地址。
* @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务来源 ISERVER|IPORTAL|ONLINE。
* @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
* @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
* @param {Object} [options.headers] - 请求头。
* @extends {ol/Observable}
*/
var ServiceBase = /*#__PURE__*/function (_Observable) {
_inherits(ServiceBase, _Observable);
var _super = _createSuper(ServiceBase);
function ServiceBase(url, options) {
var _this;
_classCallCheck(this, ServiceBase);
_this = _super.call(this, url, options);
_this.options = options || {};
_this.url = url;
_this.dispatchEvent({
type: 'initialized',
value: _assertThisInitialized(_this)
});
return _this;
}
return ServiceBase;
}((external_ol_Observable_default()));
;// CONCATENATED MODULE: ./src/common/SuperMap.js
/* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
* This program are made available under the terms of the Apache License, Version 2.0
* which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
var SuperMap = window.SuperMap = window.SuperMap || {};
SuperMap.Components = window.SuperMap.Components || {};
;// CONCATENATED MODULE: ./src/common/REST.js
/* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
* This program are made available under the terms of the Apache License, Version 2.0
* which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
/**
* @enum DataFormat
* @memberOf SuperMap
* @description 服务请求返回结果数据类型
* @type {string}
*/
var DataFormat = SuperMap.DataFormat = {
/** GEOJSON */
GEOJSON: "GEOJSON",
/** ISERVER */
ISERVER: "ISERVER"
};
/**
* @enum ServerType
* @memberOf SuperMap
* @description 服务器类型
* @type {string}
*/
var ServerType = SuperMap.ServerType = {
/** ISERVER */
ISERVER: "ISERVER",
/** IPORTAL */
IPORTAL: "IPORTAL",
/** ONLINE */
ONLINE: "ONLINE"
};
/**
* @enum GeometryType
* @memberOf SuperMap
* @description 几何对象枚举,定义了一系列几何对象类型。
* @type {string}
*/
var GeometryType = SuperMap.GeometryType = {
/** LINE */
LINE: "LINE",
/** LINEM */
LINEM: "LINEM",
/** POINT */
POINT: "POINT",
/** REGION */
REGION: "REGION",
/** POINTEPS */
POINTEPS: "POINTEPS",
/** LINEEPS */
LINEEPS: "LINEEPS",
/** REGIONEPS */
REGIONEPS: "REGIONEPS",
/** ELLIPSE */
ELLIPSE: "ELLIPSE",
/** CIRCLE */
CIRCLE: "CIRCLE",
/** TEXT */
TEXT: "TEXT",
/** RECTANGLE */
RECTANGLE: "RECTANGLE",
/** UNKNOWN */
UNKNOWN: "UNKNOWN",
/** GEOCOMPOUND */
GEOCOMPOUND: "GEOCOMPOUND"
};
/**
* @enum QueryOption
* @memberOf SuperMap
* @description 查询结果类型枚举,描述查询结果返回类型,包括只返回属性、只返回几何实体以及返回属性和几何实体。
* @type {string}
*/
var QueryOption = SuperMap.QueryOption = {
/** 属性 */
ATTRIBUTE: "ATTRIBUTE",
/** 属性和几何对象 */
ATTRIBUTEANDGEOMETRY: "ATTRIBUTEANDGEOMETRY",
/** 几何对象 */
GEOMETRY: "GEOMETRY"
};
/**
* @enum JoinType
* @memberOf SuperMap
* @description 关联查询时的关联类型常量。
* 该类定义了两个表之间的连接类型常量,决定了对两个表之间进行连接查询时,查询结果中得到的记录的情况。
* @type {string}
*/
var JoinType = SuperMap.JoinType = {
/** INNERJOIN */
INNERJOIN: "INNERJOIN",
/** LEFTJOIN */
LEFTJOIN: "LEFTJOIN"
};
/**
* @enum SpatialQueryMode
* @memberOf SuperMap
* @description 空间查询模式枚举。该类定义了空间查询操作模式常量。
* @type {string}
*/
var SpatialQueryMode = SuperMap.SpatialQueryMode = {
/** 包含空间查询模式 */
CONTAIN: "CONTAIN",
/** 交叉空间查询模式 */
CROSS: "CROSS",
/** 分离空间查询模式 */
DISJOINT: "DISJOINT",
/** 重合空间查询模式 */
IDENTITY: "IDENTITY",
/** 相交空间查询模式 */
INTERSECT: "INTERSECT",
/** 无空间查询 */
NONE: "NONE",
/** 叠加空间查询模式 */
OVERLAP: "OVERLAP",
/** 邻接空间查询模式 */
TOUCH: "TOUCH",
/** 被包含空间查询模式 */
WITHIN: "WITHIN"
};
/**
* @enum SpatialRelationType
* @memberOf SuperMap
* @description 数据集对象间的空间关系枚举。
* 该类定义了数据集对象间的空间关系类型常量。
* @type {string}
*/
var SpatialRelationType = SuperMap.SpatialRelationType = {
/** 包含关系 */
CONTAIN: "CONTAIN",
/** 相交关系 */
INTERSECT: "INTERSECT",
/** 被包含关系 */
WITHIN: "WITHIN"
};
/**
* @enum MeasureMode
* @memberOf SuperMap
* @type {string}
* @description 量算模式枚举。
* 该类定义了两种测量模式:距离测量和面积测量。
*/
var MeasureMode = SuperMap.MeasureMode = {
/** 距离测量 */
DISTANCE: "DISTANCE",
/** 面积测量 */
AREA: "AREA"
};
/**
* @enum Unit
* @memberOf SuperMap
* @description 距离单位枚举。
* 该类定义了一系列距离单位类型。
* @type {string}
*/
var REST_Unit = SuperMap.Unit = {
/** 米 */
METER: "METER",
/** 千米 */
KILOMETER: "KILOMETER",
/** 英里 */
MILE: "MILE",
/** 码 */
YARD: "YARD",
/** 度 */
DEGREE: "DEGREE",
/** 毫米 */
MILLIMETER: "MILLIMETER",
/** 厘米 */
CENTIMETER: "CENTIMETER",
/** 英寸 */
INCH: "INCH",
/** 分米 */
DECIMETER: "DECIMETER",
/** 英尺 */
FOOT: "FOOT",
/** 秒 */
SECOND: "SECOND",
/** 分 */
MINUTE: "MINUTE",
/** 弧度 */
RADIAN: "RADIAN"
};
/**
* @enum BufferRadiusUnit
* @memberOf SuperMap
* @description 缓冲区距离单位枚举。
* 该类定义了一系列缓冲距离单位类型。
* @type {string}
*/
var BufferRadiusUnit = SuperMap.BufferRadiusUnit = {
/** 厘米 */
CENTIMETER: "CENTIMETER",
/** 分米 */
DECIMETER: "DECIMETER",
/** 英尺 */
FOOT: "FOOT",
/** 英寸 */
INCH: "INCH",
/** 千米 */
KILOMETER: "KILOMETER",
/** 米 */
METER: "METER",
/** 英里 */
MILE: "MILE",
/** 毫米 */
MILLIMETER: "MILLIMETER",
/** 码 */
YARD: "YARD"
};
/**
* @enum EngineType
* @memberOf SuperMap
* @description 数据源引擎类型枚举。
* @type {string}
*/
var EngineType = SuperMap.EngineType = {
/** 影像只读引擎类型,文件引擎,针对通用影像格式如 BMP,JPG,TIFF 以及超图自定义影像格式 SIT 等。 */
IMAGEPLUGINS: "IMAGEPLUGINS",
/** OGC 引擎类型,针对于 Web 数据源,Web 引擎,目前支持的类型有 WMS,WFS,WCS。 */
OGC: "OGC",
/** Oracle 引擎类型,针对 Oracle 数据源,数据库引擎。 */
ORACLEPLUS: "ORACLEPLUS",
/** SDB 引擎类型,文件引擎,即 SDB 数据源。 */
SDBPLUS: "SDBPLUS",
/** SQL Server 引擎类型,针对 SQL Server 数据源,数据库引擎 */
SQLPLUS: "SQLPLUS",
/** UDB 引擎类型,文件引擎。 */
UDB: "UDB"
};
/**
* @enum ThemeGraphTextFormat
* @memberOf SuperMap
* @description 统计专题图文本显示格式枚举。
* @type {string}
*/
var ThemeGraphTextFormat = SuperMap.ThemeGraphTextFormat = {
/** 标题。以各子项的标题来进行标注。 */
CAPTION: "CAPTION",
/** 标题 + 百分数。以各子项的标题和所占的百分比来进行标注。 */
CAPTION_PERCENT: "CAPTION_PERCENT",
/** 标题 + 实际数值。以各子项的标题和真实数值来进行标注。 */
CAPTION_VALUE: "CAPTION_VALUE",
/** 百分数。以各子项所占的百分比来进行标注。 */
PERCENT: "PERCENT",
/** 实际数值。以各子项的真实数值来进行标注。 */
VALUE: "VALUE"
};
/**
* @enum ThemeGraphType
* @memberOf SuperMap
* @description 统计专题图类型枚举。
* @type {string}
*/
var ThemeGraphType = SuperMap.ThemeGraphType = {
/** 面积图。 */
AREA: "AREA",
/** 柱状图。 */
BAR: "BAR",
/** 三维柱状图。 */
BAR3D: "BAR3D",
/** 折线图。 */
LINE: "LINE",
/** 饼图。 */
PIE: "PIE",
/** 三维饼图。 */
PIE3D: "PIE3D",
/** 点状图。 */
POINT: "POINT",
/** 环状图。 */
RING: "RING",
/** 玫瑰图。 */
ROSE: "ROSE",
/** 三维玫瑰图。 */
ROSE3D: "ROSE3D",
/** 堆叠柱状图。 */
STACK_BAR: "STACK_BAR",
/** 三维堆叠柱状图。 */
STACK_BAR3D: "STACK_BAR3D",
/** 阶梯图。 */
STEP: "STEP"
};
/**
* @enum GraphAxesTextDisplayMode
* @memberOf SuperMap
* @description 统计专题图坐标轴文本显示模式。
* @type {string}
*/
var GraphAxesTextDisplayMode = SuperMap.GraphAxesTextDisplayMode = {
/** 显示全部文本。 */
ALL: "ALL",
/** 不显示。 */
NONE: "NONE",
/** 显示Y轴的文本。 */
YAXES: "YAXES"
};
/**
* @enum GraduatedMode
* @memberOf SuperMap
* @description 专题图分级模式枚举。
*
* @type {string}
*/
var GraduatedMode = SuperMap.GraduatedMode = {
/** 常量分级模式。 */
CONSTANT: "CONSTANT",
/** 对数分级模式。 */
LOGARITHM: "LOGARITHM",
/** 平方根分级模式。 */
SQUAREROOT: "SQUAREROOT"
};
/**
* @enum RangeMode
* @memberOf SuperMap
* @description 范围分段专题图分段方式枚举。
* @type {string}
*/
var RangeMode = SuperMap.RangeMode = {
/** 自定义分段法。 */
CUSTOMINTERVAL: "CUSTOMINTERVAL",
/** 等距离分段法。 */
EQUALINTERVAL: "EQUALINTERVAL",
/** 对数分段法。 */
LOGARITHM: "LOGARITHM",
/** 等计数分段法。 */
QUANTILE: "QUANTILE",
/** 平方根分段法。 */
SQUAREROOT: "SQUAREROOT",
/** 标准差分段法。 */
STDDEVIATION: "STDDEVIATION"
};
/**
* @enum ThemeType
* @memberOf SuperMap
* @description 专题图类型枚举。
* @type {string}
*/
var ThemeType = SuperMap.ThemeType = {
/** 点密度专题图。 */
DOTDENSITY: "DOTDENSITY",
/** 等级符号专题图。 */
GRADUATEDSYMBOL: "GRADUATEDSYMBOL",
/** 统计专题图。 */
GRAPH: "GRAPH",
/** 标签专题图。 */
LABEL: "LABEL",
/** 分段专题图。 */
RANGE: "RANGE",
/** 単值专题图。 */
UNIQUE: "UNIQUE"
};
/**
* @enum ColorGradientType
* @memberOf SuperMap
* @description 渐变颜色枚举。
* @type {string}
*/
var ColorGradientType = SuperMap.ColorGradientType = {
/** 黑白渐变色。 */
BLACK_WHITE: "BLACKWHITE",
/** 蓝黑渐变色。 */
BLUE_BLACK: "BLUEBLACK",
/** 蓝红渐变色。 */
BLUE_RED: "BLUERED",
/** 蓝白渐变色。 */
BLUE_WHITE: "BLUEWHITE",
/** 青黑渐变色。 */
CYAN_BLACK: "CYANBLACK",
/** 青蓝渐变色。 */
CYAN_BLUE: "CYANBLUE",
/** 青绿渐变色。 */
CYAN_GREEN: "CYANGREEN",
/** 青白渐变色。 */
CYAN_WHITE: "CYANWHITE",
/** 绿黑渐变色。 */
GREEN_BLACK: "GREENBLACK",
/** 绿蓝渐变色。 */
GREEN_BLUE: "GREENBLUE",
/** 绿橙紫渐变色。 */
GREEN_ORANGE_VIOLET: "GREENORANGEVIOLET",
/** 绿红渐变色。 */
GREEN_RED: "GREENRED",
/** 蓝红渐变色。 */
GREEN_WHITE: "GREENWHITE",
/** 粉黑渐变色。 */
PINK_BLACK: "PINKBLACK",
/** 粉蓝渐变色。 */
PINK_BLUE: "PINKBLUE",
/** 粉红渐变色。 */
PINK_RED: "PINKRED",
/** 粉白渐变色。 */
PINK_WHITE: "PINKWHITE",
/** 彩虹色。 */
RAIN_BOW: "RAINBOW",
/** 红黑渐变色。 */
RED_BLACK: "REDBLACK",
/** 红白渐变色。 */
RED_WHITE: "REDWHITE",
/** 光谱渐变。 */
SPECTRUM: "SPECTRUM",
/** 地形渐变,用于三维显示效果较好。 */
TERRAIN: "TERRAIN",
/** 黄黑渐变色。 */
YELLOW_BLACK: "YELLOWBLACK",
/** 黄蓝渐变色。 */
YELLOW_BLUE: "YELLOWBLUE",
/** 黄绿渐变色。 */
YELLOW_GREEN: "YELLOWGREEN",
/** 黄红渐变色。 */
YELLOW_RED: "YELLOWRED",
/** 黄白渐变色。 */
YELLOW_WHITE: "YELLOWWHITE"
};
/**
* @enum TextAlignment
* @memberOf SuperMap
* @description 文本对齐枚举。
* @type {string}
*/
var TextAlignment = SuperMap.TextAlignment = {
/** 左上角对齐。 */
TOPLEFT: "TOPLEFT",
/** 顶部居中对齐。 */
TOPCENTER: "TOPCENTER",
/** 右上角对齐。 */
TOPRIGHT: "TOPRIGHT",
/** 基准线左对齐。 */
BASELINELEFT: "BASELINELEFT",
/** 基准线居中对齐。 */
BASELINECENTER: "BASELINECENTER",
/** 基准线右对齐。 */
BASELINERIGHT: "BASELINERIGHT",
/** 左下角对齐。 */
BOTTOMLEFT: "BOTTOMLEFT",
/** 底部居中对齐。 */
BOTTOMCENTER: "BOTTOMCENTER",
/** 右下角对齐。 */
BOTTOMRIGHT: "BOTTOMRIGHT",
/** 左中对齐。 */
MIDDLELEFT: "MIDDLELEFT",
/** 中心对齐。 */
MIDDLECENTER: "MIDDLECENTER",
/** 右中对齐。 */
MIDDLERIGHT: "MIDDLERIGHT"
};
/**
* @enum FillGradientMode
* @memberOf SuperMap
* @description 渐变填充风格的渐变类型枚举。
* @type {string}
*/
var FillGradientMode = SuperMap.FillGradientMode = {
/** 无渐变。 */
NONE: "NONE",
/** 线性渐变填充。 */
LINEAR: "LINEAR",
/** 辐射渐变填充。 */
RADIAL: "RADIAL",
/** 圆锥渐变填充。 */
CONICAL: "CONICAL",
/** 四角渐变填充。 */
SQUARE: "SQUARE"
};
/**
* @enum AlongLineDirection
* @memberOf SuperMap
* @description 标签沿线标注方向枚举。
* @type {string}
*/
var AlongLineDirection = SuperMap.AlongLineDirection = {
/** 沿线的法线方向放置标签。 */
NORMAL: "ALONG_LINE_NORMAL",
/** 从下到上,从左到右放置。 */
LB_TO_RT: "LEFT_BOTTOM_TO_RIGHT_TOP",
/** 从上到下,从左到右放置。 */
LT_TO_RB: "LEFT_TOP_TO_RIGHT_BOTTOM",
/** 从下到上,从右到左放置。 */
RB_TO_LT: "RIGHT_BOTTOM_TO_LEFT_TOP",
/** 从上到下,从右到左放置。 */
RT_TO_LB: "RIGHT_TOP_TO_LEFT_BOTTOM"
};
/**
* @enum LabelBackShape
* @memberOf SuperMap
* @description 标签专题图中标签背景的形状枚举。
* @type {string}
*/
var LabelBackShape = SuperMap.LabelBackShape = {
/** 菱形背景,即标签背景的形状为菱形。 */
DIAMOND: "DIAMOND",
/** 椭圆形背景,即标签背景的行状为椭圆形。 */
ELLIPSE: "ELLIPSE",
/** 符号背景,即标签背景的形状为设定的符号。 */
MARKER: "MARKER",
/** 空背景,即不使用任何形状作为标签的背景。 */
NONE: "NONE",
/** 矩形背景,即标签背景的形状为矩形。 */
RECT: "RECT",
/** 圆角矩形背景,即标签背景的形状为圆角矩形。 */
ROUNDRECT: "ROUNDRECT",
/** 三角形背景,即标签背景的形状为三角形。 */
TRIANGLE: "TRIANGLE"
};
/**
* @enum LabelOverLengthMode
* @memberOf SuperMap
* @description 标签专题图中超长标签的处理模式枚举。
* @type {string}
*/
var LabelOverLengthMode = SuperMap.LabelOverLengthMode = {
/** 换行显示。 */
NEWLINE: "NEWLINE",
/** 对超长标签不进行处理。 */
NONE: "NONE",
/** 省略超出部分。 */
OMIT: "OMIT"
};
/**
* @enum DirectionType
* @memberOf SuperMap
* @description 网络分析中方向枚举。
* 在行驶引导子项中使用。
* @type {string}
*/
var DirectionType = SuperMap.DirectionType = {
/** 东。 */
EAST: "EAST",
/** 无方向。 */
NONE: "NONE",
/** 北。 */
NORTH: "NORTH",
/** 南。 */
SOURTH: "SOURTH",
/** 西。 */
WEST: "WEST"
};
/**
* @enum SideType
* @memberOf SuperMap
* @description 行驶位置枚举。
* 表示在行驶在路的左边、右边或者路上的枚举,该类用在行驶导引子项类中。
* @type {string}
*/
var SideType = SuperMap.SideType = {
/** 路的左侧。 */
LEFT: "LEFT",
/** 在路上(即路的中间)。 */
MIDDLE: "MIDDLE",
/** 无效值。 */
NONE: "NONE",
/** 路的右侧。 */
RIGHT: "RIGHT"
};
/**
* @enum SupplyCenterType
* @memberOf SuperMap
* @description 资源供给中心类型枚举。
* 该枚举定义了网络分析中资源中心点的类型,主要用于资源分配和选址分区。
* 资源供给中心点的类型包括非中心,固定中心和可选中心。固定中心用于资源分配分析; 固定中心和可选中心用于选址分析;非中心在两种网络分析时都不予考虑。
* @type {string}
*/
var SupplyCenterType = SuperMap.SupplyCenterType = {
/** 固定中心点。 */
FIXEDCENTER: "FIXEDCENTER",
/** 非中心点。 */
NULL: "NULL",
/** 可选中心点。 */
OPTIONALCENTER: "OPTIONALCENTER"
};
/**
* @enum TurnType
* @memberOf SuperMap
* @description 转弯方向枚举。
* 用在行驶引导子项类中,表示转弯的方向。
* @type {string}
*/
var TurnType = SuperMap.TurnType = {
/** 向前直行。 */
AHEAD: "AHEAD",
/** 掉头。 */
BACK: "BACK",
/** 终点,不拐弯。 */
END: "END",
/** 左转弯。 */
LEFT: "LEFT",
/** 无效值。 */
NONE: "NONE",
/** 右转弯。 */
RIGHT: "RIGHT"
};
/**
* @enum BufferEndType
* @memberOf SuperMap
* @description 缓冲区分析BufferEnd类型。
* @type {string}
*/
var BufferEndType = SuperMap.BufferEndType = {
/** FLAT */
FLAT: "FLAT",
/** ROUND */
ROUND: "ROUND"
};
/**
* @enum OverlayOperationType
* @memberOf SuperMap
* @description 叠加分析类型枚举。
* @type {string}
*/
var OverlayOperationType = SuperMap.OverlayOperationType = {
/** 操作数据集(几何对象)裁剪被操作数据集(几何对象)。 */
CLIP: "CLIP",
/** 在被操作数据集(几何对象)上擦除掉与操作数据集(几何对象)相重合的部分。 */
ERASE: "ERASE",
/**对被操作数据集(几何对象)进行同一操作,即操作执行后,被操作数据集(几何对象)包含来自操作数据集(几何对象)的几何形状。 */
IDENTITY: "IDENTITY",
/** 对两个数据集(几何对象)求交,返回两个数据集(几何对象)的交集。 */
INTERSECT: "INTERSECT",
/** 对两个面数据集(几何对象)进行合并操作。 */
UNION: "UNION",
/** 对两个面数据集(几何对象)进行更新操作。 */
UPDATE: "UPDATE",
/** 对两个面数据集(几何对象)进行对称差操作。 */
XOR: "XOR"
};
/**
* @enum OutputType
* @memberOf SuperMap
* @description 分布式分析输出类型枚举。
* @type {string}
*/
var OutputType = SuperMap.OutputType = {
/** INDEXEDHDFS */
INDEXEDHDFS: "INDEXEDHDFS",
/** UDB */
UDB: "UDB",
/** MONGODB */
MONGODB: "MONGODB",
/** PG */
PG: "PG"
};
/**
* @enum SmoothMethod
* @memberOf SuperMap
* @description 光滑方法枚举。
* 用于从Grid 或DEM数据生成等值线或等值面时对等值线或者等值面的边界线进行平滑处理的方法。
* @type {string}
*/
var SmoothMethod = SuperMap.SmoothMethod = {
/** B 样条法。 */
BSPLINE: "BSPLINE",
/** 磨角法。 */
POLISH: "POLISH"
};
/**
* @enum SurfaceAnalystMethod
* @memberOf SuperMap
* @description 表面分析方法枚举。
* 通过对数据进行表面分析,能够挖掘原始数据所包含的信息,使某些细节明显化,易于分析。
* @type {string}
*/
var SurfaceAnalystMethod = SuperMap.SurfaceAnalystMethod = {
/** 等值线提取。 */
ISOLINE: "ISOLINE",
/** 等值面提取。 */
ISOREGION: "ISOREGION"
};
/**
* @enum DataReturnMode
* @memberOf SuperMap
* @description 数据返回模式枚举。
* 该枚举用于指定空间分析返回结果模式,包含返回数据集标识和记录集、只返回数据集标识(数据集名称@数据源名称)及只返回记录集三种模式。
* @type {string}
*/
var DataReturnMode = SuperMap.DataReturnMode = {
/** 返回结果数据集标识(数据集名称@数据源名称)和记录集(RecordSet)。 */
DATASET_AND_RECORDSET: "DATASET_AND_RECORDSET",
/** 只返回数据集标识(数据集名称@数据源名称)。 */
DATASET_ONLY: "DATASET_ONLY",
/** 只返回记录集(RecordSet)。 */
RECORDSET_ONLY: "RECORDSET_ONLY"
};
/**
* @enum EditType
* @memberOf SuperMap
* @description 要素集更新模式枚举。
* 该枚举用于指定数据服务中要素集更新模式,包含添加要素集、更新要素集和删除要素集。
* @type {string}
*/
var EditType = SuperMap.EditType = {
/** 增加操作。 */
ADD: "add",
/** 修改操作。 */
UPDATE: "update",
/** 删除操作。 */
DELETE: "delete"
};
/**
* @enum TransferTactic
* @memberOf SuperMap
* @description 公交换乘策略枚举。
* 该枚举用于指定公交服务中要素集更新模式,包含添加要素集、更新要素集和删除要素集。
* @type {string}
*/
var TransferTactic = SuperMap.TransferTactic = {
/** 时间短。 */
LESS_TIME: "LESS_TIME",
/** 少换乘。 */
LESS_TRANSFER: "LESS_TRANSFER",
/** 少步行。 */
LESS_WALK: "LESS_WALK",
/** 距离最短。 */
MIN_DISTANCE: "MIN_DISTANCE"
};
/**
* @enum TransferPreference
* @memberOf SuperMap
* @description 公交换乘策略枚举。
* 该枚举用于指定交通换乘服务中设置地铁优先、公交优先、不乘地铁、无偏好等偏好设置。
* @type {string}
*/
var TransferPreference = SuperMap.TransferPreference = {
/** 公交汽车优先。 */
BUS: "BUS",
/** 地铁优先。 */
SUBWAY: "SUBWAY",
/** 不乘坐地铁。 */
NO_SUBWAY: "NO_SUBWAY",
/** 无乘车偏好。 */
NONE: "NONE"
};
/**
* @enum GridType
* @memberOf SuperMap
* @description 地图背景格网类型枚举。
* @type {string}
*/
var GridType = SuperMap.GridType = {
/** 十字叉丝。 */
CROSS: "CROSS",
/** 网格线。 */
GRID: "GRID",
/** 点。 */
POINT: "POINT"
};
/**
* @enum ColorSpaceType
* @memberOf SuperMap
* @description 色彩空间枚举。
* 由于成色原理的不同,决定了显示器、投影仪这类靠色光直接合成颜色的颜色设备和打印机、
* 印刷机这类靠使用颜料的印刷设备在生成颜色方式上的区别。
* 针对上述不同成色方式,SuperMap 提供两种色彩空间,
* 分别为 RGB 和 CMYK。RGB 主要用于显示系统中,CMYK 主要用于印刷系统中。
* @type {string}
*/
var ColorSpaceType = SuperMap.ColorSpaceType = {
/** 该类型主要在印刷系统使用。 */
CMYK: "CMYK",
/** 该类型主要在显示系统中使用。 */
RGB: "RGB"
};
/**
* @enum LayerType
* @memberOf SuperMap
* @description 图层类型。
* @type {string}
*/
var LayerType = SuperMap.LayerType = {
/** SuperMap UGC 类型图层。如矢量图层、栅格(Grid)图层、影像图层。 */
UGC: "UGC",
/** WMS 图层。 */
WMS: "WMS",
/** WFS 图层。 */
WFS: "WFS",
/** 自定义图层。 */
CUSTOM: "CUSTOM"
};
/**
* @enum UGCLayerType
* @memberOf SuperMap
* @description UGC图层类型。
* @type {string}
*/
var UGCLayerType = SuperMap.UGCLayerType = {
/** 专题图层。 */
THEME: "THEME",
/** 矢量图层。 */
VECTOR: "VECTOR",
/** 栅格图层。。 */
GRID: "GRID",
/** 影像图层。 */
IMAGE: "IMAGE"
};
/**
* @enum StatisticMode
* @memberOf SuperMap
* @description 字段统计方法类型。
* @type {string}
*/
var StatisticMode = SuperMap.StatisticMode = {
/** 统计所选字段的平均值。 */
AVERAGE: "AVERAGE",
/** 统计所选字段的最大值。 */
MAX: "MAX",
/** 统计所选字段的最小值。 */
MIN: "MIN",
/** 统计所选字段的标准差 */
STDDEVIATION: "STDDEVIATION",
/** 统计所选字段的总和。 */
SUM: "SUM",
/** 统计所选字段的方差。 */
VARIANCE: "VARIANCE"
};
/**
* @enum PixelFormat
* @memberOf SuperMap
* @description 栅格与影像数据存储的像素格式枚举。
* @type {string}
*/
var PixelFormat = SuperMap.PixelFormat = {
/** 每个像元用16个比特(即2个字节)表示。 */
BIT16: "BIT16",
/** 每个像元用32个比特(即4个字节)表示。 */
BIT32: "BIT32",
/** 每个像元用64个比特(即8个字节)表示,只提供给栅格数据集使用。 */
BIT64: "BIT64",
/** 每个像元用4个字节来表示,只提供给栅格数据集使用。 */
SINGLE: "SINGLE",
/** 每个像元用8个字节来表示,只提供给栅格数据集使用。 */
DOUBLE: "DOUBLE",
/** 每个像元用1个比特表示。 */
UBIT1: "UBIT1",
/** 每个像元用4个比特来表示。 */
UBIT4: "UBIT4",
/** 每个像元用8个比特(即1个字节)来表示。 */
UBIT8: "UBIT8",
/** 每个像元用24个比特(即3个字节)来表示。 */
UBIT24: "UBIT24",
/** 每个像元用32个比特(即4个字节)来表示。 */
UBIT32: "UBIT32"
};
/**
* @enum SearchMode
* @memberOf SuperMap
* @description 内插时使用的样本点的查找方式枚举
* @type {string}
*/
var SearchMode = SuperMap.SearchMode = {
/** 使用 KDTREE 的固定点数方式查找参与内插分析的点。 */
KDTREE_FIXED_COUNT: "KDTREE_FIXED_COUNT",
/** 使用 KDTREE 的定长方式查找参与内插分析的点。 */
KDTREE_FIXED_RADIUS: "KDTREE_FIXED_RADIUS",
/** 不进行查找,使用所有的输入点进行内插分析。 */
NONE: "NONE",
/** 使用 QUADTREE 方式查找参与内插分析的点,仅对样条(RBF)插值和普通克吕金(Kriging)有用。 */
QUADTREE: "QUADTREE"
};
/**
* @enum InterpolationAlgorithmType
* @memberOf SuperMap
* @description 插值分析的算法的类型
* @type {string}
*/
var InterpolationAlgorithmType = SuperMap.InterpolationAlgorithmType = {
/** 普通克吕金插值法。 */
KRIGING: "KRIGING",
/** 简单克吕金插值法。 */
SimpleKriging: "SimpleKriging",
/** 泛克吕金插值法。 */
UniversalKriging: "UniversalKriging"
};
/**
* @enum VariogramMode
* @memberOf SuperMap
* @description 克吕金(Kriging)插值时的半变函数类型枚举
* @type {string}
*/
var VariogramMode = SuperMap.VariogramMode = {
/** 指数函数。 */
EXPONENTIAL: "EXPONENTIAL",
/** 高斯函数。 */
GAUSSIAN: "GAUSSIAN",
/** 球型函数。 */
SPHERICAL: "SPHERICAL"
};
/**
* @enum Exponent
* @memberOf SuperMap
* @description 定义了泛克吕金(UniversalKriging)插值时样点数据中趋势面方程的阶数
* @type {string}
*/
var Exponent = SuperMap.Exponent = {
/** 阶数为1。 */
EXP1: "EXP1",
/** 阶数为2。 */
EXP2: "EXP2"
};
/**
* @enum ClientType
* @memberOf SuperMap
* @description token申请的客户端标识类型
* @type {string}
*/
var ClientType = SuperMap.ClientType = {
/** 指定的 IP 地址。 */
IP: "IP",
/** 指定的 URL。 */
REFERER: "Referer",
/** 发送申请令牌请求的客户端 IP。 */
REQUESTIP: "RequestIP",
/** 不做任何验证。 */
NONE: "NONE",
/** SERVER。 */
SERVER: "SERVER",
/** WEB。 */
WEB: "WEB"
};
/**
* @enum ChartType
* @memberOf SuperMap
* @description 客户端专题图图表类型
* @type {string}
*/
var ChartType = SuperMap.ChartType = {
/** 柱状图。 */
BAR: "Bar",
/** 三维柱状图。 */
BAR3D: "Bar3D",
/** 圆形图。 */
CIRCLE: "Circle",
/** 饼图。 */
PIE: "Pie",
/** 散点图。 */
POINT: "Point",
/** 折线图。 */
LINE: "Line",
/** 环状图。 */
RING: "Ring"
};
/**
* @enum ClipAnalystMode
* @memberOf SuperMap
* @description 裁剪分析模式
* @type {string}
*/
var ClipAnalystMode = SuperMap.ClipAnalystMode = {
/** CLIP。 */
CLIP: "clip",
/** INTERSECT。 */
INTERSECT: "intersect"
};
/**
* @enum AnalystAreaUnit
* @memberOf SuperMap
* @description 分布式分析面积单位
* @type {string}
*/
var AnalystAreaUnit = SuperMap.AnalystAreaUnit = {
/** 平方米。 */
"SQUAREMETER": "SquareMeter",
/** 平方千米。 */
"SQUAREKILOMETER": "SquareKiloMeter",
/** 公顷。 */
"HECTARE": "Hectare",
/** 公亩。 */
"ARE": "Are",
/** 英亩。 */
"ACRE": "Acre",
/** 平方英尺。 */
"SQUAREFOOT": "SquareFoot",
/** 平方码。 */
"SQUAREYARD": "SquareYard",
/** 平方英里。 */
"SQUAREMILE": "SquareMile"
};
/**
* @enum AnalystSizeUnit
* @memberOf SuperMap
* @description 分布式分析单位
* @type {string}
*/
var AnalystSizeUnit = SuperMap.AnalystSizeUnit = {
/** 米。 */
"METER": "Meter",
/** 千米。 */
"KILOMETER": "Kilometer",
/** 码。 */
"YARD": "Yard",
/** 英尺。 */
"FOOT": "Foot",
/** 英里。 */
"MILE": "Mile"
};
/**
* @enum StatisticAnalystMode
* @memberOf SuperMap
* @description 分布式分析统计模式
* @type {string}
*/
var StatisticAnalystMode = SuperMap.StatisticAnalystMode = {
/** 统计所选字段的最大值。 */
"MAX": "max",
/** 统计所选字段的最小值。 */
"MIN": "min",
/** 统计所选字段的平均值。 */
"AVERAGE": "average",
/** 统计所选字段的总和。 */
"SUM": "sum",
/** 统计所选字段的方差。 */
"VARIANCE": "variance",
/** 统计所选字段的标准差 */
"STDDEVIATION": "stdDeviation"
};
/**
* @enum SummaryType
* @memberOf SuperMap
* @description 分布式分析聚合类型
* @type {string}
*/
var SummaryType = SuperMap.SummaryType = {
/** 格网聚合。 */
"SUMMARYMESH": "SUMMARYMESH",
/** 多边形聚合。 */
"SUMMARYREGION": "SUMMARYREGION"
};
/**
* @enum TopologyValidatorRule
* @memberOf SuperMap
* @description 拓扑检查模式枚举。该类定义了拓扑检查操作模式常量。
* @type {string}
*/
var TopologyValidatorRule = SuperMap.TopologyValidatorRule = {
/** 面内无重叠,用于对面数据进行拓扑检查。 */
REGIONNOOVERLAP: "REGIONNOOVERLAP",
/** 面与面无重叠,用于对面数据进行拓扑检查。 */
REGIONNOOVERLAPWITH: "REGIONNOOVERLAPWITH",
/** 面被面包含,用于对面数据进行拓扑检查。 */
REGIONCONTAINEDBYREGION: "REGIONCONTAINEDBYREGION",
/** 面被面覆盖,用于对面数据进行拓扑检查。 */
REGIONCOVEREDBYREGION: "REGIONCOVEREDBYREGION",
/** 线与线无重叠,用于对线数据进行拓扑检查。 */
LINENOOVERLAP: "LINENOOVERLAP",
/** 线内无重叠,用于对线数据进行拓扑检查。 */
LINENOOVERLAPWITH: "LINENOOVERLAPWITH",
/** 点不相同,用于对点数据进行拓扑检查。 */
POINTNOIDENTICAL: "POINTNOIDENTICAL"
};
/**
* @enum AggregationType
* @memberOf SuperMap
* @description 聚合查询枚举类,该类定义了Es数据服务中聚合查询模式常量
* @type {string}
*/
var AggregationType = SuperMap.AggregationType = {
/** 格网聚合类型。 */
GEOHASH_GRID: "geohash_grid",
/** 过滤聚合类型。 */
FILTER: "filter"
};
/**
* @enum AggregationType
* @memberOf SuperMap
* @description 聚合查询中filter查询枚举类
* @type {string}
*/
var AggregationQueryBuilderType = SuperMap.AggregationQueryBuilderType = {
/** 范围查询。 */
GEO_BOUNDING_BOX: "geo_bounding_box"
};
/**
* @enum GetFeatureMode
* @memberOf SuperMap
* @description feature 查询方式。
* @type {string}
*/
var GetFeatureMode = SuperMap.GetFeatureMode = {
/** 通过范围查询来获取要素。 */
BOUNDS: "BOUNDS",
/** 通过几何对象的缓冲区来获取要素。 */
BUFFER: "BUFFER",
/** 通过 ID 来获取要素。 */
ID: "ID",
/** 通过空间查询模式来获取要素。 */
SPATIAL: "SPATIAL",
/** 通过 SQL 查询来获取要素。 */
SQL: 'SQL'
};
/**
* @enum RasterFunctionType
* @memberOf SuperMap
* @description 栅格分析方法。
* @type {string}
*/
var RasterFunctionType = SuperMap.RasterFunctionType = {
/** 归一化植被指数。 */
NDVI: "NDVI",
/** 阴影面分析。 */
HILLSHADE: "HILLSHADE"
};
/**
* @enum ResourceType
* @memberOf SuperMap
* @description iportal资源类型。
* @version 10.0.1
* @type {string}
*/
var ResourceType = SuperMap.ResourceType = {
/** 地图。 */
MAP: "MAP",
/** 服务。 */
SERVICE: "SERVICE",
/** 场景。 */
SCENE: "SCENE",
/** 数据。 */
DATA: "DATA",
/** 洞察。 */
INSIGHTS_WORKSPACE: "INSIGHTS_WORKSPACE",
/** 大屏。 */
MAP_DASHBOARD: "MAP_DASHBOARD"
};
/**
* @enum OrderBy
* @memberOf SuperMap
* @description iportal资源排序字段。
* @version 10.0.1
* @type {string}
*/
var OrderBy = SuperMap.OrderBy = {
/** 按更新时间排序 */
UPDATETIME: "UPDATETIME",
/** 按热度(可能是访问量、下载量)排序 */
HEATLEVEL: "HEATLEVEL",
/** 按相关性排序 */
RELEVANCE: "RELEVANCE"
};
/**
* @enum OrderType
* @memberOf SuperMap
* @description iportal资源升序还是降序过滤
* @version 10.0.1
* @type {string}
*/
var OrderType = SuperMap.OrderType = {
/** 升序 */
ASC: "ASC",
/** 降序 */
DESC: "DESC"
};
/**
* @enum SearchType
* @memberOf SuperMap
* @description iportal资源查询的范围进行过滤
* @version 10.0.1
* @type {string}
*/
var SearchType = SuperMap.SearchType = {
/** 公开资源。 */
PUBLIC: "PUBLIC",
/** 我的资源。 */
MY_RES: "MY_RES",
/** 我的群组资源。 */
MYGROUP_RES: "MYGROUP_RES",
/** 我的部门资源。 */
MYDEPARTMENT_RES: "MYDEPARTMENT_RES",
/** 分享给我的资源。 */
SHARETOME_RES: "SHARETOME_RES"
};
/**
* @enum AggregationTypes
* @memberOf SuperMap
* @description iportal资源聚合查询的类型
* @version 10.0.1
* @type {string}
*/
var AggregationTypes = SuperMap.AggregationTypes = {
/** 标签 */
TAG: "TAG",
/** 资源类型 */
TYPE: "TYPE"
};
/**
* @enum PermissionType
* @memberOf SuperMap
* @description iportal资源权限类型。
* @version 10.0.1
* @type {string}
*/
var PermissionType = SuperMap.PermissionType = {
/** 可检索 */
SEARCH: "SEARCH",
/** 可查看 */
READ: "READ",
/** 可编辑 */
READWRITE: "READWRITE",
/** 可删除 */
DELETE: "DELETE",
/** 可下载,包括可读、可检索 */
DOWNLOAD: "DOWNLOAD"
};
/**
* @enum EntityType
* @memberOf SuperMap
* @description iportal资源实体类型。
* @version 10.0.1
* @type {string}
*/
var EntityType = SuperMap.EntityType = {
/** 部门 */
DEPARTMENT: "DEPARTMENT",
/** 用户组 */
GROUP: "GROUP",
/** 群组 */
IPORTALGROUP: "IPORTALGROUP",
/** 角色 */
ROLE: "ROLE",
/** 用户 */
USER: "USER"
};
/**
* @enum DataItemType
* @memberOf SuperMap
* @description iportal数据类型。
* @version 10.0.1
* @type {string}
*/
var DataItemType = SuperMap.DataItemType = {
/** 工作空间 sxwu, smwu, sxw, smw */
WORKSPACE: "WORKSPACE",
/** udb 数据源 */
UDB: "UDB",
/** shp空间数据 */
SHP: "SHP",
/** excel数据 */
EXCEL: "EXCEL",
/** csv数据 */
CSV: "CSV",
/** geojson数据。 */
GEOJSON: "GEOJSON",
/** smtiles */
SMTILES: "SMTILES",
/** svtiles */
SVTILES: "SVTILES",
/** mbtiles */
MBTILES: "MBTILES",
/** tpk */
TPK: "TPK",
/** ugc v5 */
UGCV5: "UGCV5",
/** UGCV5_MVT */
UGCV5_MVT: "UGCV5_MVT",
/** json数据 */
JSON: "JSON"
};
/**
* @enum WebExportFormatType
* @memberOf SuperMap
* @description Web 打印输出的格式。
* @version 10.0.1
* @type {string}
*/
var WebExportFormatType = SuperMap.WebExportFormatType = {
/** png */
PNG: "PNG",
/** pdf */
PDF: "PDF"
};
/**
* @enum WebScaleOrientationType
* @memberOf SuperMap
* @description Web 比例尺的方位样式。
* @version 10.0.1
* @type {string}
*/
var WebScaleOrientationType = SuperMap.WebScaleOrientationType = {
/** horizontal labels below */
HORIZONTALLABELSBELOW: "HORIZONTALLABELSBELOW",
/** horizontal labels above */
HORIZONTALLABELSABOVE: "HORIZONTALLABELSABOVE",
/** vertical labels left */
VERTICALLABELSLEFT: "VERTICALLABELSLEFT",
/** vertical labels right */
VERTICALLABELSRIGHT: "VERTICALLABELSRIGHT"
};
/**
* @enum WebScaleType
* @memberOf SuperMap
* @description Web 比例尺的样式。
* @version 10.0.1
* @type {string}
*/
var WebScaleType = SuperMap.WebScaleType = {
/** line */
LINE: "LINE",
/** bar */
BAR: "BAR",
/** bar sub */
BAR_SUB: "BAR_SUB"
};
/**
* @enum WebScaleUnit
* @memberOf SuperMap
* @description Web 比例尺的单位制。
* @version 10.0.1
* @type {string}
*/
var WebScaleUnit = SuperMap.WebScaleUnit = {
/** meter */
METER: "METER",
/** foot */
FOOT: "FOOT",
/** degrees */
DEGREES: "DEGREES"
};
;// CONCATENATED MODULE: ./src/common/commontypes/Size.js
function Size_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
/* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
* This program are made available under the terms of the Apache License, Version 2.0
* which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
/**
* @class SuperMap.Size
* @category BaseTypes Style
* @classdesc 此类描绘一对高宽值的实例。
* @param {number} [w=0.0] - 宽度。
* @param {number} [h=0.0] - 高度。
*
* @example
* var size = new SuperMap.Size(31,46);
*/
var Size = /*#__PURE__*/function () {
function Size(w, h) {
Size_classCallCheck(this, Size);
/**
* @member {number} [SuperMap.Size.prototype.w=0.0]
* @description 宽度。
*/
this.w = w ? parseFloat(w) : 0.0;
/**
* @member {number} [SuperMap.Size.prototype.h=0.0]
* @description 高度。
*/
this.h = w ? parseFloat(h) : 0.0;
this.CLASS_NAME = "SuperMap.Size";
}
/**
* @function SuperMap.Size.prototype.toString
* @description 返回此对象的字符串形式。
* @example
* var size = new SuperMap.Size(10,5);
* var str = size.toString();
* @returns {string} 例如:"w=10,h=5"。
*/
_createClass(Size, [{
key: "toString",
value: function toString() {
return "w=" + this.w + ",h=" + this.h;
}
/**
* @function SuperMap.Size.prototype.clone
* @description 克隆当前size对象。
* @example
* var size = new SuperMap.Size(31,46);
* var size2 = size.clone();
* @returns {SuperMap.Size} 返回一个新的与当前 size 对象有相同宽、高的 Size 对象。
*/
}, {
key: "clone",
value: function clone() {
return new Size(this.w, this.h);
}
/**
*
* @function SuperMap.Size.prototype.equals
* @description 比较两个 size 对象是否相等。
* @example
* var size = new SuperMap.Size(31,46);
* var size2 = new SuperMap.Size(31,46);
* var isEquals = size.equals(size2);
*
* @param {SuperMap.Size} sz - 用于比较相等的 Size 对象。
* @returns {boolean} 传入的 size 和当前 size 高宽相等,注意:如果传入的 size 为空则返回 false。
*
*/
}, {
key: "equals",
value: function equals(sz) {
var equals = false;
if (sz != null) {
equals = this.w === sz.w && this.h === sz.h || isNaN(this.w) && isNaN(this.h) && isNaN(sz.w) && isNaN(sz.h);
}
return equals;
}
/**
*
* @function SuperMap.Size.prototype.destroy
* @description 销毁此对象。销毁后此对象的所有属性为 null,而不是初始值。
* @example
* var size = new SuperMap.Size(31,46);
* size.destroy();
*/
}, {
key: "destroy",
value: function destroy() {
this.w = null;
this.h = null;
}
}]);
return Size;
}();
SuperMap.Size = Size;
;// CONCATENATED MODULE: ./src/common/commontypes/Pixel.js
function Pixel_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function Pixel_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
function Pixel_createClass(Constructor, protoProps, staticProps) { if (protoProps) Pixel_defineProperties(Constructor.prototype, protoProps); if (staticProps) Pixel_defineProperties(Constructor, staticProps); return Constructor; }
/* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
* This program are made available under the terms of the Apache License, Version 2.0
* which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
/**
* @class SuperMap.Pixel
* @category BaseTypes Geometry
* @classdesc 此类用 x,y 坐标描绘屏幕坐标(像素点)。
* @param {number} [x=0.0] - x 坐标。
* @param {number} [y=0.0] - y 坐标。
* @param {SuperMap.Pixel.Mode} [mode=SuperMap.Pixel.Mode.LeftTop] - 坐标模式。
*
* @example
* //单独创建一个对象
* var pixcel = new SuperMap.Pixel(100,50);
*
* //依据 size 创建
* var size = new SuperMap.Size(21,25);
* var offset = new SuperMap.Pixel(-(size.w/2), -size.h);
*/
var Pixel = /*#__PURE__*/function () {
function Pixel(x, y, mode) {
Pixel_classCallCheck(this, Pixel);
/**
* @member {number} [SuperMap.Pixel.prototype.x=0.0]
* @description x 坐标。
*/
this.x = x ? parseFloat(x) : 0.0;
/**
* @member {number} [SuperMap.Pixel.prototype.y=0.0]
* @description y 坐标。
*/
this.y = y ? parseFloat(y) : 0.0;
/**
* @member {SuperMap.Pixel.Mode} [SuperMap.Pixel.prototype.mode=SuperMap.Pixel.Mode.LeftTop]
* @description 坐标模式,有左上、右上、右下、左下这几种模式,分别表示相对于左上角、右上角、右下角、左下角的坐标。
*/
this.mode = mode;
this.CLASS_NAME = "SuperMap.Pixel";
/**
* @enum SuperMap.Pixel.Mode
* @readonly
* @description 模式。
* @type {string}
*/
SuperMap.Pixel.Mode = {
/** 左上模式。*/
LeftTop: "lefttop",
/** 右上模式。 */
RightTop: "righttop",
/** 右下模式。 */
RightBottom: "rightbottom",
/** 左下模式。 */
LeftBottom: "leftbottom"
};
}
/**
* @function SuperMap.Pixel.prototype.toString
* @description 返回此对象的字符串形式。
* @example
*
* var pixcel = new SuperMap.Pixel(100,50);
* var str = pixcel.toString();
*
* @returns {string} 例如: "x=200.4,y=242.2"
*/
Pixel_createClass(Pixel, [{
key: "toString",
value: function toString() {
return "x=" + this.x + ",y=" + this.y;
}
/**
* @function SuperMap.Pixel.prototype.clone
* @description 克隆当前的 pixel 对象。
* @example
* var pixcel = new SuperMap.Pixel(100,50);
* var pixcel2 = pixcel.clone();
* @returns {SuperMap.Pixel} 返回一个新的与当前 pixel 对象有相同 x、y 坐标的 pixel 对象。
*/
}, {
key: "clone",
value: function clone() {
return new Pixel(this.x, this.y, this.mode);
}
/**
* @function SuperMap.Pixel.prototype.equals
* @description 比较两 pixel 是否相等。
* @example
* var pixcel = new SuperMap.Pixel(100,50);
* var pixcel2 = new SuperMap.Pixel(100,50);
* var isEquals = pixcel.equals(pixcel2);
*
* @param {SuperMap.Pixel} px - 用于比较相等的 pixel 对象。
* @returns {boolean} 如果传入的像素点和当前像素点相同返回 true,如果不同或传入参数为 NULL 则返回 false。
*/
}, {
key: "equals",
value: function equals(px) {
var equals = false;
if (px != null) {
equals = this.x == px.x && this.y == px.y || isNaN(this.x) && isNaN(this.y) && isNaN(px.x) && isNaN(px.y);
}
return equals;
}
/**
* @function SuperMap.Pixel.prototype.distanceTo
* @description 返回两个 pixel 的距离。
* @example
* var pixcel = new SuperMap.Pixel(100,50);
* var pixcel2 = new SuperMap.Pixel(110,30);
* var distance = pixcel.distanceTo(pixcel2);
*
* @param {SuperMap.Pixel} px - 用于计算的一个 pixel。
* @returns {float} 作为参数传入的像素与当前像素点的距离。
*/
}, {
key: "distanceTo",
value: function distanceTo(px) {
return Math.sqrt(Math.pow(this.x - px.x, 2) + Math.pow(this.y - px.y, 2));
}
/**
* @function SuperMap.Pixel.prototype.add
* @description 在原来像素坐标基础上,x 值加上传入的 x 参数,y 值加上传入的 y 参数。
* @example
* var pixcel = new SuperMap.Pixel(100,50);
* //pixcel2是新的对象
* var pixcel2 = pixcel.add(20,30);
*
* @param {number} x - 传入的 x 值。
* @param {number} y - 传入的 y 值。
* @returns {SuperMap.Pixel} 返回一个新的 pixel 对象,该 pixel 是由当前的 pixel 与传入的 x,y 相加得到。
*/
}, {
key: "add",
value: function add(x, y) {
if (x == null || y == null) {
throw new TypeError('Pixel.add cannot receive null values');
}
return new Pixel(this.x + x, this.y + y);
}
/**
* @function SuperMap.Pixel.prototype.offset
* @description 通过传入的 {@link SuperMap.Pixel} 参数对原屏幕坐标进行偏移。
* @example
* var pixcel = new SuperMap.Pixel(100,50);
* var pixcel2 = new SuperMap.Pixel(130,20);
* //pixcel3 是新的对象
* var pixcel3 = pixcel.offset(pixcel2);
*
* @param {SuperMap.Pixel} px - 传入的 对象。
* @returns {SuperMap.Pixel} 返回一个新的 pixel,该 pixel 是由当前的 pixel 对象的 x,y 值与传入的 Pixel 对象的 x,y 值相加得到。
*/
}, {
key: "offset",
value: function offset(px) {
var newPx = this.clone();
if (px) {
newPx = this.add(px.x, px.y);
}
return newPx;
}
/**
*
* @function SuperMap.Pixel.prototype.destroy
* @description 销毁此对象。销毁后此对象的所有属性为 null,而不是初始值。
* @example
* var pixcel = new SuperMap.Pixel(100,50);
* pixcel.destroy();
*/
}, {
key: "destroy",
value: function destroy() {
this.x = null;
this.y = null;
this.mode = null;
}
}]);
return Pixel;
}();
SuperMap.Pixel = Pixel;
;// CONCATENATED MODULE: ./src/common/commontypes/BaseTypes.js
function BaseTypes_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
/* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
* This program are made available under the terms of the Apache License, Version 2.0
* which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
/**
*@namespace SuperMap
*@category BaseTypes Namespace
*/
/**
* @function SuperMap.inherit
* @description 除了 C 和 P 两个必要参数外,可以传递任意数量的对象,这些对象都将继承C。
* @memberOf SuperMap
* @param {Object} C - 继承的类。
* @param {Object} P - 被继承的父类。
*/
SuperMap.inherit = function (C, P) {
var F = function F() {};
F.prototype = P.prototype;
C.prototype = new F();
var i, l, o;
for (i = 2, l = arguments.length; i < l; i++) {
o = arguments[i];
if (typeof o === "function") {
o = o.prototype;
}
SuperMap.Util.extend(C.prototype, o);
}
};
/**
* @function SuperMap.mixin
* @description 实现多重继承。
* @memberOf SuperMap
* @param {Class|Object} ...mixins - 继承的类。
*/
SuperMap.mixin = function () {
for (var _len = arguments.length, mixins = new Array(_len), _key = 0; _key < _len; _key++) {
mixins[_key] = arguments[_key];
}
var Mix = function Mix(options) {
BaseTypes_classCallCheck(this, Mix);
for (var index = 0; index < mixins.length; index++) {
copyProperties(this, new mixins[index](options));
}
};
for (var index = 0; index < mixins.length; index++) {
var mixin = mixins[index];
copyProperties(Mix, mixin);
copyProperties(Mix.prototype, mixin.prototype);
copyProperties(Mix.prototype, new mixin());
}
return Mix;
function copyProperties(target, source) {
var ownKeys = Object.getOwnPropertyNames(source);
if (Object.getOwnPropertySymbols) {
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source));
}
for (var index = 0; index < ownKeys.length; index++) {
var key = ownKeys[index];
if (key !== "constructor" && key !== "prototype" && key !== "name" && key !== "length") {
var desc = Object.getOwnPropertyDescriptor(source, key);
if (window["ActiveXObject"]) {
Object.defineProperty(target, key, desc || {});
} else {
Object.defineProperty(target, key, desc);
}
}
}
}
};
/**
* @name String
* @namespace
* @memberOf SuperMap
* @category BaseTypes Util
* @description 字符串操作的一系列常用扩展函数。
*/
var StringExt = SuperMap.String = {
/**
* @function SuperMap.String.startsWith
* @description 判断目标字符串是否以指定的子字符串开头。
* @param {string} str - 目标字符串。
* @param {string} sub - 查找的子字符串。
* @returns {boolean} 目标字符串以指定的子字符串开头,则返回 true;否则返回 false。
*/
startsWith: function startsWith(str, sub) {
return str.indexOf(sub) == 0;
},
/**
* @function SuperMap.String.contains
* @description 判断目标字符串是否包含指定的子字符串。
* @param {string} str - 目标字符串。
* @param {string} sub - 查找的子字符串。
* @returns {boolean} 目标字符串中包含指定的子字符串,则返回 true;否则返回 false。
*/
contains: function contains(str, sub) {
return str.indexOf(sub) != -1;
},
/**
* @function SuperMap.String.trim
* @description 删除一个字符串的开头和结尾处的所有空白字符。
* @param {string} str - (可能)存在空白字符填塞的字符串。
* @returns {string} 删除开头和结尾处空白字符后的字符串。
*/
trim: function trim(str) {
return str.replace(/^\s\s*/, '').replace(/\s\s*$/, '');
},
/**
* @function SuperMap.String.camelize
* @description 骆驼式("-")连字符的字符串处理。
* 例如:"chicken-head" becomes "chickenHead",
* "-chicken-head" becomes "ChickenHead"。
* @param {string} str - 要处理的字符串,原始内容不应被修改。
* @returns {string}
*/
camelize: function camelize(str) {
var oStringList = str.split('-');
var camelizedString = oStringList[0];
for (var i = 1, len = oStringList.length; i < len; i++) {
var s = oStringList[i];
camelizedString += s.charAt(0).toUpperCase() + s.substring(1);
}
return camelizedString;
},
/**
* @function SuperMap.String.format
* @description 提供带 ${token} 标记的字符串, 返回 context 对象属性中指定标记的属性值。
* @example
* 示例:
* (code)
* 1、template = "${value,getValue}";
* context = {value: {getValue:function(){return Math.max.apply(null,argument);}}};
* args = [2,23,12,36,21];
* 返回值:36
* (end)
* 示例:
* (code)
* 2、template = "$${{value,getValue}}";
* context = {value: {getValue:function(){return Math.max.apply(null,argument);}}};
* args = [2,23,12,36,21];
* 返回值:"${36}"
* (end)
* 示例:
* (code)
* 3、template = "${a,b}";
* context = {a: {b:"format"}};
* args = null;
* 返回值:"format"
* (end)
* 示例:
* (code)
* 3、template = "${a,b}";
* context = null;
* args = null;
* 返回值:"${a.b}"
* (end)
* @param {string} template - 带标记的字符串将要被替换。参数 template 格式为"${token}",此处的 token 标记会替换为 context["token"] 属性的值。
* @param {Object} [context=window] - 带有属性的可选对象的属性用于匹配格式化字符串中的标记。如果该参数为空,将使用 window 对象。
* @param {Array} [args] - 可选参数传递给在 context 对象上找到的函数。
* @returns {string} 从 context 对象属性中替换字符串标记位的字符串。
*/
format: function format(template, context, args) {
if (!context) {
context = window;
} // Example matching:
// str = ${foo.bar}
// match = foo.bar
var replacer = function replacer(str, match) {
var replacement; // Loop through all subs. Example: ${a.b.c}
// 0 -> replacement = context[a];
// 1 -> replacement = context[a][b];
// 2 -> replacement = context[a][b][c];
var subs = match.split(/\.+/);
for (var i = 0; i < subs.length; i++) {
if (i == 0) {
replacement = context;
}
replacement = replacement[subs[i]];
}
if (typeof replacement === "function") {
replacement = args ? replacement.apply(null, args) : replacement();
} // If replacement is undefined, return the string 'undefined'.
// This is a workaround for a bugs in browsers not properly
// dealing with non-participating groups in regular expressions:
// http://blog.stevenlevithan.com/archives/npcg-javascript
if (typeof replacement == 'undefined') {
return 'undefined';
} else {
return replacement;
}
};
return template.replace(SuperMap.String.tokenRegEx, replacer);
},
/**
* @member {RegExp} [SuperMap.String.tokenRegEx]
* @description 寻找带 token 的字符串,默认为 tokenRegEx=/\$\{([\w.]+?)\}/g。
* @example
* Examples: ${a}, ${a.b.c}, ${a-b}, ${5}
*/
tokenRegEx: /\$\{([\w.]+?)\}/g,
/**
* @member {RegExp} [SuperMap.String.numberRegEx]
* @description 判断一个字符串是否只包含一个数值,默认为 numberRegEx=/^([+-]?)(?=\d|\.\d)\d*(\.\d*)?([Ee]([+-]?\d+))?$/。
*/
numberRegEx: /^([+-]?)(?=\d|\.\d)\d*(\.\d*)?([Ee]([+-]?\d+))?$/,
/**
* @function SuperMap.String.isNumeric
* @description 判断一个字符串是否只包含一个数值。
* @example
* (code)
* SuperMap.String.isNumeric("6.02e23") // true
* SuperMap.String.isNumeric("12 dozen") // false
* SuperMap.String.isNumeric("4") // true
* SuperMap.String.isNumeric(" 4 ") // false
* (end)
* @returns {boolean} 字符串包含唯一的数值,返回 true;否则返回 false。
*/
isNumeric: function isNumeric(value) {
return SuperMap.String.numberRegEx.test(value);
},
/**
* @function SuperMap.String.numericIf
* @description 把一个看似数值型的字符串转化为一个数值。
* @returns {(number|string)} 如果能转换为数值则返回数值,否则返回字符串本身。
*/
numericIf: function numericIf(value) {
return SuperMap.String.isNumeric(value) ? parseFloat(value) : value;
}
};
/**
* @name Number
* @memberOf SuperMap
* @namespace
* @category BaseTypes Util
* @description 数值操作的一系列常用扩展函数。
*/
var NumberExt = SuperMap.Number = {
/**
* @member {string} [SuperMap.Number.decimalSeparator='.']
* @description 格式化数字时默认的小数点分隔符。
* @constant
*/
decimalSeparator: ".",
/**
* @member {string} [SuperMap.Number.thousandsSeparator=',']
* @description 格式化数字时默认的千位分隔符。
* @constant
*/
thousandsSeparator: ",",
/**
* @function SuperMap.Number.limitSigDigs
* @description 限制浮点数的有效数字位数。
* @param {number} num - 浮点数。
* @param {integer} sig - 有效位数。
* @returns {number} 将数字四舍五入到指定数量的有效位数。
*/
limitSigDigs: function limitSigDigs(num, sig) {
var fig = 0;
if (sig > 0) {
fig = parseFloat(num.toPrecision(sig));
}
return fig;
},
/**
* @function SuperMap.Number.format
* @description 数字格式化输出。
* @param {number} num - 数字。
* @param {integer} [dec=0] - 数字的小数部分四舍五入到指定的位数。设置为 null 值时小数部分不变。
* @param {string} [tsep=','] - 千位分隔符。
* @param {string} [dsep='.'] - 小数点分隔符。
* @returns {string} 数字格式化后的字符串。
*/
format: function format(num, dec, tsep, dsep) {
dec = typeof dec != "undefined" ? dec : 0;
tsep = typeof tsep != "undefined" ? tsep : SuperMap.Number.thousandsSeparator;
dsep = typeof dsep != "undefined" ? dsep : SuperMap.Number.decimalSeparator;
if (dec != null) {
num = parseFloat(num.toFixed(dec));
}
var parts = num.toString().split(".");
if (parts.length === 1 && dec == null) {
// integer where we do not want to touch the decimals
dec = 0;
}
var integer = parts[0];
if (tsep) {
var thousands = /(-?[0-9]+)([0-9]{3})/;
while (thousands.test(integer)) {
integer = integer.replace(thousands, "$1" + tsep + "$2");
}
}
var str;
if (dec == 0) {
str = integer;
} else {
var rem = parts.length > 1 ? parts[1] : "0";
if (dec != null) {
rem = rem + new Array(dec - rem.length + 1).join("0");
}
str = integer + dsep + rem;
}
return str;
}
};
if (!Number.prototype.limitSigDigs) {
/**
* APIMethod: Number.limitSigDigs
* 限制浮点数的有效数字位数.
* @param {integer} sig -有效位数。
* @returns {integer} 将数字四舍五入到指定数量的有效位数。
* 如果传入值 为 null、0、或者是负数, 返回值 0。
*/
Number.prototype.limitSigDigs = function (sig) {
return NumberExt.limitSigDigs(this, sig);
};
}
/**
* @name Function
* @memberOf SuperMap
* @namespace
* @category BaseTypes Util
* @description 函数操作的一系列常用扩展函数。
*/
var FunctionExt = SuperMap.Function = {
/**
* @function SuperMap.Function.bind
* @description 绑定函数到对象。方便创建 this 的作用域。
* @param {function} func - 输入函数。
* @param {Object} object - 对象绑定到输入函数(作为输入函数的 this 对象)。
* @returns {function} object 参数作为 func 函数的 this 对象。
*/
bind: function bind(func, object) {
// create a reference to all arguments past the second one
var args = Array.prototype.slice.apply(arguments, [2]);
return function () {
// Push on any additional arguments from the actual function call.
// These will come after those sent to the bind call.
var newArgs = args.concat(Array.prototype.slice.apply(arguments, [0]));
return func.apply(object, newArgs);
};
},
/**
* @function SuperMap.Function.bindAsEventListener
* @description 绑定函数到对象,在调用该函数时配置并使用事件对象作为第一个参数。
* @param {function} func - 用于监听事件的函数。
* @param {Object} object - this 对象的引用。
* @returns {function}
*/
bindAsEventListener: function bindAsEventListener(func, object) {
return function (event) {
return func.call(object, event || window.event);
};
},
/**
* @function SuperMap.Function.False
* @description 该函数仅仅返回 false。该函数主要是避免在 IE8 以下浏览中 DOM 事件句柄的匿名函数问题。
* @example
* document.onclick = SuperMap.Function.False;
* @returns {boolean}
*/
False: function False() {
return false;
},
/**
* @function SuperMap.Function.True
* @description 该函数仅仅返回 true。该函数主要是避免在 IE8 以下浏览中 DOM 事件句柄的匿名函数问题。
* @example
* document.onclick = SuperMap.Function.True;
* @returns {boolean}
*/
True: function True() {
return true;
},
/**
* @function SuperMap.Function.Void
* @description 可重用函数,仅仅返回 "undefined"。
* @returns {undefined}
*/
Void: function Void() {}
};
/**
* @name Array
* @memberOf SuperMap
* @namespace
* @category BaseTypes Util
* @description 数组操作的一系列常用扩展函数。
*/
var ArrayExt = SuperMap.Array = {
/**
* @function SuperMap.Array.filter
* @description 过滤数组,提供了 ECMA-262 标准中 Array.prototype.filter 函数的扩展。详见:{@link http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array/filter}
* @param {Array} array - 要过滤的数组。
* @param {function} callback - 数组中的每一个元素调用该函数。
* 如果函数的返回值为 true,该元素将包含在返回的数组中。该函数有三个参数: 数组中的元素,元素的索引,数组自身。
* 如果设置了可选参数 caller,在调用 callback 时,使用可选参数 caller 设置为 callback 的参数。
* @param {Object} [caller] - 在调用 callback 时,使用参数 caller 设置为 callback 的参数。
* @returns {Array} callback 函数返回 true 时的元素将作为返回数组中的元素。
*/
filter: function filter(array, callback, caller) {
var selected = [];
if (Array.prototype.filter) {
selected = array.filter(callback, caller);
} else {
var len = array.length;
if (typeof callback != "function") {
throw new TypeError();
}
for (var i = 0; i < len; i++) {
if (i in array) {
var val = array[i];
if (callback.call(caller, val, i, array)) {
selected.push(val);
}
}
}
}
return selected;
}
};
;// CONCATENATED MODULE: ./src/common/commontypes/Util.js
function Util_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { Util_typeof = function _typeof(obj) { return typeof obj; }; } else { Util_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return Util_typeof(obj); }
/* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
* This program are made available under the terms of the Apache License, Version 2.0
* which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
var Util = SuperMap.Util = SuperMap.Util || {};
/**
* @name Util
* @memberOf SuperMap
* @namespace
* @category BaseTypes Util
* @description common 工具类。
*/
/**
* @description 复制源对象的所有属性到目标对象上,源对象上的没有定义的属性在目标对象上也不会被设置。
* @example
* 要复制 SuperMap.Size 对象的所有属性到自定义对象上,使用方法如下:
* var size = new SuperMap.Size(100, 100);
* var obj = {};
* SuperMap.Util.extend(obj, size);
* @param {Object} [destination] - 目标对象。
* @param {Object} source - 源对象,其属性将被设置到目标对象上。
* @returns {Object} 目标对象。
*/
SuperMap.Util.extend = function (destination, source) {
destination = destination || {};
if (source) {
for (var property in source) {
var value = source[property];
if (value !== undefined) {
destination[property] = value;
}
}
/**
* IE doesn't include the toString property when iterating over an object's
* properties with the for(property in object) syntax. Explicitly check if
* the source has its own toString property.
*/
/*
* FF/Windows < 2.0.0.13 reports "Illegal operation on WrappedNative
* prototype object" when calling hawOwnProperty if the source object
* is an instance of window.Event.
*/
var sourceIsEvt = typeof window.Event === "function" && source instanceof window.Event;
if (!sourceIsEvt && source.hasOwnProperty && source.hasOwnProperty("toString")) {
destination.toString = source.toString;
}
}
return destination;
};
/**
* @description 对象拷贝。
* @param {Object} [des] - 目标对象。
* @param {Object} soc - 源对象。
*/
SuperMap.Util.copy = function (des, soc) {
des = des || {};
var v;
if (soc) {
for (var p in des) {
v = soc[p];
if (typeof v !== 'undefined') {
des[p] = v;
}
}
}
};
/**
* @description 销毁对象,将其属性置空。
* @param {Object} [obj] - 目标对象。
*/
SuperMap.Util.reset = function (obj) {
obj = obj || {};
for (var p in obj) {
if (obj.hasOwnProperty(p)) {
if (Util_typeof(obj[p]) === "object" && obj[p] instanceof Array) {
for (var i in obj[p]) {
if (obj[p][i].destroy) {
obj[p][i].destroy();
}
}
obj[p].length = 0;
} else if (Util_typeof(obj[p]) === "object" && obj[p] instanceof Object) {
if (obj[p].destroy) {
obj[p].destroy();
}
}
obj[p] = null;
}
}
};
/**
* @description 获取 HTML 元素数组。
* @returns {Array.} HTML 元素数组。
*/
SuperMap.Util.getElement = function () {
var elements = [];
for (var i = 0, len = arguments.length; i < len; i++) {
var element = arguments[i];
if (typeof element === 'string') {
element = document.getElementById(element);
}
if (arguments.length === 1) {
return element;
}
elements.push(element);
}
return elements;
};
/**
* @description instance of 的跨浏览器实现。
* @param {Object} o - 对象。
* @returns {boolean} 是否是页面元素。
*/
SuperMap.Util.isElement = function (o) {
return !!(o && o.nodeType === 1);
};
/**
* @description 判断一个对象是否是数组。
* @param {Object} a - 对象。
* @returns {boolean} 是否是数组。
*/
SuperMap.Util.isArray = function (a) {
return Object.prototype.toString.call(a) === '[object Array]';
};
/**
* @description 从数组中删除某一项。
* @param {Array} array - 数组。
* @param {Object} item - 数组中要删除的一项。
* @returns {Array} 执行删除操作后的数组。
*/
SuperMap.Util.removeItem = function (array, item) {
for (var i = array.length - 1; i >= 0; i--) {
if (array[i] === item) {
array.splice(i, 1); //break;more than once??
}
}
return array;
};
/**
* @description 获取某对象再数组中的索引值。
* @param {Array} array - 数组。
* @param {Object} obj - 对象。
* @returns {number} 某对象再数组中的索引值。
*/
SuperMap.Util.indexOf = function (array, obj) {
if (array == null) {
return -1;
} else {
// use the build-in function if available.
if (typeof array.indexOf === "function") {
return array.indexOf(obj);
} else {
for (var i = 0, len = array.length; i < len; i++) {
if (array[i] === obj) {
return i;
}
}
return -1;
}
}
};
/**
* @description 修改某 DOM 元素的许多属性。
* @param {HTMLElement} element - 待修改的 DOM 元素。
* @param {string} [id] - DOM 元素的 ID。
* @param {SuperMap.Pixel} [px] - 包含 DOM 元素的 style 属性的 left 和 top 属性。
* @param {SuperMap.Size} [sz] - 包含 DOM 元素的 width 和 height 属性。
* @param {string} [position] - DOM 元素的 position 属性。
* @param {string} [border] - DOM 元素的 style 属性的 border 属性。
* @param {string} [overflow] - DOM 元素的 style 属性的 overflow 属性。
* @param {number} [opacity] - 不透明度值。取值范围为(0.0 - 1.0)。
*/
SuperMap.Util.modifyDOMElement = function (element, id, px, sz, position, border, overflow, opacity) {
if (id) {
element.id = id;
}
if (px) {
element.style.left = px.x + "px";
element.style.top = px.y + "px";
}
if (sz) {
element.style.width = sz.w + "px";
element.style.height = sz.h + "px";
}
if (position) {
element.style.position = position;
}
if (border) {
element.style.border = border;
}
if (overflow) {
element.style.overflow = overflow;
}
if (parseFloat(opacity) >= 0.0 && parseFloat(opacity) < 1.0) {
element.style.filter = 'alpha(opacity=' + opacity * 100 + ')';
element.style.opacity = opacity;
} else if (parseFloat(opacity) === 1.0) {
element.style.filter = '';
element.style.opacity = '';
}
};
/**
* @description Takes an object and copies any properties that don't exist from
* another properties, by analogy with SuperMap.Util.extend() from
* Prototype.js.
*
* @param {Object} [to] - 目标对象。
* @param {Object} from - 源对象。Any properties of this object that
* are undefined in the to object will be set on the to object.
*
* @returns {Object} A reference to the to object. Note that the to argument is modified
* in place and returned by this function.
*/
SuperMap.Util.applyDefaults = function (to, from) {
to = to || {};
/*
* FF/Windows < 2.0.0.13 reports "Illegal operation on WrappedNative
* prototype object" when calling hawOwnProperty if the source object is an
* instance of window.Event.
*/
var fromIsEvt = typeof window.Event === "function" && from instanceof window.Event;
for (var key in from) {
if (to[key] === undefined || !fromIsEvt && from.hasOwnProperty && from.hasOwnProperty(key) && !to.hasOwnProperty(key)) {
to[key] = from[key];
}
}
/**
* IE doesn't include the toString property when iterating over an object's
* properties with the for(property in object) syntax. Explicitly check if
* the source has its own toString property.
*/
if (!fromIsEvt && from && from.hasOwnProperty && from.hasOwnProperty('toString') && !to.hasOwnProperty('toString')) {
to.toString = from.toString;
}
return to;
};
/**
* @description 将参数对象转换为 HTTP 的 GET 请求中的参数字符串。例如:"key1=value1&key2=value2&key3=value3"。
* @param {Object} params - 参数对象。
* @returns {string} HTTP 的 GET 请求中的参数字符串。
*/
SuperMap.Util.getParameterString = function (params) {
var paramsArray = [];
for (var key in params) {
var value = params[key];
if (value != null && typeof value !== 'function') {
var encodedValue;
if (Array.isArray(value) || value.toString() === '[object Object]') {
encodedValue = encodeURIComponent(JSON.stringify(value));
} else {
/* value is a string; simply encode */
encodedValue = encodeURIComponent(value);
}
paramsArray.push(encodeURIComponent(key) + "=" + encodedValue);
}
}
return paramsArray.join("&");
};
/**
* @description 给 URL 追加查询参数。
* @param {string} url - 待追加参数的 URL 字符串。
* @param {string} paramStr - 待追加的查询参数。
* @returns {string} 新的 URL。
*/
SuperMap.Util.urlAppend = function (url, paramStr) {
var newUrl = url;
if (paramStr) {
if (paramStr.indexOf('?') === 0) {
paramStr = paramStr.substring(1);
}
var parts = (url + " ").split(/[?&]/);
newUrl += parts.pop() === " " ? paramStr : parts.length ? "&" + paramStr : "?" + paramStr;
}
return newUrl;
};
/**
* @description 给 URL 追加 path 参数。
* @param {string} url - 待追加参数的 URL 字符串。
* @param {string} paramStr - 待追加的path参数。
* @returns {string} 新的 URL。
*/
SuperMap.Util.urlPathAppend = function (url, pathStr) {
var newUrl = url;
if (!pathStr) {
return newUrl;
}
if (pathStr.indexOf('/') === 0) {
pathStr = pathStr.substring(1);
}
var parts = url.split('?');
if (parts[0].indexOf('/', parts[0].length - 1) < 0) {
parts[0] += '/';
}
newUrl = "".concat(parts[0]).concat(pathStr).concat(parts.length > 1 ? "?".concat(parts[1]) : '');
return newUrl;
};
/**
* @description 为了避免浮点精度错误而保留的有效位数。
* @type {number}
* @default 14
*/
SuperMap.Util.DEFAULT_PRECISION = 14;
/**
* @description 将字符串以接近的精度转换为数字。
* @param {string} number - 字符串。
* @param {number} [precision=14] - 精度。
* @returns {number} 数字。
*/
SuperMap.Util.toFloat = function (number, precision) {
if (precision == null) {
precision = SuperMap.Util.DEFAULT_PRECISION;
}
if (typeof number !== "number") {
number = parseFloat(number);
}
return precision === 0 ? number : parseFloat(number.toPrecision(precision));
};
/**
* @description 角度转弧度。
* @param {number} x - 角度。
* @returns {number} 弧度。
*/
SuperMap.Util.rad = function (x) {
return x * Math.PI / 180;
};
/**
* @description 从 URL 字符串中解析出参数对象。
* @param {string} url - URL。
* @returns {Object} 解析出的参数对象。
*/
SuperMap.Util.getParameters = function (url) {
// if no url specified, take it from the location bar
url = url === null || url === undefined ? window.location.href : url; //parse out parameters portion of url string
var paramsString = "";
if (SuperMap.String.contains(url, '?')) {
var start = url.indexOf('?') + 1;
var end = SuperMap.String.contains(url, "#") ? url.indexOf('#') : url.length;
paramsString = url.substring(start, end);
}
var parameters = {};
var pairs = paramsString.split(/[&;]/);
for (var i = 0, len = pairs.length; i < len; ++i) {
var keyValue = pairs[i].split('=');
if (keyValue[0]) {
var key = keyValue[0];
try {
key = decodeURIComponent(key);
} catch (err) {
key = unescape(key);
} // being liberal by replacing "+" with " "
var value = (keyValue[1] || '').replace(/\+/g, " ");
try {
value = decodeURIComponent(value);
} catch (err) {
value = unescape(value);
} // follow OGC convention of comma delimited values
value = value.split(","); //if there's only one value, do not return as array
if (value.length == 1) {
value = value[0];
}
parameters[key] = value;
}
}
return parameters;
};
/**
* @description 不断递增计数变量,用于生成唯一 ID。
* @type {number}
* @default 0
*/
SuperMap.Util.lastSeqID = 0;
/**
* @description 创建唯一 ID 值。
* @param {string} [prefix] - 前缀。
* @returns {string} 唯一的 ID 值。
*/
SuperMap.Util.createUniqueID = function (prefix) {
if (prefix == null) {
prefix = "id_";
}
SuperMap.Util.lastSeqID += 1;
return prefix + SuperMap.Util.lastSeqID;
};
/**
* @memberOf SuperMap
* @description 每单位的英尺数。
* @type {Object}
* @constant
*/
SuperMap.INCHES_PER_UNIT = {
'inches': 1.0,
'ft': 12.0,
'mi': 63360.0,
'm': 39.3701,
'km': 39370.1,
'dd': 4374754,
'yd': 36
};
SuperMap.INCHES_PER_UNIT.in = SuperMap.INCHES_PER_UNIT.inches;
SuperMap.INCHES_PER_UNIT.degrees = SuperMap.INCHES_PER_UNIT.dd;
SuperMap.INCHES_PER_UNIT.nmi = 1852 * SuperMap.INCHES_PER_UNIT.m; // Units from CS-Map
SuperMap.METERS_PER_INCH = 0.02540005080010160020;
SuperMap.Util.extend(SuperMap.INCHES_PER_UNIT, {
"Inch": SuperMap.INCHES_PER_UNIT.inches,
"Meter": 1.0 / SuperMap.METERS_PER_INCH,
//EPSG:9001
"Foot": 0.30480060960121920243 / SuperMap.METERS_PER_INCH,
//EPSG:9003
"IFoot": 0.30480000000000000000 / SuperMap.METERS_PER_INCH,
//EPSG:9002
"ClarkeFoot": 0.3047972651151 / SuperMap.METERS_PER_INCH,
//EPSG:9005
"SearsFoot": 0.30479947153867624624 / SuperMap.METERS_PER_INCH,
//EPSG:9041
"GoldCoastFoot": 0.30479971018150881758 / SuperMap.METERS_PER_INCH,
//EPSG:9094
"IInch": 0.02540000000000000000 / SuperMap.METERS_PER_INCH,
"MicroInch": 0.00002540000000000000 / SuperMap.METERS_PER_INCH,
"Mil": 0.00000002540000000000 / SuperMap.METERS_PER_INCH,
"Centimeter": 0.01000000000000000000 / SuperMap.METERS_PER_INCH,
"Kilometer": 1000.00000000000000000000 / SuperMap.METERS_PER_INCH,
//EPSG:9036
"Yard": 0.91440182880365760731 / SuperMap.METERS_PER_INCH,
"SearsYard": 0.914398414616029 / SuperMap.METERS_PER_INCH,
//EPSG:9040
"IndianYard": 0.91439853074444079983 / SuperMap.METERS_PER_INCH,
//EPSG:9084
"IndianYd37": 0.91439523 / SuperMap.METERS_PER_INCH,
//EPSG:9085
"IndianYd62": 0.9143988 / SuperMap.METERS_PER_INCH,
//EPSG:9086
"IndianYd75": 0.9143985 / SuperMap.METERS_PER_INCH,
//EPSG:9087
"IndianFoot": 0.30479951 / SuperMap.METERS_PER_INCH,
//EPSG:9080
"IndianFt37": 0.30479841 / SuperMap.METERS_PER_INCH,
//EPSG:9081
"IndianFt62": 0.3047996 / SuperMap.METERS_PER_INCH,
//EPSG:9082
"IndianFt75": 0.3047995 / SuperMap.METERS_PER_INCH,
//EPSG:9083
"Mile": 1609.34721869443738887477 / SuperMap.METERS_PER_INCH,
"IYard": 0.91440000000000000000 / SuperMap.METERS_PER_INCH,
//EPSG:9096
"IMile": 1609.34400000000000000000 / SuperMap.METERS_PER_INCH,
//EPSG:9093
"NautM": 1852.00000000000000000000 / SuperMap.METERS_PER_INCH,
//EPSG:9030
"Lat-66": 110943.316488932731 / SuperMap.METERS_PER_INCH,
"Lat-83": 110946.25736872234125 / SuperMap.METERS_PER_INCH,
"Decimeter": 0.10000000000000000000 / SuperMap.METERS_PER_INCH,
"Millimeter": 0.00100000000000000000 / SuperMap.METERS_PER_INCH,
"Dekameter": 10.00000000000000000000 / SuperMap.METERS_PER_INCH,
"Decameter": 10.00000000000000000000 / SuperMap.METERS_PER_INCH,
"Hectometer": 100.00000000000000000000 / SuperMap.METERS_PER_INCH,
"GermanMeter": 1.0000135965 / SuperMap.METERS_PER_INCH,
//EPSG:9031
"CaGrid": 0.999738 / SuperMap.METERS_PER_INCH,
"ClarkeChain": 20.1166194976 / SuperMap.METERS_PER_INCH,
//EPSG:9038
"GunterChain": 20.11684023368047 / SuperMap.METERS_PER_INCH,
//EPSG:9033
"BenoitChain": 20.116782494375872 / SuperMap.METERS_PER_INCH,
//EPSG:9062
"SearsChain": 20.11676512155 / SuperMap.METERS_PER_INCH,
//EPSG:9042
"ClarkeLink": 0.201166194976 / SuperMap.METERS_PER_INCH,
//EPSG:9039
"GunterLink": 0.2011684023368047 / SuperMap.METERS_PER_INCH,
//EPSG:9034
"BenoitLink": 0.20116782494375872 / SuperMap.METERS_PER_INCH,
//EPSG:9063
"SearsLink": 0.2011676512155 / SuperMap.METERS_PER_INCH,
//EPSG:9043
"Rod": 5.02921005842012 / SuperMap.METERS_PER_INCH,
"IntnlChain": 20.1168 / SuperMap.METERS_PER_INCH,
//EPSG:9097
"IntnlLink": 0.201168 / SuperMap.METERS_PER_INCH,
//EPSG:9098
"Perch": 5.02921005842012 / SuperMap.METERS_PER_INCH,
"Pole": 5.02921005842012 / SuperMap.METERS_PER_INCH,
"Furlong": 201.1684023368046 / SuperMap.METERS_PER_INCH,
"Rood": 3.778266898 / SuperMap.METERS_PER_INCH,
"CapeFoot": 0.3047972615 / SuperMap.METERS_PER_INCH,
"Brealey": 375.00000000000000000000 / SuperMap.METERS_PER_INCH,
"ModAmFt": 0.304812252984505969011938 / SuperMap.METERS_PER_INCH,
"Fathom": 1.8288 / SuperMap.METERS_PER_INCH,
"NautM-UK": 1853.184 / SuperMap.METERS_PER_INCH,
"50kilometers": 50000.0 / SuperMap.METERS_PER_INCH,
"150kilometers": 150000.0 / SuperMap.METERS_PER_INCH
}); //unit abbreviations supported by PROJ.4
SuperMap.Util.extend(SuperMap.INCHES_PER_UNIT, {
"mm": SuperMap.INCHES_PER_UNIT.Meter / 1000.0,
"cm": SuperMap.INCHES_PER_UNIT.Meter / 100.0,
"dm": SuperMap.INCHES_PER_UNIT.Meter * 100.0,
"km": SuperMap.INCHES_PER_UNIT.Meter * 1000.0,
"kmi": SuperMap.INCHES_PER_UNIT.nmi,
//International Nautical Mile
"fath": SuperMap.INCHES_PER_UNIT.Fathom,
//International Fathom
"ch": SuperMap.INCHES_PER_UNIT.IntnlChain,
//International Chain
"link": SuperMap.INCHES_PER_UNIT.IntnlLink,
//International Link
"us-in": SuperMap.INCHES_PER_UNIT.inches,
//U.S. Surveyor's Inch
"us-ft": SuperMap.INCHES_PER_UNIT.Foot,
//U.S. Surveyor's Foot
"us-yd": SuperMap.INCHES_PER_UNIT.Yard,
//U.S. Surveyor's Yard
"us-ch": SuperMap.INCHES_PER_UNIT.GunterChain,
//U.S. Surveyor's Chain
"us-mi": SuperMap.INCHES_PER_UNIT.Mile,
//U.S. Surveyor's Statute Mile
"ind-yd": SuperMap.INCHES_PER_UNIT.IndianYd37,
//Indian Yard
"ind-ft": SuperMap.INCHES_PER_UNIT.IndianFt37,
//Indian Foot
"ind-ch": 20.11669506 / SuperMap.METERS_PER_INCH //Indian Chain
});
/**
* @memberOf SuperMap
* @member [SuperMap.DOTS_PER_INCH=96]
* @description 分辨率与比例尺之间转换的常量。
* @type {Object}
*/
SuperMap.DOTS_PER_INCH = 96;
/**
* @param {number} scale - 比例尺。
* @returns {number} 返回正常的 scale 值。
*/
SuperMap.Util.normalizeScale = function (scale) {
var normScale = scale > 1.0 ? 1.0 / scale : scale;
return normScale;
};
/**
* @description 比例尺转分辨率。
* @param {number} scale - 比例尺。
* @param {string} [units='degrees'] - 比例尺单位。
* @returns {number} 分辨率。
*/
SuperMap.Util.getResolutionFromScale = function (scale, units) {
var resolution;
if (scale) {
if (units == null) {
units = "degrees";
}
var normScale = SuperMap.Util.normalizeScale(scale);
resolution = 1 / (normScale * SuperMap.INCHES_PER_UNIT[units] * SuperMap.DOTS_PER_INCH);
}
return resolution;
};
/**
* @description 分辨率转比例尺。
* @param {number} resolution - 分辨率。
* @param {string} [units='degrees'] - 分辨率单位。
* @returns {number} 比例尺。
*/
SuperMap.Util.getScaleFromResolution = function (resolution, units) {
if (units == null) {
units = "degrees";
}
var scale = resolution * SuperMap.INCHES_PER_UNIT[units] * SuperMap.DOTS_PER_INCH;
return scale;
};
/**
* @memberOf SuperMap
* @description 如果 userAgent 捕获到浏览器使用的是 Gecko 引擎则返回 true。
* @constant
*/
SuperMap.IS_GECKO = function () {
var ua = navigator.userAgent.toLowerCase();
return ua.indexOf("webkit") === -1 && ua.indexOf("gecko") !== -1;
}();
/**
* @memberOf SuperMap
* @description 浏览器名称,依赖于 userAgent 属性,BROWSER_NAME 可以是空,或者以下浏览器:
* * "opera" -- Opera
* * "msie" -- Internet Explorer
* * "safari" -- Safari
* * "firefox" -- Firefox
* * "mozilla" -- Mozilla
* @constant
*/
SuperMap.Browser = function () {
var name = '',
version = '',
device = 'pc',
uaMatch; //以下进行测试
var ua = navigator.userAgent.toLowerCase();
if (ua.indexOf("msie") > -1 || ua.indexOf("trident") > -1 && ua.indexOf("rv") > -1) {
name = 'msie';
uaMatch = ua.match(/msie ([\d.]+)/) || ua.match(/rv:([\d.]+)/);
} else if (ua.indexOf("chrome") > -1) {
name = 'chrome';
uaMatch = ua.match(/chrome\/([\d.]+)/);
} else if (ua.indexOf("firefox") > -1) {
name = 'firefox';
uaMatch = ua.match(/firefox\/([\d.]+)/);
} else if (ua.indexOf("opera") > -1) {
name = 'opera';
uaMatch = ua.match(/version\/([\d.]+)/);
} else if (ua.indexOf("safari") > -1) {
name = 'safari';
uaMatch = ua.match(/version\/([\d.]+)/);
}
version = uaMatch ? uaMatch[1] : '';
if (ua.indexOf("ipad") > -1 || ua.indexOf("ipod") > -1 || ua.indexOf("iphone") > -1) {
device = 'apple';
} else if (ua.indexOf("android") > -1) {
uaMatch = ua.match(/version\/([\d.]+)/);
version = uaMatch ? uaMatch[1] : '';
device = 'android';
}
return {
name: name,
version: version,
device: device
};
}();
/**
* @description 获取浏览器相关信息。支持的浏览器包括:Opera,Internet Explorer,Safari,Firefox。
* @returns {Object} 获取浏览器名称、版本、设备名称。对应的属性分别为 name, version, device。
*/
SuperMap.Util.getBrowser = function () {
return SuperMap.Browser;
};
/**
* @description 浏览器是否支持 Canvas。
* @returns {boolean} 获取当前浏览器是否支持 HTML5 Canvas。
*/
SuperMap.Util.isSupportCanvas = function () {
var checkRes = true,
broz = SuperMap.Util.getBrowser();
if (document.createElement("canvas").getContext) {
if (broz.name === 'firefox' && parseFloat(broz.version) < 5) {
checkRes = false;
}
if (broz.name === 'safari' && parseFloat(broz.version) < 4) {
checkRes = false;
}
if (broz.name === 'opera' && parseFloat(broz.version) < 10) {
checkRes = false;
}
if (broz.name === 'msie' && parseFloat(broz.version) < 9) {
checkRes = false;
}
} else {
checkRes = false;
}
return checkRes;
}();
/**
* @description 判断;浏览器是否支持 Canvas。
* @returns {boolean} 获取当前浏览器是否支持 HTML5 Canvas 。
*/
SuperMap.Util.supportCanvas = function () {
return SuperMap.Util.isSupportCanvas;
}; //将服务端的地图单位转成SuperMap的地图单位
SuperMap.INCHES_PER_UNIT.degree = SuperMap.INCHES_PER_UNIT.dd;
SuperMap.INCHES_PER_UNIT.meter = SuperMap.INCHES_PER_UNIT.m;
SuperMap.INCHES_PER_UNIT.foot = SuperMap.INCHES_PER_UNIT.ft;
SuperMap.INCHES_PER_UNIT.inch = SuperMap.INCHES_PER_UNIT.inches;
SuperMap.INCHES_PER_UNIT.mile = SuperMap.INCHES_PER_UNIT.mi;
SuperMap.INCHES_PER_UNIT.kilometer = SuperMap.INCHES_PER_UNIT.km;
SuperMap.INCHES_PER_UNIT.yard = SuperMap.INCHES_PER_UNIT.yd;
/**
* @description 判断一个 URL 请求是否在当前域中。
* @param {string} url - URL 请求字符串。
* @returns {boolean} URL 请求是否在当前域中。
*/
SuperMap.Util.isInTheSameDomain = function (url) {
if (!url) {
return true;
}
var index = url.indexOf("//");
var documentUrl = document.location.toString();
var documentIndex = documentUrl.indexOf("//");
if (index === -1) {
return true;
} else {
var protocol;
var substring = protocol = url.substring(0, index);
var documentSubString = documentUrl.substring(documentIndex + 2);
documentIndex = documentSubString.indexOf("/");
var documentPortIndex = documentSubString.indexOf(":");
var documentDomainWithPort = documentSubString.substring(0, documentIndex); //var documentPort;
var documentprotocol = document.location.protocol;
if (documentPortIndex !== -1) {// documentPort = +documentSubString.substring(documentPortIndex, documentIndex);
} else {
documentDomainWithPort += ':' + (documentprotocol.toLowerCase() === 'http:' ? 80 : 443);
}
if (documentprotocol.toLowerCase() !== substring.toLowerCase()) {
return false;
}
substring = url.substring(index + 2);
var portIndex = substring.indexOf(":");
index = substring.indexOf("/");
var domainWithPort = substring.substring(0, index);
var domain;
if (portIndex !== -1) {
domain = substring.substring(0, portIndex);
} else {
domain = substring.substring(0, index);
domainWithPort += ':' + (protocol.toLowerCase() === 'http:' ? 80 : 443);
}
var documentDomain = document.domain;
if (domain === documentDomain && domainWithPort === documentDomainWithPort) {
return true;
}
}
return false;
};
/**
* @description 计算 iServer 服务的 REST 图层的显示分辨率,需要从 iServer 的 REST 图层表述中获取 viewBounds、viewer、scale、coordUnit、datumAxis 五个参数,来进行计算。
* @param {SuperMap.Bounds} viewBounds - 地图的参照可视范围,即地图初始化时默认的地图显示范围。
* @param {SuperMap.Size} viewer - 地图初始化时默认的地图图片的尺寸。
* @param {number} scale - 地图初始化时默认的显示比例尺。
* @param {string} [coordUnit='degrees'] - 投影坐标系统的地图单位。
* @param {number} [datumAxis=6378137] - 地理坐标系统椭球体长半轴。用户自定义地图的 Options 时,若未指定该参数的值,则系统默认为 WGS84 参考系的椭球体长半轴 6378137。
* @returns {number} 返回图层显示分辨率。
*/
SuperMap.Util.calculateDpi = function (viewBounds, viewer, scale, coordUnit, datumAxis) {
//10000 是 0.1毫米与米的转换。DPI的计算公式:Viewer / DPI * 0.0254 * 10000 = ViewBounds * scale ,公式中的10000是为了提高计算结果的精度,以下出现的ratio皆为如此。
if (!viewBounds || !viewer || !scale) {
return;
}
var ratio = 10000,
rvbWidth = viewBounds.getWidth(),
rvbHeight = viewBounds.getHeight(),
rvWidth = viewer.w,
rvHeight = viewer.h; //用户自定义地图的Options时,若未指定该参数的值,则系统默认为6378137米,即WGS84参考系的椭球体长半轴。
datumAxis = datumAxis || 6378137;
coordUnit = coordUnit || "degrees";
var dpi;
if (coordUnit.toLowerCase() === "degree" || coordUnit.toLowerCase() === "degrees" || coordUnit.toLowerCase() === "dd") {
var num1 = rvbWidth / rvWidth,
num2 = rvbHeight / rvHeight,
resolution = num1 > num2 ? num1 : num2;
dpi = 0.0254 * ratio / resolution / scale / (Math.PI * 2 * datumAxis / 360) / ratio;
} else {
var _resolution = rvbWidth / rvWidth;
dpi = 0.0254 * ratio / _resolution / scale / ratio;
}
return dpi;
};
/**
* @description 将对象转换成 JSON 字符串。
* @param {Object} obj - 要转换成 JSON 的 Object 对象。
* @returns {string} 返回转换后的 JSON 对象。
*/
SuperMap.Util.toJSON = function (obj) {
var objInn = obj;
if (objInn == null) {
return null;
}
switch (objInn.constructor) {
case String:
//s = "'" + str.replace(/(["\\])/g, "\\$1") + "'"; string含有单引号出错
objInn = '"' + objInn.replace(/(["\\])/g, '\\$1') + '"';
objInn = objInn.replace(/\n/g, "\\n");
objInn = objInn.replace(/\r/g, "\\r");
objInn = objInn.replace("<", "<");
objInn = objInn.replace(">", ">");
objInn = objInn.replace(/%/g, "%25");
objInn = objInn.replace(/&/g, "%26");
return objInn;
case Array:
var arr = [];
for (var i = 0, len = objInn.length; i < len; i++) {
arr.push(SuperMap.Util.toJSON(objInn[i]));
}
return "[" + arr.join(",") + "]";
case Number:
return isFinite(objInn) ? String(objInn) : null;
case Boolean:
return String(objInn);
case Date:
var dateStr = "{" + "'__type':\"System.DateTime\"," + "'Year':" + objInn.getFullYear() + "," + "'Month':" + (objInn.getMonth() + 1) + "," + "'Day':" + objInn.getDate() + "," + "'Hour':" + objInn.getHours() + "," + "'Minute':" + objInn.getMinutes() + "," + "'Second':" + objInn.getSeconds() + "," + "'Millisecond':" + objInn.getMilliseconds() + "," + "'TimezoneOffset':" + objInn.getTimezoneOffset() + "}";
return dateStr;
default:
if (objInn["toJSON"] != null && typeof objInn["toJSON"] === "function") {
return objInn.toJSON();
}
if (Util_typeof(objInn) === "object") {
if (objInn.length) {
var _arr2 = [];
for (var _i = 0, _len = objInn.length; _i < _len; _i++) {
_arr2.push(SuperMap.Util.toJSON(objInn[_i]));
}
return "[" + _arr2.join(",") + "]";
}
var _arr = [];
for (var attr in objInn) {
//为解决SuperMap.Geometry类型头json时堆栈溢出的问题,attr == "parent"时不进行json转换
if (typeof objInn[attr] !== "function" && attr !== "CLASS_NAME" && attr !== "parent") {
_arr.push("'" + attr + "':" + SuperMap.Util.toJSON(objInn[attr]));
}
}
if (_arr.length > 0) {
return "{" + _arr.join(",") + "}";
} else {
return "{}";
}
}
return objInn.toString();
}
};
/**
* @description 根据比例尺和 dpi 计算屏幕分辨率。
* @param {number} scale - 比例尺。
* @param {number} dpi - 图像分辨率,表示每英寸内的像素个数。
* @param {string} [coordUnit] - 投影坐标系统的地图单位。
* @param {number} [datumAxis=6378137] - 地理坐标系统椭球体长半轴。用户自定义地图的 Options 时,若未指定该参数的值,则 DPI 默认按照 WGS84 参考系的椭球体长半轴 6378137 来计算。
* @returns {number} 返回当前比例尺下的屏幕分辨率。
*/
SuperMap.Util.getResolutionFromScaleDpi = function (scale, dpi, coordUnit, datumAxis) {
var resolution = null,
ratio = 10000; //用户自定义地图的Options时,若未指定该参数的值,则系统默认为6378137米,即WGS84参考系的椭球体长半轴。
datumAxis = datumAxis || 6378137;
coordUnit = coordUnit || "";
if (scale > 0 && dpi > 0) {
scale = SuperMap.Util.normalizeScale(scale);
if (coordUnit.toLowerCase() === "degree" || coordUnit.toLowerCase() === "degrees" || coordUnit.toLowerCase() === "dd") {
//scale = SuperMap.Util.normalizeScale(scale);
resolution = 0.0254 * ratio / dpi / scale / (Math.PI * 2 * datumAxis / 360) / ratio;
return resolution;
} else {
resolution = 0.0254 * ratio / dpi / scale / ratio;
return resolution;
}
}
return -1;
};
/**
* @description 根据 resolution、dpi、coordUnit 和 datumAxis 计算比例尺。
* @param {number} resolution - 用于计算比例尺的地图分辨率。
* @param {number} dpi - 图像分辨率,表示每英寸内的像素个数。
* @param {string} [coordUnit] - 投影坐标系统的地图单位。
* @param {number} [datumAxis=6378137] - 地理坐标系统椭球体长半轴。用户自定义地图的 Options 时,若未指定该参数的值,则 DPI 默认按照 WGS84 参考系的椭球体长半轴 6378137 来计算。
* @returns {number} 返回当前屏幕分辨率下的比例尺。
*/
SuperMap.Util.getScaleFromResolutionDpi = function (resolution, dpi, coordUnit, datumAxis) {
var scale = null,
ratio = 10000; //用户自定义地图的Options时,若未指定该参数的值,则系统默认为6378137米,即WGS84参考系的椭球体长半轴。
datumAxis = datumAxis || 6378137;
coordUnit = coordUnit || "";
if (resolution > 0 && dpi > 0) {
if (coordUnit.toLowerCase() === "degree" || coordUnit.toLowerCase() === "degrees" || coordUnit.toLowerCase() === "dd") {
scale = 0.0254 * ratio / dpi / resolution / (Math.PI * 2 * datumAxis / 360) / ratio;
return scale;
} else {
scale = 0.0254 * ratio / dpi / resolution / ratio;
return scale;
}
}
return -1;
};
/**
* @description 转换查询结果。
* @param {Object} result - 查询结果。
* @returns {Object} 转换后的查询结果。
*/
SuperMap.Util.transformResult = function (result) {
if (result.responseText && typeof result.responseText === "string") {
result = JSON.parse(result.responseText);
}
return result;
};
/**
* @description 属性拷贝,不拷贝方法类名(CLASS_NAME)等。
* @param {Object} [destination] - 拷贝目标。
* @param {Object} source - 源对象。
*
*/
SuperMap.Util.copyAttributes = function (destination, source) {
destination = destination || {};
if (source) {
for (var property in source) {
var value = source[property];
if (value !== undefined && property !== "CLASS_NAME" && typeof value !== "function") {
destination[property] = value;
}
}
}
return destination;
};
/**
* @description 将源对象上的属性拷贝到目标对象上。(不拷贝 CLASS_NAME 和方法)
* @param {Object} [destination] - 目标对象。
* @param {Object} source - 源对象。
* @param {Array.} clip - 源对象中禁止拷贝到目标对象的属性,目的是防止目标对象上不可修改的属性被篡改。
*
*/
SuperMap.Util.copyAttributesWithClip = function (destination, source, clip) {
destination = destination || {};
if (source) {
for (var property in source) {
//去掉禁止拷贝的属性
var isInClip = false;
if (clip && clip.length) {
for (var i = 0, len = clip.length; i < len; i++) {
if (property === clip[i]) {
isInClip = true;
break;
}
}
}
if (isInClip === true) {
continue;
}
var value = source[property];
if (value !== undefined && property !== "CLASS_NAME" && typeof value !== "function") {
destination[property] = value;
}
}
}
return destination;
};
/**
* @description 克隆一个 Object 对象
* @param {Object} obj - 需要克隆的对象。
* @returns {Object} 返回对象的拷贝对象,注意是新的对象,不是指向。
*/
SuperMap.Util.cloneObject = function (obj) {
// Handle the 3 simple types, and null or undefined
if (null === obj || "object" !== Util_typeof(obj)) {
return obj;
} // Handle Date
if (obj instanceof Date) {
var copy = new Date();
copy.setTime(obj.getTime());
return copy;
} // Handle Array
if (obj instanceof Array) {
var _copy = obj.slice(0);
return _copy;
} // Handle Object
if (obj instanceof Object) {
var _copy2 = {};
for (var attr in obj) {
if (obj.hasOwnProperty(attr)) {
_copy2[attr] = SuperMap.Util.cloneObject(obj[attr]);
}
}
return _copy2;
}
throw new Error("Unable to copy obj! Its type isn't supported.");
};
/**
* @description 判断两条线段是不是有交点。
* @param {SuperMap.Geometry.Point} a1 - 第一条线段的起始节点。
* @param {SuperMap.Geometry.Point} a2 - 第一条线段的结束节点。
* @param {SuperMap.Geometry.Point} b1 - 第二条线段的起始节点。
* @param {SuperMap.Geometry.Point} b2 - 第二条线段的结束节点。
* @returns {Object} 如果相交返回交点,如果不相交返回两条线段的位置关系。
*/
SuperMap.Util.lineIntersection = function (a1, a2, b1, b2) {
var intersectValue = null;
var k1;
var k2;
var b = (b2.x - b1.x) * (a1.y - b1.y) - (b2.y - b1.y) * (a1.x - b1.x);
var a = (a2.x - a1.x) * (a1.y - b1.y) - (a2.y - a1.y) * (a1.x - b1.x);
var ab = (b2.y - b1.y) * (a2.x - a1.x) - (b2.x - b1.x) * (a2.y - a1.y); //ab==0代表两条线断的斜率一样
if (ab != 0) {
k1 = b / ab;
k2 = a / ab;
if (k1 >= 0 && k2 <= 1 && k1 <= 1 && k2 >= 0) {
intersectValue = new SuperMap.Geometry.Point(a1.x + k1 * (a2.x - a1.x), a1.y + k1 * (a2.y - a1.y));
} else {
intersectValue = "No Intersection";
}
} else {
if (b == 0 && a == 0) {
var maxy = Math.max(a1.y, a2.y);
var miny = Math.min(a1.y, a2.y);
var maxx = Math.max(a1.x, a2.x);
var minx = Math.min(a1.x, a2.x);
if ((b1.y >= miny && b1.y <= maxy || b2.y >= miny && b2.y <= maxy) && b1.x >= minx && b1.x <= maxx || b2.x >= minx && b2.x <= maxx) {
intersectValue = "Coincident"; //重合
} else {
intersectValue = "Parallel"; //平行
}
} else {
intersectValue = "Parallel"; //平行
}
}
return intersectValue;
};
/**
* @description 获取文本外接矩形宽度与高度。
* @param {SuperMap.ThemeStyle} style - 文本样式。
* @param {string} text - 文本内容。
* @param {Object} element - DOM 元素。
* @returns {Object} 返回裁剪后的宽度,高度信息。
*/
SuperMap.Util.getTextBounds = function (style, text, element) {
document.body.appendChild(element);
element.style.width = 'auto';
element.style.height = 'auto';
if (style.fontSize) {
element.style.fontSize = style.fontSize;
}
if (style.fontFamily) {
element.style.fontFamily = style.fontFamily;
}
if (style.fontWeight) {
element.style.fontWeight = style.fontWeight;
}
element.style.position = 'relative';
element.style.visibility = 'hidden'; //fix 在某些情况下,element内的文本变成竖起排列,导致宽度计算不正确的bug
element.style.display = 'inline-block';
element.innerHTML = text;
var textWidth = element.clientWidth;
var textHeight = element.clientHeight;
document.body.removeChild(element);
return {
textWidth: textWidth,
textHeight: textHeight
};
};
;// CONCATENATED MODULE: ./src/common/commontypes/LonLat.js
function LonLat_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function LonLat_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
function LonLat_createClass(Constructor, protoProps, staticProps) { if (protoProps) LonLat_defineProperties(Constructor.prototype, protoProps); if (staticProps) LonLat_defineProperties(Constructor, staticProps); return Constructor; }
/* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
* This program are made available under the terms of the Apache License, Version 2.0
* which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
/**
* @class SuperMap.LonLat
* @category BaseTypes Geometry
* @classdesc 这个类用来表示经度和纬度对。
* @param {number} [lon=0.0] - 地图单位上的 X 轴坐标,如果地图是地理投影,则此值是经度,否则,此值是地图地理位置的 x 坐标。
* @param {number} [lat=0.0] - 地图单位上的 Y 轴坐标,如果地图是地理投影,则此值是纬度,否则,此值是地图地理位置的 y 坐标。
* @param {Array.} [location] - 如果要同时设置,则使用传入横纵坐标组成的数组。
* @example
* var lonLat = new SuperMap.LonLat(30,45);
*/
var LonLat = /*#__PURE__*/function () {
function LonLat(lon, lat) {
LonLat_classCallCheck(this, LonLat);
if (Util.isArray(lon)) {
lat = lon[1];
lon = lon[0];
}
/**
* @member {float} [SuperMap.LonLat.prototype.lon=0.0]
* @description 地图的单位的 X 轴(横轴)坐标。
*/
this.lon = lon ? Util.toFloat(lon) : 0.0;
/**
* @member {float} [SuperMap.LonLat.prototype.lat=0.0]
* @description 地图的单位的 Y 轴(纵轴)坐标。
*/
this.lat = lat ? Util.toFloat(lat) : 0.0;
this.CLASS_NAME = "SuperMap.LonLat";
}
/**
* @function SuperMap.LonLat.prototype.toString
* @description 返回此对象的字符串形式
* @example
* var lonLat = new SuperMap.LonLat(100,50);
* var str = lonLat.toString();
* @returns {string} 例如: "lon=100,lat=50"
*/
LonLat_createClass(LonLat, [{
key: "toString",
value: function toString() {
return "lon=" + this.lon + ",lat=" + this.lat;
}
/**
* @function SuperMap.LonLat.prototype.toShortString
* @description 将经度纬度转换成简单字符串。
* @example
* var lonLat = new SuperMap.LonLat(100,50);
* var str = lonLat.toShortString();
* @returns {string} 返回处理后的经纬度字符串。例如:"100,50"
*/
}, {
key: "toShortString",
value: function toShortString() {
return this.lon + "," + this.lat;
}
/**
* @function SuperMap.LonLat.prototype.clone
* @description 复制坐标对象,并返回复制后的新对象。
* @example
* var lonLat1 = new SuperMap.LonLat(100,50);
* var lonLat2 = lonLat1.clone();
* @returns {SuperMap.LonLat} 返回相同坐标值的新的坐标对象。
*/
}, {
key: "clone",
value: function clone() {
return new LonLat(this.lon, this.lat);
}
/**
* @function SuperMap.LonLat.prototype.add
* @description 在已有坐标对象的经纬度基础上加上新的坐标经纬度,并返回新的坐标对象。
* @example
* var lonLat1 = new SuperMap.LonLat(100,50);
* //lonLat2 是新的对象
* var lonLat2 = lonLat1.add(100,50);
* @param {float} lon - 传入的经度参数。
* @param {float} lat - 传入的纬度参数。
* @returns {SuperMap.LonLat} 返回一个新的 LonLat 对象,此对象的经纬度是由传入的经纬度与当前的经纬度相加所得。
*/
}, {
key: "add",
value: function add(lon, lat) {
if (lon == null || lat == null) {
throw new TypeError('LonLat.add cannot receive null values');
}
return new LonLat(this.lon + Util.toFloat(lon), this.lat + Util.toFloat(lat));
}
/**
* @function SuperMap.LonLat.prototype.equals
* @description 判断两个坐标对象是否相等。
* @example
* var lonLat1 = new SuperMap.LonLat(100,50);
* var lonLat2 = new SuperMap.LonLat(100,50);
* var isEquals = lonLat1.equals(lonLat2);
* @param {SuperMap.LonLat} ll - 需要进行比较的坐标对象。
* @returns {boolean} 如果LonLat对象的经纬度和传入的经纬度一致则返回true,不一
* 致或传入的ll参数为NULL则返回false。
*/
}, {
key: "equals",
value: function equals(ll) {
var equals = false;
if (ll != null) {
equals = this.lon === ll.lon && this.lat === ll.lat || isNaN(this.lon) && isNaN(this.lat) && isNaN(ll.lon) && isNaN(ll.lat);
}
return equals;
}
/**
* @function SuperMap.LonLat.prototype.wrapDateLine
* @description 通过传入的范围对象对坐标对象转换到该范围内。
* 如果经度小于给定范围最小精度,则在原经度基础上加上范围宽度,直到精度在范围内为止,如果经度大于给定范围则在原经度基础上减去范围宽度。
* 即指将不在经度范围内的坐标转换到范围以内(只会转换 lon,不会转换 lat,主要用于转移到日界线以内)。
* @example
* var lonLat1 = new SuperMap.LonLat(420,50);
* var lonLat2 = lonLat1.wrapDateLine(
* new SuperMap.Bounds(-180,-90,180,90)
* );
* @param {SuperMap.Bounds} maxExtent - 最大边界的范围。
* @returns {SuperMap.LonLat} 将坐标转换到范围对象以内,并返回新的坐标。
*/
}, {
key: "wrapDateLine",
value: function wrapDateLine(maxExtent) {
var newLonLat = this.clone();
if (maxExtent) {
//shift right?
while (newLonLat.lon < maxExtent.left) {
newLonLat.lon += maxExtent.getWidth();
} //shift left?
while (newLonLat.lon > maxExtent.right) {
newLonLat.lon -= maxExtent.getWidth();
}
}
return newLonLat;
}
/**
*
* @function SuperMap.LonLat.prototype.destroy
* @description 销毁此对象。
* 销毁后此对象的所有属性为 null,而不是初始值。
* @example
* var lonLat = new SuperMap.LonLat(100,50);
* lonLat.destroy();
*/
}, {
key: "destroy",
value: function destroy() {
this.lon = null;
this.lat = null;
}
/**
* @function SuperMap.LonLat.fromString
* @description 通过字符串生成一个 {@link SuperMap.LonLat} 对象。
* @example
* var str = "100,50";
* var lonLat = SuperMap.LonLat.fromString(str);
* @param {string} str - 字符串的格式:Lon+","+Lat。如:"100,50"。
* @returns {SuperMap.LonLat} 返回一个 {@link SuperMap.LonLat} 对象。
*/
}], [{
key: "fromString",
value: function fromString(str) {
var pair = str.split(",");
return new LonLat(pair[0], pair[1]);
}
/**
* @function SuperMap.LonLat.fromArray
* @description 通过数组生成一个 对象。
* @param {Array.} arr - 数组的格式,长度只能为2,:[Lon,Lat]。如:[5,-42]。
* @returns {SuperMap.LonLat} 返回一个 对象。
*/
}, {
key: "fromArray",
value: function fromArray(arr) {
var gotArr = Util.isArray(arr),
lon = gotArr && arr[0],
lat = gotArr && arr[1];
return new LonLat(lon, lat);
}
}]);
return LonLat;
}();
;// CONCATENATED MODULE: ./src/common/commontypes/Bounds.js
function Bounds_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function Bounds_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
function Bounds_createClass(Constructor, protoProps, staticProps) { if (protoProps) Bounds_defineProperties(Constructor.prototype, protoProps); if (staticProps) Bounds_defineProperties(Constructor, staticProps); return Constructor; }
/* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
* This program are made available under the terms of the Apache License, Version 2.0
* which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
/**
* @class SuperMap.Bounds
* @category BaseTypes Geometry
* @classdesc 表示边界类实例。使用 bounds 之前需要设置 left,bottom,right,top 四个属性,这些属性的初始值为 null。
* @param {number} [left] - 左边界,注意考虑宽度,理论上小于 right 值。
* @param {number} [bottom] - 下边界。考虑高度,理论上小于 top 值。
* @param {number} [right] - 右边界。
* @param {number} [top] - 上边界。
* @param {Array.} [array] - [left, bottom, right, top],如果同时传多个参数,则使用左下右上组成的数组。
* @example
* var bounds = new SuperMap.Bounds();
* bounds.extend(new SuperMap.LonLat(4,5));
* bounds.extend(new SuperMap.LonLat(5,6));
* bounds.toBBOX(); // returns 4,5,5,6
*/
var Bounds = /*#__PURE__*/function () {
function Bounds(left, bottom, right, top) {
Bounds_classCallCheck(this, Bounds);
if (Util.isArray(left)) {
top = left[3];
right = left[2];
bottom = left[1];
left = left[0];
}
/**
* @member {number} SuperMap.Bounds.prototype.left
* @description 最小的水平坐标系。
*/
this.left = left != null ? Util.toFloat(left) : this.left;
/**
* @member {number} SuperMap.Bounds.prototype.bottom
* @description 最小的垂直坐标系。
*/
this.bottom = bottom != null ? Util.toFloat(bottom) : this.bottom;
/**
* @member {number} SuperMap.Bounds.prototype.right
* @description 最大的水平坐标系。
*/
this.right = right != null ? Util.toFloat(right) : this.right;
/**
* @member {number} SuperMap.Bounds.prototype.top
* @description 最大的垂直坐标系。
*/
this.top = top != null ? Util.toFloat(top) : this.top;
/**
* @member {SuperMap.LonLat} SuperMap.Bounds.prototype.centerLonLat
* @description bounds 的地图空间的中心点。用 getCenterLonLat() 获得。
*/
this.centerLonLat = null;
this.CLASS_NAME = "SuperMap.Bounds";
}
/**
* @function SuperMap.Bounds.prototype.clone
* @description 复制当前 bounds 对象。
* @example
* var bounds1 = new SuperMap.Bounds(-180,-90,180,90);
* var bounds2 = bounds1.clone();
* @returns {SuperMap.Bounds} 返回一个克隆的 bounds。
*/
Bounds_createClass(Bounds, [{
key: "clone",
value: function clone() {
return new Bounds(this.left, this.bottom, this.right, this.top);
}
/**
* @function SuperMap.Bounds.prototype.equals
* @description 判断两个 bounds 对象是否相等。
* @example
* var bounds1 = new SuperMap.Bounds(-180,-90,180,90);
* var bounds2 = new SuperMap.Bounds(-180,-90,180,90);
* var isEquals = bounds1.equals(bounds2);
* @param {SuperMap.Bounds} bounds - 需要进行计较的 bounds。
* @returns {boolean} 如果 bounds 对象的边和传入的 bounds 一致则返回 true,不一致或传入的 bounds 参数为 NULL 则返回 false。
*/
}, {
key: "equals",
value: function equals(bounds) {
var equals = false;
if (bounds != null) {
equals = this.left === bounds.left && this.right === bounds.right && this.top === bounds.top && this.bottom === bounds.bottom;
}
return equals;
}
/**
* @function SuperMap.Bounds.prototype.toString
* @description 返回此对象的字符串形式。
* @example
* var bounds = new SuperMap.Bounds(-180,-90,180,90);
* var str = bounds.toString();
* @returns {string} 边界对象的字符串表示形式(left,bottom,right,top),例如: "-180,-90,180,90"。
*/
}, {
key: "toString",
value: function toString() {
return [this.left, this.bottom, this.right, this.top].join(",");
}
/**
* @function SuperMap.Bounds.prototype.toArray
* @description 边界对象的数组表示形式。
* @example
* var bounds = new SuperMap.Bounds(-180,-90,100,80);
* //array1 = [-180,-90,100,80];
* var array1 = bounds.toArray();
* //array1 = [-90,-180,80,100];
* var array2 = bounds.toArray(true);
* @param {boolean} [reverseAxisOrder=false] - 是否反转轴顺序。
* 如果设为 true,则倒转顺序(bottom,left,top,right),否则按正常轴顺序(left,bottom,right,top)。
* @returns {Array.} left, bottom, right, top 数组。
*/
}, {
key: "toArray",
value: function toArray(reverseAxisOrder) {
if (reverseAxisOrder === true) {
return [this.bottom, this.left, this.top, this.right];
} else {
return [this.left, this.bottom, this.right, this.top];
}
}
/**
* @function SuperMap.Bounds.prototype.toBBOX
* @description 取小数点后 decimal 位数字进行四舍五入再转换为 BBOX 字符串。
* @example
* var bounds = new SuperMap.Bounds(-1.1234567,-1.7654321,1.4444444,1.5555555);
* //str1 = "-1.123457,-1.765432,1.444444,1.555556";
* var str1 = bounds.toBBOX();
* //str2 = "-1.1,-1.8,1.4,1.6";
* var str2 = bounds.toBBOX(1);
* //str2 = "-1.8,-1.1,1.6,1.4";
* var str2 = bounds.toBBOX(1,true);
* @param {integer} [decimal=6] - 边界方位坐标的有效数字个数。
* @param {boolean} [reverseAxisOrder=false] - 是否是反转轴顺序。
* 如果设为true,则倒转顺序(bottom,left,top,right),否则按正常轴顺序(left,bottom,right,top)。
* @returns {string} 边界对象的字符串表示形式,如:"5,42,10,45"。
*/
}, {
key: "toBBOX",
value: function toBBOX(decimal, reverseAxisOrder) {
if (decimal == null) {
decimal = 6;
}
var mult = Math.pow(10, decimal);
var xmin = Math.round(this.left * mult) / mult;
var ymin = Math.round(this.bottom * mult) / mult;
var xmax = Math.round(this.right * mult) / mult;
var ymax = Math.round(this.top * mult) / mult;
if (reverseAxisOrder === true) {
return ymin + "," + xmin + "," + ymax + "," + xmax;
} else {
return xmin + "," + ymin + "," + xmax + "," + ymax;
}
}
/**
* @function SuperMap.Bounds.prototype.toGeometry
* @description 基于当前边界范围创建一个新的多边形对象。
* @example
* var bounds = new SuperMap.Bounds(-180,-90,100,80);
* //SuperMap.Geometry.Polygon对象
* var geo = bounds.toGeometry();
* @returns {SuperMap.Geometry.Polygon} 基于当前 bounds 坐标创建的新的多边形。
*/
// toGeometry() {
// return new Polygon([
// new LinearRing([
// new Point(this.left, this.bottom),
// new Point(this.right, this.bottom),
// new Point(this.right, this.top),
// new Point(this.left, this.top)
// ])
// ]);
// }
/**
* @function SuperMap.Bounds.prototype.getWidth
* @description 获取 bounds 的宽度。
* @example
* var bounds = new SuperMap.Bounds(-180,-90,100,80);
* //width = 280;
* var width = bounds.getWidth();
* @returns {float} 获取当前 bounds 的宽度(right 减去 left)。
*/
}, {
key: "getWidth",
value: function getWidth() {
return this.right - this.left;
}
/**
* @function SuperMap.Bounds.prototype.getHeight
* @description 获取 bounds 的高度。
* @example
* var bounds = new SuperMap.Bounds(-180,-90,100,80);
* //height = 170;
* var height = bounds.getHeight();
* @returns {float} 返回边界高度(top 减去 bottom)。
*/
}, {
key: "getHeight",
value: function getHeight() {
return this.top - this.bottom;
}
/**
* @function SuperMap.Bounds.prototype.getSize
* @description 获取边框大小。
* @example
* var bounds = new SuperMap.Bounds(-180,-90,100,80);
* var size = bounds.getSize();
* @returns {SuperMap.Size} 返回边框大小。
*/
}, {
key: "getSize",
value: function getSize() {
return new Size(this.getWidth(), this.getHeight());
}
/**
* @function SuperMap.Bounds.prototype.getCenterPixel
* @description 获取像素格式的范围中心点。
* @example
* var bounds = new SuperMap.Bounds(-180,-90,100,80);
* var pixel = bounds.getCenterPixel();
* @returns {SuperMap.Pixel} 返回像素格式的当前范围的中心点。
*/
}, {
key: "getCenterPixel",
value: function getCenterPixel() {
return new Pixel((this.left + this.right) / 2, (this.bottom + this.top) / 2);
}
/**
* @function SuperMap.Bounds.prototype.getCenterLonLat
* @description 获取地理格式的范围中心点。
* @example
* var bounds = new SuperMap.Bounds(-180,-90,100,80);
* var lonlat = bounds.getCenterLonLat();
* @returns {SuperMap.LonLat} 返回当前地理范围的中心点。
*/
}, {
key: "getCenterLonLat",
value: function getCenterLonLat() {
if (!this.centerLonLat) {
this.centerLonLat = new LonLat((this.left + this.right) / 2, (this.bottom + this.top) / 2);
}
return this.centerLonLat;
}
/**
* @function SuperMap.Bounds.prototype.scale
* @description 按照比例扩大/缩小出一个新的 bounds。
* @example
* var bounds = new SuperMap.Bounds(-50,-50,40,40);
* var bounds2 = bounds.scale(2);
* @param {float} [ratio=1] - 需要扩大的比例。
* @param {(SuperMap.Pixel|SuperMap.LonLat)} [origin] - 扩大时的基准点,默认为当前 bounds 的中心点。
* @returns {SuperMap.Bounds} 返回通过 ratio、origin 计算得到的新的边界范围。
*/
}, {
key: "scale",
value: function scale(ratio, origin) {
ratio = ratio ? ratio : 1;
if (origin == null) {
origin = this.getCenterLonLat();
}
var origx, origy; // get origin coordinates
if (origin.CLASS_NAME === "SuperMap.LonLat") {
origx = origin.lon;
origy = origin.lat;
} else {
origx = origin.x;
origy = origin.y;
}
var left = (this.left - origx) * ratio + origx;
var bottom = (this.bottom - origy) * ratio + origy;
var right = (this.right - origx) * ratio + origx;
var top = (this.top - origy) * ratio + origy;
return new Bounds(left, bottom, right, top);
}
/**
* @function SuperMap.Bounds.prototype.add
* @description 在当前的 Bounds 上按照传入的坐标点进行平移,返回新的范围。
* @example
* var bounds1 = new SuperMap.Bounds(-50,-50,40,40);
* //bounds2 是新的 bounds
* var bounds2 = bounds.add(20,10);
* @param {float} x - 传入坐标点的 x 坐标。
* @param {float} y - 传入坐标点的 y 坐标。
* @returns {SuperMap.Bounds} 返回一个新的 bounds,此 bounds 的坐标是由传入的 x,y 参数与当前 bounds 坐标计算所得。
*/
}, {
key: "add",
value: function add(x, y) {
if (x == null || y == null) {
throw new TypeError('Bounds.add cannot receive null values');
}
return new Bounds(this.left + x, this.bottom + y, this.right + x, this.top + y);
}
/**
* @function SuperMap.Bounds.prototype.extend
* @description 在当前 bounds 上扩展 bounds,支持 point,lanlat 和 bounds。扩展后的 bounds 的范围是两者的结合。
* @example
* var bounds1 = new SuperMap.Bounds(-50,-50,40,40);
* //bounds 改变
* bounds.extend(new SuperMap.LonLat(50,60));
* @param {(SuperMap.Geometry.Point|SuperMap.LonLat|SuperMap.Bounds)} object - 可以是 point、lonlat 和 bounds。
*/
}, {
key: "extend",
value: function extend(object) {
var bounds = null;
if (object) {
// clear cached center location
switch (object.CLASS_NAME) {
case "SuperMap.LonLat":
bounds = new Bounds(object.lon, object.lat, object.lon, object.lat);
break;
case "SuperMap.Geometry.Point":
bounds = new Bounds(object.x, object.y, object.x, object.y);
break;
case "SuperMap.Bounds":
bounds = object;
break;
}
if (bounds) {
this.centerLonLat = null;
if (this.left == null || bounds.left < this.left) {
this.left = bounds.left;
}
if (this.bottom == null || bounds.bottom < this.bottom) {
this.bottom = bounds.bottom;
}
if (this.right == null || bounds.right > this.right) {
this.right = bounds.right;
}
if (this.top == null || bounds.top > this.top) {
this.top = bounds.top;
}
}
}
}
/**
* @function SuperMap.Bounds.prototype.containsLonLat
* @description 判断传入的坐标是否在范围内。
* @example
* var bounds1 = new SuperMap.Bounds(-50,-50,40,40);
* //isContains1 = true
* //这里的第二个参数可以直接为 boolean 类型,也就是inclusive
* var isContains1 = bounds.containsLonLat(new SuperMap.LonLat(40,40),true);
*
* //(40,40)在范围内,同样(40+360,40)也在范围内
* var bounds2 = new SuperMap.Bounds(-50,-50,40,40);
* //isContains2 = true;
* var isContains2 = bounds2.containsLonLat(
* new SuperMap.LonLat(400,40),
* {
* inclusive:true,
* //全球的范围
* worldBounds: new SuperMap.Bounds(-180,-90,180,90)
* }
* );
* @param {(SuperMap.LonLat|Object)} ll - 对象或者是一个包含 'lon' 与 'lat' 属性的对象。
* @param {Object} options - 可选参数。
* @param {boolean} [options.inclusive=true] - 是否包含边界。
* @param {SuperMap.Bounds} [options.worldBounds] - 如果提供 worldBounds 参数, 如果 ll 参数提供的坐标超出了世界边界(worldBounds),
* 但是通过日界线的转化可以被包含, 它将被认为是包含在该范围内的。
* @returns {boolean} 传入坐标是否包含在范围内。
*/
}, {
key: "containsLonLat",
value: function containsLonLat(ll, options) {
if (typeof options === "boolean") {
options = {
inclusive: options
};
}
options = options || {};
var contains = this.contains(ll.lon, ll.lat, options.inclusive),
worldBounds = options.worldBounds; //日界线以外的也有可能算包含,
if (worldBounds && !contains) {
var worldWidth = worldBounds.getWidth();
var worldCenterX = (worldBounds.left + worldBounds.right) / 2; //这一步很关键
var worldsAway = Math.round((ll.lon - worldCenterX) / worldWidth);
contains = this.containsLonLat({
lon: ll.lon - worldsAway * worldWidth,
lat: ll.lat
}, {
inclusive: options.inclusive
});
}
return contains;
}
/**
* @function SuperMap.Bounds.prototype.containsPixel
* @description 判断传入的像素是否在范围内。直接匹配大小,不涉及像素和地理转换。
* @example
* var bounds = new SuperMap.Bounds(-50,-50,40,40);
* //isContains = true
* var isContains = bounds.containsPixel(new SuperMap.Pixel(40,40),true);
* @param {SuperMap.Pixel} px - 提供的像素参数。
* @param {boolean} [inclusive=true] - 是否包含边界。
* @returns {boolean} 传入的 pixel 在当前边界范围之内。
*/
}, {
key: "containsPixel",
value: function containsPixel(px, inclusive) {
return this.contains(px.x, px.y, inclusive);
}
/**
* @function SuperMap.Bounds.prototype.contains
* @description 判断传入的 x,y 坐标值是否在范围内。
* @example
* var bounds = new SuperMap.Bounds(-50,-50,40,40);
* //isContains = true
* var isContains = bounds.contains(40,40,true);
* @param {float} x - 传入的 x 坐标值。
* @param {float} y - 传入的 y 坐标值。
* @param {boolean} [inclusive=true] - 是否包含边界。
* @returns {boolean} 传入的 x,y 坐标是否在当前范围内。
*/
}, {
key: "contains",
value: function contains(x, y, inclusive) {
//set default
if (inclusive == null) {
inclusive = true;
}
if (x == null || y == null) {
return false;
} //x = Util.toFloat(x);
//y = Util.toFloat(y);
var contains = false;
if (inclusive) {
contains = x >= this.left && x <= this.right && y >= this.bottom && y <= this.top;
} else {
contains = x > this.left && x < this.right && y > this.bottom && y < this.top;
}
return contains;
}
/**
* @function SuperMap.Bounds.prototype.intersectsBounds
* @description 判断目标边界范围是否与当前边界范围相交。如果两个边界范围中的任意
* 边缘相交或者一个边界包含了另外一个就认为这两个边界相交。
* @example
* var bounds = new SuperMap.Bounds(-180,-90,100,80);
* var isIntersects = bounds.intersectsBounds(
* new SuperMap.Bounds(-170,-90,120,80)
* );
* @param {SuperMap.Bounds} bounds - 目标边界。
* @param {Object} options - 参数。
* @param {boolean} [options.inclusive=true] - 边缘重合也看成相交。如果是false,
* 两个边界范围没有重叠部分仅仅是在边缘相接(重合),
* 这种情况被认为没有相交。
* @param {SuperMap.Bounds} [options.worldBounds] - 提供了 worldBounds 参数, 如果他们相交时
* 是在全球范围内, 两个边界将被视为相交。这仅适用于交叉或完全不在世界范围的边界。
* @returns {boolean} 传入的 bounds 对象与当前 bounds 相交。
*/
}, {
key: "intersectsBounds",
value: function intersectsBounds(bounds, options) {
if (typeof options === "boolean") {
options = {
inclusive: options
};
}
options = options || {};
if (options.worldBounds) {
var self = this.wrapDateLine(options.worldBounds);
bounds = bounds.wrapDateLine(options.worldBounds);
} else {
self = this;
}
if (options.inclusive == null) {
options.inclusive = true;
}
var intersects = false;
var mightTouch = self.left === bounds.right || self.right === bounds.left || self.top === bounds.bottom || self.bottom === bounds.top; // if the two bounds only touch at an edge, and inclusive is false,
// then the bounds don't *really* intersect.
if (options.inclusive || !mightTouch) {
// otherwise, if one of the boundaries even partially contains another,
// inclusive of the edges, then they do intersect.
var inBottom = bounds.bottom >= self.bottom && bounds.bottom <= self.top || self.bottom >= bounds.bottom && self.bottom <= bounds.top;
var inTop = bounds.top >= self.bottom && bounds.top <= self.top || self.top > bounds.bottom && self.top < bounds.top;
var inLeft = bounds.left >= self.left && bounds.left <= self.right || self.left >= bounds.left && self.left <= bounds.right;
var inRight = bounds.right >= self.left && bounds.right <= self.right || self.right >= bounds.left && self.right <= bounds.right;
intersects = (inBottom || inTop) && (inLeft || inRight);
} // document me
if (options.worldBounds && !intersects) {
var world = options.worldBounds;
var width = world.getWidth();
var selfCrosses = !world.containsBounds(self);
var boundsCrosses = !world.containsBounds(bounds);
if (selfCrosses && !boundsCrosses) {
bounds = bounds.add(-width, 0);
intersects = self.intersectsBounds(bounds, {
inclusive: options.inclusive
});
} else if (boundsCrosses && !selfCrosses) {
self = self.add(-width, 0);
intersects = bounds.intersectsBounds(self, {
inclusive: options.inclusive
});
}
}
return intersects;
}
/**
* @function SuperMap.Bounds.prototype.containsBounds
* @description 判断目标边界是否被当前边界包含在内。
* @example
* var bounds = new SuperMap.Bounds(-180,-90,100,80);
* var isContains = bounds.containsBounds(
* new SuperMap.Bounds(-170,-90,100,80),true,true
* );
* @param {SuperMap.Bounds} bounds - 目标边界。
* @param {boolean} [partial=false] - 目标边界的任意部分都包含在当前边界中则被认为是包含关系。
* 如果设为 false,整个目标边界全部被包含在当前边界范围内。
* @param {boolean} [inclusive=true] - 边缘共享被视为包含。
* @returns {boolean} 传入的边界被当前边界包含。
*/
}, {
key: "containsBounds",
value: function containsBounds(bounds, partial, inclusive) {
if (partial == null) {
partial = false;
}
if (inclusive == null) {
inclusive = true;
}
var bottomLeft = this.contains(bounds.left, bounds.bottom, inclusive);
var bottomRight = this.contains(bounds.right, bounds.bottom, inclusive);
var topLeft = this.contains(bounds.left, bounds.top, inclusive);
var topRight = this.contains(bounds.right, bounds.top, inclusive);
return partial ? bottomLeft || bottomRight || topLeft || topRight : bottomLeft && bottomRight && topLeft && topRight;
}
/**
* @function SuperMap.Bounds.prototype.determineQuadrant
* @description 判断传入坐标是否在 bounds 范围内的象限。以 bounds 中心点为坐标原点。
* @example
* var bounds = new SuperMap.Bounds(-180,-90,100,80);
* //str = "tr";
* var str = bounds.determineQuadrant(
* new SuperMap.LonLat(20,20)
* );
* @param {SuperMap.LonLat} lonlat - 传入的坐标对象。
* @returns {string} 传入坐标所在的象限("br" "tr" "tl" "bl" 分别对应"右下","右上","左上" "左下")。
*/
}, {
key: "determineQuadrant",
value: function determineQuadrant(lonlat) {
var quadrant = "";
var center = this.getCenterLonLat();
quadrant += lonlat.lat < center.lat ? "b" : "t";
quadrant += lonlat.lon < center.lon ? "l" : "r";
return quadrant;
}
/**
* @function SuperMap.Bounds.prototype.wrapDateLine
* @description 将当前 bounds 移动到最大边界范围内部(所谓的内部是相交或者内部)。
* @example
* var bounds = new SuperMap.Bounds(380,-40,400,-20);
* var maxExtent = new SuperMap.Bounds(-180,-90,100,80);
* //新的bounds
* var newBounds = bounds.wrapDateLine(maxExtent);
* @param {SuperMap.Bounds} maxExtent - 最大的边界范围(一般是全球范围)。
* @param {Object} options - 可选选项参数。
* @param {float} [options.leftTolerance=0] - left 允许的误差。
* @param {float} [options.rightTolerance=0] - right 允许的误差。
* @returns {SuperMap.Bounds} 克隆当前边界。如果当前边界完全在最大范围之外此函数则返回一个不同值的边界,
* 若落在最大边界的左边,则给当前的bounds值加上最大范围的宽度,即向右移动,
* 若落在右边,则向左移动,即给当前的bounds值加上负的最大范围的宽度。
*/
}, {
key: "wrapDateLine",
value: function wrapDateLine(maxExtent, options) {
options = options || {};
var leftTolerance = options.leftTolerance || 0;
var rightTolerance = options.rightTolerance || 0;
var newBounds = this.clone();
if (maxExtent) {
var width = maxExtent.getWidth(); //如果 newBounds 在 maxExtent 的左边,那么一直向右移动,直到相交或者包含为止,每次移动width
//shift right?
while (newBounds.left < maxExtent.left && newBounds.right - rightTolerance <= maxExtent.left) {
newBounds = newBounds.add(width, 0);
} //如果 newBounds 在 maxExtent 的右边,那么一直向左移动,直到相交或者包含为止,每次移动width
//shift left?
while (newBounds.left + leftTolerance >= maxExtent.right && newBounds.right > maxExtent.right) {
newBounds = newBounds.add(-width, 0);
} //如果和右边相交,左边又在内部,那么再次向左边移动一次
// crosses right only? force left
var newLeft = newBounds.left + leftTolerance;
if (newLeft < maxExtent.right && newLeft > maxExtent.left && newBounds.right - rightTolerance > maxExtent.right) {
newBounds = newBounds.add(-width, 0);
}
}
return newBounds;
}
/**
* @function SuperMap.Bounds.prototype.toServerJSONObject
* @description 转换成对应的 JSON 格式对象。
* @example
* var bounds = new SuperMap.Bounds(-180,-90,100,80);
* var obj = bounds.toServerJSONObject();
* @returns {Object} 返回 JSON 格式的 Object 对象。
*/
}, {
key: "toServerJSONObject",
value: function toServerJSONObject() {
var jsonObject = {
rightTop: {
x: this.right,
y: this.top
},
leftBottom: {
x: this.left,
y: this.bottom
},
left: this.left,
right: this.right,
top: this.top,
bottom: this.bottom
};
return jsonObject;
}
/**
*
* @function SuperMap.Bounds.prototype.destroy
* @description 销毁此对象。
* 销毁后此对象的所有属性为 null,而不是初始值。
* @example
* var bounds = new SuperMap.Bounds(-180,-90,100,80);
* bounds.destroy();
*/
}, {
key: "destroy",
value: function destroy() {
this.left = null;
this.right = null;
this.top = null;
this.bottom = null;
this.centerLonLat = null;
}
/**
* @function SuperMap.Bounds.fromString
* @description 通过字符串参数创建新的 bounds 的构造函数。
* @example
* var bounds = SuperMap.Bounds.fromString("-180,-90,100,80");
* @param {string} str - 边界字符串,用逗号隔开(e.g. "5,42,10,45")。
* @param {boolean} [reverseAxisOrder=false] - 是否反转轴顺序。
* 如果设为true,则倒转顺序(bottom,left,top,right),否则按正常轴顺序(left,bottom,right,top)。
* @returns {SuperMap.Bounds} 返回给定的字符串创建的新的边界对象。
*/
}], [{
key: "fromString",
value: function fromString(str, reverseAxisOrder) {
var bounds = str.split(",");
return Bounds.fromArray(bounds, reverseAxisOrder);
}
/**
* @function SuperMap.Bounds.fromArray
* @description 通过边界框数组创建 Bounds。
* @example
* var bounds = SuperMap.Bounds.fromArray([-180,-90,100,80]);
* @param {Array.} bbox - 边界值数组。(e.g. [5,42,10,45])。
* @param {boolean} [reverseAxisOrder=false] - 是否是反转轴顺序。如果设为true,则倒转顺序(bottom,left,top,right),否则按正常轴顺序(left,bottom,right,top)。
* @returns {SuperMap.Bounds} 返回根据传入的数组创建的新的边界对象。
*/
}, {
key: "fromArray",
value: function fromArray(bbox, reverseAxisOrder) {
return reverseAxisOrder === true ? new Bounds(bbox[1], bbox[0], bbox[3], bbox[2]) : new Bounds(bbox[0], bbox[1], bbox[2], bbox[3]);
}
/**
* @function SuperMap.Bounds.fromSize
* @description 通过传入的边界大小来创建新的边界。
* @example
* var bounds = SuperMap.Bounds.fromSize(new SuperMap.Size(20,10));
* @param {SuperMap.Size} size - 传入的边界大小。
* @returns {SuperMap.Bounds} 返回根据传入的边界大小的创建新的边界。
*/
}, {
key: "fromSize",
value: function fromSize(size) {
return new Bounds(0, size.h, size.w, 0);
}
/**
* @function SuperMap.Bounds.oppositeQuadrant
* @description 反转象限。"t"和"b" 交换,"r"和"l"交换, 如:"tl"变为"br"。
* @param {string} quadrant - 代表象限的字符串,如:"tl"。
* @returns {string} 反转后的象限。
*/
}, {
key: "oppositeQuadrant",
value: function oppositeQuadrant(quadrant) {
var opp = "";
opp += quadrant.charAt(0) === 't' ? 'b' : 't';
opp += quadrant.charAt(1) === 'l' ? 'r' : 'l';
return opp;
}
}]);
return Bounds;
}();
SuperMap.Bounds = Bounds;
;// CONCATENATED MODULE: ./src/common/commontypes/Geometry.js
function Geometry_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function Geometry_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
function Geometry_createClass(Constructor, protoProps, staticProps) { if (protoProps) Geometry_defineProperties(Constructor.prototype, protoProps); if (staticProps) Geometry_defineProperties(Constructor, staticProps); return Constructor; }
/* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
* This program are made available under the terms of the Apache License, Version 2.0
* which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
// import {WKT} from '../format/WKT';
// import {Vector} from './Vector';
/**
* @class SuperMap.Geometry
* @category BaseTypes Geometry
* @classdesc 几何对象类,描述地理对象的几何图形。
*/
var Geometry = /*#__PURE__*/function () {
function Geometry() {
Geometry_classCallCheck(this, Geometry);
this.CLASS_NAME = "SuperMap.Geometry";
/**
* @member {string} SuperMap.Geometry.prototype.id
* @description 此几何对象的唯一标示符。
*
*/
this.id = Util.createUniqueID(this.CLASS_NAME + "_");
/**
* @member {SuperMap.Geometry} SuperMap.Geometry.prototype.parent
* @description This is set when a Geometry is added as component
* of another geometry
*/
this.parent = null;
/**
* @member {SuperMap.Bounds} SuperMap.Geometry.prototype.bounds
* @description 几何对象的范围。
*
*/
this.bounds = null;
/**
* @member {interger} SuperMap.Geometry.prototype.SRID
* @description 投影坐标参数。通过该参数,服务器判断 Geometry 对象的坐标参考系是否与数据集相同,如果不同,则在数据入库前进行投影变换。
* @example
* var geometry= new SuperMap.Geometry();
* geometry. SRID=4326;
*
*/
this.SRID = null;
}
/**
* @function SuperMap.Geometry.prototype.destroy
* @description 解构 Geometry 类,释放资源。
*/
Geometry_createClass(Geometry, [{
key: "destroy",
value: function destroy() {
this.id = null;
this.bounds = null;
this.SRID = null;
}
/**
* @function SuperMap.Geometry.prototype.clone
* @description 创建克隆的几何图形。克隆的几何图形不设置非标准的属性。
* @returns {SuperMap.Geometry} 克隆的几何图形。
*/
}, {
key: "clone",
value: function clone() {
return new Geometry();
}
/**
* @function SuperMap.Geometry.prototype.setBounds
* @description 设置此几何对象的 bounds。
* @param {SuperMap.Bounds} bounds - 范围。
*/
}, {
key: "setBounds",
value: function setBounds(bounds) {
if (bounds) {
this.bounds = bounds.clone();
}
}
/**
* @function SuperMap.Geometry.prototype.clearBounds
* @description 清除几何对象的 bounds。
* 如果该对象有父类,也会清除父类几何对象的 bounds。
*/
}, {
key: "clearBounds",
value: function clearBounds() {
this.bounds = null;
if (this.parent) {
this.parent.clearBounds();
}
}
/**
* @function SuperMap.Geometry.prototype.extendBounds
* @description Extend the existing bounds to include the new bounds.
* If geometry's bounds is not yet set, then set a new Bounds.
*
* @param {SuperMap.Bounds} newBounds - 范围。
*/
}, {
key: "extendBounds",
value: function extendBounds(newBounds) {
var bounds = this.getBounds();
if (!bounds) {
this.setBounds(newBounds);
} else {
this.bounds.extend(newBounds);
}
}
/**
* @function SuperMap.Geometry.prototype.getBounds
* @description 获得几何图形的边界。如果没有设置边界,可通过计算获得。
* @returns {SuperMap.Bounds} 返回的几何对象的边界。
*/
}, {
key: "getBounds",
value: function getBounds() {
if (this.bounds == null) {
this.calculateBounds();
}
return this.bounds;
}
/**
* @function SuperMap.Geometry.prototype.calculateBounds
* @description 重新计算几何图形的边界(需要在子类中实现此方法)。
*/
}, {
key: "calculateBounds",
value: function calculateBounds() {//
// This should be overridden by subclasses.
//
}
/**
* @function SuperMap.Geometry.prototype.getVertices
* @description 返回几何图形的所有顶点的列表(需要在子类中实现此方法)。
* @param {boolean} [nodes] - 如果是 true,线则只返回线的末端点,如果 false,仅仅返回顶点,如果没有设置,则返回顶点。
* @returns {Array} 几何图形的顶点列表。
*/
}, {
key: "getVertices",
value: function getVertices(nodes) {// eslint-disable-line no-unused-vars
}
/**
* @function SuperMap.Geometry.prototype.getArea
* @description 计算几何对象的面积 ,此方法需要在子类中定义。
* @returns {float} The area of the collection by summing its parts
*/
}, {
key: "getArea",
value: function getArea() {
//to be overridden by geometries that actually have an area
//
return 0.0;
} // /**
// * @function SuperMap.Geometry.prototype.toString
// * @description 返回geometry对象的字符串表述,需要引入{@link SuperMap.Format.WKT}。此方法只能在子类实现,在父类使用会报错。
// * @returns {string} geometry对象的字符串表述(Well-Known Text)
// */
// toString() {
// var string;
// if (WKT) {
// var wkt = new WKT();
// string = wkt.write(new Vector(this));
// } else {
// string = Object.prototype.toString.call(this);
// }
// return string;
// }
}]);
return Geometry;
}();
SuperMap.Geometry = Geometry;
;// CONCATENATED MODULE: ./src/common/commontypes/geometry/Collection.js
function Collection_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { Collection_typeof = function _typeof(obj) { return typeof obj; }; } else { Collection_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return Collection_typeof(obj); }
function Collection_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function Collection_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
function Collection_createClass(Constructor, protoProps, staticProps) { if (protoProps) Collection_defineProperties(Constructor.prototype, protoProps); if (staticProps) Collection_defineProperties(Constructor, staticProps); return Constructor; }
function _get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get; } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return _get(target, property, receiver || target); }
function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = Collection_getPrototypeOf(object); if (object === null) break; } return object; }
function Collection_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) Collection_setPrototypeOf(subClass, superClass); }
function Collection_setPrototypeOf(o, p) { Collection_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Collection_setPrototypeOf(o, p); }
function Collection_createSuper(Derived) { var hasNativeReflectConstruct = Collection_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = Collection_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = Collection_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return Collection_possibleConstructorReturn(this, result); }; }
function Collection_possibleConstructorReturn(self, call) { if (call && (Collection_typeof(call) === "object" || typeof call === "function")) { return call; } return Collection_assertThisInitialized(self); }
function Collection_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
function Collection_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
function Collection_getPrototypeOf(o) { Collection_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Collection_getPrototypeOf(o); }
/* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
* This program are made available under the terms of the Apache License, Version 2.0
* which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
/**
* @class SuperMap.Geometry.Collection
* @classdesc 几何对象集合类,存储在本地的 components 属性中(可作为参数传递给构造函数)。
* 随着新的几何图形添加到集合中,将不能被克隆,当移动几何图形时,需要指定参照物。
* getArea 和 getLength 函数只能通过遍历存储几何对象的 components 数组,总计所有几何图形的面积和长度。
* @category BaseTypes Geometry
* @extends {SuperMap.Geometry}
* @param {Array.} components - 几何对象数组。
* @example
* var point1 = new SuperMap.Geometry.Point(10,20);
* var point2 = new SuperMap.Geometry.Point(30,40);
* var col = new SuperMap.Geometry.Collection([point1,point2]);
*/
var Collection = /*#__PURE__*/function (_Geometry) {
Collection_inherits(Collection, _Geometry);
var _super = Collection_createSuper(Collection);
function Collection(components) {
var _this;
Collection_classCallCheck(this, Collection);
_this = _super.call(this);
/**
* @description 存储几何对象的数组。
* @member {Array.} SuperMap.Geometry.Collection.prototype.components
*/
_this.components = [];
/**
* @member {Array.} SuperMap.Geometry.Collection.prototype.componentTypes
* @description components 存储的的几何对象所支持的几何类型数组,为空表示类型不受限制。
*/
_this.componentTypes = null;
if (components != null) {
_this.addComponents(components);
}
_this.CLASS_NAME = "SuperMap.Geometry.Collection";
_this.geometryType = "Collection";
return _this;
}
/**
* @function SuperMap.Geometry.Collection.prototype.destroy
* @description 销毁几何图形。
*/
Collection_createClass(Collection, [{
key: "destroy",
value: function destroy() {
this.components.length = 0;
this.components = null;
_get(Collection_getPrototypeOf(Collection.prototype), "destroy", this).call(this);
}
/**
* @function SuperMap.Geometry.Collection.prototype.clone
* @description 克隆当前几何对象。
* @returns {SuperMap.Geometry.Collection} 克隆的几何对象集合。
*/
}, {
key: "clone",
value: function clone() {
var geometry = new Collection();
for (var i = 0, len = this.components.length; i < len; i++) {
geometry.addComponent(this.components[i].clone());
} // catch any randomly tagged-on properties
Util.applyDefaults(geometry, this);
return geometry;
}
/**
* @function SuperMap.Geometry.Collection.prototype.getComponentsString
* @description 获取 components 字符串。
* @returns {string} components 字符串。
*/
}, {
key: "getComponentsString",
value: function getComponentsString() {
var strings = [];
for (var i = 0, len = this.components.length; i < len; i++) {
strings.push(this.components[i].toShortString());
}
return strings.join(",");
}
/**
* @function SuperMap.Geometry.Collection.prototype.calculateBounds
* @description 通过遍历数组重新计算边界,在遍历每一子项中时调用 extend 方法。
*/
}, {
key: "calculateBounds",
value: function calculateBounds() {
this.bounds = null;
var bounds = new Bounds();
var components = this.components;
if (components) {
for (var i = 0, len = components.length; i < len; i++) {
bounds.extend(components[i].getBounds());
}
} // to preserve old behavior, we only set bounds if non-null
// in the future, we could add bounds.isEmpty()
if (bounds.left != null && bounds.bottom != null && bounds.right != null && bounds.top != null) {
this.setBounds(bounds);
}
}
/**
* @function SuperMap.Geometry.Collection.prototype.addComponents
* @description 给几何图形对象添加元素。
* @param {Array.} components - 几何对象组件。
* @example
* var collection = new SuperMap.Geometry.Collection();
* collection.addComponents(new SuerpMap.Geometry.Point(10,10));
*/
}, {
key: "addComponents",
value: function addComponents(components) {
if (!Util.isArray(components)) {
components = [components];
}
for (var i = 0, len = components.length; i < len; i++) {
this.addComponent(components[i]);
}
}
/**
* @function SuperMap.Geometry.Collection.prototype.addComponent
* @description 添加一个几何对象到集合中。如果设置了 componentTypes 类型,则添加的几何对象必须是 componentTypes 中的类型。
* @param {SuperMap.Geometry} component - 待添加的几何对象。
* @param {int} [index] - 几何对象插入的位置。
* @returns {boolean} 是否添加成功。
*/
}, {
key: "addComponent",
value: function addComponent(component, index) {
var added = false;
if (component) {
if (this.componentTypes == null || Util.indexOf(this.componentTypes, component.CLASS_NAME) > -1) {
if (index != null && index < this.components.length) {
var components1 = this.components.slice(0, index);
var components2 = this.components.slice(index, this.components.length);
components1.push(component);
this.components = components1.concat(components2);
} else {
this.components.push(component);
}
component.parent = this;
this.clearBounds();
added = true;
}
}
return added;
}
/**
* @function SuperMap.Geometry.Collection.prototype.removeComponents
* @description 清除几何对象。
* @param {Array.} components - 需要清除的几何对象。
* @returns {boolean} 元素是否被删除。
*/
}, {
key: "removeComponents",
value: function removeComponents(components) {
var removed = false;
if (!Util.isArray(components)) {
components = [components];
}
for (var i = components.length - 1; i >= 0; --i) {
removed = this.removeComponent(components[i]) || removed;
}
return removed;
}
/**
* @function SuperMap.Geometry.Collection.prototype.removeComponent
* @description 从集合中移除一个几何对象。
* @param {SuperMap.Geometry} component - 要移除的几何对象。
* @returns {boolean} 几何对象是否移除成功。
*/
}, {
key: "removeComponent",
value: function removeComponent(component) {
Util.removeItem(this.components, component); // clearBounds() so that it gets recalculated on the next call
// to this.getBounds();
this.clearBounds();
return true;
}
/**
* @function SuperMap.Geometry.Collection.prototype.getArea
* @description 计算几何对象的面积。注意,这个方法在 {@link SuperMap.Geometry.Polygon} 类中需要重写。
* @returns {number} 几何图形的面积,是几何对象中所有组成部分的面积之和。
*/
}, {
key: "getArea",
value: function getArea() {
var area = 0.0;
for (var i = 0, len = this.components.length; i < len; i++) {
area += this.components[i].getArea();
}
return area;
}
/**
* @function SuperMap.Geometry.Collection.prototype.equals
* @description 判断两个几何图形是否相等。如果所有的 components 具有相同的坐标,则认为是相等的。
* @param {SuperMap.Geometry} geometry - 需要判断的几何图形。
* @returns {boolean} 输入的几何图形与当前几何图形是否相等。
*/
}, {
key: "equals",
value: function equals(geometry) {
var equivalent = true;
if (!geometry || !geometry.CLASS_NAME || this.CLASS_NAME !== geometry.CLASS_NAME) {
equivalent = false;
} else if (!Util.isArray(geometry.components) || geometry.components.length !== this.components.length) {
equivalent = false;
} else {
for (var i = 0, len = this.components.length; i < len; ++i) {
if (!this.components[i].equals(geometry.components[i])) {
equivalent = false;
break;
}
}
}
return equivalent;
}
/**
* @function SuperMap.Geometry.Collection.prototype.getVertices
* @description 返回几何对象的所有结点的列表。
* @param {boolean} [nodes] - 对于线来说,仅仅返回作为端点的顶点,如果设为 false,则返回非端点的顶点如果没有设置此参数,则返回所有顶点。
* @returns {Array} 几何对象的顶点列表。
*/
}, {
key: "getVertices",
value: function getVertices(nodes) {
var vertices = [];
for (var i = 0, len = this.components.length; i < len; ++i) {
Array.prototype.push.apply(vertices, this.components[i].getVertices(nodes));
}
return vertices;
}
}]);
return Collection;
}(Geometry);
SuperMap.Geometry.Collection = Collection;
;// CONCATENATED MODULE: ./src/common/commontypes/geometry/MultiPoint.js
function MultiPoint_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { MultiPoint_typeof = function _typeof(obj) { return typeof obj; }; } else { MultiPoint_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return MultiPoint_typeof(obj); }
function MultiPoint_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function MultiPoint_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
function MultiPoint_createClass(Constructor, protoProps, staticProps) { if (protoProps) MultiPoint_defineProperties(Constructor.prototype, protoProps); if (staticProps) MultiPoint_defineProperties(Constructor, staticProps); return Constructor; }
function MultiPoint_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) MultiPoint_setPrototypeOf(subClass, superClass); }
function MultiPoint_setPrototypeOf(o, p) { MultiPoint_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return MultiPoint_setPrototypeOf(o, p); }
function MultiPoint_createSuper(Derived) { var hasNativeReflectConstruct = MultiPoint_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = MultiPoint_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = MultiPoint_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return MultiPoint_possibleConstructorReturn(this, result); }; }
function MultiPoint_possibleConstructorReturn(self, call) { if (call && (MultiPoint_typeof(call) === "object" || typeof call === "function")) { return call; } return MultiPoint_assertThisInitialized(self); }
function MultiPoint_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
function MultiPoint_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
function MultiPoint_getPrototypeOf(o) { MultiPoint_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return MultiPoint_getPrototypeOf(o); }
/* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
* This program are made available under the terms of the Apache License, Version 2.0
* which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
/**
* @class SuperMap.Geometry.MultiPoint
* @classdesc 几何对象多点类。
* @category BaseTypes Geometry
* @extends {SuperMap.Geometry.Collection}
* @param {Array.} components - 点对象数组。
* @example
* var point1 = new SuperMap.Geometry.Point(5,6);
* var poine2 = new SuperMap.Geometry.Point(7,8);
* var multiPoint = new SuperMap.Geometry.MultiPoint([point1,point2]);
*/
var MultiPoint = /*#__PURE__*/function (_Collection) {
MultiPoint_inherits(MultiPoint, _Collection);
var _super = MultiPoint_createSuper(MultiPoint);
function MultiPoint(components) {
var _this;
MultiPoint_classCallCheck(this, MultiPoint);
_this = _super.call(this, components);
/**
* @member {Array.} [SuperMap.Geometry.MultiPoint.prototype.componentTypes=["SuperMap.Geometry.Point"]]
* @description components 存储的的几何对象所支持的几何类型数组。
* @readonly
*/
_this.componentTypes = ["SuperMap.Geometry.Point"];
_this.CLASS_NAME = "SuperMap.Geometry.MultiPoint";
_this.geometryType = "MultiPoint";
return _this;
}
/**
* @function SuperMap.Geometry.MultiPoint.prototype.addPoint
* @description 添加点,封装了 {@link SuperMap.Geometry.Collection|SuperMap.Geometry.Collection.addComponent} 方法。
* @param {SuperMap.Geometry.Point} point - 添加的点。
* @param {integer} [index] - 下标。
*/
MultiPoint_createClass(MultiPoint, [{
key: "addPoint",
value: function addPoint(point, index) {
this.addComponent(point, index);
}
/**
* @function SuperMap.Geometry.MultiPoint.prototype.removePoint
* @description 移除点,封装了 {@link SuperMap.Geometry.Collection|SuperMap.Geometry.Collection.removeComponent} 方法。
* @param {SuperMap.Geometry.Point} point - 移除的点对象。
*/
}, {
key: "removePoint",
value: function removePoint(point) {
this.removeComponent(point);
}
}]);
return MultiPoint;
}(Collection);
SuperMap.Geometry.MultiPoint = MultiPoint;
;// CONCATENATED MODULE: ./src/common/commontypes/geometry/Curve.js
function Curve_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { Curve_typeof = function _typeof(obj) { return typeof obj; }; } else { Curve_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return Curve_typeof(obj); }
function Curve_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function Curve_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) Curve_setPrototypeOf(subClass, superClass); }
function Curve_setPrototypeOf(o, p) { Curve_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Curve_setPrototypeOf(o, p); }
function Curve_createSuper(Derived) { var hasNativeReflectConstruct = Curve_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = Curve_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = Curve_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return Curve_possibleConstructorReturn(this, result); }; }
function Curve_possibleConstructorReturn(self, call) { if (call && (Curve_typeof(call) === "object" || typeof call === "function")) { return call; } return Curve_assertThisInitialized(self); }
function Curve_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
function Curve_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
function Curve_getPrototypeOf(o) { Curve_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Curve_getPrototypeOf(o); }
/* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
* This program are made available under the terms of the Apache License, Version 2.0
* which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
/**
* @class SuperMap.Geometry.Curve
* @classdesc 几何对象曲线类。
* @category BaseTypes Geometry
* @extends {SuperMap.Geometry.MultiPoint}
* @param {Array.} components - 几何对象数组。
* @example
* var point1 = new SuperMap.Geometry.Point(10,20);
* var point2 = new SuperMap.Geometry.Point(30,40);
* var curve = new SuperMap.Geometry.Curve([point1,point2]);
*/
var Curve = /*#__PURE__*/function (_MultiPoint) {
Curve_inherits(Curve, _MultiPoint);
var _super = Curve_createSuper(Curve);
function Curve(components) {
var _this;
Curve_classCallCheck(this, Curve);
_this = _super.call(this, components);
/**
* @member {Array.} [SuperMap.Geometry.Curve.prototype.componentType=["SuperMap.Geometry.Point", "SuperMap.PointWithMeasure"]]
* @description components 存储的的几何对象所支持的几何类型数组。
* @readonly
*/
_this.componentTypes = ["SuperMap.Geometry.Point", "SuperMap.PointWithMeasure"];
_this.CLASS_NAME = "SuperMap.Geometry.Curve";
_this.geometryType = "Curve";
return _this;
}
return Curve;
}(MultiPoint);
SuperMap.Geometry.Curve = Curve;
;// CONCATENATED MODULE: ./src/common/commontypes/geometry/Point.js
function Point_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { Point_typeof = function _typeof(obj) { return typeof obj; }; } else { Point_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return Point_typeof(obj); }
function Point_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function Point_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
function Point_createClass(Constructor, protoProps, staticProps) { if (protoProps) Point_defineProperties(Constructor.prototype, protoProps); if (staticProps) Point_defineProperties(Constructor, staticProps); return Constructor; }
function Point_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { Point_get = Reflect.get; } else { Point_get = function _get(target, property, receiver) { var base = Point_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return Point_get(target, property, receiver || target); }
function Point_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = Point_getPrototypeOf(object); if (object === null) break; } return object; }
function Point_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) Point_setPrototypeOf(subClass, superClass); }
function Point_setPrototypeOf(o, p) { Point_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Point_setPrototypeOf(o, p); }
function Point_createSuper(Derived) { var hasNativeReflectConstruct = Point_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = Point_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = Point_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return Point_possibleConstructorReturn(this, result); }; }
function Point_possibleConstructorReturn(self, call) { if (call && (Point_typeof(call) === "object" || typeof call === "function")) { return call; } return Point_assertThisInitialized(self); }
function Point_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
function Point_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
function Point_getPrototypeOf(o) { Point_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Point_getPrototypeOf(o); }
/* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
* This program are made available under the terms of the Apache License, Version 2.0
* which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
/**
* @class SuperMap.Geometry.Point
* @classdesc 点几何对象类。
* @category BaseTypes Geometry
* @extends {SuperMap.Geometry}
* @param {float} x - x 坐标。
* @param {float} y - y 坐标。
* @param {string} [type = 'Point'] - 用来存储点的类型。
* @param {float} [tag] - 用来存储额外的属性,比如差值分析中的 Z 值。
* @example
* var point = new SuperMap.Geometry.Point(-111.04, 45.68);
*/
var Point = /*#__PURE__*/function (_Geometry) {
Point_inherits(Point, _Geometry);
var _super = Point_createSuper(Point);
function Point(x, y, type, tag) {
var _this;
Point_classCallCheck(this, Point);
_this = _super.call(this, x, y, type, tag);
/**
* @member {float} SuperMap.Geometry.Point.prototype.x
* @description 横坐标。
*/
_this.x = parseFloat(x);
/**
* @member {float} SuperMap.Geometry.Point.prototype.y
* @description 纵坐标。
*/
_this.y = parseFloat(y);
/**
* @member {string} SuperMap.Geometry.Point.prototype.tag
* @description 用来存储额外的属性,比如差值分析中的 Z 值。
*/
_this.tag = tag || tag == 0 ? parseFloat(tag) : null;
/**
* @member {string} SuperMap.Geometry.Point.prototype.tag
* @description 用来存储点的类型
*/
_this.type = type || "Point";
_this.CLASS_NAME = "SuperMap.Geometry.Point";
_this.geometryType = "Point";
return _this;
}
/**
* @function SuperMap.Geometry.Point.prototype.clone
* @description 克隆点对象。
* @returns {SuperMap.Geometry.Point} 克隆后的点对象。
*/
Point_createClass(Point, [{
key: "clone",
value: function clone(obj) {
if (obj == null) {
obj = new Point(this.x, this.y);
} // catch any randomly tagged-on properties
Util.applyDefaults(obj, this);
return obj;
}
/**
* @function SuperMap.Geometry.Point.prototype.calculateBounds
* @description 计算点对象的范围。
*/
}, {
key: "calculateBounds",
value: function calculateBounds() {
this.bounds = new Bounds(this.x, this.y, this.x, this.y);
}
/**
* @function SuperMap.Geometry.Point.prototype.equals
* @description 判断两个点对象是否相等。如果两个点对象具有相同的坐标,则认为是相等的。
* @example
* var point= new SuperMap.Geometry.Point(0,0);
* var point1={x:0,y:0};
* var result= point.equals(point1);
* @param {SuperMap.Geometry.Point} geom - 需要判断的点对象。
* @returns {boolean} 两个点对象是否相等(true 为相等,false 为不等)。
*/
}, {
key: "equals",
value: function equals(geom) {
var equals = false;
if (geom != null) {
equals = this.x === geom.x && this.y === geom.y || isNaN(this.x) && isNaN(this.y) && isNaN(geom.x) && isNaN(geom.y);
}
return equals;
}
/**
* @function SuperMap.Geometry.Point.prototype.move
* @description 沿着 x、y 轴的正方向上按照给定的位移移动点对象,move 不仅改变了几何对象的位置并且清理了边界缓存。
* @param {float} x - x 轴正方向上的偏移量。
* @param {float} y - y 轴正方向上偏移量。
*/
}, {
key: "move",
value: function move(x, y) {
this.x = this.x + x;
this.y = this.y + y;
this.clearBounds();
}
/**
* @function SuperMap.Geometry.Point.prototype.toShortString
* @returns {string} 字符串代表点对象。(ex. "5, 42")
*/
}, {
key: "toShortString",
value: function toShortString() {
return this.x + ", " + this.y;
}
/**
* @function SuperMap.Geometry.Point.prototype.destroy
* @description 释放点对象的资源。
*/
}, {
key: "destroy",
value: function destroy() {
this.x = null;
this.y = null;
this.tag = null;
Point_get(Point_getPrototypeOf(Point.prototype), "destroy", this).call(this);
}
/**
* @function SuperMap.Geometry.Point.prototype.getVertices
* @description 返回点对象的所有顶点的列表。
* @param {boolean} [nodes] - 对于点对象此参数不起作用,直接返回点。
* @returns {Array} 几何图形的顶点列表。
*/
}, {
key: "getVertices",
value: function getVertices(nodes) {
// eslint-disable-line no-unused-vars
return [this];
}
}]);
return Point;
}(Geometry);
SuperMap.Geometry.Point = Point;
;// CONCATENATED MODULE: ./src/common/commontypes/geometry/LineString.js
function LineString_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { LineString_typeof = function _typeof(obj) { return typeof obj; }; } else { LineString_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return LineString_typeof(obj); }
function LineString_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function LineString_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
function LineString_createClass(Constructor, protoProps, staticProps) { if (protoProps) LineString_defineProperties(Constructor.prototype, protoProps); if (staticProps) LineString_defineProperties(Constructor, staticProps); return Constructor; }
function LineString_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { LineString_get = Reflect.get; } else { LineString_get = function _get(target, property, receiver) { var base = LineString_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return LineString_get(target, property, receiver || target); }
function LineString_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = LineString_getPrototypeOf(object); if (object === null) break; } return object; }
function LineString_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) LineString_setPrototypeOf(subClass, superClass); }
function LineString_setPrototypeOf(o, p) { LineString_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return LineString_setPrototypeOf(o, p); }
function LineString_createSuper(Derived) { var hasNativeReflectConstruct = LineString_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = LineString_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = LineString_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return LineString_possibleConstructorReturn(this, result); }; }
function LineString_possibleConstructorReturn(self, call) { if (call && (LineString_typeof(call) === "object" || typeof call === "function")) { return call; } return LineString_assertThisInitialized(self); }
function LineString_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
function LineString_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
function LineString_getPrototypeOf(o) { LineString_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return LineString_getPrototypeOf(o); }
/* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
* This program are made available under the terms of the Apache License, Version 2.0
* which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
/**
* @class SuperMap.Geometry.LineString
* @classdesc 几何对象线串类。
* @category BaseTypes Geometry
* @param {Array.} points - 用来生成线串的点数组。
* @extends {SuperMap.Geometry.Curve}
* @example
* var points = [new SuperMap.Geometry.Point(4933.319287022352, -3337.3849141502124),
* new SuperMap.Geometry.Point(4960.9674060199022, -3349.3316322355736),
* new SuperMap.Geometry.Point(5006.0235999418364, -3358.8890067038628),
* new SuperMap.Geometry.Point(5075.3145648369318, -3378.0037556404409),
* new SuperMap.Geometry.Point(5305.19551436013, -3376.9669111768926)],
* var roadLine = new SuperMap.Geometry.LineString(points);
*/
var LineString = /*#__PURE__*/function (_Curve) {
LineString_inherits(LineString, _Curve);
var _super = LineString_createSuper(LineString);
function LineString(points) {
var _this;
LineString_classCallCheck(this, LineString);
_this = _super.call(this, points);
_this.CLASS_NAME = "SuperMap.Geometry.LineString";
_this.geometryType = "LineString";
return _this;
}
/**
* @function SuperMap.Geometry.LineString.prototype.removeComponent
* @description 只有在线串上有三个或更多的点的时候,才会允许移除点(否则结果将会是单一的点)。
* @param {SuperMap.Geometry.Point} point - 将被删除的点。
* @returns {boolean} 删除的点。
*/
LineString_createClass(LineString, [{
key: "removeComponent",
value: function removeComponent(point) {
// eslint-disable-line no-unused-vars
var removed = this.components && this.components.length > 2;
if (removed) {
LineString_get(LineString_getPrototypeOf(LineString.prototype), "removeComponent", this).apply(this, arguments);
}
return removed;
}
/**
* @function SuperMap.Geometry.LineString.prototype.getSortedSegments
* @returns {Array} An array of segment objects. Segment objects have properties
* x1, y1, x2, and y2. The start point is represented by x1 and y1.
* The end point is represented by x2 and y2. Start and end are
* ordered so that x1 < x2.
*/
}, {
key: "getSortedSegments",
value: function getSortedSegments() {
var numSeg = this.components.length - 1;
var segments = new Array(numSeg),
point1,
point2;
for (var i = 0; i < numSeg; ++i) {
point1 = this.components[i];
point2 = this.components[i + 1];
if (point1.x < point2.x) {
segments[i] = {
x1: point1.x,
y1: point1.y,
x2: point2.x,
y2: point2.y
};
} else {
segments[i] = {
x1: point2.x,
y1: point2.y,
x2: point1.x,
y2: point1.y
};
}
} // more efficient to define this somewhere static
function byX1(seg1, seg2) {
return seg1.x1 - seg2.x1;
}
return segments.sort(byX1);
}
/**
* @function SuperMap.Geometry.LineString.prototype.getVertices
* @description 返回几何图形的所有顶点的列表。
* @param {boolean} [nodes] - 对于线来说,仅仅返回作为端点的顶点,如果设为 false,则返回非端点的顶点。如果没有设置此参数,则返回所有顶点。
* @returns {Array} 几何图形的顶点列表。
*/
}, {
key: "getVertices",
value: function getVertices(nodes) {
var vertices;
if (nodes === true) {
vertices = [this.components[0], this.components[this.components.length - 1]];
} else if (nodes === false) {
vertices = this.components.slice(1, this.components.length - 1);
} else {
vertices = this.components.slice();
}
return vertices;
}
/**
* @function SuperMap.Geometry.LineString.calculateCircle
* @description 三点画圆弧。
* @param {Array.} points - 传入的待计算的初始点串。
* @returns {Array.} 计算出相应的圆弧控制点。
* @example
* var points = [];
* points.push(new SuperMap.Geometry.Point(-50,30));
* points.push(new SuperMap.Geometry.Point(-30,50));
* points.push(new SuperMap.Geometry.Point(2,60));
* var circle = SuperMap.Geometry.LineString.calculateCircle(points);
*/
}], [{
key: "calculateCircle",
value: function calculateCircle(points) {
if (points.length < 3) {
return points;
}
var centerPoint = {},
p1 = points[0],
p2 = points[1],
p3 = points[2];
var R = 0,
dStep = 0,
direc = true,
dRotation = 0,
dRotationBegin = 0,
dRotationAngle = 0,
nSegmentCount = 72,
circlePoints = [];
var KTan13 = (p3.y - p1.y) / (p3.x - p1.x);
var B13 = p3.y - KTan13 * p3.x;
if (p3.x != p1.x && p3.y != p1.y && p2.y == KTan13 * p2.x + B13 || p3.x == p1.x && p2.x == p1.x || p3.y == p1.y && p2.y == p1.y || p3.x == p1.x && p3.y == p1.y || p3.x == p2.x && p3.y == p2.y || p1.x == p2.x && p1.y == p2.y) {
circlePoints.push(p1);
circlePoints.push(p2);
circlePoints.push(p3);
} else {
var D = (p2.x * p2.x + p2.y * p2.y - (p1.x * p1.x + p1.y * p1.y)) * (2 * (p3.y - p1.y)) - (p3.x * p3.x + p3.y * p3.y - (p1.x * p1.x + p1.y * p1.y)) * (2 * (p2.y - p1.y));
var E = 2 * (p2.x - p1.x) * (p3.x * p3.x + p3.y * p3.y - (p1.x * p1.x + p1.y * p1.y)) - 2 * (p3.x - p1.x) * (p2.x * p2.x + p2.y * p2.y - (p1.x * p1.x + p1.y * p1.y));
var F = 4 * ((p2.x - p1.x) * (p3.y - p1.y) - (p3.x - p1.x) * (p2.y - p1.y));
centerPoint.x = D / F;
centerPoint.y = E / F;
R = Math.sqrt((p1.x - centerPoint.x) * (p1.x - centerPoint.x) + (p1.y - centerPoint.y) * (p1.y - centerPoint.y));
var dis = (p1.x - p3.x) * (p1.x - p3.x) + (p1.y - p3.y) * (p1.y - p3.y);
var cons = (2 * R * R - dis) / (2 * R * R);
cons = cons >= 1 ? 1 : cons;
cons = cons <= -1 ? -1 : cons;
dRotationAngle = Math.acos(cons) * 180 / Math.PI;
if (p3.x == p1.x) {
dRotationAngle = centerPoint.x > p1.x && p2.x > p1.x || centerPoint.x < p1.x && p2.x < p1.x ? 360 - dRotationAngle : dRotationAngle;
} else {
dRotationAngle = centerPoint.y > KTan13 * centerPoint.x + B13 && p2.y > KTan13 * p2.x + B13 || centerPoint.y < KTan13 * centerPoint.x + B13 && p2.y < KTan13 * p2.x + B13 ? 360 - dRotationAngle : dRotationAngle;
}
dStep = dRotationAngle / 72;
if (p3.y != p1.y) {
if (p3.x == p1.x) {
if (p3.y > p1.y) {
if (p2.x < p1.x) {
direc = false;
}
} else {
if (p2.x > p1.x) {
direc = false;
}
}
} else if (p3.x < p1.x) {
if (p2.y < KTan13 * p2.x + B13) {
direc = false;
}
} else {
if (p2.y > KTan13 * p2.x + B13) {
direc = false;
}
}
} else {
if (p3.x > p1.x) {
if (p2.y > p1.y) {
direc = false;
}
} else {
if (p2.y < p1.y) {
direc = false;
}
}
}
var K10 = (p1.y - centerPoint.y) / (p1.x - centerPoint.x);
var atan10 = K10 >= 0 ? Math.atan(K10) * 180 / Math.PI : Math.abs(Math.atan(K10) * 180 / Math.PI) + 90;
var CY = Math.abs(centerPoint.y);
if (p1.y == CY && CY == p3.y) {
if (p1.x < p3.x) {
atan10 = atan10 + 180;
}
}
var newPY = p1.y - centerPoint.y;
circlePoints.push(p1);
for (var i = 1; i < nSegmentCount; i++) {
dRotation = dStep * i;
dRotationBegin = atan10;
if (direc) {
if (newPY >= 0) {
if (K10 >= 0) {
dRotationBegin = dRotationBegin + dRotation;
} else {
dRotationBegin = 180 - (dRotationBegin - 90) + dRotation;
}
} else {
if (K10 > 0) {
dRotationBegin = dRotationBegin - 180 + dRotation;
} else {
dRotationBegin = 90 - dRotationBegin + dRotation;
}
}
} else {
if (newPY >= 0) {
if (K10 >= 0) {
dRotationBegin = dRotationBegin - dRotation;
} else {
dRotationBegin = 180 - (dRotationBegin - 90) - dRotation;
}
} else {
if (K10 >= 0) {
dRotationBegin = dRotationBegin - 180 - dRotation;
} else {
dRotationBegin = 90 - dRotationBegin - dRotation;
}
}
}
dRotationBegin = dRotationBegin * Math.PI / 180;
var x = centerPoint.x + R * Math.cos(dRotationBegin);
var y = centerPoint.y + R * Math.sin(dRotationBegin);
circlePoints.push(new Point(x, y));
}
circlePoints.push(p3);
}
return circlePoints;
}
/**
* @function SuperMap.Geometry.LineString.createLineEPS
* @description 根据点的类型画出不同类型的曲线。
* 点的类型有三种:LTypeArc,LTypeCurve,NONE。
* @param {Array.} points - 传入的待计算的初始点串。
* @returns {Array.} 计算出相应的 lineEPS 控制点。
* @example
* var points = [];
* points.push(new SuperMap.Geometry.Point(-50,30));
* points.push(new SuperMap.Geometry.Point(-30,50,"LTypeArc"));
* points.push(new SuperMap.Geometry.Point(2,60));
* points.push(new SuperMap.Geometry.Point(8,20));
* var lineEPS = SuperMap.Geometry.LineString.createLineEPS(points);
*/
}, {
key: "createLineEPS",
value: function createLineEPS(points) {
var list = [],
len = points.length;
if (len < 2) {
return points;
}
for (var i = 0; i < len;) {
var type = points[i].type;
if (type == 'LTypeArc') {
var listObj = LineString.createLineArc(list, i, len, points);
list = listObj[0];
i = listObj[1];
} else {
list.push(points[i]);
i++;
}
}
return list;
}
}, {
key: "createLineArc",
value: function createLineArc(list, i, len, points) {
if (i == 0) {
var bezierPtsObj = LineString.addPointEPS(points, i, len, 'LTypeArc');
Array.prototype.push.apply(list, bezierPtsObj[0]);
i = bezierPtsObj[1] + 1;
} else if (i == len - 1) {
var bezierP = [points[i - 1], points[i]],
bezierPts = LineString.calculateCircle(bezierP);
Array.prototype.push.apply(list, bezierPts);
i++;
} else {
var _bezierPtsObj = LineString.addPointEPS(points, i, len, 'LTypeArc');
list.pop();
Array.prototype.push.apply(list, _bezierPtsObj[0]);
i = _bezierPtsObj[1] + 1;
}
return [list, i];
}
}, {
key: "addPointEPS",
value: function addPointEPS(points, i, len, type) {
var bezierP = [],
j = i + 1;
if (i == 0) {
Array.prototype.push.apply(bezierP, [points[i], points[i + 1]]);
} else if (i == len - 1) {
Array.prototype.push.apply(bezierP, [points[i - 1], points[i]]);
} else {
Array.prototype.push.apply(bezierP, [points[i - 1], points[i], points[i + 1]]);
}
var bezierPts;
if (type == 'LTypeCurve') {
bezierPts = LineString.calculatePointsFBZN(bezierP);
} else if (type == 'LTypeArc') {
bezierPts = LineString.calculateCircle(bezierP);
}
return [bezierPts, j];
}
}]);
return LineString;
}(Curve);
SuperMap.Geometry.LineString = LineString;
;// CONCATENATED MODULE: ./src/common/commontypes/geometry/GeoText.js
function GeoText_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { GeoText_typeof = function _typeof(obj) { return typeof obj; }; } else { GeoText_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return GeoText_typeof(obj); }
function GeoText_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function GeoText_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
function GeoText_createClass(Constructor, protoProps, staticProps) { if (protoProps) GeoText_defineProperties(Constructor.prototype, protoProps); if (staticProps) GeoText_defineProperties(Constructor, staticProps); return Constructor; }
function GeoText_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { GeoText_get = Reflect.get; } else { GeoText_get = function _get(target, property, receiver) { var base = GeoText_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return GeoText_get(target, property, receiver || target); }
function GeoText_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GeoText_getPrototypeOf(object); if (object === null) break; } return object; }
function GeoText_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) GeoText_setPrototypeOf(subClass, superClass); }
function GeoText_setPrototypeOf(o, p) { GeoText_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GeoText_setPrototypeOf(o, p); }
function GeoText_createSuper(Derived) { var hasNativeReflectConstruct = GeoText_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = GeoText_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = GeoText_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return GeoText_possibleConstructorReturn(this, result); }; }
function GeoText_possibleConstructorReturn(self, call) { if (call && (GeoText_typeof(call) === "object" || typeof call === "function")) { return call; } return GeoText_assertThisInitialized(self); }
function GeoText_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
function GeoText_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
function GeoText_getPrototypeOf(o) { GeoText_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GeoText_getPrototypeOf(o); }
/* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
* This program are made available under the terms of the Apache License, Version 2.0
* which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
/**
* @class SuperMap.Geometry.GeoText
* @classdesc 文本标签类。
* @category BaseTypes Geometry
* @extends {SuperMap.Geometry}
* @param {float} x - x 坐标。
* @param {float} y - y 坐标。
* @param {string} text - 标签中的文本内容。
*/
var GeoText = /*#__PURE__*/function (_Geometry) {
GeoText_inherits(GeoText, _Geometry);
var _super = GeoText_createSuper(GeoText);
function GeoText(x, y, text) {
var _this;
GeoText_classCallCheck(this, GeoText);
_this = _super.call(this, x, y, text);
/**
* @member {float} SuperMap.Geometry.GeoText.prototype.x
* @description 横坐标。
*/
_this.x = parseFloat(x);
/**
* @member {float} SuperMap.Geometry.GeoText.prototype.y
* @description 纵坐标。
*/
_this.y = parseFloat(y);
/**
* @member {string} SuperMap.Geometry.GeoText.prototype.text
* @description 标签中的文本内容。
*/
_this.text = text.toString();
/**
* @member {Object} SuperMap.Geometry.GeoText.prototype.bsInfo
* @description 标签范围的基础信息。
* @property {number} w - bounds 的宽。
* @property {number} h - bounds 的高度。
*/
_this.bsInfo = {
"h": null,
"w": null
};
_this.element = document.createElement('span');
_this.CLASS_NAME = "SuperMap.Geometry.GeoText";
_this.geometryType = "GeoText";
return _this;
}
/**
* @function SuperMap.Geometry.GeoText.prototype.destroy
* @description 销毁文本标签类。
*/
GeoText_createClass(GeoText, [{
key: "destroy",
value: function destroy() {
GeoText_get(GeoText_getPrototypeOf(GeoText.prototype), "destroy", this).call(this);
this.x = null;
this.y = null;
this.text = null;
}
/**
* @function SuperMap.Geometry.GeoText.prototype.getCentroid
* @description 获取标签对象的质心。
* @returns {SuperMap.Geometry.Point} 标签对象的质心。
*/
}, {
key: "getCentroid",
value: function getCentroid() {
return new Point(this.x, this.y);
}
/**
* @function SuperMap.Geometry.GeoText.prototype.clone
* @description 克隆标签对象。
* @returns {SuperMap.Geometry.GeoText} 克隆后的标签对象。
*/
}, {
key: "clone",
value: function clone(obj) {
if (obj == null) {
obj = new GeoText(this.x, this.y, this.text);
}
Util.applyDefaults(obj, this);
return obj;
}
/**
* @function SuperMap.Geometry.GeoText.prototype.calculateBounds
* @description 计算标签对象的范围。
*/
}, {
key: "calculateBounds",
value: function calculateBounds() {
this.bounds = new Bounds(this.x, this.y, this.x, this.y);
}
/**
* @function SuperMap.Geometry.GeoText.prototype.getLabelPxBoundsByLabel
* @description 根据绘制好的标签获取文字标签的像素范围,参数的单位是像素;此方法相对于 getLabelPxBoundsByText 效率较低,但支持所有格式的文本。
* @param {Object} locationPixel - 标签的位置点,该对象含有属性 x(横坐标),属性 y(纵坐标)。
* @param {string} labelWidth - 标签的宽度,如:“90px”。
* @param {string} labelHeight - 标签的高度。
* @param {Object} style - 标签的 style。
* @returns {SuperMap.Bounds} 标签的像素范围。
*/
}, {
key: "getLabelPxBoundsByLabel",
value: function getLabelPxBoundsByLabel(locationPixel, labelWidth, labelHeight, style) {
var labelPxBounds, left, bottom, top, right;
var locationPx = Util.cloneObject(locationPixel); //计算文本行数
var theText = style.label || this.text;
var textRows = theText.split('\n');
var laberRows = textRows.length; //处理文字对齐
labelWidth = parseFloat(labelWidth);
labelHeight = parseFloat(labelHeight);
if (laberRows > 1) {
labelHeight = parseFloat(labelHeight) * laberRows;
}
if (style.labelAlign && style.labelAlign !== "cm") {
switch (style.labelAlign) {
case "lt":
locationPx.x += labelWidth / 2;
locationPx.y += labelHeight / 2;
break;
case "lm":
locationPx.x += labelWidth / 2;
break;
case "lb":
locationPx.x += labelWidth / 2;
locationPx.y -= labelHeight / 2;
break;
case "ct":
locationPx.y += labelHeight / 2;
break;
case "cb":
locationPx.y -= labelHeight / 2;
break;
case "rt":
locationPx.x -= labelWidth / 2;
locationPx.y += labelHeight / 2;
break;
case "rm":
locationPx.x -= labelWidth / 2;
break;
case "rb":
locationPx.x -= labelWidth / 2;
locationPx.y -= labelHeight / 2;
break;
default:
break;
}
}
this.bsInfo.h = labelHeight;
this.bsInfo.w = labelWidth; //bounds的四边
left = locationPx.x - parseFloat(labelWidth) / 2;
bottom = locationPx.y + parseFloat(labelHeight) / 2;
right = locationPx.x + parseFloat(labelWidth) / 2;
top = locationPx.y - parseFloat(labelHeight) / 2;
labelPxBounds = new Bounds(left, bottom, right, top);
return labelPxBounds;
}
/**
* @function SuperMap.Geometry.GeoText.prototype.getLabelPxBoundsByText
* @description 根据文本内容获取文字标签的像素范围。
* @param {Object} locationPixel - 标签的位置点,该对象含有属性 x(横坐标),属性 y(纵坐标)。
* @param {Object} style - 标签的样式。
* @returns {SuperMap.Bounds} 标签的像素范围。
*/
}, {
key: "getLabelPxBoundsByText",
value: function getLabelPxBoundsByText(locationPixel, style) {
var labelPxBounds, left, bottom, top, right;
var labelSize = this.getLabelPxSize(style);
var locationPx = Util.cloneObject(locationPixel); //处理文字对齐
if (style.labelAlign && style.labelAlign !== "cm") {
switch (style.labelAlign) {
case "lt":
locationPx.x += labelSize.w / 2;
locationPx.y += labelSize.h / 2;
break;
case "lm":
locationPx.x += labelSize.w / 2;
break;
case "lb":
locationPx.x += labelSize.w / 2;
locationPx.y -= labelSize.h / 2;
break;
case "ct":
locationPx.y += labelSize.h / 2;
break;
case "cb":
locationPx.y -= labelSize.h / 2;
break;
case "rt":
locationPx.x -= labelSize.w / 2;
locationPx.y += labelSize.h / 2;
break;
case "rm":
locationPx.x -= labelSize.w / 2;
break;
case "rb":
locationPx.x -= labelSize.w / 2;
locationPx.y -= labelSize.h / 2;
break;
default:
break;
}
}
this.bsInfo.h = labelSize.h;
this.bsInfo.w = labelSize.w;
left = locationPx.x - labelSize.w / 2;
bottom = locationPx.y + labelSize.h / 2; //处理斜体字
if (style.fontStyle && style.fontStyle === "italic") {
right = locationPx.x + labelSize.w / 2 + parseInt(parseFloat(style.fontSize) / 2);
} else {
right = locationPx.x + labelSize.w / 2;
}
top = locationPx.y - labelSize.h / 2;
labelPxBounds = new Bounds(left, bottom, right, top);
return labelPxBounds;
}
/**
* @function SuperMap.Geometry.GeoText.prototype.getLabelPxSize
* @description 获取 label 的像素大小。
* @param {Object} style - 标签样式。
* @returns {Object} 标签大小对象,属性 w 表示标签的宽度,属性 h 表示标签的高度。
*/
}, {
key: "getLabelPxSize",
value: function getLabelPxSize(style) {
var text,
//文本内容
fontSize,
//字体大小
spacing = 1,
//两个字符间的间距(单位:px)
lineSpacing = 0.2,
bgstrokeWidth = parseFloat(style.strokeWidth); //标签背景框边框的宽度
text = style.label || this.text;
if (style.fontSize) {
fontSize = parseFloat(style.fontSize);
} else {
fontSize = parseFloat("12px");
} //标签宽高
var labelW, labelH;
var textRows = text.split('\n');
var numRows = textRows.length;
if (numRows > 1) {
labelH = fontSize * numRows + numRows + bgstrokeWidth + lineSpacing * fontSize;
} else {
labelH = fontSize + bgstrokeWidth + lineSpacing * fontSize + 1;
} //取最大宽度
labelW = 0;
if (this.labelWTmp && labelW < this.labelWTmp) {
labelW = this.labelWTmp;
}
for (var i = 0; i < numRows; i++) {
var textCharC = this.getTextCount(textRows[i]);
var labelWTmp = this.labelWTmp = Util.getTextBounds(style, textRows[i], this.element).textWidth + textCharC.textC * spacing + bgstrokeWidth;
if (labelW < labelWTmp) {
labelW = labelWTmp;
}
}
var labelSize = new Object(); //标签大小
labelSize.h = labelH;
labelSize.w = labelW;
return labelSize;
}
/**
* @function SuperMap.Geometry.GeoText.prototype.getTextCount
* @description 获取 text 中的字符个数。
* @param {string} text - 字符串。
* @returns {Object} 字符个数统计结果,属性 cnC 表示中文字符个数,属性 enC 表示英文字符个数,属性 textC 表示字符总个数。
*/
}, {
key: "getTextCount",
value: function getTextCount(text) {
var textCharCount = {};
var cnCount = 0;
var enCount = 0;
for (var i = 0; i < text.length; i++) {
if (text.charCodeAt(i) > 255) {
//遍历判断字符串中每个字符的Unicode码,大于255则为中文
cnCount++;
} else {
enCount++;
}
} //中午字符个数
textCharCount.cnC = cnCount; //英文字符个数
textCharCount.enC = enCount; //字符总个数
textCharCount.textC = text.length;
return textCharCount;
}
}]);
return GeoText;
}(Geometry);
SuperMap.Geometry.GeoText = GeoText;
;// CONCATENATED MODULE: ./src/common/commontypes/geometry/LinearRing.js
function LinearRing_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { LinearRing_typeof = function _typeof(obj) { return typeof obj; }; } else { LinearRing_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return LinearRing_typeof(obj); }
function LinearRing_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function LinearRing_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
function LinearRing_createClass(Constructor, protoProps, staticProps) { if (protoProps) LinearRing_defineProperties(Constructor.prototype, protoProps); if (staticProps) LinearRing_defineProperties(Constructor, staticProps); return Constructor; }
function LinearRing_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { LinearRing_get = Reflect.get; } else { LinearRing_get = function _get(target, property, receiver) { var base = LinearRing_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return LinearRing_get(target, property, receiver || target); }
function LinearRing_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = LinearRing_getPrototypeOf(object); if (object === null) break; } return object; }
function LinearRing_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) LinearRing_setPrototypeOf(subClass, superClass); }
function LinearRing_setPrototypeOf(o, p) { LinearRing_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return LinearRing_setPrototypeOf(o, p); }
function LinearRing_createSuper(Derived) { var hasNativeReflectConstruct = LinearRing_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = LinearRing_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = LinearRing_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return LinearRing_possibleConstructorReturn(this, result); }; }
function LinearRing_possibleConstructorReturn(self, call) { if (call && (LinearRing_typeof(call) === "object" || typeof call === "function")) { return call; } return LinearRing_assertThisInitialized(self); }
function LinearRing_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
function LinearRing_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
function LinearRing_getPrototypeOf(o) { LinearRing_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return LinearRing_getPrototypeOf(o); }
/* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
* This program are made available under the terms of the Apache License, Version 2.0
* which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
/**
* @class SuperMap.Geometry.LinearRing
* @classdesc 几何对象线环类,是一个特殊的封闭的线串,在每次 addPoint/removePoint 之后会通过添加一个点(此点是复制的第一个点得到的)
* 作为最后的一个点来自动关闭线环。
* @category BaseTypes Geometry
* @extends {SuperMap.Geometry.LineString}
* @param {Array.} points - 组成线性环的点。
* @example
* var points = [new SuperMap.Geometry.Point(4933.319287022352, -3337.3849141502124),
* new SuperMap.Geometry.Point(4960.9674060199022, -3349.3316322355736),
* new SuperMap.Geometry.Point(5006.0235999418364, -3358.8890067038628),
* new SuperMap.Geometry.Point(5075.3145648369318, -3378.0037556404409),
* new SuperMap.Geometry.Point(5305.19551436013, -3376.9669111768926)],
* var linearRing = new SuperMap.Geometry.LinearRing(points);
*/
var LinearRing = /*#__PURE__*/function (_LineString) {
LinearRing_inherits(LinearRing, _LineString);
var _super = LinearRing_createSuper(LinearRing);
function LinearRing(points) {
var _this;
LinearRing_classCallCheck(this, LinearRing);
_this = _super.call(this, points);
/**
* @member {Array.} [SuperMap.Geometry.LinearRing.prototype.componentTypes=["SuperMap.Geometry.Point"]]
* @description components 存储的的几何对象所支持的几何类型数组,为空表示类型不受限制。
* @readonly
*/
_this.componentTypes = ["SuperMap.Geometry.Point"];
_this.CLASS_NAME = "SuperMap.Geometry.LinearRing";
_this.geometryType = "LinearRing";
return _this;
}
/**
* @function SuperMap.Geometry.LinearRing.prototype.addComponent
* @description 添加一个点到几何图形数组中,如果这个点将要被添加到组件数组的末端,并且与数组中已经存在的最后一个点相同,
* 重复的点是不能被添加的。这将影响未关闭环的关闭。
* 这个方法可以通过将非空索引(组件数组的下标)作为第二个参数重写。
* @param {SuperMap.Geometry.Point} point - 点对象。
* @param {integer} [index] - 插入组件数组的下标。
* @returns {boolean} 点对象是否添加成功。
*/
LinearRing_createClass(LinearRing, [{
key: "addComponent",
value: function addComponent(point, index) {
var added = false; //remove last point
var lastPoint = this.components.pop(); // given an index, add the point
// without an index only add non-duplicate points
if (index != null || !point.equals(lastPoint)) {
added = LinearRing_get(LinearRing_getPrototypeOf(LinearRing.prototype), "addComponent", this).apply(this, arguments);
} //append copy of first point
var firstPoint = this.components[0];
LinearRing_get(LinearRing_getPrototypeOf(LinearRing.prototype), "addComponent", this).apply(this, [firstPoint]);
return added;
}
/**
* @function SuperMap.Geometry.LinearRing.prototype.removeComponent
* @description 从几何组件中删除一个点。
* @param {SuperMap.Geometry.Point} point - 点对象。
* @returns {boolean} 点对象是否删除。
*/
}, {
key: "removeComponent",
value: function removeComponent(point) {
// eslint-disable-line no-unused-vars
var removed = this.components && this.components.length > 3;
if (removed) {
//remove last point
this.components.pop(); //remove our point
LinearRing_get(LinearRing_getPrototypeOf(LinearRing.prototype), "removeComponent", this).apply(this, arguments); //append copy of first point
var firstPoint = this.components[0];
LinearRing_get(LinearRing_getPrototypeOf(LinearRing.prototype), "addComponent", this).apply(this, [firstPoint]);
}
return removed;
}
/**
* @function SuperMap.Geometry.LinearRing.prototype.getArea
* @description 获得当前几何对象区域大小,如果是沿顺时针方向的环则是正值,否则为负值。
* @returns {float} 环的面积。
*/
}, {
key: "getArea",
value: function getArea() {
var area = 0.0;
if (this.components && this.components.length > 2) {
var sum = 0.0;
for (var i = 0, len = this.components.length; i < len - 1; i++) {
var b = this.components[i];
var c = this.components[i + 1];
sum += (b.x + c.x) * (c.y - b.y);
}
area = -sum / 2.0;
}
return area;
}
/**
* @function SuperMap.Geometry.LinearRing.prototype.getVertices
* @description 返回几何图形的所有点的列表。
* @param {boolean} [nodes] - 对于线来说,仅仅返回作为端点的顶点,如果设为 false ,则返回非端点的顶点,如果没有设置此参数,则返回所有顶点。
* @returns {Array} 几何对象所有点的列表。
*/
}, {
key: "getVertices",
value: function getVertices(nodes) {
return nodes === true ? [] : this.components.slice(0, this.components.length - 1);
}
}]);
return LinearRing;
}(LineString);
SuperMap.Geometry.LinearRing = LinearRing;
;// CONCATENATED MODULE: ./src/common/commontypes/geometry/MultiLineString.js
function MultiLineString_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { MultiLineString_typeof = function _typeof(obj) { return typeof obj; }; } else { MultiLineString_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return MultiLineString_typeof(obj); }
function MultiLineString_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function MultiLineString_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) MultiLineString_setPrototypeOf(subClass, superClass); }
function MultiLineString_setPrototypeOf(o, p) { MultiLineString_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return MultiLineString_setPrototypeOf(o, p); }
function MultiLineString_createSuper(Derived) { var hasNativeReflectConstruct = MultiLineString_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = MultiLineString_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = MultiLineString_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return MultiLineString_possibleConstructorReturn(this, result); }; }
function MultiLineString_possibleConstructorReturn(self, call) { if (call && (MultiLineString_typeof(call) === "object" || typeof call === "function")) { return call; } return MultiLineString_assertThisInitialized(self); }
function MultiLineString_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
function MultiLineString_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
function MultiLineString_getPrototypeOf(o) { MultiLineString_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return MultiLineString_getPrototypeOf(o); }
/* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
* This program are made available under the terms of the Apache License, Version 2.0
* which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
/**
* @class SuperMap.Geometry.MultiLineString
* @classdesc 几何对象多线类。
* @category BaseTypes Geometry
* @extends {SuperMap.Geometry.Collection}
* @param {Array.} components - LineString 数组。
* @example
* var multi = new SuperMap.Geometry.MultiLineString([
* new SuperMap.Geometry.LineString([
* new SuperMap.Geometry.Point(1, 0),
* new SuperMap.Geometry.Point(0, 1)
* ])
* ]);
*/
var MultiLineString = /*#__PURE__*/function (_Collection) {
MultiLineString_inherits(MultiLineString, _Collection);
var _super = MultiLineString_createSuper(MultiLineString);
function MultiLineString(components) {
var _this;
MultiLineString_classCallCheck(this, MultiLineString);
_this = _super.call(this, components);
/**
* @member {Array.} [SuperMap.Geometry.MultiLineString.prototype.componentTypes=["SuperMap.Geometry.LineString"]]
* @description components 存储的的几何对象所支持的几何类型数组。
* @readonly
*/
_this.componentTypes = ["SuperMap.Geometry.LineString"];
_this.CLASS_NAME = "SuperMap.Geometry.MultiLineString";
_this.geometryType = "MultiLineString";
return _this;
}
return MultiLineString;
}(Collection);
SuperMap.Geometry.MultiLineString = MultiLineString;
;// CONCATENATED MODULE: ./src/common/commontypes/geometry/MultiPolygon.js
function MultiPolygon_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { MultiPolygon_typeof = function _typeof(obj) { return typeof obj; }; } else { MultiPolygon_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return MultiPolygon_typeof(obj); }
function MultiPolygon_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function MultiPolygon_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) MultiPolygon_setPrototypeOf(subClass, superClass); }
function MultiPolygon_setPrototypeOf(o, p) { MultiPolygon_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return MultiPolygon_setPrototypeOf(o, p); }
function MultiPolygon_createSuper(Derived) { var hasNativeReflectConstruct = MultiPolygon_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = MultiPolygon_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = MultiPolygon_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return MultiPolygon_possibleConstructorReturn(this, result); }; }
function MultiPolygon_possibleConstructorReturn(self, call) { if (call && (MultiPolygon_typeof(call) === "object" || typeof call === "function")) { return call; } return MultiPolygon_assertThisInitialized(self); }
function MultiPolygon_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
function MultiPolygon_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
function MultiPolygon_getPrototypeOf(o) { MultiPolygon_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return MultiPolygon_getPrototypeOf(o); }
/* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
* This program are made available under the terms of the Apache License, Version 2.0
* which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
/**
* @class SuperMap.Geometry.MultiPolygon
* @classdesc 几何对象多多边形类。
* @category BaseTypes Geometry
* @extends {SuperMap.Geometry.Collection}
* @param {Array.} components - 形成 MultiPolygon 的多边形数组。
* @example
* var points1 = [new SuperMap.Geometry.Point(10,10),new SuperMap.Geometry.Point(0,0)];
* var points2 = [new SuperMap.Geometry.Point(10,10),new SuperMap.Geometry.Point(0,0),new SuperMap.Geometry.Point(3,3),new SuperMap.Geometry.Point(10,10)];
*
* var linearRing1 = new SuperMap.Geometry.LinearRing(points1);
* var linearRing2 = new SuperMap.Geometry.LinearRing(points2);
*
* var polygon1 = new SuperMap.Geometry.Polygon([linearRing1]);
* var polygon2 = new SuperMap.Geometry.Polygon([linearRing2]);
*
* var multiPolygon1 = new SuperMap.Geometry.MultiPolygon([polygon1,polygon2]);
*/
var MultiPolygon = /*#__PURE__*/function (_Collection) {
MultiPolygon_inherits(MultiPolygon, _Collection);
var _super = MultiPolygon_createSuper(MultiPolygon);
function MultiPolygon(components) {
var _this;
MultiPolygon_classCallCheck(this, MultiPolygon);
_this = _super.call(this, components);
/**
* @member {Array.} [SuperMap.Geometry.MultiPolygon.prototype.componentTypes=["SuperMap.Geometry.Polygon"]]
* @description components 存储的的几何对象所支持的几何类型数组。
* @readonly
*/
_this.componentTypes = ["SuperMap.Geometry.Polygon"];
_this.CLASS_NAME = "SuperMap.Geometry.MultiPolygon";
_this.geometryType = "MultiPolygon";
return _this;
}
return MultiPolygon;
}(Collection);
SuperMap.Geometry.MultiPolygon = MultiPolygon;
;// CONCATENATED MODULE: ./src/common/commontypes/geometry/Polygon.js
function Polygon_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { Polygon_typeof = function _typeof(obj) { return typeof obj; }; } else { Polygon_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return Polygon_typeof(obj); }
function Polygon_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function Polygon_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
function Polygon_createClass(Constructor, protoProps, staticProps) { if (protoProps) Polygon_defineProperties(Constructor.prototype, protoProps); if (staticProps) Polygon_defineProperties(Constructor, staticProps); return Constructor; }
function Polygon_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) Polygon_setPrototypeOf(subClass, superClass); }
function Polygon_setPrototypeOf(o, p) { Polygon_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Polygon_setPrototypeOf(o, p); }
function Polygon_createSuper(Derived) { var hasNativeReflectConstruct = Polygon_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = Polygon_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = Polygon_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return Polygon_possibleConstructorReturn(this, result); }; }
function Polygon_possibleConstructorReturn(self, call) { if (call && (Polygon_typeof(call) === "object" || typeof call === "function")) { return call; } return Polygon_assertThisInitialized(self); }
function Polygon_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
function Polygon_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
function Polygon_getPrototypeOf(o) { Polygon_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Polygon_getPrototypeOf(o); }
/* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
* This program are made available under the terms of the Apache License, Version 2.0
* which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
/**
* @class SuperMap.Geometry.Polygon
* @classdesc 多边形几何对象类。
* @category BaseTypes Geometry
* @extends {SuperMap.Geometry.Collection}
* @param {Array.} components - 用来生成多边形的线环数组。
* @example
* var points =[new SuperMap.Geometry.Point(0,4010338),
* new SuperMap.Geometry.Point(1063524,4010338),
* new SuperMap.Geometry.Point(1063524,3150322),
* new SuperMap.Geometry.Point(0,3150322)
* ],
* var linearRings = new SuperMap.Geometry.LinearRing(points),
* var region = new SuperMap.Geometry.Polygon([linearRings]);
*/
var Polygon = /*#__PURE__*/function (_Collection) {
Polygon_inherits(Polygon, _Collection);
var _super = Polygon_createSuper(Polygon);
function Polygon(components) {
var _this;
Polygon_classCallCheck(this, Polygon);
_this = _super.call(this, components);
/**
* @member {Array.} [SuperMap.Geometry.Polygon.prototype.componentTypes=["SuperMap.Geometry.LinearRing"]]
* @description components 存储的的几何对象所支持的几何类型数组。
* @readonly
*/
_this.componentTypes = ["SuperMap.Geometry.LinearRing"];
_this.CLASS_NAME = "SuperMap.Geometry.Polygon";
_this.geometryType = "Polygon";
return _this;
}
/**
* @function SuperMap.Geometry.Polygon.prototype.getArea
* @description 获得区域面积,从区域的外部口径减去计此区域内部口径算所得的面积。
* @returns {float} 几何对象的面积。
*/
Polygon_createClass(Polygon, [{
key: "getArea",
value: function getArea() {
var area = 0.0;
if (this.components && this.components.length > 0) {
area += Math.abs(this.components[0].getArea());
for (var i = 1, len = this.components.length; i < len; i++) {
area -= Math.abs(this.components[i].getArea());
}
}
return area;
}
}]);
return Polygon;
}(Collection);
SuperMap.Geometry.Polygon = Polygon;
;// CONCATENATED MODULE: ./src/common/commontypes/geometry/Rectangle.js
function Rectangle_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { Rectangle_typeof = function _typeof(obj) { return typeof obj; }; } else { Rectangle_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return Rectangle_typeof(obj); }
function Rectangle_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function Rectangle_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
function Rectangle_createClass(Constructor, protoProps, staticProps) { if (protoProps) Rectangle_defineProperties(Constructor.prototype, protoProps); if (staticProps) Rectangle_defineProperties(Constructor, staticProps); return Constructor; }
function Rectangle_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) Rectangle_setPrototypeOf(subClass, superClass); }
function Rectangle_setPrototypeOf(o, p) { Rectangle_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Rectangle_setPrototypeOf(o, p); }
function Rectangle_createSuper(Derived) { var hasNativeReflectConstruct = Rectangle_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = Rectangle_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = Rectangle_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return Rectangle_possibleConstructorReturn(this, result); }; }
function Rectangle_possibleConstructorReturn(self, call) { if (call && (Rectangle_typeof(call) === "object" || typeof call === "function")) { return call; } return Rectangle_assertThisInitialized(self); }
function Rectangle_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
function Rectangle_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
function Rectangle_getPrototypeOf(o) { Rectangle_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Rectangle_getPrototypeOf(o); }
/* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
* This program are made available under the terms of the Apache License, Version 2.0
* which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
/**
* @class SuperMap.Geometry.Rectangle
* @classdesc 矩形几何对象类。
* @category BaseTypes Geometry
* @param {float} x - 矩形左下角点的横坐标。
* @param {float} y - 矩形左下角点的纵坐标。
* @param {float} width - 矩形的宽度。
* @param {float} height - 矩形的高度。
* @extends {SuperMap.Geometry}
* @example
* //x 为矩形左下角点的横坐标;y 为矩形左下角点的纵坐标;w 为矩形的宽度;h 为矩形的高度
* var x = 1;
* var y = 2;
* var w = 10;
* var h = 20;
* var recttangle = new SuperMap.Geometry.Rectangle(x, y, w, h);
*/
var Rectangle = /*#__PURE__*/function (_Geometry) {
Rectangle_inherits(Rectangle, _Geometry);
var _super = Rectangle_createSuper(Rectangle);
function Rectangle(x, y, width, height) {
var _this;
Rectangle_classCallCheck(this, Rectangle);
_this = _super.call(this, x, y, width, height);
/**
* @member {float} SuperMap.Geometry.Rectangle.prototype.x
* @description 矩形左下角点的横坐标。
*/
_this.x = x;
/**
* @member {float} SuperMap.Geometry.Rectangle.prototype.y
* @description 矩形左下角点的纵坐标。
*/
_this.y = y;
/**
* @member {float} SuperMap.Geometry.Rectangle.prototype.width
* @description 矩形的宽度。
*/
_this.width = width;
/**
* @member {float} SuperMap.Geometry.Rectangle.prototype.height
* @description 矩形的高度。
*/
_this.height = height;
_this.CLASS_NAME = "SuperMap.Geometry.Rectangle";
_this.geometryType = "Rectangle";
return _this;
}
/**
* @function SuperMap.Geometry.Rectangle.prototype.calculateBounds
* @description 计算出此矩形对象的 bounds。
*/
Rectangle_createClass(Rectangle, [{
key: "calculateBounds",
value: function calculateBounds() {
this.bounds = new Bounds(this.x, this.y, this.x + this.width, this.y + this.height);
}
/**
* @function SuperMap.Geometry.Rectangle.prototype.getArea
* @description 获取矩形对象的面积。
* @returns {float} 矩形对象面积。
*/
}, {
key: "getArea",
value: function getArea() {
var area = this.width * this.height;
return area;
}
}]);
return Rectangle;
}(Geometry);
SuperMap.Geometry.Rectangle = Rectangle;
;// CONCATENATED MODULE: ./src/common/commontypes/geometry/index.js
/* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
* This program are made available under the terms of the Apache License, Version 2.0
* which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
;// CONCATENATED MODULE: ./src/common/commontypes/Credential.js
function Credential_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function Credential_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
function Credential_createClass(Constructor, protoProps, staticProps) { if (protoProps) Credential_defineProperties(Constructor.prototype, protoProps); if (staticProps) Credential_defineProperties(Constructor, staticProps); return Constructor; }
/* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
* This program are made available under the terms of the Apache License, Version 2.0
* which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
/**
* @class SuperMap.Credential
* @category Security
* @classdesc SuperMap 的安全证书类,其中包括 token 等安全验证信息。
* 需要使用用户名和密码在:"http://localhost:8090/iserver/services/security/tokens" 下申请 value。
* 获得形如:"2OMwGmcNlrP2ixqv1Mk4BuQMybOGfLOrljruX6VcYMDQKc58Sl9nMHsqQaqeBx44jRvKSjkmpZKK1L596y7skQ.." 的 value。
* 目前支持的功能包括:地图服务、专题图、量算、查询、公交换乘、空间分析、网络分析,不支持轮询功能。
* @param {string} value - 访问受安全限制的服务时用于通过安全认证的验证信息。
* @param {string} [name='token'] - 验证信息前缀,name=value 部分的 name 部分。
* @example
* var pixcel = new SuperMap.Credential("valueString","token");
* pixcel.destroy();
*/
var Credential = /*#__PURE__*/function () {
function Credential(value, name) {
Credential_classCallCheck(this, Credential);
/**
* @member {string} SuperMap.Bounds.prototype.value
* @description 访问受安全限制的服务时用于通过安全认证的验证信息。
*/
this.value = value ? value : "";
/**
* @member {string} [SuperMap.Bounds.prototype.name='token']
* @description 验证信息前缀,name=value 部分的 name 部分。
*/
this.name = name ? name : "token";
this.CLASS_NAME = "SuperMap.Credential";
}
/**
* @function SuperMap.Credential.prototype.getUrlParameters
* @example
* var credential = new SuperMap.Credential("valueString","token");
* //这里 str = "token=valueString";
* var str = credential.getUrlParameters();
* @returns {string} 返回安全信息组成的 url 片段。
*/
Credential_createClass(Credential, [{
key: "getUrlParameters",
value: function getUrlParameters() {
//当需要其他安全信息的时候,则需要return this.name + "=" + this.value + "&" + "...";的形式添加。
return this.name + "=" + this.value;
}
/**
* @function SuperMap.Bounds.prototype.getValue
* @description 获取 value。
* @example
* var credential = new SuperMap.Credential("2OMwGmcNlrP2ixqv1Mk4BuQMybOGfLOrljruX6VcYMDQKc58Sl9nMHsqQaqeBx44jRvKSjkmpZKK1L596y7skQ..","token");
* //这里 str = "2OMwGmcNlrP2ixqv1Mk4BuQMybOGfLOrljruX6VcYMDQKc58Sl9nMHsqQaqeBx44jRvKSjkmpZKK1L596y7skQ..";
* var str = credential.getValue();
* @returns {string} 返回 value 字符串,在 iServer 服务下该 value 值即为 token 值。
*/
}, {
key: "getValue",
value: function getValue() {
return this.value;
}
/**
*
* @function SuperMap.Credential.prototype.destroy
* @description 销毁此对象。销毁后此对象的所有属性为 null,而不是初始值。
* @example
* var credential = new SuperMap.Credential("valueString","token");
* credential.destroy();
*/
}, {
key: "destroy",
value: function destroy() {
this.value = null;
this.name = null;
}
}]);
return Credential;
}();
/**
* @member {SuperMap.Credential} SuperMap.Credential.CREDENTIAL
* @description 这个对象保存一个安全类的实例,在服务端需要安全验证的时候必须进行设置。
* @constant
* @example
* 代码实例:
* // 当iServer启用服务安全的时候,下边的代码是必须的。安全证书类能够接收一个value和一个name参数。
* var value = "(以iServer为例,这里是申请的token值)";
* var name = "token";
* // 默认name参数为token,所以当使用iServer服务的时候可以不进行设置。
* SuperMap.Credential.CREDENTIAL = new SuperMap.Credential(value, name);
*
*/
Credential.CREDENTIAL = null;
SuperMap.Credential = Credential;
;// CONCATENATED MODULE: ./src/common/commontypes/Date.js
/* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
* This program are made available under the terms of the Apache License, Version 2.0
* which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
/**
* @name Date
* @memberOf SuperMap
* @namespace
* @category BaseTypes Util
* @description 包含 parse、toISOString 方法的实现,两个方法用来解析 RFC 3339 日期,遵循 ECMAScript 5 规范。
*/
var DateExt = SuperMap.Date = {
/**
* @description 生成代表一个具体的日期字符串,该日期遵循 ISO 8601 标准(详情查看{@link http://tools.ietf.org/html/rfc3339})。
* @example
* var dateString = SuperMap.Date.toISOString(new Date());
* @param {Date} date - 日期对象。
* @returns {string} 一个代表日期的字符串。(例如 "2010-08-07T16:58:23.123Z")。
*/
toISOString: function () {
//标准的Date会存在toISOString方法,可以直接调用
if ("toISOString" in Date.prototype) {
return function (date) {
return date.toISOString();
};
} else {
// 部分浏览器没有,就得自己组合,组合后的字符串规则不变
var pad = function pad(num, len) {
var str = num + "";
while (str.length < len) {
str = "0" + str;
}
return str;
};
return function (date) {
var str;
if (isNaN(date.getTime())) {
// ECMA-262 says throw RangeError, Firefox returns
// "Invalid Date"
str = "Invalid Date";
} else {
str = date.getUTCFullYear() + "-" + pad(date.getUTCMonth() + 1, 2) + "-" + pad(date.getUTCDate(), 2) + "T" + pad(date.getUTCHours(), 2) + ":" + pad(date.getUTCMinutes(), 2) + ":" + pad(date.getUTCSeconds(), 2) + "." + pad(date.getUTCMilliseconds(), 3) + "Z";
}
return str;
};
}
}(),
/**
* @description 从一个字符串生成一个日期对象。
* @example
* var date = SuperMap.Date.parse("2010-08-07");
* @param {string} str - 代表日期的字符串。(例如: "2010", "2010-08", "2010-08-07", "2010-08-07T16:58:23.123Z","2010-08-07T11:58:23.123-06")。
* @returns {Date} 日期对象,如果字符串无法被解析,则返回一个无效的日期。(例如 isNaN(date.getTime()))。
*/
parse: function parse(str) {
var date;
var match = str.match(/^(?:(\d{4})(?:-(\d{2})(?:-(\d{2}))?)?)?(?:(?:T(\d{1,2}):(\d{2}):(\d{2}(?:\.\d+)?)(Z|(?:[+-]\d{1,2}(?::(\d{2}))?)))|Z)?$/);
if (match && (match[1] || match[7])) {
// must have at least year or time
var year = parseInt(match[1], 10) || 0;
var month = parseInt(match[2], 10) - 1 || 0;
var day = parseInt(match[3], 10) || 1;
date = new Date(Date.UTC(year, month, day)); // optional time
var type = match[7];
if (type) {
var hours = parseInt(match[4], 10);
var minutes = parseInt(match[5], 10);
var secFrac = parseFloat(match[6]);
var seconds = secFrac | 0;
var milliseconds = Math.round(1000 * (secFrac - seconds));
date.setUTCHours(hours, minutes, seconds, milliseconds); // check offset
if (type !== "Z") {
var hoursOffset = parseInt(type, 10);
var minutesOffset = parseInt(match[8], 10) || 0;
var offset = -1000 * (60 * (hoursOffset * 60) + minutesOffset * 60);
date = new Date(date.getTime() + offset);
}
}
} else {
date = new Date("invalid");
}
return date;
}
};
;// CONCATENATED MODULE: ./src/common/commontypes/Event.js
/* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
* This program are made available under the terms of the Apache License, Version 2.0
* which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
/**
* @name Event
* @memberOf SuperMap
* @namespace
* @description 事件处理函数.
*/
var Event = SuperMap.Event = {
/**
* @description A hash table cache of the event observers. Keyed by element._eventCacheID
* @type {boolean}
* @default false
*/
observers: false,
/**
* @description KEY_SPACE
* @type {number}
* @default 32
*/
KEY_SPACE: 32,
/**
* @description KEY_BACKSPACE
* @type {number}
* @default 8
*/
KEY_BACKSPACE: 8,
/**
* @description KEY_TAB
* @type {number}
* @default 9
*/
KEY_TAB: 9,
/**
* @description KEY_RETURN
* @type {number}
* @default 13
*/
KEY_RETURN: 13,
/**
* @description KEY_ESC
* @type {number}
* @default 27
*/
KEY_ESC: 27,
/**
* @description KEY_LEFT
* @type {number}
* @default 37
*/
KEY_LEFT: 37,
/**
* @description KEY_UP
* @type {number}
* @default 38
*/
KEY_UP: 38,
/**
* @description KEY_RIGHT
* @type {number}
* @default 39
*/
KEY_RIGHT: 39,
/**
* @description KEY_DOWN
* @type {number}
* @default 40
*/
KEY_DOWN: 40,
/**
* @description KEY_DELETE
* @type {number}
* @default 46
*/
KEY_DELETE: 46,
/**
* @description Cross browser event element detection.
* @param {Event} event - The event
* @returns {HTMLElement} The element that caused the event
*/
element: function element(event) {
return event.target || event.srcElement;
},
/**
* @description Determine whether event was caused by a single touch
* @param {Event} event - The event
* @returns {boolean}
*/
isSingleTouch: function isSingleTouch(event) {
return event.touches && event.touches.length === 1;
},
/**
* @description Determine whether event was caused by a multi touch
* @param {Event} event - The event
* @returns {boolean}
*/
isMultiTouch: function isMultiTouch(event) {
return event.touches && event.touches.length > 1;
},
/**
* @description Determine whether event was caused by a left click.
* @param {Event} event - The event
* @returns {boolean}
*/
isLeftClick: function isLeftClick(event) {
return event.which && event.which === 1 || event.button && event.button === 1;
},
/**
* @description Determine whether event was caused by a right mouse click.
* @param {Event} event - The event
* @returns {boolean}
*/
isRightClick: function isRightClick(event) {
return event.which && event.which === 3 || event.button && event.button === 2;
},
/**
* @description Stops an event from propagating.
* @param {Event} event - The event
* @param {boolean} allowDefault - If true, we stop the event chain but still allow the default browser behaviour (text selection, radio-button clicking, etc) Default false
*/
stop: function stop(event, allowDefault) {
if (!allowDefault) {
if (event.preventDefault) {
event.preventDefault();
} else {
event.returnValue = false;
}
}
if (event.stopPropagation) {
event.stopPropagation();
} else {
event.cancelBubble = true;
}
},
/**
* @param {Event} event - The event。
* @param {string} tagName - html 标签名。
* @returns {HTMLElement} The first node with the given tagName, starting from the node the event was triggered on and traversing the DOM upwards
*/
findElement: function findElement(event, tagName) {
var element = SuperMap.Event.element(event);
while (element.parentNode && (!element.tagName || element.tagName.toUpperCase() != tagName.toUpperCase())) {
element = element.parentNode;
}
return element;
},
/**
* @description 监听事件,注册事件处理方法。
* @param {(HTMLElement|string)} elementParam - 待监听的 DOM 对象或者其 ID 标识。
* @param {string} name - 监听事件的类别名称。
* @param {function} observer - 注册的事件处理方法。
* @param {boolean} [useCapture=false] - 是否捕获。
*/
observe: function observe(elementParam, name, observer, useCapture) {
var element = Util.getElement(elementParam);
useCapture = useCapture || false;
if (name === 'keypress' && (navigator.appVersion.match(/Konqueror|Safari|KHTML/) || element.attachEvent)) {
name = 'keydown';
} //if observers cache has not yet been created, create it
if (!this.observers) {
this.observers = {};
} //if not already assigned, make a new unique cache ID
if (!element._eventCacheID) {
var idPrefix = "eventCacheID_";
if (element.id) {
idPrefix = element.id + "_" + idPrefix;
}
element._eventCacheID = Util.createUniqueID(idPrefix);
}
var cacheID = element._eventCacheID; //if there is not yet a hash entry for this element, add one
if (!this.observers[cacheID]) {
this.observers[cacheID] = [];
} //add a new observer to this element's list
this.observers[cacheID].push({
'element': element,
'name': name,
'observer': observer,
'useCapture': useCapture
}); //add the actual browser event listener
if (element.addEventListener) {
if (name === 'mousewheel') {
// https://www.chromestatus.com/features/6662647093133312
element.addEventListener(name, observer, {
useCapture: useCapture,
passive: false
});
} else {
element.addEventListener(name, observer, useCapture);
}
} else if (element.attachEvent) {
element.attachEvent('on' + name, observer);
}
},
/**
* @description Given the id of an element to stop observing, cycle through the
* element's cached observers, calling stopObserving on each one,
* skipping those entries which can no longer be removed.
*
* @param {(HTMLElement|string)} elementParam -
*/
stopObservingElement: function stopObservingElement(elementParam) {
var element = Util.getElement(elementParam);
var cacheID = element._eventCacheID;
this._removeElementObservers(SuperMap.Event.observers[cacheID]);
},
/**
* @param {Array.