@antv/l7-map
Advanced tools
Comparing version 2.5.6-l7mini2 to 2.5.6
@@ -20,4 +20,2 @@ "use strict"; | ||
var _lng_lat_bounds = _interopRequireDefault(require("./lng_lat_bounds")); | ||
var earthRadius = 6371008.8; | ||
@@ -55,11 +53,2 @@ exports.earthRadius = earthRadius; | ||
}, { | ||
key: "toBounds", | ||
value: function toBounds() { | ||
var radius = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; | ||
var earthCircumferenceInMetersAtEquator = 40075017; | ||
var latAccuracy = 360 * radius / earthCircumferenceInMetersAtEquator; | ||
var lngAccuracy = latAccuracy / Math.cos(Math.PI / 180 * this.lat); | ||
return new _lng_lat_bounds.default(new LngLat(this.lng - lngAccuracy, this.lat - latAccuracy), new LngLat(this.lng + lngAccuracy, this.lat + latAccuracy)); | ||
} | ||
}, { | ||
key: "toString", | ||
@@ -66,0 +55,0 @@ value: function toString() { |
"use strict"; | ||
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard"); | ||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); | ||
var _typeof = require("@babel/runtime/helpers/typeof"); | ||
Object.defineProperty(exports, "__esModule", { | ||
@@ -27,2 +27,6 @@ value: true | ||
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } | ||
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | ||
var earthCircumfrence = 2 * Math.PI * _lng_lat.earthRadius; | ||
@@ -29,0 +33,0 @@ |
"use strict"; | ||
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard"); | ||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); | ||
var _typeof = require("@babel/runtime/helpers/typeof"); | ||
Object.defineProperty(exports, "__esModule", { | ||
@@ -27,2 +27,6 @@ value: true | ||
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } | ||
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | ||
var earthCircumfrence = 2 * Math.PI * _lng_lat.earthRadius; | ||
@@ -29,0 +33,0 @@ |
"use strict"; | ||
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard"); | ||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); | ||
var _typeof = require("@babel/runtime/helpers/typeof"); | ||
Object.defineProperty(exports, "__esModule", { | ||
@@ -32,2 +32,6 @@ value: true | ||
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } | ||
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | ||
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; } | ||
@@ -34,0 +38,0 @@ |
"use strict"; | ||
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard"); | ||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); | ||
var _typeof = require("@babel/runtime/helpers/typeof"); | ||
Object.defineProperty(exports, "__esModule", { | ||
@@ -20,2 +20,6 @@ value: true | ||
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } | ||
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | ||
var TapRecognizer = function () { | ||
@@ -22,0 +26,0 @@ function TapRecognizer(options) { |
@@ -36,2 +36,4 @@ "use strict"; | ||
var _handler_manager = _interopRequireDefault(require("./handler/handler_manager")); | ||
var _hash = _interopRequireDefault(require("./hash")); | ||
@@ -99,2 +101,3 @@ | ||
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "boxZoom", void 0); | ||
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handlers", void 0); | ||
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "container", void 0); | ||
@@ -118,5 +121,9 @@ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "canvas", void 0); | ||
_this.initContainer(); | ||
_this.resize(); | ||
if (!_util.isMiniAli && typeof window !== 'undefined') { | ||
_this.handlers = new _handler_manager.default((0, _assertThisInitialized2.default)(_this), _this.options); | ||
if (typeof window !== 'undefined') { | ||
window.addEventListener('online', _this.onWindowOnline, false); | ||
@@ -127,8 +134,6 @@ window.addEventListener('resize', _this.onWindowResize, false); | ||
if (!_util.isMiniAli) { | ||
var hashName = typeof options.hash === 'string' && options.hash || undefined; | ||
var hashName = typeof options.hash === 'string' && options.hash || undefined; | ||
if (options.hash) { | ||
_this.hash = new _hash.default(hashName).addTo((0, _assertThisInitialized2.default)(_this)); | ||
} | ||
if (options.hash) { | ||
_this.hash = new _hash.default(hashName).addTo((0, _assertThisInitialized2.default)(_this)); | ||
} | ||
@@ -162,7 +167,2 @@ | ||
var height = dimensions[1]; | ||
if (!_util.isMiniAli && this.canvas) { | ||
this.resizeCanvas(width, height); | ||
} | ||
this.transform.resize(width, height); | ||
@@ -173,4 +173,12 @@ var fireMoving = !this.moving; | ||
this.stop(); | ||
this.emit('movestart', new Event('movestart', eventData)); | ||
this.emit('move', new Event('move', eventData)); | ||
} | ||
this.emit('resize', new Event('resize', eventData)); | ||
if (fireMoving) { | ||
this.emit('moveend', new Event('moveend', eventData)); | ||
} | ||
return this; | ||
@@ -382,19 +390,36 @@ } | ||
key: "initContainer", | ||
value: function initContainer() {} | ||
value: function initContainer() { | ||
if (typeof this.options.container === 'string') { | ||
this.container = window.document.getElementById(this.options.container); | ||
if (!this.container) { | ||
throw new Error("Container '".concat(this.options.container, "' not found.")); | ||
} | ||
} else if (this.options.container instanceof HTMLElement) { | ||
this.container = this.options.container; | ||
} else { | ||
throw new Error("Invalid type: 'container' must be a String or HTMLElement."); | ||
} | ||
var container = this.container; | ||
container.classList.add('l7-map'); | ||
var canvasContainer = this.canvasContainer = _l7Utils.DOM.create('div', 'l7-canvas-container', container); | ||
if (this.options.interactive) { | ||
canvasContainer.classList.add('l7-interactive'); | ||
} | ||
} | ||
}, { | ||
key: "containerDimensions", | ||
value: function containerDimensions() { | ||
if (_util.isMiniAli) { | ||
return [400, 300]; | ||
} else { | ||
var width = 0; | ||
var height = 0; | ||
var width = 0; | ||
var height = 0; | ||
if (this.container) { | ||
width = this.container.clientWidth || 400; | ||
height = this.container.clientHeight || 300; | ||
} | ||
if (this.container) { | ||
width = this.container.clientWidth || 400; | ||
height = this.container.clientHeight || 300; | ||
} | ||
return [400, 300]; | ||
} | ||
return [width, height]; | ||
} | ||
@@ -401,0 +426,0 @@ }, { |
@@ -15,3 +15,3 @@ "use strict"; | ||
exports.renderframe = renderframe; | ||
exports.cancel = exports.raf = exports.now = exports.ease = exports.isMiniAli = void 0; | ||
exports.cancel = exports.raf = exports.now = exports.ease = void 0; | ||
@@ -27,4 +27,2 @@ var _unitbezier = _interopRequireDefault(require("@mapbox/unitbezier")); | ||
var reducedMotionQuery; | ||
var isMiniAli = typeof my !== 'undefined' && !!my && typeof my.showToast === 'function'; | ||
exports.isMiniAli = isMiniAli; | ||
@@ -90,14 +88,8 @@ function wrap(n, min, max) { | ||
var now = isMiniAli ? function () { | ||
return 1; | ||
} : window.performance && window.performance.now ? window.performance.now.bind(window.performance) : Date.now.bind(Date); | ||
var now = window.performance && window.performance.now ? window.performance.now.bind(window.performance) : Date.now.bind(Date); | ||
exports.now = now; | ||
var raf = isMiniAli ? function () { | ||
return 1; | ||
} : window.requestAnimationFrame || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame || window.msRequestAnimationFrame; | ||
var raf = window.requestAnimationFrame || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame || window.msRequestAnimationFrame; | ||
exports.raf = raf; | ||
var _cancel = isMiniAli ? function () { | ||
return 1; | ||
} : window.cancelAnimationFrame || window.mozCancelAnimationFrame || window.webkitCancelAnimationFrame || window.msCancelAnimationFrame; | ||
var _cancel = window.cancelAnimationFrame || window.mozCancelAnimationFrame || window.webkitCancelAnimationFrame || window.msCancelAnimationFrame; | ||
@@ -107,11 +99,9 @@ exports.cancel = _cancel; | ||
function renderframe(fn) { | ||
if (!isMiniAli) { | ||
var frame = raf(fn); | ||
return { | ||
cancel: function cancel() { | ||
return _cancel(frame); | ||
} | ||
}; | ||
} | ||
var frame = raf(fn); | ||
return { | ||
cancel: function cancel() { | ||
return _cancel(frame); | ||
} | ||
}; | ||
} | ||
//# sourceMappingURL=util.js.map |
@@ -23,10 +23,44 @@ "use strict"; | ||
DOM.create = function (tagName, className, container) { | ||
return null; | ||
var el = window.document.createElement(tagName); | ||
if (className !== undefined) { | ||
el.className = className; | ||
} | ||
if (container) { | ||
container.appendChild(el); | ||
} | ||
return el; | ||
}; | ||
DOM.createNS = function (namespaceURI, tagName) { | ||
return null; | ||
var el = window.document.createElementNS(namespaceURI, tagName); | ||
return el; | ||
}; | ||
var docStyle = window.document && window.document.documentElement.style; | ||
function testProp(props) { | ||
if (!docStyle) { | ||
return props[0]; | ||
} | ||
var _iterator = _createForOfIteratorHelper(props), | ||
_step; | ||
try { | ||
for (_iterator.s(); !(_step = _iterator.n()).done;) { | ||
var i = _step.value; | ||
if (i in docStyle) { | ||
return i; | ||
} | ||
} | ||
} catch (err) { | ||
_iterator.e(err); | ||
} finally { | ||
_iterator.f(); | ||
} | ||
return props[0]; | ||
@@ -36,6 +70,16 @@ } | ||
var selectProp = testProp(['userSelect', 'MozUserSelect', 'WebkitUserSelect', 'msUserSelect']); | ||
var userSelect; | ||
DOM.disableDrag = function () {}; | ||
DOM.disableDrag = function () { | ||
if (docStyle && selectProp) { | ||
userSelect = docStyle[selectProp]; | ||
docStyle[selectProp] = 'none'; | ||
} | ||
}; | ||
DOM.enableDrag = function () {}; | ||
DOM.enableDrag = function () { | ||
if (docStyle && selectProp) { | ||
docStyle[selectProp] = userSelect; | ||
} | ||
}; | ||
@@ -56,2 +100,4 @@ var transformProp = testProp(['transform', 'WebkitTransform']); | ||
}); | ||
window.addEventListener('test', options, options); | ||
window.removeEventListener('test', options, options); | ||
} catch (err) { | ||
@@ -84,5 +130,11 @@ passiveSupported = false; | ||
e.stopPropagation(); | ||
window.removeEventListener('click', suppressClick, true); | ||
}; | ||
DOM.suppressClick = function () {}; | ||
DOM.suppressClick = function () { | ||
window.addEventListener('click', suppressClick, true); | ||
window.setTimeout(function () { | ||
window.removeEventListener('click', suppressClick, true); | ||
}, 0); | ||
}; | ||
@@ -98,14 +150,14 @@ DOM.mousePos = function (el, e) { | ||
var _iterator = _createForOfIteratorHelper(touches), | ||
_step; | ||
var _iterator2 = _createForOfIteratorHelper(touches), | ||
_step2; | ||
try { | ||
for (_iterator.s(); !(_step = _iterator.n()).done;) { | ||
var touche = _step.value; | ||
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) { | ||
var touche = _step2.value; | ||
points.push(new _point.default(touche.clientX - rect.left - el.clientLeft, touche.clientY - rect.top - el.clientTop)); | ||
} | ||
} catch (err) { | ||
_iterator.e(err); | ||
_iterator2.e(err); | ||
} finally { | ||
_iterator.f(); | ||
_iterator2.f(); | ||
} | ||
@@ -116,4 +168,10 @@ | ||
DOM.mouseButton = function (e) {}; | ||
DOM.mouseButton = function (e) { | ||
if (typeof window.InstallTrigger !== 'undefined' && e.button === 2 && e.ctrlKey && window.navigator.platform.toUpperCase().indexOf('MAC') >= 0) { | ||
return 0; | ||
} | ||
return e.button; | ||
}; | ||
DOM.remove = function (node) { | ||
@@ -120,0 +178,0 @@ if (node.parentNode) { |
@@ -7,21 +7,7 @@ "use strict"; | ||
exports.PerformanceUtils = exports.PerformanceMarkers = void 0; | ||
var _util = require("../util"); | ||
var lastFrameTime = null; | ||
var frameTimes = []; | ||
var miniPerformance = { | ||
mark: function mark() { | ||
return ''; | ||
}, | ||
clearMeasures: function clearMeasures() { | ||
return ''; | ||
}, | ||
measure: function measure() { | ||
return ''; | ||
} | ||
}; | ||
var minFramerateTarget = 30; | ||
var frameTimeTarget = 1000 / minFramerateTarget; | ||
var performance = _util.isMiniAli ? miniPerformance : window.performance; | ||
var performance = window.performance; | ||
var PerformanceMarkers = { | ||
@@ -28,0 +14,0 @@ create: 'create', |
{ | ||
"name": "@antv/l7-map", | ||
"version": "2.5.6-l7mini2", | ||
"version": "2.5.6", | ||
"description": "l7 map", | ||
@@ -40,3 +40,3 @@ "keywords": [], | ||
"dependencies": { | ||
"@antv/l7-utils": "^2.5.5", | ||
"@antv/l7-utils": "^2.5.6", | ||
"@babel/runtime": "^7.7.7", | ||
@@ -48,3 +48,3 @@ "@mapbox/point-geometry": "^0.1.0", | ||
}, | ||
"gitHead": "7eb8382ede52d803fae13a85fe6af074400260ee" | ||
"gitHead": "873e70132ffa40b1e7b68575677575a9df0774ca" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Mixed license
License(Experimental) Package contains multiple licenses.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
1249833
273
13591
0
1
2
Updated@antv/l7-utils@^2.5.6