| @@ -12085,7 +12085,7 @@ eval("module.exports = extend\n\nvar hasOwnProperty = Object.prototype.hasOwnPro | |||
| /***/ (function(module, __webpack_exports__, __webpack_require__) { | |||
| "use strict"; | |||
| eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _mixin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./mixin */ \"./src/base/global-api/mixin.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"initMixin\", function() { return _mixin__WEBPACK_IMPORTED_MODULE_0__[\"initMixin\"]; });\n\n/* harmony import */ var _use__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./use */ \"./src/base/global-api/use.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"initUse\", function() { return _use__WEBPACK_IMPORTED_MODULE_1__[\"initUse\"]; });\n\n/*\n * @Author: Caven\n * @Date: 2020-05-09 23:09:42\n * @Last Modified by: Caven\n * @Last Modified time: 2020-05-09 23:20:08\n */\n\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9zcmMvYmFzZS9nbG9iYWwtYXBpL2luZGV4LmpzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vc3JjL2Jhc2UvZ2xvYmFsLWFwaS9pbmRleC5qcz80ZWNlIl0sInNvdXJjZXNDb250ZW50IjpbIi8qXG4gKiBAQXV0aG9yOiBDYXZlblxuICogQERhdGU6IDIwMjAtMDUtMDkgMjM6MDk6NDJcbiAqIEBMYXN0IE1vZGlmaWVkIGJ5OiBDYXZlblxuICogQExhc3QgTW9kaWZpZWQgdGltZTogMjAyMC0wNS0wOSAyMzoyMDowOFxuICovXG5cbmV4cG9ydCAqIGZyb20gJy4vbWl4aW4nXG5leHBvcnQgKiBmcm9tICcuL3VzZSdcbiJdLCJtYXBwaW5ncyI6IkFBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTs7Ozs7O0FBT0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./src/base/global-api/index.js\n"); | |||
| eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _mixin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./mixin */ \"./src/base/global-api/mixin.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"initMixin\", function() { return _mixin__WEBPACK_IMPORTED_MODULE_0__[\"initMixin\"]; });\n\n/* harmony import */ var _use__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./use */ \"./src/base/global-api/use.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"initUse\", function() { return _use__WEBPACK_IMPORTED_MODULE_1__[\"initUse\"]; });\n\n/*\n * @Author: Caven\n * @Date: 2020-05-09 23:09:42\n * @Last Modified by: Caven\n * @Last Modified time: 2020-05-11 22:34:52\n */\n\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9zcmMvYmFzZS9nbG9iYWwtYXBpL2luZGV4LmpzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vc3JjL2Jhc2UvZ2xvYmFsLWFwaS9pbmRleC5qcz80ZWNlIl0sInNvdXJjZXNDb250ZW50IjpbIi8qXG4gKiBAQXV0aG9yOiBDYXZlblxuICogQERhdGU6IDIwMjAtMDUtMDkgMjM6MDk6NDJcbiAqIEBMYXN0IE1vZGlmaWVkIGJ5OiBDYXZlblxuICogQExhc3QgTW9kaWZpZWQgdGltZTogMjAyMC0wNS0xMSAyMjozNDo1MlxuICovXG5cbmV4cG9ydCAqIGZyb20gJy4vbWl4aW4nXG5leHBvcnQgKiBmcm9tICcuL3VzZSdcbiJdLCJtYXBwaW5ncyI6IkFBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTs7Ozs7O0FBT0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./src/base/global-api/index.js\n"); | |||
| /***/ }), | |||
| @@ -12109,7 +12109,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) * | |||
| /***/ (function(module, __webpack_exports__, __webpack_require__) { | |||
| "use strict"; | |||
| eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"initUse\", function() { return initUse; });\n/*\n * @Author: Caven\n * @Date: 2020-05-09 23:01:21\n * @Last Modified by: Caven\n * @Last Modified time: 2020-05-09 23:01:58\n */\nfunction initUse(DC) {\n var _arguments = arguments,\n _this = this;\n\n DC.use = function (plugin) {\n var installedPlugins = _this._installedPlugins || (_this._installedPlugins = []);\n\n if (installedPlugins.indexOf(plugin) > -1) {\n return _this;\n } // additional parameters\n\n\n var args = toArray(_arguments, 1);\n args.unshift(_this);\n\n if (typeof plugin.install === 'function') {\n plugin.install.apply(plugin, args);\n } else if (typeof plugin === 'function') {\n plugin.apply(null, args);\n }\n\n installedPlugins.push(plugin);\n return _this;\n };\n}//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9zcmMvYmFzZS9nbG9iYWwtYXBpL3VzZS5qcy5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL3NyYy9iYXNlL2dsb2JhbC1hcGkvdXNlLmpzPzU0ZTIiXSwic291cmNlc0NvbnRlbnQiOlsiLypcbiAqIEBBdXRob3I6IENhdmVuXG4gKiBARGF0ZTogMjAyMC0wNS0wOSAyMzowMToyMVxuICogQExhc3QgTW9kaWZpZWQgYnk6IENhdmVuXG4gKiBATGFzdCBNb2RpZmllZCB0aW1lOiAyMDIwLTA1LTA5IDIzOjAxOjU4XG4gKi9cblxuZXhwb3J0IGZ1bmN0aW9uIGluaXRVc2UoREMpIHtcbiAgREMudXNlID0gcGx1Z2luID0+IHtcbiAgICBjb25zdCBpbnN0YWxsZWRQbHVnaW5zID1cbiAgICAgIHRoaXMuX2luc3RhbGxlZFBsdWdpbnMgfHwgKHRoaXMuX2luc3RhbGxlZFBsdWdpbnMgPSBbXSlcbiAgICBpZiAoaW5zdGFsbGVkUGx1Z2lucy5pbmRleE9mKHBsdWdpbikgPiAtMSkge1xuICAgICAgcmV0dXJuIHRoaXNcbiAgICB9XG4gICAgLy8gYWRkaXRpb25hbCBwYXJhbWV0ZXJzXG4gICAgY29uc3QgYXJncyA9IHRvQXJyYXkoYXJndW1lbnRzLCAxKVxuICAgIGFyZ3MudW5zaGlmdCh0aGlzKVxuICAgIGlmICh0eXBlb2YgcGx1Z2luLmluc3RhbGwgPT09ICdmdW5jdGlvbicpIHtcbiAgICAgIHBsdWdpbi5pbnN0YWxsLmFwcGx5KHBsdWdpbiwgYXJncylcbiAgICB9IGVsc2UgaWYgKHR5cGVvZiBwbHVnaW4gPT09ICdmdW5jdGlvbicpIHtcbiAgICAgIHBsdWdpbi5hcHBseShudWxsLCBhcmdzKVxuICAgIH1cbiAgICBpbnN0YWxsZWRQbHVnaW5zLnB1c2gocGx1Z2luKVxuICAgIHJldHVybiB0aGlzXG4gIH1cbn1cbiJdLCJtYXBwaW5ncyI6IkFBQUE7QUFBQTtBQUFBOzs7Ozs7QUFPQTtBQUFBO0FBQUE7QUFDQTtBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFBQTtBQUNBO0FBQ0E7QUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFBQTtBQUNBO0FBQ0E7QUFDQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./src/base/global-api/use.js\n"); | |||
| eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"initUse\", function() { return initUse; });\n/*\n * @Author: Caven\n * @Date: 2020-05-09 23:01:21\n * @Last Modified by: Caven\n * @Last Modified time: 2020-05-11 23:55:03\n */\nfunction initUse(DC) {\n var _arguments = arguments,\n _this = this;\n\n DC.use = function (plugin) {\n var installedPlugins = _this._installedPlugins || (_this._installedPlugins = []);\n\n if (installedPlugins.indexOf(plugin) > -1) {\n return _this;\n } // additional parameters\n\n\n var args = toArray(_arguments, 1);\n args.unshift(_this);\n\n if (typeof plugin.install === 'function') {\n plugin.install.apply(plugin, args);\n } else if (typeof plugin === 'function') {\n plugin.apply(null, args);\n }\n\n installedPlugins.push(plugin);\n return _this;\n };\n}//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9zcmMvYmFzZS9nbG9iYWwtYXBpL3VzZS5qcy5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL3NyYy9iYXNlL2dsb2JhbC1hcGkvdXNlLmpzPzU0ZTIiXSwic291cmNlc0NvbnRlbnQiOlsiLypcbiAqIEBBdXRob3I6IENhdmVuXG4gKiBARGF0ZTogMjAyMC0wNS0wOSAyMzowMToyMVxuICogQExhc3QgTW9kaWZpZWQgYnk6IENhdmVuXG4gKiBATGFzdCBNb2RpZmllZCB0aW1lOiAyMDIwLTA1LTExIDIzOjU1OjAzXG4gKi9cblxuZXhwb3J0IGZ1bmN0aW9uIGluaXRVc2UoREMpIHtcbiAgREMudXNlID0gcGx1Z2luID0+IHtcbiAgICBjb25zdCBpbnN0YWxsZWRQbHVnaW5zID1cbiAgICAgIHRoaXMuX2luc3RhbGxlZFBsdWdpbnMgfHwgKHRoaXMuX2luc3RhbGxlZFBsdWdpbnMgPSBbXSlcbiAgICBpZiAoaW5zdGFsbGVkUGx1Z2lucy5pbmRleE9mKHBsdWdpbikgPiAtMSkge1xuICAgICAgcmV0dXJuIHRoaXNcbiAgICB9XG4gICAgLy8gYWRkaXRpb25hbCBwYXJhbWV0ZXJzXG4gICAgY29uc3QgYXJncyA9IHRvQXJyYXkoYXJndW1lbnRzLCAxKVxuICAgIGFyZ3MudW5zaGlmdCh0aGlzKVxuICAgIGlmICh0eXBlb2YgcGx1Z2luLmluc3RhbGwgPT09ICdmdW5jdGlvbicpIHtcbiAgICAgIHBsdWdpbi5pbnN0YWxsLmFwcGx5KHBsdWdpbiwgYXJncylcbiAgICB9IGVsc2UgaWYgKHR5cGVvZiBwbHVnaW4gPT09ICdmdW5jdGlvbicpIHtcbiAgICAgIHBsdWdpbi5hcHBseShudWxsLCBhcmdzKVxuICAgIH1cbiAgICBpbnN0YWxsZWRQbHVnaW5zLnB1c2gocGx1Z2luKVxuICAgIHJldHVybiB0aGlzXG4gIH1cbn1cbiJdLCJtYXBwaW5ncyI6IkFBQUE7QUFBQTtBQUFBOzs7Ozs7QUFPQTtBQUFBO0FBQUE7QUFDQTtBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFBQTtBQUNBO0FBQ0E7QUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFBQTtBQUNBO0FBQ0E7QUFDQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./src/base/global-api/use.js\n"); | |||
| /***/ }), | |||
| @@ -12121,7 +12121,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) * | |||
| /***/ (function(module, __webpack_exports__, __webpack_require__) { | |||
| "use strict"; | |||
| eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _global_api__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./global-api */ \"./src/base/global-api/index.js\");\n/*\n * @Author: Caven\n * @Date: 2020-04-22 09:44:30\n * @Last Modified by: Caven\n * @Last Modified time: 2020-05-10 08:07:56\n */\n\nvar DC = {\n Author: 'Caven Chen',\n GitHub: 'https://github.com/Digital-Visual',\n Home: 'https://www.dvgis.cn',\n Version: '1.5.0',\n Namespace: {},\n Initialized: false\n};\ndelete window.DC;\nwindow.DC = DC;\n\n(function () {\n __webpack_require__(/*! ../log */ \"./src/log.js\");\n\n Object(_global_api__WEBPACK_IMPORTED_MODULE_0__[\"initMixin\"])(window.DC);\n Object(_global_api__WEBPACK_IMPORTED_MODULE_0__[\"initUse\"])(window.DC);\n new Promise(function (resolve, reject) {\n var Cesium = __webpack_require__(/*! cesium/Cesium */ \"./node_modules/cesium/Source/Cesium.js\");\n\n resolve(Cesium);\n }).then(function (Cesium) {\n window.DC.Namespace['Cesium'] = Cesium;\n delete window.Cesium;\n });\n})();\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (DC);//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9zcmMvYmFzZS9pbmRleC5qcy5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL3NyYy9iYXNlL2luZGV4LmpzPzgyMDciXSwic291cmNlc0NvbnRlbnQiOlsiLypcbiAqIEBBdXRob3I6IENhdmVuXG4gKiBARGF0ZTogMjAyMC0wNC0yMiAwOTo0NDozMFxuICogQExhc3QgTW9kaWZpZWQgYnk6IENhdmVuXG4gKiBATGFzdCBNb2RpZmllZCB0aW1lOiAyMDIwLTA1LTEwIDA4OjA3OjU2XG4gKi9cblxuaW1wb3J0IHsgaW5pdE1peGluLCBpbml0VXNlIH0gZnJvbSAnLi9nbG9iYWwtYXBpJ1xuXG5sZXQgREMgPSB7XG4gIEF1dGhvcjogJ0NhdmVuIENoZW4nLFxuICBHaXRIdWI6ICdodHRwczovL2dpdGh1Yi5jb20vRGlnaXRhbC1WaXN1YWwnLFxuICBIb21lOiAnaHR0cHM6Ly93d3cuZHZnaXMuY24nLFxuICBWZXJzaW9uOiAnMS41LjAnLFxuICBOYW1lc3BhY2U6IHt9LFxuICBJbml0aWFsaXplZDogZmFsc2Vcbn1cbmRlbGV0ZSB3aW5kb3cuRENcbndpbmRvdy5EQyA9IERDXG47KGZ1bmN0aW9uKCkge1xuICByZXF1aXJlKCcuLi9sb2cnKVxuICBpbml0TWl4aW4od2luZG93LkRDKVxuICBpbml0VXNlKHdpbmRvdy5EQylcbiAgbmV3IFByb21pc2UoKHJlc29sdmUsIHJlamVjdCkgPT4ge1xuICAgIGxldCBDZXNpdW0gPSByZXF1aXJlKCdjZXNpdW0vQ2VzaXVtJylcbiAgICByZXNvbHZlKENlc2l1bSlcbiAgfSkudGhlbihDZXNpdW0gPT4ge1xuICAgIHdpbmRvdy5EQy5OYW1lc3BhY2VbJ0Nlc2l1bSddID0gQ2VzaXVtXG4gICAgZGVsZXRlIHdpbmRvdy5DZXNpdW1cbiAgfSlcbn0pKClcblxuZXhwb3J0IGRlZmF1bHQgRENcbiJdLCJtYXBwaW5ncyI6IkFBQUE7QUFBQTtBQUFBOzs7Ozs7QUFPQTtBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBTkE7QUFRQTtBQUNBO0FBQ0E7QUFBQTtBQUNBO0FBQ0E7QUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./src/base/index.js\n"); | |||
| eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _global_api__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./global-api */ \"./src/base/global-api/index.js\");\n/*\n * @Author: Caven\n * @Date: 2020-04-22 09:44:30\n * @Last Modified by: Caven\n * @Last Modified time: 2020-05-11 23:50:26\n */\n\nvar DC = {\n Author: 'Caven Chen',\n GitHub: 'https://github.com/Digital-Visual',\n Home: 'https://www.dvgis.cn',\n Version: '1.5.0',\n Namespace: {},\n Initialized: false\n};\ndelete window.DC;\nwindow.DC = DC;\n\n(function () {\n __webpack_require__(/*! ../log */ \"./src/log.js\");\n\n Object(_global_api__WEBPACK_IMPORTED_MODULE_0__[\"initMixin\"])(window.DC);\n Object(_global_api__WEBPACK_IMPORTED_MODULE_0__[\"initUse\"])(window.DC);\n var cesiumLoaded = false;\n\n DC.init = function (callback) {\n if (!cesiumLoaded) {\n new Promise(function (resolve, reject) {\n var Cesium = __webpack_require__(/*! cesium/Cesium */ \"./node_modules/cesium/Source/Cesium.js\");\n\n resolve(Cesium);\n }).then(function (Cesium) {\n DC.Namespace['Cesium'] = Cesium;\n cesiumLoaded = true;\n delete window.Cesium;\n callback && callback();\n });\n } else {\n callback && callback();\n }\n };\n})();\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (DC);//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9zcmMvYmFzZS9pbmRleC5qcy5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL3NyYy9iYXNlL2luZGV4LmpzPzgyMDciXSwic291cmNlc0NvbnRlbnQiOlsiLypcbiAqIEBBdXRob3I6IENhdmVuXG4gKiBARGF0ZTogMjAyMC0wNC0yMiAwOTo0NDozMFxuICogQExhc3QgTW9kaWZpZWQgYnk6IENhdmVuXG4gKiBATGFzdCBNb2RpZmllZCB0aW1lOiAyMDIwLTA1LTExIDIzOjUwOjI2XG4gKi9cblxuaW1wb3J0IHsgaW5pdE1peGluLCBpbml0VXNlIH0gZnJvbSAnLi9nbG9iYWwtYXBpJ1xuXG5sZXQgREMgPSB7XG4gIEF1dGhvcjogJ0NhdmVuIENoZW4nLFxuICBHaXRIdWI6ICdodHRwczovL2dpdGh1Yi5jb20vRGlnaXRhbC1WaXN1YWwnLFxuICBIb21lOiAnaHR0cHM6Ly93d3cuZHZnaXMuY24nLFxuICBWZXJzaW9uOiAnMS41LjAnLFxuICBOYW1lc3BhY2U6IHt9LFxuICBJbml0aWFsaXplZDogZmFsc2Vcbn1cbmRlbGV0ZSB3aW5kb3cuRENcbndpbmRvdy5EQyA9IERDXG47KGZ1bmN0aW9uKCkge1xuICByZXF1aXJlKCcuLi9sb2cnKVxuICBpbml0TWl4aW4od2luZG93LkRDKVxuICBpbml0VXNlKHdpbmRvdy5EQylcbiAgbGV0IGNlc2l1bUxvYWRlZCA9IGZhbHNlXG4gIERDLmluaXQgPSBjYWxsYmFjayA9PiB7XG4gICAgaWYgKCFjZXNpdW1Mb2FkZWQpIHtcbiAgICAgIG5ldyBQcm9taXNlKChyZXNvbHZlLCByZWplY3QpID0+IHtcbiAgICAgICAgbGV0IENlc2l1bSA9IHJlcXVpcmUoJ2Nlc2l1bS9DZXNpdW0nKVxuICAgICAgICByZXNvbHZlKENlc2l1bSlcbiAgICAgIH0pLnRoZW4oQ2VzaXVtID0+IHtcbiAgICAgICAgREMuTmFtZXNwYWNlWydDZXNpdW0nXSA9IENlc2l1bVxuICAgICAgICBjZXNpdW1Mb2FkZWQgPSB0cnVlXG4gICAgICAgIGRlbGV0ZSB3aW5kb3cuQ2VzaXVtXG4gICAgICAgIGNhbGxiYWNrICYmIGNhbGxiYWNrKClcbiAgICAgIH0pXG4gICAgfSBlbHNlIHtcbiAgICAgIGNhbGxiYWNrICYmIGNhbGxiYWNrKClcbiAgICB9XG4gIH1cbn0pKClcblxuZXhwb3J0IGRlZmF1bHQgRENcbiJdLCJtYXBwaW5ncyI6IkFBQUE7QUFBQTtBQUFBOzs7Ozs7QUFPQTtBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBTkE7QUFRQTtBQUNBO0FBQ0E7QUFBQTtBQUNBO0FBQ0E7QUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./src/base/index.js\n"); | |||
| /***/ }), | |||
| @@ -2,7 +2,7 @@ | |||
| * @Author: Caven | |||
| * @Date: 2020-05-09 23:09:42 | |||
| * @Last Modified by: Caven | |||
| * @Last Modified time: 2020-05-09 23:20:08 | |||
| * @Last Modified time: 2020-05-11 22:34:52 | |||
| */ | |||
| export * from './mixin' | |||
| @@ -2,7 +2,7 @@ | |||
| * @Author: Caven | |||
| * @Date: 2020-05-09 23:01:21 | |||
| * @Last Modified by: Caven | |||
| * @Last Modified time: 2020-05-09 23:01:58 | |||
| * @Last Modified time: 2020-05-11 23:55:03 | |||
| */ | |||
| export function initUse(DC) { | |||
| @@ -2,7 +2,7 @@ | |||
| * @Author: Caven | |||
| * @Date: 2020-04-22 09:44:30 | |||
| * @Last Modified by: Caven | |||
| * @Last Modified time: 2020-05-10 08:07:56 | |||
| * @Last Modified time: 2020-05-11 23:50:26 | |||
| */ | |||
| import { initMixin, initUse } from './global-api' | |||
| @@ -21,13 +21,22 @@ window.DC = DC | |||
| require('../log') | |||
| initMixin(window.DC) | |||
| initUse(window.DC) | |||
| new Promise((resolve, reject) => { | |||
| let Cesium = require('cesium/Cesium') | |||
| resolve(Cesium) | |||
| }).then(Cesium => { | |||
| window.DC.Namespace['Cesium'] = Cesium | |||
| delete window.Cesium | |||
| }) | |||
| let cesiumLoaded = false | |||
| DC.init = callback => { | |||
| if (!cesiumLoaded) { | |||
| new Promise((resolve, reject) => { | |||
| let Cesium = require('cesium/Cesium') | |||
| resolve(Cesium) | |||
| }).then(Cesium => { | |||
| DC.Namespace['Cesium'] = Cesium | |||
| cesiumLoaded = true | |||
| delete window.Cesium | |||
| callback && callback() | |||
| }) | |||
| } else { | |||
| callback && callback() | |||
| } | |||
| } | |||
| })() | |||
| export default DC | |||
| @@ -2,22 +2,34 @@ | |||
| * @Author: Caven | |||
| * @Date: 2020-05-09 13:19:53 | |||
| * @Last Modified by: Caven | |||
| * @Last Modified time: 2020-05-11 17:24:59 | |||
| * @Last Modified time: 2020-05-12 00:21:25 | |||
| */ | |||
| import { MouseEventType, SceneEventType } from './event/EventType' | |||
| import { DomUtil, Util } from './utils' | |||
| import { MouseEventType, SceneEventType, Event } from './event' | |||
| import { Layer, LayerType } from './layer' | |||
| import { Overlay, OverlayType } from './overlay' | |||
| import ImageryType from './imagery/ImageryType' | |||
| import State from './state/State' | |||
| import Position from './position/Position' | |||
| import Transform from './transform/Transform' | |||
| import Parse from './parse/Parse' | |||
| DC.mixin({ | |||
| State: State, | |||
| ImageryType: ImageryType, | |||
| LayerType: LayerType, | |||
| OverlayType: OverlayType, | |||
| MouseEventType: MouseEventType, | |||
| SceneEventType: SceneEventType, | |||
| Layer: Layer, | |||
| Overlay: Overlay | |||
| DomUtil, | |||
| Util, | |||
| State, | |||
| Event, | |||
| ImageryType, | |||
| LayerType, | |||
| OverlayType, | |||
| MouseEventType, | |||
| SceneEventType, | |||
| Layer, | |||
| Overlay, | |||
| Position, | |||
| Transform, | |||
| T: Transform, | |||
| Parse, | |||
| P: Parse | |||
| }) | |||
| @@ -2,14 +2,11 @@ | |||
| * @Author: Caven | |||
| * @Date: 2019-12-27 17:18:52 | |||
| * @Last Modified by: Caven | |||
| * @Last Modified time: 2020-05-09 23:54:17 | |||
| * @Last Modified time: 2020-05-12 00:45:45 | |||
| */ | |||
| import { DomUtil, Util } from './utils' | |||
| import ImageryLayerFactory from './imagery/ImageryLayerFactory' | |||
| import TerrainFactory from './terrain/TerrainFactory' | |||
| import Position from './position/Position' | |||
| import Transform from './transform/Transform' | |||
| import Parse from './parse/Parse' | |||
| import Viewer from './viewer/Viewer' | |||
| import { | |||
| GeoJsonLayer, | |||
| @@ -32,28 +29,36 @@ import { | |||
| Tileset | |||
| } from './overlay' | |||
| import { area, bounds, center, distance, heading, isBetween } from './math' | |||
| const { Cesium } = DC.Namespace | |||
| Cesium.Math.area = area | |||
| Cesium.Math.bounds = bounds | |||
| Cesium.Math.center = center | |||
| Cesium.Math.distance = distance | |||
| Cesium.Math.heading = heading | |||
| Cesium.Math.isBetween = isBetween | |||
| DC.mixin({ | |||
| DomUtil: DomUtil, | |||
| Util: Util, | |||
| ImageryLayerFactory: ImageryLayerFactory, | |||
| TerrainFactory: TerrainFactory, | |||
| Position: Position, | |||
| T: Transform, | |||
| P: Parse, | |||
| Viewer: Viewer, | |||
| GeoJsonLayer: GeoJsonLayer, | |||
| HtmlLayer: HtmlLayer, | |||
| LabelLayer: LabelLayer, | |||
| TilesetLayer: TilesetLayer, | |||
| TopoJsonLayer: TopoJsonLayer, | |||
| VectorLayer: VectorLayer, | |||
| Billboard: Billboard, | |||
| Cricle: Cricle, | |||
| DivIcon: DivIcon, | |||
| Label: Label, | |||
| Point: Point, | |||
| Polyline: Polyline, | |||
| Polygon: Polygon, | |||
| Model: Model, | |||
| Tileset: Tileset | |||
| ImageryLayerFactory, | |||
| TerrainFactory, | |||
| Viewer, | |||
| GeoJsonLayer, | |||
| HtmlLayer, | |||
| LabelLayer, | |||
| TilesetLayer, | |||
| TopoJsonLayer, | |||
| VectorLayer, | |||
| Billboard, | |||
| Cricle, | |||
| DivIcon, | |||
| Label, | |||
| Point, | |||
| Polyline, | |||
| Polygon, | |||
| Model, | |||
| Tileset | |||
| }) | |||
| DC.Math = Cesium.Math | |||
| @@ -2,8 +2,9 @@ | |||
| * @Author: Caven | |||
| * @Date: 2020-01-02 15:24:38 | |||
| * @Last Modified by: Caven | |||
| * @Last Modified time: 2020-05-10 08:12:03 | |||
| * @Last Modified time: 2020-05-11 22:34:56 | |||
| */ | |||
| class Event { | |||
| constructor() { | |||
| this._cache = {} | |||
| @@ -2,10 +2,10 @@ | |||
| * @Author: Caven | |||
| * @Date: 2020-04-10 17:02:28 | |||
| * @Last Modified by: Caven | |||
| * @Last Modified time: 2020-05-10 08:20:33 | |||
| * @Last Modified time: 2020-05-11 23:20:10 | |||
| */ | |||
| import { Cesium } from '../../namespace' | |||
| const { Cesium } = DC.Namespace | |||
| const baseEventType = { | |||
| ADD: 'add', | |||
| @@ -47,22 +47,10 @@ const OverlayEventType = { | |||
| ...baseEventType | |||
| } | |||
| const EffectEventType = { | |||
| ...baseEventType | |||
| } | |||
| const RoamingEventType = { | |||
| ...baseEventType, | |||
| TICK: 'tick', | |||
| ACTIVE: 'active' | |||
| } | |||
| export { | |||
| MouseEventType, | |||
| ViewerEventType, | |||
| SceneEventType, | |||
| LayerEventType, | |||
| OverlayEventType, | |||
| EffectEventType, | |||
| RoamingEventType | |||
| OverlayEventType | |||
| } | |||
| @@ -2,12 +2,14 @@ | |||
| * @Author: Caven | |||
| * @Date: 2020-01-02 14:26:35 | |||
| * @Last Modified by: Caven | |||
| * @Last Modified time: 2020-05-10 08:13:06 | |||
| * @Last Modified time: 2020-05-11 22:35:05 | |||
| */ | |||
| import { Cesium } from '../../namespace' | |||
| import { LayerEventType } from './EventType' | |||
| import Event from './Event' | |||
| const { Cesium } = DC.Namespace | |||
| class LayerEvent extends Event { | |||
| constructor() { | |||
| super() | |||
| @@ -2,13 +2,14 @@ | |||
| * @Author: Caven | |||
| * @Date: 2019-12-31 16:58:31 | |||
| * @Last Modified by: Caven | |||
| * @Last Modified time: 2020-05-10 08:13:16 | |||
| * @Last Modified time: 2020-05-11 22:35:29 | |||
| */ | |||
| import { Cesium } from '../../namespace' | |||
| import { MouseEventType } from './EventType' | |||
| import Event from './Event' | |||
| const { Cesium } = DC.Namespace | |||
| /** | |||
| * Mouse events in 3D scene, optimized Cesium event model | |||
| */ | |||
| @@ -2,13 +2,14 @@ | |||
| * @Author: Caven | |||
| * @Date: 2020-01-02 14:26:35 | |||
| * @Last Modified by: Caven | |||
| * @Last Modified time: 2020-05-10 08:13:32 | |||
| * @Last Modified time: 2020-05-11 23:57:41 | |||
| */ | |||
| import { Cesium } from '../../namespace' | |||
| import { MouseEventType, OverlayEventType } from './EventType' | |||
| import Event from './Event' | |||
| const { Cesium } = DC.Namespace | |||
| class OverlayEvent extends Event { | |||
| constructor() { | |||
| super() | |||
| @@ -2,13 +2,14 @@ | |||
| * @Author: Caven | |||
| * @Date: 2020-04-10 16:58:31 | |||
| * @Last Modified by: Caven | |||
| * @Last Modified time: 2020-05-10 08:13:53 | |||
| * @Last Modified time: 2020-05-12 00:00:07 | |||
| */ | |||
| import { Cesium } from '../../namespace' | |||
| import { RoamingEventType } from './EventType' | |||
| import Event from './Event' | |||
| const { Cesium } = DC.Namespace | |||
| class RoamingEvent extends Event { | |||
| constructor() { | |||
| super() | |||
| @@ -2,11 +2,11 @@ | |||
| * @Author: Caven | |||
| * @Date: 2020-03-02 21:32:43 | |||
| * @Last Modified by: Caven | |||
| * @Last Modified time: 2020-05-10 08:14:10 | |||
| * @Last Modified time: 2020-05-11 22:36:08 | |||
| */ | |||
| import Event from './Event' | |||
| import { SceneEventType } from './EventType' | |||
| import Event from './Event' | |||
| class SceneEvent extends Event { | |||
| constructor(viewer) { | |||
| @@ -2,13 +2,14 @@ | |||
| * @Author: Caven | |||
| * @Date: 2020-01-02 14:26:35 | |||
| * @Last Modified by: Caven | |||
| * @Last Modified time: 2020-05-10 08:14:19 | |||
| * @Last Modified time: 2020-05-11 23:57:30 | |||
| */ | |||
| import { Cesium } from '../../namespace' | |||
| import { MouseEventType, ViewerEventType } from './EventType' | |||
| import Event from './Event' | |||
| const { Cesium } = DC.Namespace | |||
| class ViewerEvent extends Event { | |||
| constructor() { | |||
| super() | |||
| @@ -2,12 +2,13 @@ | |||
| * @Author: Caven | |||
| * @Date: 2020-03-05 21:54:13 | |||
| * @Last Modified by: Caven | |||
| * @Last Modified time: 2020-05-10 08:11:55 | |||
| * @Last Modified time: 2020-05-11 22:34:59 | |||
| */ | |||
| export * from './EventType' | |||
| export { default as Event } from './Event' | |||
| export { default as MouseEvent } from './MouseEvent' | |||
| export { default as ViewerEvent } from './ViewerEvent' | |||
| export { default as SceneEvent } from './SceneEvent' | |||
| export { default as LayerEvent } from './LayerEvent' | |||
| export { default as OverlayEvent } from './OverlayEvent' | |||
| export { default as EffectEvent } from './EffectEvent' | |||
| export { default as RoamingEvent } from './RoamingEvent' | |||
| @@ -2,10 +2,9 @@ | |||
| * @Author: Caven | |||
| * @Date: 2020-01-21 15:54:56 | |||
| * @Last Modified by: Caven | |||
| * @Last Modified time: 2020-05-10 08:17:20 | |||
| * @Last Modified time: 2020-05-11 22:10:48 | |||
| */ | |||
| import { Cesium } from '../../namespace' | |||
| import ImageryType from './ImageryType' | |||
| import AmapImageryProvider from './provider/AmapImageryProvider' | |||
| import BaiduImageryProvider from './provider/BaiduImageryProvider' | |||
| @@ -13,6 +12,8 @@ import GoogleImageryProvider from './provider/GoogleImageryProvider' | |||
| import TdtImageryProvider from './provider/TdtImageryProvider' | |||
| import TencentImageryProvider from './provider/TencentImageryProvider' | |||
| const { Cesium } = DC.Namespace | |||
| class ImageryLayerFactory { | |||
| /** | |||
| * Create amap image layer | |||
| @@ -2,12 +2,13 @@ | |||
| * @Author: Caven | |||
| * @Date: 2020-01-15 20:31:28 | |||
| * @Last Modified by: Caven | |||
| * @Last Modified time: 2020-05-10 08:17:34 | |||
| * @Last Modified time: 2020-05-11 22:03:22 | |||
| */ | |||
| import { Cesium } from '../../../namespace' | |||
| import ImageryType from '../ImageryType' | |||
| const { Cesium } = DC.Namespace | |||
| const IMG_URL = | |||
| 'https://webst{s}.is.autonavi.com/appmaptile?style=6&x={x}&y={y}&z={z}' | |||
| @@ -2,12 +2,13 @@ | |||
| * @Author: Caven | |||
| * @Date: 2020-01-15 20:27:27 | |||
| * @Last Modified by: Caven | |||
| * @Last Modified time: 2020-05-10 08:17:55 | |||
| * @Last Modified time: 2020-05-11 22:03:27 | |||
| */ | |||
| import { Cesium } from '../../../namespace' | |||
| import ImageryType from '../ImageryType' | |||
| const { Cesium } = DC.Namespace | |||
| const TEMP_MAP_URL = | |||
| 'http://api{s}.map.bdimg.com/customimage/tile?&x={x}&y={y}&z={z}&scale=1&customid={style}' | |||
| @@ -2,12 +2,13 @@ | |||
| * @Author: Caven | |||
| * @Date: 2020-01-21 16:06:14 | |||
| * @Last Modified by: Caven | |||
| * @Last Modified time: 2020-05-10 08:17:59 | |||
| * @Last Modified time: 2020-05-11 22:04:47 | |||
| */ | |||
| import { Cesium } from '../../../namespace' | |||
| import ImageryType from '../ImageryType' | |||
| const { Cesium } = DC.Namespace | |||
| const ELEC_URL = | |||
| 'http://mt{s}.google.cn/vt/lyrs=m@207000000&hl=zh-CN&gl=CN&src=app&x={x}&y={y}&z={z}&s=Galile' | |||
| @@ -2,11 +2,13 @@ | |||
| * @Author: Caven | |||
| * @Date: 2020-01-15 20:31:46 | |||
| * @Last Modified by: Caven | |||
| * @Last Modified time: 2020-05-10 08:18:02 | |||
| * @Last Modified time: 2020-05-11 22:03:41 | |||
| */ | |||
| import { Cesium } from '../../../namespace' | |||
| import ImageryType from '../ImageryType' | |||
| const { Cesium } = DC.Namespace | |||
| const MAP_URL = | |||
| 'http://t{s}.tianditu.gov.cn/{layer}_c/wmts?service=WMTS&version=1.0.0&request=GetTile&tilematrix={TileMatrix}&layer={layer}&style={style}&tilerow={TileRow}&tilecol={TileCol}&tilematrixset={TileMatrixSet}&format=tiles&tk={key}' | |||
| @@ -2,11 +2,13 @@ | |||
| * @Author: Caven | |||
| * @Date: 2020-01-21 16:10:47 | |||
| * @Last Modified by: Caven | |||
| * @Last Modified time: 2020-05-10 08:18:37 | |||
| * @Last Modified time: 2020-05-11 22:04:41 | |||
| */ | |||
| import { Cesium } from '../../../namespace' | |||
| import ImageryType from '../ImageryType' | |||
| const { Cesium } = DC.Namespace | |||
| const ELEC_URL = | |||
| 'https://rt{s}.map.gtimg.com/tile?z={z}&x={x}&y={reverseY}&styleid=1000&scene=0&version=347' | |||
| @@ -2,7 +2,7 @@ | |||
| * @Author: Caven | |||
| * @Date: 2019-12-27 14:29:05 | |||
| * @Last Modified by: Caven | |||
| * @Last Modified time: 2020-05-10 08:38:53 | |||
| * @Last Modified time: 2020-05-11 23:50:56 | |||
| */ | |||
| const install = function(DC) { | |||
| @@ -10,7 +10,9 @@ const install = function(DC) { | |||
| throw new Error('Missing Base SDK') | |||
| } | |||
| require('./Loader.Base') | |||
| DC.init(() => { | |||
| require('./Loader.Base') | |||
| }) | |||
| /** | |||
| * 框架开始 | |||
| @@ -2,13 +2,14 @@ | |||
| * @Author: Caven | |||
| * @Date: 2020-01-13 10:13:53 | |||
| * @Last Modified by: Caven | |||
| * @Last Modified time: 2020-05-11 17:00:13 | |||
| * @Last Modified time: 2020-05-11 22:37:07 | |||
| */ | |||
| import { Cesium } from '../../namespace' | |||
| import { Layer, VectorLayer } from './index' | |||
| import { Billboard, Polyline, Polygon } from '../overlay' | |||
| import State from '../state/State' | |||
| import Layer from './Layer' | |||
| const { Cesium } = DC.Namespace | |||
| class GeoJsonLayer extends Layer { | |||
| constructor(id, url, options = {}) { | |||
| @@ -72,7 +73,7 @@ class GeoJsonLayer extends Layer { | |||
| * | |||
| */ | |||
| toVectorLayer() { | |||
| let layer = new DC.VectorLayer(this._id) | |||
| let layer = new VectorLayer(this._id) | |||
| let self = this | |||
| this.eachOverlay(item => { | |||
| if (item.billboard) { | |||
| @@ -2,17 +2,20 @@ | |||
| * @Author: Caven | |||
| * @Date: 2020-02-12 21:43:33 | |||
| * @Last Modified by: Caven | |||
| * @Last Modified time: 2020-05-11 17:00:20 | |||
| * @Last Modified time: 2020-05-11 22:37:07 | |||
| */ | |||
| import { Cesium } from '../../namespace' | |||
| import { DomUtil } from '../utils' | |||
| import State from '../state/State' | |||
| import Layer from './Layer' | |||
| import Transform from '../transform/Transform' | |||
| const { Cesium } = DC.Namespace | |||
| class HtmlLayer extends Layer { | |||
| constructor(id) { | |||
| super(id) | |||
| this._delegate = DC.DomUtil.create('div', 'html-layer') | |||
| this._delegate = DomUtil.create('div', 'html-layer') | |||
| this._delegate.setAttribute('id', this._id) | |||
| this._renderRemoveCallback = undefined | |||
| this.type = Layer.getLayerType('html') | |||
| @@ -41,7 +44,7 @@ class HtmlLayer extends Layer { | |||
| let cameraPosition = this._viewer.camera.positionWC | |||
| this.eachOverlay(item => { | |||
| if (item && item.position) { | |||
| let position = DC.T.transformWGS84ToCartesian(item.position) | |||
| let position = Transform.transformWGS84ToCartesian(item.position) | |||
| let windowCoord = Cesium.SceneTransforms.wgs84ToWindowCoordinates( | |||
| scene, | |||
| position | |||
| @@ -2,11 +2,14 @@ | |||
| * @Author: Caven | |||
| * @Date: 2020-03-30 17:14:00 | |||
| * @Last Modified by: Caven | |||
| * @Last Modified time: 2020-05-11 16:59:59 | |||
| * @Last Modified time: 2020-05-11 22:37:12 | |||
| */ | |||
| import { Cesium } from '../../namespace' | |||
| import State from '../state/State' | |||
| import Layer from './Layer' | |||
| import { Label } from '../overlay' | |||
| const { Cesium } = DC.Namespace | |||
| class LabelLayer extends Layer { | |||
| constructor(id, url) { | |||
| @@ -23,7 +26,7 @@ class LabelLayer extends Layer { | |||
| _createLabel(entity) { | |||
| if (entity.position && item.name) { | |||
| return DC.Label.fromEntity(entity) | |||
| return Label.fromEntity(entity) | |||
| } | |||
| } | |||
| @@ -2,18 +2,19 @@ | |||
| * @Author: Caven | |||
| * @Date: 2020-01-03 09:38:21 | |||
| * @Last Modified by: Caven | |||
| * @Last Modified time: 2020-05-11 17:04:58 | |||
| * @Last Modified time: 2020-05-11 21:53:16 | |||
| */ | |||
| import { Cesium } from '../../namespace' | |||
| import { LayerEvent } from '../event' | |||
| import { LayerEventType, OverlayEventType } from '../event/EventType' | |||
| import { Util } from '../utils' | |||
| import { LayerEventType, OverlayEventType, LayerEvent } from '../event' | |||
| import State from '../state/State' | |||
| import LayerType from './LayerType' | |||
| const { Cesium } = DC.Namespace | |||
| class Layer { | |||
| constructor(id) { | |||
| this._id = id || DC.Util.uuid() | |||
| this._id = id || Util.uuid() | |||
| this._delegate = undefined | |||
| this._viewer = undefined | |||
| this._state = undefined | |||
| @@ -2,12 +2,12 @@ | |||
| * @Author: Caven | |||
| * @Date: 2020-01-09 09:16:27 | |||
| * @Last Modified by: Caven | |||
| * @Last Modified time: 2020-05-11 17:00:30 | |||
| * @Last Modified time: 2020-05-11 22:37:12 | |||
| */ | |||
| import { Cesium } from '../../namespace' | |||
| import State from '../state/State' | |||
| import Layer from './Layer' | |||
| const { Cesium } = DC.Namespace | |||
| /** | |||
| * TilesetLayer is used to add various tileset | |||
| @@ -2,7 +2,7 @@ | |||
| * @Author: Caven | |||
| * @Date: 2020-03-22 01:12:39 | |||
| * @Last Modified by: Caven | |||
| * @Last Modified time: 2020-05-11 17:05:29 | |||
| * @Last Modified time: 2020-05-11 22:10:53 | |||
| */ | |||
| import GeoJsonLayer from './GeoJsonLayer' | |||
| @@ -2,10 +2,9 @@ | |||
| * @Author: Caven | |||
| * @Date: 2020-01-02 16:42:03 | |||
| * @Last Modified by: Caven | |||
| * @Last Modified time: 2020-05-11 17:05:49 | |||
| * @Last Modified time: 2020-05-11 22:06:23 | |||
| */ | |||
| import { Cesium } from '../../namespace' | |||
| import State from '../state/State' | |||
| import Layer from './Layer' | |||
| @@ -2,8 +2,9 @@ | |||
| * @Author: Caven | |||
| * @Date: 2020-01-03 11:06:26 | |||
| * @Last Modified by: Caven | |||
| * @Last Modified time: 2020-05-10 10:39:31 | |||
| * @Last Modified time: 2020-05-11 22:37:09 | |||
| */ | |||
| export { default as LayerType } from './LayerType' | |||
| export { default as Layer } from './Layer' | |||
| export { default as GeoJsonLayer } from './GeoJsonLayer' | |||
| @@ -2,9 +2,13 @@ | |||
| * @Author: Caven | |||
| * @Date: 2020-04-24 14:49:37 | |||
| * @Last Modified by: Caven | |||
| * @Last Modified time: 2020-05-10 09:06:41 | |||
| * @Last Modified time: 2020-05-12 00:38:59 | |||
| */ | |||
| import Transform from '../transform/Transform' | |||
| const { Cesium } = DC.Namespace | |||
| export default function area(positions) { | |||
| let result = 0 | |||
| if (positions && Array.isArray(positions)) { | |||
| @@ -13,10 +17,10 @@ export default function area(positions) { | |||
| let positions = [...positions].concat(positions[0]) | |||
| for (let i = 1; i < positions.length; i++) { | |||
| let oel = ellipsoid.cartographicToCartesian( | |||
| DC.T.transformWGS84ToCartographic(positions[i - 1]) | |||
| Transform.transformWGS84ToCartographic(positions[i - 1]) | |||
| ) | |||
| let el = ellipsoid.cartographicToCartesian( | |||
| DC.T.transformWGS84ToCartographic(positions[i]) | |||
| Transform.transformWGS84ToCartographic(positions[i]) | |||
| ) | |||
| h += oel.x * el.y - el.x * oel.y | |||
| } | |||
| @@ -24,3 +28,5 @@ export default function area(positions) { | |||
| } | |||
| return result | |||
| } | |||
| Cesium.Math.area = area | |||
| @@ -2,7 +2,7 @@ | |||
| * @Author: Caven | |||
| * @Date: 2020-04-23 09:29:56 | |||
| * @Last Modified by: Caven | |||
| * @Last Modified time: 2020-04-24 15:36:58 | |||
| * @Last Modified time: 2020-05-12 00:46:48 | |||
| */ | |||
| export default function bounds(positions = [], expand = 0) { | |||
| @@ -2,18 +2,21 @@ | |||
| * @Author: Caven | |||
| * @Date: 2020-04-24 14:43:39 | |||
| * @Last Modified by: Caven | |||
| * @Last Modified time: 2020-05-09 21:50:19 | |||
| * @Last Modified time: 2020-05-12 00:42:28 | |||
| */ | |||
| import { Cesium } from '../../namespace' | |||
| import Transform from '../transform/Transform' | |||
| import Position from '../position/Position' | |||
| const { Cesium } = DC.Namespace | |||
| export default function center(positions) { | |||
| if (positions && Array.isArray(positions)) { | |||
| let boundingSphere = Cesium.BoundingSphere.fromPoints( | |||
| DC.T.transformWGS84ArrayToCartesianArray(positions) | |||
| Transform.transformWGS84ArrayToCartesianArray(positions) | |||
| ) | |||
| return DC.T.transformCartesianToWGS84(boundingSphere.center) | |||
| return Transform.transformCartesianToWGS84(boundingSphere.center) | |||
| } | |||
| return new DC.Position() | |||
| return new Position() | |||
| } | |||
| @@ -2,14 +2,19 @@ | |||
| * @Author: Caven | |||
| * @Date: 2020-03-31 20:58:06 | |||
| * @Last Modified by: Caven | |||
| * @Last Modified time: 2020-04-24 14:50:54 | |||
| * @Last Modified time: 2020-05-11 21:48:23 | |||
| */ | |||
| import Transform from '../transform/Transform' | |||
| export default function distance(positions) { | |||
| let distance = 0 | |||
| if (positions && Array.isArray(positions)) { | |||
| for (let i = 0; i < positions.length - 1; i++) { | |||
| let point1cartographic = DC.T.transformWGS84ToCartographic(positions[i]) | |||
| let point2cartographic = DC.T.transformWGS84ToCartographic( | |||
| let point1cartographic = Transform.transformWGS84ToCartographic( | |||
| positions[i] | |||
| ) | |||
| let point2cartographic = Transform.transformWGS84ToCartographic( | |||
| positions[i + 1] | |||
| ) | |||
| let geodesic = new Cesium.EllipsoidGeodesic() | |||
| @@ -2,17 +2,21 @@ | |||
| * @Author: Caven | |||
| * @Date: 2020-04-11 00:41:47 | |||
| * @Last Modified by: Caven | |||
| * @Last Modified time: 2020-05-09 21:50:32 | |||
| * @Last Modified time: 2020-05-12 00:39:20 | |||
| */ | |||
| import { Cesium } from '../../namespace' | |||
| import Transform from '../transform/Transform' | |||
| import Position from '../position/Position' | |||
| const { Cesium } = DC.Namespace | |||
| export default function heading(startPosition, endPosition) { | |||
| let heading = 0 | |||
| if (startPosition instanceof DC.Position) { | |||
| startPosition = DC.T.transformWGS84ToCartesian(startPosition) | |||
| if (startPosition instanceof Position) { | |||
| startPosition = Transform.transformWGS84ToCartesian(startPosition) | |||
| } | |||
| if (endPosition instanceof DC.Position) { | |||
| endPosition = DC.T.transformWGS84ToCartesian(endPosition) | |||
| if (endPosition instanceof Position) { | |||
| endPosition = Transform.transformWGS84ToCartesian(endPosition) | |||
| } | |||
| let v = Cesium.Cartesian3.subtract( | |||
| endPosition, | |||
| @@ -2,7 +2,7 @@ | |||
| * @Author: Caven | |||
| * @Date: 2020-03-31 20:57:36 | |||
| * @Last Modified by: Caven | |||
| * @Last Modified time: 2020-05-09 23:43:22 | |||
| * @Last Modified time: 2020-05-12 00:42:27 | |||
| */ | |||
| export { default as area } from './area' | |||
| @@ -2,7 +2,7 @@ | |||
| * @Author: Caven | |||
| * @Date: 2020-03-31 20:58:06 | |||
| * @Last Modified by: Caven | |||
| * @Last Modified time: 2020-04-24 14:41:15 | |||
| * @Last Modified time: 2020-05-12 00:39:22 | |||
| */ | |||
| export default function isBetween(value, min, max) { | |||
| @@ -2,9 +2,10 @@ | |||
| * @Author: Caven | |||
| * @Date: 2020-01-21 15:33:52 | |||
| * @Last Modified by: Caven | |||
| * @Last Modified time: 2020-05-09 21:06:59 | |||
| * @Last Modified time: 2020-05-11 22:06:42 | |||
| */ | |||
| import { Cesium } from '../../namespace' | |||
| const { Cesium } = DC.Namespace | |||
| class CameraOption { | |||
| constructor(viewer) { | |||
| @@ -2,10 +2,10 @@ | |||
| * @Author: Caven | |||
| * @Date: 2019-12-30 09:24:37 | |||
| * @Last Modified by: Caven | |||
| * @Last Modified time: 2020-05-09 21:07:05 | |||
| * @Last Modified time: 2020-05-11 22:06:50 | |||
| */ | |||
| import { Cesium } from '../../namespace' | |||
| const { Cesium } = DC.Namespace | |||
| class ViewerOption { | |||
| constructor(viewer) { | |||
| @@ -2,25 +2,27 @@ | |||
| * @Author: Caven | |||
| * @Date: 2020-01-03 12:18:17 | |||
| * @Last Modified by: Caven | |||
| * @Last Modified time: 2020-05-10 09:11:36 | |||
| * @Last Modified time: 2020-05-11 22:11:10 | |||
| */ | |||
| import { OverlayEvent } from '../event' | |||
| import { Util } from '../utils' | |||
| import { OverlayEventType, OverlayEvent } from '../event' | |||
| import State from '../state/State' | |||
| import OverlayType from './OverlayType' | |||
| class Overlay { | |||
| constructor() { | |||
| this._id = DC.Util.uuid() | |||
| this._id = Util.uuid() | |||
| this._layer = undefined | |||
| this._state = undefined | |||
| this._delegate = undefined | |||
| this._bid = DC.Util.uuid() // Business id | |||
| this._bid = Util.uuid() // Business id | |||
| this._show = true | |||
| this._style = {} | |||
| this._attr = {} | |||
| this._overlayEvent = new OverlayEvent() | |||
| this.type = undefined | |||
| this.on(DC.OverlayEventType.ADD, this._addHandler, this) | |||
| this.on(DC.OverlayEventType.REMOVE, this._removeHandler, this) | |||
| this.on(OverlayEventType.ADD, this._addHandler, this) | |||
| this.on(OverlayEventType.REMOVE, this._removeHandler, this) | |||
| } | |||
| get overlayId() { | |||
| @@ -98,7 +100,7 @@ class Overlay { | |||
| if (this._layer && this._layer.delegate && this._layer.delegate.entities) { | |||
| this._layer.delegate.entities.add(this._delegate) | |||
| this._addedHook && this._addedHook() | |||
| this._state = DC.OverlayState.ADDED | |||
| this._state = State.ADDED | |||
| } | |||
| } | |||
| @@ -109,7 +111,7 @@ class Overlay { | |||
| if (this._layer && this._layer.delegate && this._layer.delegate.entities) { | |||
| this._layer.delegate.entities.remove(this._delegate) | |||
| this._removedHook && this._removedHook() | |||
| this._state = DC.OverlayState.REMOVED | |||
| this._state = State.REMOVED | |||
| } | |||
| } | |||
| @@ -196,6 +198,4 @@ class Overlay { | |||
| } | |||
| } | |||
| DC.Overlay = Overlay | |||
| export default Overlay | |||
| @@ -2,7 +2,7 @@ | |||
| * @Author: Caven | |||
| * @Date: 2020-05-10 08:24:57 | |||
| * @Last Modified by: Caven | |||
| * @Last Modified time: 2020-05-10 09:08:49 | |||
| * @Last Modified time: 2020-05-11 22:11:19 | |||
| */ | |||
| let OverlayType = {} | |||
| @@ -2,15 +2,16 @@ | |||
| * @Author: Caven | |||
| * @Date: 2020-01-19 10:18:23 | |||
| * @Last Modified by: Caven | |||
| * @Last Modified time: 2020-05-11 17:08:29 | |||
| * @Last Modified time: 2020-05-11 22:06:59 | |||
| */ | |||
| import { Cesium } from '../../../namespace' | |||
| import { Util } from '../../utils' | |||
| import Transform from '../../transform/Transform' | |||
| import State from '../../state/State' | |||
| import Overlay from '../Overlay' | |||
| const { Cesium } = DC.Namespace | |||
| class Billboard extends Overlay { | |||
| constructor(position, icon) { | |||
| if (!Util.checkPosition(position)) { | |||
| @@ -2,15 +2,16 @@ | |||
| * @Author: Caven | |||
| * @Date: 2020-01-31 18:57:02 | |||
| * @Last Modified by: Caven | |||
| * @Last Modified time: 2020-05-11 17:08:52 | |||
| * @Last Modified time: 2020-05-11 21:54:41 | |||
| */ | |||
| import { Cesium } from '../../../namespace' | |||
| import { Util } from '../../utils' | |||
| import Transform from '../../transform/Transform' | |||
| import State from '../../state/State' | |||
| import Overlay from '../Overlay' | |||
| const { Cesium } = DC.Namespace | |||
| class Circle extends Overlay { | |||
| constructor(center, radius) { | |||
| if (!Util.checkPosition(center)) { | |||
| @@ -28,7 +29,7 @@ class Circle extends Overlay { | |||
| set center(center) { | |||
| if (!Util.checkPosition(center)) { | |||
| throw new Error('DC.Circle: the center invalid') | |||
| throw new Error('Circle: the center invalid') | |||
| } | |||
| this._center = center | |||
| } | |||
| @@ -2,13 +2,13 @@ | |||
| * @Author: Caven | |||
| * @Date: 2020-02-12 21:46:22 | |||
| * @Last Modified by: Caven | |||
| * @Last Modified time: 2020-05-11 17:09:28 | |||
| * @Last Modified time: 2020-05-11 23:35:31 | |||
| */ | |||
| import { DomUtil, Util } from '../../utils' | |||
| import { isBetween } from '../../math' | |||
| import Transform from '../../transform/Transform' | |||
| import State from '../State' | |||
| import State from '../../state/State' | |||
| import Overlay from '../Overlay' | |||
| class DivIcon extends Overlay { | |||
| @@ -2,18 +2,20 @@ | |||
| * @Author: Caven | |||
| * @Date: 2020-02-01 11:59:28 | |||
| * @Last Modified by: Caven | |||
| * @Last Modified time: 2020-05-11 17:10:01 | |||
| * @Last Modified time: 2020-05-11 22:38:18 | |||
| */ | |||
| import { Cesium } from '../../../namespace' | |||
| import { Util } from '../../utils' | |||
| import Transform from '../../transform/Transform' | |||
| import State from '../../state/State' | |||
| import Overlay from '../Overlay' | |||
| const { Cesium } = DC.Namespace | |||
| class Label extends Overlay { | |||
| constructor(position, text) { | |||
| if (!Util.checkPosition(position)) { | |||
| throw new Error('DC.Label: the position invalid') | |||
| throw new Error('Label: the position invalid') | |||
| } | |||
| super() | |||
| this._position = position | |||
| @@ -25,7 +27,7 @@ class Label extends Overlay { | |||
| set position(position) { | |||
| if (!Util.checkPosition(position)) { | |||
| throw new Error('DC.Label: the position invalid') | |||
| throw new Error('Label: the position invalid') | |||
| } | |||
| this._position = position | |||
| } | |||
| @@ -2,15 +2,16 @@ | |||
| * @Author: Caven | |||
| * @Date: 2020-01-06 15:03:25 | |||
| * @Last Modified by: Caven | |||
| * @Last Modified time: 2020-05-11 17:10:26 | |||
| * @Last Modified time: 2020-05-11 22:07:14 | |||
| */ | |||
| import { Cesium } from '../../../namespace' | |||
| import { Util } from '../../utils' | |||
| import Transform from '../../transform/Transform' | |||
| import State from '../../state/State' | |||
| import Overlay from '../Overlay' | |||
| const { Cesium } = DC.Namespace | |||
| const DEF_STYLE = { | |||
| pixelSize: 8, | |||
| outlineColor: Cesium.Color.BLUE, | |||
| @@ -2,9 +2,9 @@ | |||
| * @Author: Caven | |||
| * @Date: 2020-01-09 09:10:37 | |||
| * @Last Modified by: Caven | |||
| * @Last Modified time: 2020-05-11 17:10:49 | |||
| * @Last Modified time: 2020-05-11 22:07:22 | |||
| */ | |||
| import { Cesium } from '../../../namespace' | |||
| import { Util } from '../../utils' | |||
| import { center, area } from '../../math' | |||
| import Transform from '../../transform/Transform' | |||
| @@ -12,6 +12,8 @@ import Parse from '../../parse/Parse' | |||
| import State from '../../state/State' | |||
| import Overlay from '../Overlay' | |||
| const { Cesium } = DC.Namespace | |||
| class Polygon extends Overlay { | |||
| constructor(positions) { | |||
| if (!Util.checkPositions(positions)) { | |||
| @@ -2,10 +2,9 @@ | |||
| * @Author: Caven | |||
| * @Date: 2020-01-06 15:03:25 | |||
| * @Last Modified by: Caven | |||
| * @Last Modified time: 2020-05-11 17:11:13 | |||
| * @Last Modified time: 2020-05-11 22:07:32 | |||
| */ | |||
| import { Cesium } from '../../../namespace' | |||
| import { Util } from '../../utils' | |||
| import { center, distance } from '../../math' | |||
| import Transform from '../../transform/Transform' | |||
| @@ -13,6 +12,8 @@ import Parse from '../../parse/Parse' | |||
| import State from '../../state/State' | |||
| import Overlay from '../Overlay' | |||
| const { Cesium } = DC.Namespace | |||
| class Polyline extends Overlay { | |||
| constructor(positions) { | |||
| if (!Util.checkPositions(positions)) { | |||
| @@ -2,15 +2,16 @@ | |||
| * @Author: Caven | |||
| * @Date: 2020-01-06 15:03:25 | |||
| * @Last Modified by: Caven | |||
| * @Last Modified time: 2020-05-11 17:11:35 | |||
| * @Last Modified time: 2020-05-11 22:07:38 | |||
| */ | |||
| import { Cesium } from '../../../namespace' | |||
| import { Util } from '../../utils' | |||
| import Transform from '../../transform/Transform' | |||
| import State from '../../state/State' | |||
| import Overlay from '../Overlay' | |||
| const { Cesium } = DC.Namespace | |||
| class Model extends Overlay { | |||
| constructor(position, modelUrl) { | |||
| if (!Util.checkPosition(position)) { | |||
| @@ -2,13 +2,15 @@ | |||
| * @Author: Caven | |||
| * @Date: 2020-01-07 08:51:56 | |||
| * @Last Modified by: Caven | |||
| * @Last Modified time: 2020-05-11 17:12:18 | |||
| * @Last Modified time: 2020-05-11 22:07:45 | |||
| */ | |||
| import { Cesium } from '../../../namespace' | |||
| import { Util } from '../../utils' | |||
| import State from '../../state/State' | |||
| import Overlay from '../Overlay' | |||
| const { Cesium } = DC.Namespace | |||
| class Tileset extends Overlay { | |||
| constructor(url, options = {}) { | |||
| super() | |||
| @@ -2,7 +2,7 @@ | |||
| * @Author: Caven | |||
| * @Date: 2020-03-22 00:10:25 | |||
| * @Last Modified by: Caven | |||
| * @Last Modified time: 2020-05-10 10:46:49 | |||
| * @Last Modified time: 2020-05-11 22:11:23 | |||
| */ | |||
| import Position from '../position/Position' | |||
| @@ -2,12 +2,13 @@ | |||
| * @Author: Caven | |||
| * @Date: 2019-12-27 14:35:02 | |||
| * @Last Modified by: Caven | |||
| * @Last Modified time: 2020-05-10 08:25:22 | |||
| * @Last Modified time: 2020-05-11 22:11:25 | |||
| */ | |||
| import { Cesium } from '../../namespace' | |||
| import Transform from '../transform/Transform' | |||
| const { Cesium } = DC.Namespace | |||
| class Position { | |||
| constructor(lng, lat, alt, heading, pitch, roll) { | |||
| this._lng = lng || 0 | |||
| @@ -2,7 +2,7 @@ | |||
| * @Author: Caven | |||
| * @Date: 2020-05-11 16:39:23 | |||
| * @Last Modified by: Caven | |||
| * @Last Modified time: 2020-05-11 16:54:51 | |||
| * @Last Modified time: 2020-05-11 22:11:28 | |||
| */ | |||
| const State = { | |||
| @@ -2,9 +2,10 @@ | |||
| * @Author: Caven | |||
| * @Date: 2020-01-21 15:54:56 | |||
| * @Last Modified by: Caven | |||
| * @Last Modified time: 2020-05-10 08:25:30 | |||
| * @Last Modified time: 2020-05-11 22:07:56 | |||
| */ | |||
| import { Cesium } from '../../namespace' | |||
| const { Cesium } = DC.Namespace | |||
| class TerrainFactory { | |||
| /** | |||
| @@ -2,11 +2,13 @@ | |||
| * @Author: Caven | |||
| * @Date: 2020-01-07 09:00:32 | |||
| * @Last Modified by: Caven | |||
| * @Last Modified time: 2020-05-11 16:34:47 | |||
| * @Last Modified time: 2020-05-11 22:38:44 | |||
| */ | |||
| import { Cesium } from '../../namespace' | |||
| import Position from '../position/Position' | |||
| const { Cesium } = DC.Namespace | |||
| const WMP = new Cesium.WebMercatorProjection() | |||
| class Transform { | |||
| @@ -95,7 +97,7 @@ class Transform { | |||
| let mp = WMP.project( | |||
| Cesium.Cartographic.fromDegrees(position.lng, position.lat, position.alt) | |||
| ) | |||
| return new DC.Position(mp.x, mp.y, mp.z) | |||
| return new Position(mp.x, mp.y, mp.z) | |||
| } | |||
| /** | |||
| @@ -107,7 +109,7 @@ class Transform { | |||
| let mp = WMP.unproject( | |||
| new Cesium.Cartesian3(position.lng, position.lat, position.alt) | |||
| ) | |||
| return new DC.Position( | |||
| return new Position( | |||
| Cesium.Math.toDegrees(mp.longitude), | |||
| Cesium.Math.toDegrees(mp.latitude), | |||
| mp.height | |||
| @@ -2,7 +2,7 @@ | |||
| * @Author: Caven | |||
| * @Date: 2019-12-31 17:58:01 | |||
| * @Last Modified by: Caven | |||
| * @Last Modified time: 2020-05-09 21:17:29 | |||
| * @Last Modified time: 2020-05-11 22:38:51 | |||
| */ | |||
| import Position from '../position/Position' | |||
| @@ -2,7 +2,8 @@ | |||
| * @Author: Caven | |||
| * @Date: 2020-01-06 16:38:49 | |||
| * @Last Modified by: Caven | |||
| * @Last Modified time: 2020-05-09 23:43:14 | |||
| * @Last Modified time: 2020-05-11 22:38:49 | |||
| */ | |||
| export { default as DomUtil } from './DomUtil' | |||
| export { default as Util } from './Util' | |||
| @@ -2,13 +2,11 @@ | |||
| * @Author: Caven | |||
| * @Date: 2019-12-27 17:13:24 | |||
| * @Last Modified by: Caven | |||
| * @Last Modified time: 2020-05-11 16:58:42 | |||
| * @Last Modified time: 2020-05-11 23:32:52 | |||
| */ | |||
| import { Cesium } from '../../namespace' | |||
| import { LayerEventType, MouseEvent, ViewerEvent, SceneEvent } from '../event' | |||
| import { ViewerOption, CameraOption } from '../option' | |||
| import { MouseEvent, ViewerEvent, SceneEvent } from '../event' | |||
| import { LayerEventType, EffectEventType } from '../event/EventType' | |||
| import { | |||
| Attribution, | |||
| ContextMenu, | |||
| @@ -20,11 +18,12 @@ import { | |||
| HawkeyeMap, | |||
| Compass | |||
| } from '../widget' | |||
| import { DomUtil } from '../utils' | |||
| import Transform from '../transform/Transform' | |||
| import Position from '../position/Position' | |||
| const { Cesium } = DC.Namespace | |||
| const DEF_OPTS = { | |||
| animation: false, //Whether to create animated widgets, lower left corner of the meter | |||
| baseLayerPicker: false, //Whether to display the layer selector | |||
| @@ -2,8 +2,9 @@ | |||
| * @Author: Caven | |||
| * @Date: 2020-02-11 21:08:01 | |||
| * @Last Modified by: Caven | |||
| * @Last Modified time: 2020-05-11 17:13:48 | |||
| * @Last Modified time: 2020-05-11 23:33:59 | |||
| */ | |||
| import { DomUtil } from '../utils' | |||
| import State from '../state/State' | |||
| import Widget from './Widget' | |||
| @@ -2,14 +2,15 @@ | |||
| * @Author: Caven | |||
| * @Date: 2020-03-19 13:11:12 | |||
| * @Last Modified by: Caven | |||
| * @Last Modified time: 2020-05-11 17:14:02 | |||
| * @Last Modified time: 2020-05-11 23:33:55 | |||
| */ | |||
| import { Cesium } from '../../namespace' | |||
| import { DomUtil } from '../utils' | |||
| import State from '../state/State' | |||
| import Widget from './Widget' | |||
| const { Cesium } = DC.Namespace | |||
| const svg_out_ring = | |||
| 'm 66.5625,0 0,15.15625 3.71875,0 0,-10.40625 5.5,10.40625 4.375,0 0,-15.15625 -3.71875,0 0,10.40625 L 70.9375,0 66.5625,0 z M 72.5,20.21875 c -28.867432,0 -52.28125,23.407738 -52.28125,52.28125 0,28.87351 23.413818,52.3125 52.28125,52.3125 28.86743,0 52.28125,-23.43899 52.28125,-52.3125 0,-28.873512 -23.41382,-52.28125 -52.28125,-52.28125 z m 0,1.75 c 13.842515,0 26.368948,5.558092 35.5,14.5625 l -11.03125,11 0.625,0.625 11.03125,-11 c 8.9199,9.108762 14.4375,21.579143 14.4375,35.34375 0,13.764606 -5.5176,26.22729 -14.4375,35.34375 l -11.03125,-11 -0.625,0.625 11.03125,11 c -9.130866,9.01087 -21.658601,14.59375 -35.5,14.59375 -13.801622,0 -26.321058,-5.53481 -35.4375,-14.5 l 11.125,-11.09375 c 6.277989,6.12179 14.857796,9.90625 24.3125,9.90625 19.241896,0 34.875,-15.629154 34.875,-34.875 0,-19.245847 -15.633104,-34.84375 -34.875,-34.84375 -9.454704,0 -18.034511,3.760884 -24.3125,9.875 L 37.0625,36.4375 C 46.179178,27.478444 58.696991,21.96875 72.5,21.96875 z m -0.875,0.84375 0,13.9375 1.75,0 0,-13.9375 -1.75,0 z M 36.46875,37.0625 47.5625,48.15625 C 41.429794,54.436565 37.65625,63.027539 37.65625,72.5 c 0,9.472461 3.773544,18.055746 9.90625,24.34375 L 36.46875,107.9375 c -8.96721,-9.1247 -14.5,-21.624886 -14.5,-35.4375 0,-13.812615 5.53279,-26.320526 14.5,-35.4375 z M 72.5,39.40625 c 18.297686,0 33.125,14.791695 33.125,33.09375 0,18.302054 -14.827314,33.125 -33.125,33.125 -18.297687,0 -33.09375,-14.822946 -33.09375,-33.125 0,-18.302056 14.796063,-33.09375 33.09375,-33.09375 z M 22.84375,71.625 l 0,1.75 13.96875,0 0,-1.75 -13.96875,0 z m 85.5625,0 0,1.75 14,0 0,-1.75 -14,0 z M 71.75,108.25 l 0,13.9375 1.71875,0 0,-13.9375 -1.71875,0 z' | |||
| const svg_rotation_marker = | |||
| @@ -2,15 +2,16 @@ | |||
| * @Author: Caven | |||
| * @Date: 2019-12-31 17:32:01 | |||
| * @Last Modified by: Caven | |||
| * @Last Modified time: 2020-05-11 17:14:23 | |||
| * @Last Modified time: 2020-05-11 22:08:55 | |||
| */ | |||
| import { Cesium } from '../../namespace' | |||
| import { DomUtil } from '../utils' | |||
| import { MouseEventType } from '../event/EventType' | |||
| import { MouseEventType } from '../event' | |||
| import State from '../state/State' | |||
| import Widget from './Widget' | |||
| const { Cesium } = DC.Namespace | |||
| class ContextMenu extends Widget { | |||
| constructor() { | |||
| super() | |||
| @@ -2,14 +2,15 @@ | |||
| * @Author: Caven | |||
| * @Date: 2020-03-15 17:47:42 | |||
| * @Last Modified by: Caven | |||
| * @Last Modified time: 2020-05-11 17:14:40 | |||
| * @Last Modified time: 2020-05-11 22:09:11 | |||
| */ | |||
| import { Cesium } from '../../namespace' | |||
| import { DomUtil, Util } from '../utils' | |||
| import State from '../state/State' | |||
| import Widget from './Widget' | |||
| const { Cesium } = DC.Namespace | |||
| const DEF_OPTS = { | |||
| animation: false, | |||
| baseLayerPicker: false, | |||
| @@ -2,13 +2,13 @@ | |||
| * @Author: Caven | |||
| * @Date: 2020-03-04 18:02:32 | |||
| * @Last Modified by: Caven | |||
| * @Last Modified time: 2020-05-10 10:30:18 | |||
| * @Last Modified time: 2020-05-11 23:34:03 | |||
| */ | |||
| import { MouseEventType, SceneEventType } from '../event/EventType' | |||
| import { MouseEventType, SceneEventType } from '../event' | |||
| import { DomUtil } from '../utils' | |||
| import State from '../state/State' | |||
| import Widget from './Widget' | |||
| import WidgetState from './WidgetState' | |||
| class LocationBar extends Widget { | |||
| constructor() { | |||
| @@ -17,7 +17,7 @@ class LocationBar extends Widget { | |||
| this._mouseEl = DomUtil.create('div', 'mouse-location', this._wrapper) | |||
| this._cameraEl = DomUtil.create('div', 'camera-location', this._wrapper) | |||
| this.type = Widget.getWidgetType('location_bar') | |||
| this._state = WidgetState.INITIALIZED | |||
| this._state = State.INITIALIZED | |||
| } | |||
| _installHook() { | |||
| @@ -2,13 +2,14 @@ | |||
| * @Author: Caven | |||
| * @Date: 2020-03-04 15:38:40 | |||
| * @Last Modified by: Caven | |||
| * @Last Modified time: 2020-05-10 10:32:57 | |||
| * @Last Modified time: 2020-05-11 23:34:20 | |||
| */ | |||
| import { Cesium } from '../../namespace' | |||
| import { DomUtil } from '../utils' | |||
| import State from '../state/State' | |||
| import Widget from './Widget' | |||
| import WidgetState from './WidgetState' | |||
| const { Cesium } = DC.Namespace | |||
| class MapSplit extends Widget { | |||
| constructor() { | |||
| @@ -17,7 +18,7 @@ class MapSplit extends Widget { | |||
| this._baseLayer = undefined | |||
| this._moveActive = false | |||
| this.type = Widget.getWidgetType('map_split') | |||
| this._state = WidgetState.INITIALIZED | |||
| this._state = State.INITIALIZED | |||
| } | |||
| _installHook() { | |||
| @@ -2,12 +2,12 @@ | |||
| * @Author: Caven | |||
| * @Date: 2020-02-11 18:34:46 | |||
| * @Last Modified by: Caven | |||
| * @Last Modified time: 2020-05-10 10:33:32 | |||
| * @Last Modified time: 2020-05-11 23:34:34 | |||
| */ | |||
| import { DomUtil } from '../utils' | |||
| import State from '../state/State' | |||
| import Widget from './Widget' | |||
| import WidgetState from './WidgetState' | |||
| class MapSwitch extends Widget { | |||
| constructor() { | |||
| @@ -16,7 +16,7 @@ class MapSwitch extends Widget { | |||
| this._config = undefined | |||
| this._cache = [] | |||
| this.type = Widget.getWidgetType('map_switch') | |||
| this._state = WidgetState.INITIALIZED | |||
| this._state = State.INITIALIZED | |||
| } | |||
| /** | |||
| @@ -2,12 +2,12 @@ | |||
| * @Author: Caven | |||
| * @Date: 2020-01-15 19:16:45 | |||
| * @Last Modified by: Caven | |||
| * @Last Modified time: 2020-05-10 10:35:02 | |||
| * @Last Modified time: 2020-05-11 23:33:26 | |||
| */ | |||
| import { DomUtil } from '../utils' | |||
| import State from '../state/State' | |||
| import Widget from './Widget' | |||
| import WidgetState from './WidgetState' | |||
| class Popup extends Widget { | |||
| constructor() { | |||
| @@ -16,7 +16,7 @@ class Popup extends Widget { | |||
| this._config = undefined | |||
| this._positionChangeable = true | |||
| this.type = Widget.getWidgetType('popup') | |||
| this._state = WidgetState.INITIALIZED | |||
| this._state = State.INITIALIZED | |||
| } | |||
| set config(config) { | |||
| @@ -2,19 +2,19 @@ | |||
| * @Author: Caven | |||
| * @Date: 2020-02-01 12:07:54 | |||
| * @Last Modified by: Caven | |||
| * @Last Modified time: 2020-05-10 10:36:16 | |||
| * @Last Modified time: 2020-05-11 23:34:58 | |||
| */ | |||
| import { DomUtil } from '../utils' | |||
| import State from '../state/State' | |||
| import Widget from './Widget' | |||
| import WidgetState from './WidgetState' | |||
| class Tooltip extends Widget { | |||
| constructor() { | |||
| super() | |||
| this._wrapper = DomUtil.create('div', 'dc-tool-tip') | |||
| this.type = Widget.getWidgetType('tooltip') | |||
| this._state = WidgetState.INITIALIZED | |||
| this._state = State.INITIALIZED | |||
| } | |||
| /** | |||
| @@ -2,12 +2,14 @@ | |||
| * @Author: Caven | |||
| * @Date: 2020-01-15 19:17:52 | |||
| * @Last Modified by: Caven | |||
| * @Last Modified time: 2020-05-11 17:13:28 | |||
| * @Last Modified time: 2020-05-11 22:12:02 | |||
| */ | |||
| import { Cesium } from '../../namespace' | |||
| import State from '../state/State' | |||
| import WidgetType from './WidgetType' | |||
| const { Cesium } = DC.Namespace | |||
| class Widget { | |||
| constructor() { | |||
| this._viewer = undefined | |||
| @@ -2,8 +2,9 @@ | |||
| * @Author: Caven | |||
| * @Date: 2020-05-10 10:15:46 | |||
| * @Last Modified by: Caven | |||
| * @Last Modified time: 2020-05-10 10:16:24 | |||
| * @Last Modified time: 2020-05-11 22:39:58 | |||
| */ | |||
| let WidgetType = {} | |||
| export default WidgetType | |||
| @@ -2,8 +2,9 @@ | |||
| * @Author: Caven | |||
| * @Date: 2020-05-06 13:25:36 | |||
| * @Last Modified by: Caven | |||
| * @Last Modified time: 2020-05-11 17:15:05 | |||
| * @Last Modified time: 2020-05-11 22:40:00 | |||
| */ | |||
| import Widget from './Widget' | |||
| class ZoomController extends Widget { | |||
| @@ -1,10 +0,0 @@ | |||
| /* | |||
| * @Author: Caven | |||
| * @Date: 2019-12-27 17:14:46 | |||
| * @Last Modified by: Caven | |||
| * @Last Modified time: 2020-05-09 21:38:07 | |||
| */ | |||
| let Cesium = DC.Namespace.Cesium | |||
| export { Cesium } | |||
| @@ -1,16 +0,0 @@ | |||
| /* | |||
| * @Author: Caven | |||
| * @Date: 2020-04-09 20:03:32 | |||
| * @Last Modified by: Caven | |||
| * @Last Modified time: 2020-04-16 20:28:58 | |||
| */ | |||
| import '@/core/const' | |||
| import './base/DC.Box' | |||
| import './base/DC.Corridor' | |||
| import './base/DC.Cylinder' | |||
| import './base/DC.Ellipse' | |||
| import './base/DC.Ellipsoid' | |||
| import './base/DC.Plane' | |||
| import './base/DC.PolylineVolume' | |||
| import './base/DC.Wall' | |||
| import './custom/DC.CustomBillboard' | |||
| @@ -0,0 +1,27 @@ | |||
| /* | |||
| * @Author: Caven | |||
| * @Date: 2020-04-09 20:03:32 | |||
| * @Last Modified by: Caven | |||
| * @Last Modified time: 2020-05-12 00:32:33 | |||
| */ | |||
| import Box from './base/Box' | |||
| import Corridor from './base/Corridor' | |||
| import Cylinder from './base/Cylinder' | |||
| import Ellipse from './base/Ellipse' | |||
| import Ellipsoid from './base/Ellipsoid' | |||
| import Plane from './base/Plane' | |||
| import PolylineVolume from './base/PolylineVolume' | |||
| import Wall from './base/Wall' | |||
| //export { default as CustomBillboard } from './custom/CustomBillboard' | |||
| DC.mixin({ | |||
| Box, | |||
| Corridor, | |||
| Cylinder, | |||
| Ellipse, | |||
| Ellipsoid, | |||
| Plane, | |||
| PolylineVolume, | |||
| Wall | |||
| }) | |||
| @@ -2,15 +2,17 @@ | |||
| * @Author: Caven | |||
| * @Date: 2020-02-25 18:28:36 | |||
| * @Last Modified by: Caven | |||
| * @Last Modified time: 2020-04-16 20:29:02 | |||
| * @Last Modified time: 2020-05-11 22:48:57 | |||
| */ | |||
| import Cesium from '@/namespace' | |||
| import Overlay from '@/core/overlay/Overlay' | |||
| DC.Box = class extends Overlay { | |||
| const { Overlay, Util, State, Transform } = DC | |||
| const { Cesium } = DC.Namespace | |||
| class Box extends Overlay { | |||
| constructor(position, length, width, height) { | |||
| if (!DC.Util.checkPosition(position)) { | |||
| throw new Error('DC.Box: the position invalid') | |||
| if (!Util.checkPosition(position)) { | |||
| throw new Error('Box: the position invalid') | |||
| } | |||
| super() | |||
| this._position = position | |||
| @@ -18,13 +20,13 @@ DC.Box = class extends Overlay { | |||
| this._width = width | |||
| this._height = height | |||
| this._delegate = new Cesium.Entity() | |||
| this._state = DC.OverlayState.INITIALIZED | |||
| this.type = DC.OverlayType.BOX | |||
| this.type = Overlay.getOverlayType('box') | |||
| this._state = State.INITIALIZED | |||
| } | |||
| set position(position) { | |||
| if (!DC.Util.checkPosition(position)) { | |||
| throw new Error('DC.Box: the position invalid') | |||
| if (!Util.checkPosition(position)) { | |||
| throw new Error('Box: the position invalid') | |||
| } | |||
| this._position = position | |||
| } | |||
| @@ -62,14 +64,14 @@ DC.Box = class extends Overlay { | |||
| * set the location | |||
| */ | |||
| this._delegate.position = new Cesium.CallbackProperty(time => { | |||
| return DC.T.transformWGS84ToCartesian(this._position) | |||
| return Transform.transformWGS84ToCartesian(this._position) | |||
| }) | |||
| /** | |||
| * set the orientation | |||
| */ | |||
| this._delegate.orientation = new Cesium.CallbackProperty(time => { | |||
| return Cesium.Transforms.headingPitchRollQuaternion( | |||
| DC.T.transformWGS84ToCartesian(this._position), | |||
| Transform.transformWGS84ToCartesian(this._position), | |||
| new Cesium.HeadingPitchRoll( | |||
| Cesium.Math.toRadians(this._position.heading), | |||
| Cesium.Math.toRadians(this._position.pitch), | |||
| @@ -97,9 +99,11 @@ DC.Box = class extends Overlay { | |||
| return this | |||
| } | |||
| this._style = style | |||
| this._delegate.box && DC.Util.merge(this._delegate.box, this._style) | |||
| this._delegate.box && Util.merge(this._delegate.box, this._style) | |||
| return this | |||
| } | |||
| } | |||
| DC.OverlayType.BOX = 'box' | |||
| Overlay.registerType('box') | |||
| export default Box | |||
| @@ -2,29 +2,30 @@ | |||
| * @Author: Caven | |||
| * @Date: 2020-04-11 12:58:17 | |||
| * @Last Modified by: Caven | |||
| * @Last Modified time: 2020-04-16 20:29:06 | |||
| * @Last Modified time: 2020-05-11 22:19:49 | |||
| */ | |||
| import Cesium from '@/namespace' | |||
| import Overlay from '@/core/overlay/Overlay' | |||
| const { Overlay, Util, State, Transform, Parse } = DC | |||
| DC.Corridor = class extends Overlay { | |||
| const { Cesium } = DC.Namespace | |||
| class Corridor extends Overlay { | |||
| constructor(positions) { | |||
| if (!DC.Util.checkPositions(positions)) { | |||
| throw new Error('DC.Corridor: the positions invalid') | |||
| if (!Util.checkPositions(positions)) { | |||
| throw new Error('Corridor: the positions invalid') | |||
| } | |||
| super() | |||
| this._positions = DC.P.parsePositions(positions) | |||
| this._positions = Parse.parsePositions(positions) | |||
| this._delegate = new Cesium.Entity() | |||
| this._state = DC.OverlayState.INITIALIZED | |||
| this.type = DC.OverlayType.CORRIDOR | |||
| this.type = Overlay.getOverlayType('corridor') | |||
| this._state = State.INITIALIZED | |||
| } | |||
| set positions(positions) { | |||
| if (!DC.Util.checkPositions(positions)) { | |||
| throw new Error('DC.Corridor: the positions invalid') | |||
| if (!Util.checkPositions(positions)) { | |||
| throw new Error('Corridor: the positions invalid') | |||
| } | |||
| this._positions = DC.P.parsePositions(positions) | |||
| this._positions = Parse.parsePositions(positions) | |||
| } | |||
| get positions() { | |||
| @@ -38,7 +39,7 @@ DC.Corridor = class extends Overlay { | |||
| this._delegate.corridor = { | |||
| ...this._style, | |||
| positions: new Cesium.CallbackProperty(time => { | |||
| return DC.T.transformWGS84ArrayToCartesianArray(this._positions) | |||
| return Transform.transformWGS84ArrayToCartesianArray(this._positions) | |||
| }) | |||
| } | |||
| } | |||
| @@ -52,10 +53,11 @@ DC.Corridor = class extends Overlay { | |||
| return this | |||
| } | |||
| this._style = style | |||
| this._delegate.corridor && | |||
| DC.Util.merge(this._delegate.corridor, this._style) | |||
| this._delegate.corridor && Util.merge(this._delegate.corridor, this._style) | |||
| return this | |||
| } | |||
| } | |||
| DC.OverlayType.CORRIDOR = 'corridor' | |||
| Overlay.registerType('corridor') | |||
| export default Corridor | |||
| @@ -2,15 +2,16 @@ | |||
| * @Author: Caven | |||
| * @Date: 2020-04-14 11:10:00 | |||
| * @Last Modified by: Caven | |||
| * @Last Modified time: 2020-04-16 20:29:10 | |||
| * @Last Modified time: 2020-05-11 22:22:10 | |||
| */ | |||
| import Cesium from '@/namespace' | |||
| import Overlay from '@/core/overlay/Overlay' | |||
| const { Overlay, Util, State, Transform } = DC | |||
| DC.Cylinder = class extends Overlay { | |||
| const { Cesium } = DC.Namespace | |||
| class Cylinder extends Overlay { | |||
| constructor(position, length, topRadius, bottomRadius) { | |||
| if (!DC.Util.checkPosition(position)) { | |||
| throw new Error('DC.Cylinder: the position invalid') | |||
| if (!Util.checkPosition(position)) { | |||
| throw new Error('Cylinder: the position invalid') | |||
| } | |||
| super() | |||
| this._position = position | |||
| @@ -18,13 +19,13 @@ DC.Cylinder = class extends Overlay { | |||
| this._topRadius = topRadius | |||
| this._bottomRadius = bottomRadius | |||
| this._delegate = new Cesium.Entity() | |||
| this._state = DC.OverlayState.INITIALIZED | |||
| this.type = DC.OverlayType.CYLINDER | |||
| this.type = Overlay.getOverlayType('cylinder') | |||
| this._state = State.INITIALIZED | |||
| } | |||
| set position(position) { | |||
| if (!DC.Util.checkPosition(position)) { | |||
| throw new Error('DC.Cylinder: the position invalid') | |||
| if (!Util.checkPosition(position)) { | |||
| throw new Error('Cylinder: the position invalid') | |||
| } | |||
| this._position = position | |||
| } | |||
| @@ -62,14 +63,14 @@ DC.Cylinder = class extends Overlay { | |||
| * set the location | |||
| */ | |||
| this._delegate.position = new Cesium.CallbackProperty(time => { | |||
| return DC.T.transformWGS84ToCartesian(this._position) | |||
| return Transform.transformWGS84ToCartesian(this._position) | |||
| }) | |||
| /** | |||
| * set the orientation | |||
| */ | |||
| this._delegate.orientation = new Cesium.CallbackProperty(time => { | |||
| return Cesium.Transforms.headingPitchRollQuaternion( | |||
| DC.T.transformWGS84ToCartesian(this._position), | |||
| Transform.transformWGS84ToCartesian(this._position), | |||
| new Cesium.HeadingPitchRoll( | |||
| Cesium.Math.toRadians(this._position.heading), | |||
| Cesium.Math.toRadians(this._position.pitch), | |||
| @@ -103,10 +104,11 @@ DC.Cylinder = class extends Overlay { | |||
| return this | |||
| } | |||
| this._style = style | |||
| this._delegate.cylinder && | |||
| DC.Util.merge(this._delegate.cylinder, this._style) | |||
| this._delegate.cylinder && Util.merge(this._delegate.cylinder, this._style) | |||
| return this | |||
| } | |||
| } | |||
| DC.OverlayType.CYLINDER = 'cylinder' | |||
| Overlay.registerType('cylinder') | |||
| export default Cylinder | |||
| @@ -1,59 +0,0 @@ | |||
| /* | |||
| * @Author: Caven | |||
| * @Date: 2020-02-25 18:28:36 | |||
| * @Last Modified by: Caven | |||
| * @Last Modified time: 2020-04-16 20:29:32 | |||
| */ | |||
| import Cesium from '@/namespace' | |||
| import Overlay from '@/core/overlay/Overlay' | |||
| DC.Wall = class extends Overlay { | |||
| constructor(positions) { | |||
| if (!DC.Util.checkPositions(positions)) { | |||
| throw new Error('DC.Wall: the positions invalid') | |||
| } | |||
| super() | |||
| this._positions = DC.P.parsePositions(positions) | |||
| this._delegate = new Cesium.Entity() | |||
| this._state = DC.OverlayState.INITIALIZED | |||
| this.type = DC.OverlayType.WALL | |||
| } | |||
| set positions(positions) { | |||
| if (!DC.Util.checkPositions(positions)) { | |||
| throw new Error('DC.Wall: the positions invalid') | |||
| } | |||
| this._positions = DC.P.parsePositions(positions) | |||
| } | |||
| get positions() { | |||
| return this._positions | |||
| } | |||
| _mountedHook() { | |||
| /** | |||
| * initialize the Overlay parameter | |||
| */ | |||
| this._delegate.wall = { | |||
| ...this._style, | |||
| positions: new Cesium.CallbackProperty(time => { | |||
| return DC.T.transformWGS84ArrayToCartesianArray(this._positions) | |||
| }) | |||
| } | |||
| } | |||
| /** | |||
| * | |||
| * @param {*} style | |||
| */ | |||
| setStyle(style) { | |||
| if (Object.keys(style).length == 0) { | |||
| return this | |||
| } | |||
| this._style = style | |||
| this._delegate.wall && DC.Util.merge(this._delegate.wall, this._style) | |||
| return this | |||
| } | |||
| } | |||
| DC.OverlayType.WALL = 'wall' | |||
| @@ -2,28 +2,29 @@ | |||
| * @Author: Caven | |||
| * @Date: 2020-04-14 11:10:00 | |||
| * @Last Modified by: Caven | |||
| * @Last Modified time: 2020-04-16 20:29:17 | |||
| * @Last Modified time: 2020-05-11 22:24:34 | |||
| */ | |||
| import Cesium from '@/namespace' | |||
| import Overlay from '@/core/overlay/Overlay' | |||
| const { Overlay, Util, State, Transform } = DC | |||
| DC.Ellipse = class extends Overlay { | |||
| const { Cesium } = DC.Namespace | |||
| class Ellipse extends Overlay { | |||
| constructor(position, semiMajorAxis, semiMinorAxis) { | |||
| if (!DC.Util.checkPosition(position)) { | |||
| throw new Error('DC.Ellipse: the position invalid') | |||
| if (!Util.checkPosition(position)) { | |||
| throw new Error('Ellipse: the position invalid') | |||
| } | |||
| super() | |||
| this._position = position | |||
| this._semiMajorAxis = semiMajorAxis || 0 | |||
| this._semiMinorAxis = semiMinorAxis || 0 | |||
| this._delegate = new Cesium.Entity() | |||
| this._state = DC.OverlayState.INITIALIZED | |||
| this.type = DC.OverlayType.ELLIPSE | |||
| this.type = Overlay.getOverlayType('ellipse') | |||
| this._state = State.INITIALIZED | |||
| } | |||
| set position(position) { | |||
| if (!position || !(position instanceof DC.Position)) { | |||
| throw new Error('DC.Ellipse: the position invalid') | |||
| if (!Util.checkPosition(position)) { | |||
| throw new Error('Ellipse: the position invalid') | |||
| } | |||
| this._position = position | |||
| } | |||
| @@ -53,14 +54,14 @@ DC.Ellipse = class extends Overlay { | |||
| * set the location | |||
| */ | |||
| this._delegate.position = new Cesium.CallbackProperty(time => { | |||
| return DC.T.transformWGS84ToCartesian(this._position) | |||
| return Transform.transformWGS84ToCartesian(this._position) | |||
| }) | |||
| /** | |||
| * set the orientation | |||
| */ | |||
| this._delegate.orientation = new Cesium.CallbackProperty(time => { | |||
| return Cesium.Transforms.headingPitchRollQuaternion( | |||
| DC.T.transformWGS84ToCartesian(this._position), | |||
| Transform.transformWGS84ToCartesian(this._position), | |||
| new Cesium.HeadingPitchRoll( | |||
| Cesium.Math.toRadians(this._position.heading), | |||
| Cesium.Math.toRadians(this._position.pitch), | |||
| @@ -91,9 +92,11 @@ DC.Ellipse = class extends Overlay { | |||
| return this | |||
| } | |||
| this._style = style | |||
| this._delegate.ellipse && DC.Util.merge(this._delegate.ellipse, this._style) | |||
| this._delegate.ellipse && Util.merge(this._delegate.ellipse, this._style) | |||
| return this | |||
| } | |||
| } | |||
| DC.OverlayType.ELLIPSE = 'ellipse' | |||
| Overlay.registerType('ellipse') | |||
| export default Ellipse | |||
| @@ -2,27 +2,28 @@ | |||
| * @Author: Caven | |||
| * @Date: 2020-04-14 11:10:00 | |||
| * @Last Modified by: Caven | |||
| * @Last Modified time: 2020-04-16 20:29:20 | |||
| * @Last Modified time: 2020-05-11 22:27:01 | |||
| */ | |||
| import Cesium from '@/namespace' | |||
| import Overlay from '@/core/overlay/Overlay' | |||
| const { Overlay, Util, State, Transform } = DC | |||
| DC.Ellipsoid = class extends Overlay { | |||
| const { Cesium } = DC.Namespace | |||
| class Ellipsoid extends Overlay { | |||
| constructor(position, radius) { | |||
| if (!DC.Util.checkPosition(position)) { | |||
| throw new Error('DC.Ellipsoid: the position invalid') | |||
| if (!Util.checkPosition(position)) { | |||
| throw new Error('Ellipsoid: the position invalid') | |||
| } | |||
| super() | |||
| this._position = position | |||
| this._radius = radius || 0 | |||
| this._delegate = new Cesium.Entity() | |||
| this._state = DC.OverlayState.INITIALIZED | |||
| this.type = DC.OverlayType.ELLIPSOID | |||
| this.type = Overlay.getOverlayType('ellipsoid') | |||
| this._state = State.INITIALIZED | |||
| } | |||
| set position(position) { | |||
| if (!DC.Util.checkPosition(position)) { | |||
| throw new Error('DC.Ellipsoid: the position invalid') | |||
| if (!Util.checkPosition(position)) { | |||
| throw new Error('Ellipsoid: the position invalid') | |||
| } | |||
| this._position = position | |||
| } | |||
| @@ -44,14 +45,14 @@ DC.Ellipsoid = class extends Overlay { | |||
| * set the location | |||
| */ | |||
| this._delegate.position = new Cesium.CallbackProperty(time => { | |||
| return DC.T.transformWGS84ToCartesian(this._position) | |||
| return Transform.transformWGS84ToCartesian(this._position) | |||
| }) | |||
| /** | |||
| * set the orientation | |||
| */ | |||
| this._delegate.orientation = new Cesium.CallbackProperty(time => { | |||
| return Cesium.Transforms.headingPitchRollQuaternion( | |||
| DC.T.transformWGS84ToCartesian(this._position), | |||
| Transform.transformWGS84ToCartesian(this._position), | |||
| new Cesium.HeadingPitchRoll( | |||
| Cesium.Math.toRadians(this._position.heading), | |||
| Cesium.Math.toRadians(this._position.pitch), | |||
| @@ -80,9 +81,11 @@ DC.Ellipsoid = class extends Overlay { | |||
| } | |||
| this._style = style | |||
| this._delegate.ellipsoid && | |||
| DC.Util.merge(this._delegate.ellipsoid, this._style) | |||
| Util.merge(this._delegate.ellipsoid, this._style) | |||
| return this | |||
| } | |||
| } | |||
| DC.OverlayType.ELLIPSOID = 'ellipsoid' | |||
| Overlay.registerType('ellipsoid') | |||
| export default Ellipsoid | |||
| @@ -2,16 +2,17 @@ | |||
| * @Author: Caven | |||
| * @Date: 2020-02-18 16:08:26 | |||
| * @Last Modified by: Caven | |||
| * @Last Modified time: 2020-04-16 20:29:24 | |||
| * @Last Modified time: 2020-05-11 22:28:49 | |||
| */ | |||
| import Cesium from '@/namespace' | |||
| import Overlay from '@/core/overlay/Overlay' | |||
| const { Overlay, Util, State, Transform } = DC | |||
| DC.Plane = class extends Overlay { | |||
| const { Cesium } = DC.Namespace | |||
| class Plane extends Overlay { | |||
| constructor(position, width, height, direction) { | |||
| if (!DC.Util.checkPosition(position)) { | |||
| throw new Error('DC.Plane: the position invalid') | |||
| if (!Util.checkPosition(position)) { | |||
| throw new Error('Plane: the position invalid') | |||
| } | |||
| super() | |||
| this._position = position | |||
| @@ -19,13 +20,13 @@ DC.Plane = class extends Overlay { | |||
| this._height = height | |||
| this._plane = new Cesium.Plane(Cesium.Cartesian3.clone(direction), 0.0) | |||
| this._delegate = new Cesium.Entity() | |||
| this._state = DC.OverlayState.INITIALIZED | |||
| this.type = DC.OverlayType.PLANE | |||
| this.type = Overlay.getOverlayType('plane') | |||
| this._state = State.INITIALIZED | |||
| } | |||
| set position(position) { | |||
| if (!DC.Util.checkPosition(position)) { | |||
| throw new Error('DC.Plane: the position invalid') | |||
| if (!Util.checkPosition(position)) { | |||
| throw new Error('Plane: the position invalid') | |||
| } | |||
| this._position = position | |||
| } | |||
| @@ -59,7 +60,7 @@ DC.Plane = class extends Overlay { | |||
| * set the location | |||
| */ | |||
| this._delegate.position = new Cesium.CallbackProperty(time => { | |||
| return DC.T.transformWGS84ToCartesian(this._position) | |||
| return Transform.transformWGS84ToCartesian(this._position) | |||
| }) | |||
| /** | |||
| @@ -67,7 +68,7 @@ DC.Plane = class extends Overlay { | |||
| */ | |||
| this._delegate.orientation = new Cesium.CallbackProperty(time => { | |||
| return Cesium.Transforms.headingPitchRollQuaternion( | |||
| DC.T.transformWGS84ToCartesian(this._center), | |||
| Transform.transformWGS84ToCartesian(this._center), | |||
| new Cesium.HeadingPitchRoll( | |||
| Cesium.Math.toRadians(this._position.heading), | |||
| Cesium.Math.toRadians(this._position.pitch), | |||
| @@ -98,9 +99,11 @@ DC.Plane = class extends Overlay { | |||
| return this | |||
| } | |||
| this._style = style | |||
| this._delegate.plane && DC.Util.merge(this._delegate.plane, this._style) | |||
| this._delegate.plane && Util.merge(this._delegate.plane, this._style) | |||
| return this | |||
| } | |||
| } | |||
| DC.OverlayType.PLANE = 'plane' | |||
| Overlay.registerType('plane') | |||
| export default Plane | |||
| @@ -2,29 +2,30 @@ | |||
| * @Author: Caven | |||
| * @Date: 2020-04-14 11:10:00 | |||
| * @Last Modified by: Caven | |||
| * @Last Modified time: 2020-04-16 20:29:27 | |||
| * @Last Modified time: 2020-05-11 23:37:38 | |||
| */ | |||
| import Cesium from '@/namespace' | |||
| import Overlay from '@/core/overlay/Overlay' | |||
| const { Overlay, Util, State, Transform, Parse } = DC | |||
| DC.PolylineVolume = class extends Overlay { | |||
| const { Cesium } = DC.Namespace | |||
| class PolylineVolume extends Overlay { | |||
| constructor(positions, shape) { | |||
| if (!DC.Util.checkPositions(positions)) { | |||
| throw new Error('DC.PolylineVolume: the positions invalid') | |||
| if (!Util.checkPositions(positions)) { | |||
| throw new Error('PolylineVolume: the positions invalid') | |||
| } | |||
| super() | |||
| this._positions = DC.P.parsePositions(positions) | |||
| this._positions = Parse.parsePositions(positions) | |||
| this._shape = shape | |||
| this._delegate = new Cesium.Entity() | |||
| this._state = DC.OverlayState.INITIALIZED | |||
| this.type = DC.OverlayType.POLYLINE_VOLUME | |||
| this.type = Overlay.getOverlayType('polyline_volume') | |||
| this._state = State.INITIALIZED | |||
| } | |||
| set positions(positions) { | |||
| if (!DC.Util.checkPositions(positions)) { | |||
| throw new Error('DC.PolylineVolume: the positions invalid') | |||
| if (!Util.checkPositions(positions)) { | |||
| throw new Error('PolylineVolume: the positions invalid') | |||
| } | |||
| this._positions = DC.P.parsePositions(positions) | |||
| this._positions = Parse.parsePositions(positions) | |||
| } | |||
| get positions() { | |||
| @@ -33,7 +34,7 @@ DC.PolylineVolume = class extends Overlay { | |||
| set shape(shape) { | |||
| if (!shape || !Array.isArray(shape)) { | |||
| throw new Error('DC.PolylineVolume: the shape invalid') | |||
| throw new Error('PolylineVolume: the shape invalid') | |||
| } | |||
| this._shape = shape | |||
| } | |||
| @@ -49,7 +50,7 @@ DC.PolylineVolume = class extends Overlay { | |||
| this._delegate.polylineVolume = { | |||
| ...this._style, | |||
| positions: new Cesium.CallbackProperty(time => { | |||
| return DC.T.transformWGS84ArrayToCartesianArray(this._positions) | |||
| return Transform.transformWGS84ArrayToCartesianArray(this._positions) | |||
| }), | |||
| shape: new Cesium.CallbackProperty(time => { | |||
| return this._shape | |||
| @@ -67,9 +68,11 @@ DC.PolylineVolume = class extends Overlay { | |||
| } | |||
| this._style = style | |||
| this._delegate.polylineVolume && | |||
| DC.Util.merge(this._delegate.polylineVolume, this._style) | |||
| Util.merge(this._delegate.polylineVolume, this._style) | |||
| return this | |||
| } | |||
| } | |||
| DC.OverlayType.POLYLINE_VOLUME = 'polylineVolume' | |||
| Overlay.registerType('polyline_volume') | |||
| export default PolylineVolume | |||
| @@ -0,0 +1,63 @@ | |||
| /* | |||
| * @Author: Caven | |||
| * @Date: 2020-02-25 18:28:36 | |||
| * @Last Modified by: Caven | |||
| * @Last Modified time: 2020-05-11 22:45:48 | |||
| */ | |||
| const { Overlay, Util, State, Transform, Parse } = DC | |||
| const { Cesium } = DC.Namespace | |||
| class Wall extends Overlay { | |||
| constructor(positions) { | |||
| if (!Util.checkPositions(positions)) { | |||
| throw new Error('Wall: the positions invalid') | |||
| } | |||
| super() | |||
| this._positions = Parse.parsePositions(positions) | |||
| this._delegate = new Cesium.Entity() | |||
| this.type = Overlay.getOverlayType('wall') | |||
| this._state = State.INITIALIZED | |||
| } | |||
| set positions(positions) { | |||
| if (!Util.checkPositions(positions)) { | |||
| throw new Error('Wall: the positions invalid') | |||
| } | |||
| this._positions = Parse.parsePositions(positions) | |||
| } | |||
| get positions() { | |||
| return this._positions | |||
| } | |||
| _mountedHook() { | |||
| /** | |||
| * initialize the Overlay parameter | |||
| */ | |||
| this._delegate.wall = { | |||
| ...this._style, | |||
| positions: new Cesium.CallbackProperty(time => { | |||
| return Transform.transformWGS84ArrayToCartesianArray(this._positions) | |||
| }) | |||
| } | |||
| } | |||
| /** | |||
| * | |||
| * @param {*} style | |||
| */ | |||
| setStyle(style) { | |||
| if (Object.keys(style).length == 0) { | |||
| return this | |||
| } | |||
| this._style = style | |||
| this._delegate.wall && Util.merge(this._delegate.wall, this._style) | |||
| return this | |||
| } | |||
| } | |||
| Overlay.registerType('wall') | |||
| export default Wall | |||
| @@ -2,16 +2,18 @@ | |||
| * @Author: Caven | |||
| * @Date: 2020-02-12 21:44:24 | |||
| * @Last Modified by: Caven | |||
| * @Last Modified time: 2020-04-14 19:05:37 | |||
| * @Last Modified time: 2020-05-12 00:18:04 | |||
| */ | |||
| import Cesium from '@/namespace' | |||
| import '@/core/overlay/base/DC.Billboard' | |||
| DC.CustomBillboard = class extends DC.Billboard { | |||
| const { Billboard, Position, State, Transform } = DC | |||
| const { Cesium } = DC.Namespace | |||
| class CustomBillboard extends Billboard { | |||
| constructor(position, icon) { | |||
| super(position, icon) | |||
| this._state = DC.OverlayState.INITIALIZED | |||
| this.type = DC.OverlayType.CUSTOM_BILLBOARD | |||
| this._state = State.INITIALIZED | |||
| this.type = Overlay.getOverlayType('custom_billboard') | |||
| } | |||
| /** | |||
| @@ -20,14 +22,14 @@ DC.CustomBillboard = class extends DC.Billboard { | |||
| */ | |||
| setVLine(style) { | |||
| if (this._position.alt > 0 && !this._delegate.polyline) { | |||
| let position = new DC.Position() | |||
| let position = new Position() | |||
| this._delegate.polyline = { | |||
| ...style, | |||
| positions: new Cesium.CallbackProperty(time => { | |||
| position.lng = this._position.lng | |||
| position.lat = this._position.lat | |||
| position.alt = 0 | |||
| return DC.T.transformWGS84ArrayToCartesianArray([ | |||
| return Transform.transformWGS84ArrayToCartesianArray([ | |||
| position, | |||
| this._position | |||
| ]) | |||
| @@ -64,4 +66,6 @@ DC.CustomBillboard = class extends DC.Billboard { | |||
| } | |||
| } | |||
| DC.OverlayType.CUSTOM_BILLBOARD = 'customBillboard' | |||
| Overlay.registerType('custom_billboard') | |||
| export default CustomBillboard | |||
| @@ -2,15 +2,20 @@ | |||
| * @Author: Caven | |||
| * @Date: 2020-04-09 20:02:37 | |||
| * @Last Modified by: Caven | |||
| * @Last Modified time: 2020-04-30 12:09:26 | |||
| * @Last Modified time: 2020-05-12 00:09:49 | |||
| */ | |||
| const install = function(DC) { | |||
| if (!DC) { | |||
| throw new Error('DC.Overlay: Missing DC Base SDK') | |||
| if (!DC || !DC.init) { | |||
| throw new Error('Plot: Missing DC Base') | |||
| } | |||
| if (!DC.ready) { | |||
| throw new Error('Plot: Missing DC Core') | |||
| } | |||
| DC.init(() => { | |||
| require('./DC.Overlay.Loader') | |||
| require('./Overlay.Loader') | |||
| }) | |||
| } | |||
| @@ -2,9 +2,9 @@ | |||
| * @Author: Caven | |||
| * @Date: 2020-01-31 15:51:32 | |||
| * @Last Modified by: Caven | |||
| * @Last Modified time: 2020-04-04 20:35:53 | |||
| * @Last Modified time: 2020-05-11 23:08:29 | |||
| */ | |||
| import Cesium from '@/namespace' | |||
| import DrawPoint from './draw/DrawPoint' | |||
| import DrawPolyline from './draw/DrawPolyline' | |||
| import DrawPolygon from './draw/DrawPolygon' | |||
| @@ -13,7 +13,11 @@ import DrawRect from './draw/DrawRect' | |||
| import EditPoint from './edit/EditPoint' | |||
| import EditPolyline from './edit/EditPolyline' | |||
| DC.Plot = class { | |||
| const { VectorLayer, OverlayType } = DC | |||
| const { Cesium } = DC.Namespace | |||
| class Plot { | |||
| constructor(viewer) { | |||
| this._viewer = viewer | |||
| this._plotEvent = new Cesium.Event() | |||
| @@ -22,7 +26,7 @@ DC.Plot = class { | |||
| this._editWorker = undefined | |||
| this._drawLayer = new Cesium.CustomDataSource('plot-draw-layer') | |||
| this._viewer.delegate.dataSources.add(this._drawLayer) | |||
| this._markerLayer = new DC.VectorLayer('plot-marker-layer') | |||
| this._markerLayer = new VectorLayer('plot-marker-layer') | |||
| this._viewer.addLayer(this._markerLayer) | |||
| this._state = undefined | |||
| } | |||
| @@ -51,19 +55,19 @@ DC.Plot = class { | |||
| layer: this._drawLayer | |||
| } | |||
| switch (type) { | |||
| case DC.OverlayType.POINT: | |||
| case OverlayType.POINT: | |||
| this._drawWorker = new DrawPoint(info, style) | |||
| break | |||
| case DC.OverlayType.POLYLINE: | |||
| case OverlayType.POLYLINE: | |||
| this._drawWorker = new DrawPolyline(info, style) | |||
| break | |||
| case DC.OverlayType.POLYGON: | |||
| case OverlayType.POLYGON: | |||
| this._drawWorker = new DrawPolygon(info, style) | |||
| break | |||
| case DC.OverlayType.CIRCLE: | |||
| case OverlayType.CIRCLE: | |||
| this._drawWorker = new DrawCircle(info, style) | |||
| break | |||
| case DC.OverlayType.RECT: | |||
| case OverlayType.RECT: | |||
| this._drawWorker = new DrawRect(info, style) | |||
| break | |||
| default: | |||
| @@ -79,19 +83,19 @@ DC.Plot = class { | |||
| overlay: overlay | |||
| } | |||
| switch (overlay.type) { | |||
| case DC.OverlayType.POINT: | |||
| case OverlayType.POINT: | |||
| this._editWorker = new EditPoint(info) | |||
| break | |||
| case DC.OverlayType.POLYLINE: | |||
| case OverlayType.POLYLINE: | |||
| this._editWorker = new EditPolyline(info) | |||
| break | |||
| case DC.OverlayType.POLYGON: | |||
| case OverlayType.POLYGON: | |||
| this._drawWorker = new DrawPolygon(info) | |||
| break | |||
| case DC.OverlayType.CIRCLE: | |||
| case OverlayType.CIRCLE: | |||
| this._drawWorker = new DrawCircle(info) | |||
| break | |||
| case DC.OverlayType.RECT: | |||
| case OverlayType.RECT: | |||
| this._drawWorker = new DrawRect(info) | |||
| break | |||
| default: | |||
| @@ -115,3 +119,5 @@ DC.Plot = class { | |||
| this._editWorker && this._editWorker.start() | |||
| } | |||
| } | |||
| export default Plot | |||
| @@ -2,11 +2,13 @@ | |||
| * @Author: Caven | |||
| * @Date: 2020-01-31 19:44:41 | |||
| * @Last Modified by: Caven | |||
| * @Last Modified time: 2020-05-10 10:57:35 | |||
| * @Last Modified time: 2020-05-11 22:31:32 | |||
| */ | |||
| import Draw from './Draw' | |||
| const { OverlayType, Transform } = DC | |||
| const { Cesium } = DC.NameSpace | |||
| const DEF_STYLE = { | |||
| @@ -33,8 +35,8 @@ class DrawClicle extends Draw { | |||
| this._computeRadius(this._center, position) | |||
| this._unbindEnvet() | |||
| this._plotEvent.raiseEvent({ | |||
| type: DC.OverlayType.CIRCLE, | |||
| points: [DC.T.transformCartesianToWGS84(this._center)], | |||
| type: OverlayType.CIRCLE, | |||
| points: [Transform.transformCartesianToWGS84(this._center)], | |||
| radius: this._radius | |||
| }) | |||
| } | |||
| @@ -2,11 +2,13 @@ | |||
| * @Author: Caven | |||
| * @Date: 2020-01-31 16:25:29 | |||
| * @Last Modified by: Caven | |||
| * @Last Modified time: 2020-05-10 10:57:47 | |||
| * @Last Modified time: 2020-05-11 23:09:24 | |||
| */ | |||
| import Draw from './Draw' | |||
| const { OverlayType, Transform } = DC | |||
| const { Cesium } = DC.NameSpace | |||
| const DEF_STYLE = { | |||
| @@ -29,8 +31,8 @@ class DrawPoint extends Draw { | |||
| this._position = e.target ? e.position : e.surfacePosition | |||
| this._unbindEnvet() | |||
| this._plotEvent.raiseEvent({ | |||
| type: DC.OverlayType.POINT, | |||
| points: [DC.T.transformCartesianToWGS84(this._position)] | |||
| type: OverlayType.POINT, | |||
| points: [Transform.transformCartesianToWGS84(this._position)] | |||
| }) | |||
| } | |||
| @@ -2,11 +2,13 @@ | |||
| * @Author: Caven | |||
| * @Date: 2020-01-31 18:59:31 | |||
| * @Last Modified by: Caven | |||
| * @Last Modified time: 2020-05-10 10:57:52 | |||
| * @Last Modified time: 2020-05-11 23:09:41 | |||
| */ | |||
| import Draw from './Draw' | |||
| const { OverlayType, Transform } = DC | |||
| const { Cesium } = DC.NameSpace | |||
| const DEF_STYLE = { | |||
| @@ -48,8 +50,8 @@ class DrawPolygon extends Draw { | |||
| _mouseRightClickHandler(e) { | |||
| this._unbindEnvet() | |||
| this._plotEvent.raiseEvent({ | |||
| type: DC.OverlayType.POLYGON, | |||
| points: DC.T.transformCartesianArrayToWGS84Array(this._positions) | |||
| type: OverlayType.POLYGON, | |||
| points: Transform.transformCartesianArrayToWGS84Array(this._positions) | |||
| }) | |||
| } | |||
| @@ -2,11 +2,13 @@ | |||
| * @Author: Caven | |||
| * @Date: 2020-01-31 18:18:44 | |||
| * @Last Modified by: Caven | |||
| * @Last Modified time: 2020-05-10 10:57:58 | |||
| * @Last Modified time: 2020-05-11 23:10:21 | |||
| */ | |||
| import Draw from './Draw' | |||
| const { OverlayType, Transform } = DC | |||
| const { Cesium } = DC.NameSpace | |||
| const DEF_STYLE = { | |||
| @@ -44,8 +46,8 @@ class DrawPolyline extends Draw { | |||
| _mouseRightClickHandler(e) { | |||
| this._unbindEnvet() | |||
| this._plotEvent.raiseEvent({ | |||
| type: DC.OverlayType.POLYLINE, | |||
| points: DC.T.transformCartesianArrayToWGS84Array(this._positions) | |||
| type: OverlayType.POLYLINE, | |||
| points: Transform.transformCartesianArrayToWGS84Array(this._positions) | |||
| }) | |||
| } | |||
| @@ -2,11 +2,13 @@ | |||
| * @Author: Caven | |||
| * @Date: 2020-01-31 20:52:01 | |||
| * @Last Modified by: Caven | |||
| * @Last Modified time: 2020-05-10 10:58:05 | |||
| * @Last Modified time: 2020-05-11 23:10:46 | |||
| */ | |||
| import Draw from './Draw' | |||
| const { OverlayType, Transform } = DC | |||
| const { Cesium } = DC.NameSpace | |||
| const DEF_STYLE = { | |||
| @@ -35,8 +37,8 @@ class DrawRect extends Draw { | |||
| ) | |||
| this._unbindEnvet() | |||
| this._plotEvent.raiseEvent({ | |||
| type: DC.OverlayType.RECT, | |||
| points: DC.T.transformCartesianArrayToWGS84Array(this._positions) | |||
| type: OverlayType.RECT, | |||
| points: Transform.transformCartesianArrayToWGS84Array(this._positions) | |||
| }) | |||
| } | |||
| } | |||
| @@ -2,9 +2,11 @@ | |||
| * @Author: Caven | |||
| * @Date: 2020-03-17 16:19:15 | |||
| * @Last Modified by: Caven | |||
| * @Last Modified time: 2020-05-10 10:58:10 | |||
| * @Last Modified time: 2020-05-11 23:11:18 | |||
| */ | |||
| const { OverlayType, Transform } = DC | |||
| const { Cesium } = DC.NameSpace | |||
| class Edit { | |||
| @@ -23,8 +25,8 @@ class Edit { | |||
| this._unbindEnvet() | |||
| this._layer.clear() | |||
| this._plotEvent.raiseEvent({ | |||
| type: DC.OverlayType.POLYLINE, | |||
| points: DC.T.transformCartesianArrayToWGS84Array(this._positions) | |||
| type: OverlayType.POLYLINE, | |||
| points: Transform.transformCartesianArrayToWGS84Array(this._positions) | |||
| }) | |||
| } | |||
| @@ -2,10 +2,12 @@ | |||
| * @Author: Caven | |||
| * @Date: 2020-03-17 18:23:25 | |||
| * @Last Modified by: Caven | |||
| * @Last Modified time: 2020-04-04 20:34:14 | |||
| * @Last Modified time: 2020-05-11 23:13:36 | |||
| */ | |||
| import Edit from './Edit' | |||
| const { OverlayType, Transform } = DC | |||
| class EditCircle extends Edit { | |||
| constructor(plotInfo) { | |||
| super(plotInfo) | |||
| @@ -26,12 +28,12 @@ class EditCircle extends Edit { | |||
| } | |||
| _prepareMarkers() { | |||
| let rectangle = Cesium.EllipseGeometry.computeRectangle({ | |||
| center: DC.T.this._center, | |||
| semiMajorAxis: this._radius, | |||
| semiMinorAxis: this._radius | |||
| }) | |||
| let positions = [this._center] | |||
| // let rectangle = Cesium.EllipseGeometry.computeRectangle({ | |||
| // center: Transform.this._center, | |||
| // semiMajorAxis: this._radius, | |||
| // semiMinorAxis: this._radius | |||
| // }) | |||
| //let positions = [this._center] | |||
| } | |||
| } | |||
| @@ -2,10 +2,13 @@ | |||
| * @Author: Caven | |||
| * @Date: 2020-03-17 17:52:29 | |||
| * @Last Modified by: Caven | |||
| * @Last Modified time: 2020-04-04 20:33:06 | |||
| * @Last Modified time: 2020-05-11 23:13:57 | |||
| */ | |||
| import Edit from './Edit' | |||
| const { OverlayType, Transform } = DC | |||
| class EditPoint extends Edit { | |||
| constructor(plotInfo) { | |||
| super(plotInfo) | |||
| @@ -16,8 +19,8 @@ class EditPoint extends Edit { | |||
| this._position = e.target ? e.position : e.surfacePosition | |||
| this._unbindEnvet() | |||
| this._plotEvent.raiseEvent({ | |||
| type: DC.OverlayType.POINT, | |||
| points: [DC.T.transformCartesianToWGS84(this._position)] | |||
| type: OverlayType.POINT, | |||
| points: [Transform.transformCartesianToWGS84(this._position)] | |||
| }) | |||
| } | |||
| @@ -2,10 +2,13 @@ | |||
| * @Author: Caven | |||
| * @Date: 2020-03-17 21:59:39 | |||
| * @Last Modified by: Caven | |||
| * @Last Modified time: 2020-04-04 20:53:10 | |||
| * @Last Modified time: 2020-05-11 23:14:46 | |||
| */ | |||
| import Edit from './Edit' | |||
| const { Transform, MouseEventType, Point } = DC | |||
| class EditPolyline extends Edit { | |||
| constructor(plotInfo) { | |||
| super(plotInfo) | |||
| @@ -14,7 +17,9 @@ class EditPolyline extends Edit { | |||
| _mouseMoveHandler(e) { | |||
| if (this._currentMarker) { | |||
| this._currentMarker.position = DC.T.transformCartesianToWGS84(e.position) | |||
| this._currentMarker.position = Transform.transformCartesianToWGS84( | |||
| e.position | |||
| ) | |||
| this._overlay.positions = this._markers.map(item => item.position) | |||
| } | |||
| } | |||
| @@ -25,8 +30,8 @@ class EditPolyline extends Edit { | |||
| _prepareMarkers() { | |||
| this._positions.forEach(item => { | |||
| let marker = new DC.Point(item) | |||
| marker.on(DC.MouseEventType.CLICK, this._markerClickHandler, this) | |||
| let marker = new Point(item) | |||
| marker.on(MouseEventType.CLICK, this._markerClickHandler, this) | |||
| this._layer.addOverlay(marker) | |||
| this._markers.push(marker) | |||
| }) | |||
| @@ -2,14 +2,21 @@ | |||
| * @Author: Caven | |||
| * @Date: 2020-04-03 10:13:42 | |||
| * @Last Modified by: Caven | |||
| * @Last Modified time: 2020-05-10 10:56:45 | |||
| * @Last Modified time: 2020-05-11 23:52:18 | |||
| */ | |||
| const install = function(DC) { | |||
| if (!DC) { | |||
| throw new Error('DC.Plot: Missing DC Base SDK') | |||
| if (!DC || !DC.init) { | |||
| throw new Error('Plot: Missing DC Base') | |||
| } | |||
| require('./Plot') | |||
| if (!DC.ready) { | |||
| throw new Error('Plot: Missing DC Core') | |||
| } | |||
| DC.init(() => { | |||
| require('./Plot') | |||
| }) | |||
| } | |||
| /* istanbul ignore if */ | |||