| /***/ (function(module, __webpack_exports__, __webpack_require__) { | /***/ (function(module, __webpack_exports__, __webpack_require__) { | ||||
| "use strict"; | "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"); | |||||
| /***/ }), | /***/ }), | ||||
| /***/ (function(module, __webpack_exports__, __webpack_require__) { | /***/ (function(module, __webpack_exports__, __webpack_require__) { | ||||
| "use strict"; | "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"); | |||||
| /***/ }), | /***/ }), | ||||
| /***/ (function(module, __webpack_exports__, __webpack_require__) { | /***/ (function(module, __webpack_exports__, __webpack_require__) { | ||||
| "use strict"; | "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"); | |||||
| /***/ }), | /***/ }), | ||||
| * @Author: Caven | * @Author: Caven | ||||
| * @Date: 2020-05-09 23:09:42 | * @Date: 2020-05-09 23:09:42 | ||||
| * @Last Modified by: Caven | * @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' | export * from './mixin' |
| * @Author: Caven | * @Author: Caven | ||||
| * @Date: 2020-05-09 23:01:21 | * @Date: 2020-05-09 23:01:21 | ||||
| * @Last Modified by: Caven | * @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) { | export function initUse(DC) { |
| * @Author: Caven | * @Author: Caven | ||||
| * @Date: 2020-04-22 09:44:30 | * @Date: 2020-04-22 09:44:30 | ||||
| * @Last Modified by: Caven | * @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' | import { initMixin, initUse } from './global-api' | ||||
| require('../log') | require('../log') | ||||
| initMixin(window.DC) | initMixin(window.DC) | ||||
| initUse(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 | export default DC |
| * @Author: Caven | * @Author: Caven | ||||
| * @Date: 2020-05-09 13:19:53 | * @Date: 2020-05-09 13:19:53 | ||||
| * @Last Modified by: Caven | * @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 { Layer, LayerType } from './layer' | ||||
| import { Overlay, OverlayType } from './overlay' | import { Overlay, OverlayType } from './overlay' | ||||
| import ImageryType from './imagery/ImageryType' | import ImageryType from './imagery/ImageryType' | ||||
| import State from './state/State' | import State from './state/State' | ||||
| import Position from './position/Position' | |||||
| import Transform from './transform/Transform' | |||||
| import Parse from './parse/Parse' | |||||
| DC.mixin({ | 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 | |||||
| }) | }) |
| * @Author: Caven | * @Author: Caven | ||||
| * @Date: 2019-12-27 17:18:52 | * @Date: 2019-12-27 17:18:52 | ||||
| * @Last Modified by: Caven | * @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 ImageryLayerFactory from './imagery/ImageryLayerFactory' | ||||
| import TerrainFactory from './terrain/TerrainFactory' | 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 Viewer from './viewer/Viewer' | ||||
| import { | import { | ||||
| GeoJsonLayer, | GeoJsonLayer, | ||||
| Tileset | Tileset | ||||
| } from './overlay' | } 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({ | 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 |
| * @Author: Caven | * @Author: Caven | ||||
| * @Date: 2020-01-02 15:24:38 | * @Date: 2020-01-02 15:24:38 | ||||
| * @Last Modified by: Caven | * @Last Modified by: Caven | ||||
| * @Last Modified time: 2020-05-10 08:12:03 | |||||
| * @Last Modified time: 2020-05-11 22:34:56 | |||||
| */ | */ | ||||
| class Event { | class Event { | ||||
| constructor() { | constructor() { | ||||
| this._cache = {} | this._cache = {} |
| * @Author: Caven | * @Author: Caven | ||||
| * @Date: 2020-04-10 17:02:28 | * @Date: 2020-04-10 17:02:28 | ||||
| * @Last Modified by: Caven | * @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 = { | const baseEventType = { | ||||
| ADD: 'add', | ADD: 'add', | ||||
| ...baseEventType | ...baseEventType | ||||
| } | } | ||||
| const EffectEventType = { | |||||
| ...baseEventType | |||||
| } | |||||
| const RoamingEventType = { | |||||
| ...baseEventType, | |||||
| TICK: 'tick', | |||||
| ACTIVE: 'active' | |||||
| } | |||||
| export { | export { | ||||
| MouseEventType, | MouseEventType, | ||||
| ViewerEventType, | ViewerEventType, | ||||
| SceneEventType, | SceneEventType, | ||||
| LayerEventType, | LayerEventType, | ||||
| OverlayEventType, | |||||
| EffectEventType, | |||||
| RoamingEventType | |||||
| OverlayEventType | |||||
| } | } |
| * @Author: Caven | * @Author: Caven | ||||
| * @Date: 2020-01-02 14:26:35 | * @Date: 2020-01-02 14:26:35 | ||||
| * @Last Modified by: Caven | * @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 { LayerEventType } from './EventType' | ||||
| import Event from './Event' | import Event from './Event' | ||||
| const { Cesium } = DC.Namespace | |||||
| class LayerEvent extends Event { | class LayerEvent extends Event { | ||||
| constructor() { | constructor() { | ||||
| super() | super() |
| * @Author: Caven | * @Author: Caven | ||||
| * @Date: 2019-12-31 16:58:31 | * @Date: 2019-12-31 16:58:31 | ||||
| * @Last Modified by: Caven | * @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 { MouseEventType } from './EventType' | ||||
| import Event from './Event' | import Event from './Event' | ||||
| const { Cesium } = DC.Namespace | |||||
| /** | /** | ||||
| * Mouse events in 3D scene, optimized Cesium event model | * Mouse events in 3D scene, optimized Cesium event model | ||||
| */ | */ |
| * @Author: Caven | * @Author: Caven | ||||
| * @Date: 2020-01-02 14:26:35 | * @Date: 2020-01-02 14:26:35 | ||||
| * @Last Modified by: Caven | * @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 { MouseEventType, OverlayEventType } from './EventType' | ||||
| import Event from './Event' | import Event from './Event' | ||||
| const { Cesium } = DC.Namespace | |||||
| class OverlayEvent extends Event { | class OverlayEvent extends Event { | ||||
| constructor() { | constructor() { | ||||
| super() | super() |
| * @Author: Caven | * @Author: Caven | ||||
| * @Date: 2020-04-10 16:58:31 | * @Date: 2020-04-10 16:58:31 | ||||
| * @Last Modified by: Caven | * @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 { RoamingEventType } from './EventType' | ||||
| import Event from './Event' | import Event from './Event' | ||||
| const { Cesium } = DC.Namespace | |||||
| class RoamingEvent extends Event { | class RoamingEvent extends Event { | ||||
| constructor() { | constructor() { | ||||
| super() | super() |
| * @Author: Caven | * @Author: Caven | ||||
| * @Date: 2020-03-02 21:32:43 | * @Date: 2020-03-02 21:32:43 | ||||
| * @Last Modified by: Caven | * @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 { SceneEventType } from './EventType' | ||||
| import Event from './Event' | |||||
| class SceneEvent extends Event { | class SceneEvent extends Event { | ||||
| constructor(viewer) { | constructor(viewer) { |
| * @Author: Caven | * @Author: Caven | ||||
| * @Date: 2020-01-02 14:26:35 | * @Date: 2020-01-02 14:26:35 | ||||
| * @Last Modified by: Caven | * @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 { MouseEventType, ViewerEventType } from './EventType' | ||||
| import Event from './Event' | import Event from './Event' | ||||
| const { Cesium } = DC.Namespace | |||||
| class ViewerEvent extends Event { | class ViewerEvent extends Event { | ||||
| constructor() { | constructor() { | ||||
| super() | super() |
| * @Author: Caven | * @Author: Caven | ||||
| * @Date: 2020-03-05 21:54:13 | * @Date: 2020-03-05 21:54:13 | ||||
| * @Last Modified by: Caven | * @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 MouseEvent } from './MouseEvent' | ||||
| export { default as ViewerEvent } from './ViewerEvent' | export { default as ViewerEvent } from './ViewerEvent' | ||||
| export { default as SceneEvent } from './SceneEvent' | export { default as SceneEvent } from './SceneEvent' | ||||
| export { default as LayerEvent } from './LayerEvent' | export { default as LayerEvent } from './LayerEvent' | ||||
| export { default as OverlayEvent } from './OverlayEvent' | export { default as OverlayEvent } from './OverlayEvent' | ||||
| export { default as EffectEvent } from './EffectEvent' | |||||
| export { default as RoamingEvent } from './RoamingEvent' |
| * @Author: Caven | * @Author: Caven | ||||
| * @Date: 2020-01-21 15:54:56 | * @Date: 2020-01-21 15:54:56 | ||||
| * @Last Modified by: Caven | * @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 ImageryType from './ImageryType' | ||||
| import AmapImageryProvider from './provider/AmapImageryProvider' | import AmapImageryProvider from './provider/AmapImageryProvider' | ||||
| import BaiduImageryProvider from './provider/BaiduImageryProvider' | import BaiduImageryProvider from './provider/BaiduImageryProvider' | ||||
| import TdtImageryProvider from './provider/TdtImageryProvider' | import TdtImageryProvider from './provider/TdtImageryProvider' | ||||
| import TencentImageryProvider from './provider/TencentImageryProvider' | import TencentImageryProvider from './provider/TencentImageryProvider' | ||||
| const { Cesium } = DC.Namespace | |||||
| class ImageryLayerFactory { | class ImageryLayerFactory { | ||||
| /** | /** | ||||
| * Create amap image layer | * Create amap image layer |
| * @Author: Caven | * @Author: Caven | ||||
| * @Date: 2020-01-15 20:31:28 | * @Date: 2020-01-15 20:31:28 | ||||
| * @Last Modified by: Caven | * @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' | import ImageryType from '../ImageryType' | ||||
| const { Cesium } = DC.Namespace | |||||
| const IMG_URL = | const IMG_URL = | ||||
| 'https://webst{s}.is.autonavi.com/appmaptile?style=6&x={x}&y={y}&z={z}' | 'https://webst{s}.is.autonavi.com/appmaptile?style=6&x={x}&y={y}&z={z}' | ||||
| * @Author: Caven | * @Author: Caven | ||||
| * @Date: 2020-01-15 20:27:27 | * @Date: 2020-01-15 20:27:27 | ||||
| * @Last Modified by: Caven | * @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' | import ImageryType from '../ImageryType' | ||||
| const { Cesium } = DC.Namespace | |||||
| const TEMP_MAP_URL = | const TEMP_MAP_URL = | ||||
| 'http://api{s}.map.bdimg.com/customimage/tile?&x={x}&y={y}&z={z}&scale=1&customid={style}' | 'http://api{s}.map.bdimg.com/customimage/tile?&x={x}&y={y}&z={z}&scale=1&customid={style}' | ||||
| * @Author: Caven | * @Author: Caven | ||||
| * @Date: 2020-01-21 16:06:14 | * @Date: 2020-01-21 16:06:14 | ||||
| * @Last Modified by: Caven | * @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' | import ImageryType from '../ImageryType' | ||||
| const { Cesium } = DC.Namespace | |||||
| const ELEC_URL = | 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' | 'http://mt{s}.google.cn/vt/lyrs=m@207000000&hl=zh-CN&gl=CN&src=app&x={x}&y={y}&z={z}&s=Galile' | ||||
| * @Author: Caven | * @Author: Caven | ||||
| * @Date: 2020-01-15 20:31:46 | * @Date: 2020-01-15 20:31:46 | ||||
| * @Last Modified by: Caven | * @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' | import ImageryType from '../ImageryType' | ||||
| const { Cesium } = DC.Namespace | |||||
| const MAP_URL = | 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}' | '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}' | ||||
| * @Author: Caven | * @Author: Caven | ||||
| * @Date: 2020-01-21 16:10:47 | * @Date: 2020-01-21 16:10:47 | ||||
| * @Last Modified by: Caven | * @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' | import ImageryType from '../ImageryType' | ||||
| const { Cesium } = DC.Namespace | |||||
| const ELEC_URL = | const ELEC_URL = | ||||
| 'https://rt{s}.map.gtimg.com/tile?z={z}&x={x}&y={reverseY}&styleid=1000&scene=0&version=347' | 'https://rt{s}.map.gtimg.com/tile?z={z}&x={x}&y={reverseY}&styleid=1000&scene=0&version=347' | ||||
| * @Author: Caven | * @Author: Caven | ||||
| * @Date: 2019-12-27 14:29:05 | * @Date: 2019-12-27 14:29:05 | ||||
| * @Last Modified by: Caven | * @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) { | const install = function(DC) { | ||||
| throw new Error('Missing Base SDK') | throw new Error('Missing Base SDK') | ||||
| } | } | ||||
| require('./Loader.Base') | |||||
| DC.init(() => { | |||||
| require('./Loader.Base') | |||||
| }) | |||||
| /** | /** | ||||
| * 框架开始 | * 框架开始 |
| * @Author: Caven | * @Author: Caven | ||||
| * @Date: 2020-01-13 10:13:53 | * @Date: 2020-01-13 10:13:53 | ||||
| * @Last Modified by: Caven | * @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 { Billboard, Polyline, Polygon } from '../overlay' | ||||
| import State from '../state/State' | import State from '../state/State' | ||||
| import Layer from './Layer' | |||||
| const { Cesium } = DC.Namespace | |||||
| class GeoJsonLayer extends Layer { | class GeoJsonLayer extends Layer { | ||||
| constructor(id, url, options = {}) { | constructor(id, url, options = {}) { | ||||
| * | * | ||||
| */ | */ | ||||
| toVectorLayer() { | toVectorLayer() { | ||||
| let layer = new DC.VectorLayer(this._id) | |||||
| let layer = new VectorLayer(this._id) | |||||
| let self = this | let self = this | ||||
| this.eachOverlay(item => { | this.eachOverlay(item => { | ||||
| if (item.billboard) { | if (item.billboard) { |
| * @Author: Caven | * @Author: Caven | ||||
| * @Date: 2020-02-12 21:43:33 | * @Date: 2020-02-12 21:43:33 | ||||
| * @Last Modified by: Caven | * @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 State from '../state/State' | ||||
| import Layer from './Layer' | import Layer from './Layer' | ||||
| import Transform from '../transform/Transform' | |||||
| const { Cesium } = DC.Namespace | |||||
| class HtmlLayer extends Layer { | class HtmlLayer extends Layer { | ||||
| constructor(id) { | constructor(id) { | ||||
| super(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._delegate.setAttribute('id', this._id) | ||||
| this._renderRemoveCallback = undefined | this._renderRemoveCallback = undefined | ||||
| this.type = Layer.getLayerType('html') | this.type = Layer.getLayerType('html') | ||||
| let cameraPosition = this._viewer.camera.positionWC | let cameraPosition = this._viewer.camera.positionWC | ||||
| this.eachOverlay(item => { | this.eachOverlay(item => { | ||||
| if (item && item.position) { | if (item && item.position) { | ||||
| let position = DC.T.transformWGS84ToCartesian(item.position) | |||||
| let position = Transform.transformWGS84ToCartesian(item.position) | |||||
| let windowCoord = Cesium.SceneTransforms.wgs84ToWindowCoordinates( | let windowCoord = Cesium.SceneTransforms.wgs84ToWindowCoordinates( | ||||
| scene, | scene, | ||||
| position | position |
| * @Author: Caven | * @Author: Caven | ||||
| * @Date: 2020-03-30 17:14:00 | * @Date: 2020-03-30 17:14:00 | ||||
| * @Last Modified by: Caven | * @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 State from '../state/State' | ||||
| import Layer from './Layer' | import Layer from './Layer' | ||||
| import { Label } from '../overlay' | |||||
| const { Cesium } = DC.Namespace | |||||
| class LabelLayer extends Layer { | class LabelLayer extends Layer { | ||||
| constructor(id, url) { | constructor(id, url) { | ||||
| _createLabel(entity) { | _createLabel(entity) { | ||||
| if (entity.position && item.name) { | if (entity.position && item.name) { | ||||
| return DC.Label.fromEntity(entity) | |||||
| return Label.fromEntity(entity) | |||||
| } | } | ||||
| } | } | ||||
| * @Author: Caven | * @Author: Caven | ||||
| * @Date: 2020-01-03 09:38:21 | * @Date: 2020-01-03 09:38:21 | ||||
| * @Last Modified by: Caven | * @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 State from '../state/State' | ||||
| import LayerType from './LayerType' | import LayerType from './LayerType' | ||||
| const { Cesium } = DC.Namespace | |||||
| class Layer { | class Layer { | ||||
| constructor(id) { | constructor(id) { | ||||
| this._id = id || DC.Util.uuid() | |||||
| this._id = id || Util.uuid() | |||||
| this._delegate = undefined | this._delegate = undefined | ||||
| this._viewer = undefined | this._viewer = undefined | ||||
| this._state = undefined | this._state = undefined |
| * @Author: Caven | * @Author: Caven | ||||
| * @Date: 2020-01-09 09:16:27 | * @Date: 2020-01-09 09:16:27 | ||||
| * @Last Modified by: Caven | * @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 State from '../state/State' | ||||
| import Layer from './Layer' | import Layer from './Layer' | ||||
| const { Cesium } = DC.Namespace | |||||
| /** | /** | ||||
| * TilesetLayer is used to add various tileset | * TilesetLayer is used to add various tileset |
| * @Author: Caven | * @Author: Caven | ||||
| * @Date: 2020-03-22 01:12:39 | * @Date: 2020-03-22 01:12:39 | ||||
| * @Last Modified by: Caven | * @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' | import GeoJsonLayer from './GeoJsonLayer' |
| * @Author: Caven | * @Author: Caven | ||||
| * @Date: 2020-01-02 16:42:03 | * @Date: 2020-01-02 16:42:03 | ||||
| * @Last Modified by: Caven | * @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 State from '../state/State' | ||||
| import Layer from './Layer' | import Layer from './Layer' | ||||
| * @Author: Caven | * @Author: Caven | ||||
| * @Date: 2020-01-03 11:06:26 | * @Date: 2020-01-03 11:06:26 | ||||
| * @Last Modified by: Caven | * @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 LayerType } from './LayerType' | ||||
| export { default as Layer } from './Layer' | export { default as Layer } from './Layer' | ||||
| export { default as GeoJsonLayer } from './GeoJsonLayer' | export { default as GeoJsonLayer } from './GeoJsonLayer' |
| * @Author: Caven | * @Author: Caven | ||||
| * @Date: 2020-04-24 14:49:37 | * @Date: 2020-04-24 14:49:37 | ||||
| * @Last Modified by: Caven | * @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) { | export default function area(positions) { | ||||
| let result = 0 | let result = 0 | ||||
| if (positions && Array.isArray(positions)) { | if (positions && Array.isArray(positions)) { | ||||
| let positions = [...positions].concat(positions[0]) | let positions = [...positions].concat(positions[0]) | ||||
| for (let i = 1; i < positions.length; i++) { | for (let i = 1; i < positions.length; i++) { | ||||
| let oel = ellipsoid.cartographicToCartesian( | let oel = ellipsoid.cartographicToCartesian( | ||||
| DC.T.transformWGS84ToCartographic(positions[i - 1]) | |||||
| Transform.transformWGS84ToCartographic(positions[i - 1]) | |||||
| ) | ) | ||||
| let el = ellipsoid.cartographicToCartesian( | let el = ellipsoid.cartographicToCartesian( | ||||
| DC.T.transformWGS84ToCartographic(positions[i]) | |||||
| Transform.transformWGS84ToCartographic(positions[i]) | |||||
| ) | ) | ||||
| h += oel.x * el.y - el.x * oel.y | h += oel.x * el.y - el.x * oel.y | ||||
| } | } | ||||
| } | } | ||||
| return result | return result | ||||
| } | } | ||||
| Cesium.Math.area = area |
| * @Author: Caven | * @Author: Caven | ||||
| * @Date: 2020-04-23 09:29:56 | * @Date: 2020-04-23 09:29:56 | ||||
| * @Last Modified by: Caven | * @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) { | export default function bounds(positions = [], expand = 0) { |
| * @Author: Caven | * @Author: Caven | ||||
| * @Date: 2020-04-24 14:43:39 | * @Date: 2020-04-24 14:43:39 | ||||
| * @Last Modified by: Caven | * @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) { | export default function center(positions) { | ||||
| if (positions && Array.isArray(positions)) { | if (positions && Array.isArray(positions)) { | ||||
| let boundingSphere = Cesium.BoundingSphere.fromPoints( | 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() | |||||
| } | } |
| * @Author: Caven | * @Author: Caven | ||||
| * @Date: 2020-03-31 20:58:06 | * @Date: 2020-03-31 20:58:06 | ||||
| * @Last Modified by: Caven | * @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) { | export default function distance(positions) { | ||||
| let distance = 0 | let distance = 0 | ||||
| if (positions && Array.isArray(positions)) { | if (positions && Array.isArray(positions)) { | ||||
| for (let i = 0; i < positions.length - 1; i++) { | 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] | positions[i + 1] | ||||
| ) | ) | ||||
| let geodesic = new Cesium.EllipsoidGeodesic() | let geodesic = new Cesium.EllipsoidGeodesic() |
| * @Author: Caven | * @Author: Caven | ||||
| * @Date: 2020-04-11 00:41:47 | * @Date: 2020-04-11 00:41:47 | ||||
| * @Last Modified by: Caven | * @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) { | export default function heading(startPosition, endPosition) { | ||||
| let heading = 0 | 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( | let v = Cesium.Cartesian3.subtract( | ||||
| endPosition, | endPosition, |
| * @Author: Caven | * @Author: Caven | ||||
| * @Date: 2020-03-31 20:57:36 | * @Date: 2020-03-31 20:57:36 | ||||
| * @Last Modified by: Caven | * @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' | export { default as area } from './area' |
| * @Author: Caven | * @Author: Caven | ||||
| * @Date: 2020-03-31 20:58:06 | * @Date: 2020-03-31 20:58:06 | ||||
| * @Last Modified by: Caven | * @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) { | export default function isBetween(value, min, max) { |
| * @Author: Caven | * @Author: Caven | ||||
| * @Date: 2020-01-21 15:33:52 | * @Date: 2020-01-21 15:33:52 | ||||
| * @Last Modified by: Caven | * @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 { | class CameraOption { | ||||
| constructor(viewer) { | constructor(viewer) { |
| * @Author: Caven | * @Author: Caven | ||||
| * @Date: 2019-12-30 09:24:37 | * @Date: 2019-12-30 09:24:37 | ||||
| * @Last Modified by: Caven | * @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 { | class ViewerOption { | ||||
| constructor(viewer) { | constructor(viewer) { |
| * @Author: Caven | * @Author: Caven | ||||
| * @Date: 2020-01-03 12:18:17 | * @Date: 2020-01-03 12:18:17 | ||||
| * @Last Modified by: Caven | * @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' | import OverlayType from './OverlayType' | ||||
| class Overlay { | class Overlay { | ||||
| constructor() { | constructor() { | ||||
| this._id = DC.Util.uuid() | |||||
| this._id = Util.uuid() | |||||
| this._layer = undefined | this._layer = undefined | ||||
| this._state = undefined | this._state = undefined | ||||
| this._delegate = undefined | this._delegate = undefined | ||||
| this._bid = DC.Util.uuid() // Business id | |||||
| this._bid = Util.uuid() // Business id | |||||
| this._show = true | this._show = true | ||||
| this._style = {} | this._style = {} | ||||
| this._attr = {} | this._attr = {} | ||||
| this._overlayEvent = new OverlayEvent() | this._overlayEvent = new OverlayEvent() | ||||
| this.type = undefined | 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() { | get overlayId() { | ||||
| if (this._layer && this._layer.delegate && this._layer.delegate.entities) { | if (this._layer && this._layer.delegate && this._layer.delegate.entities) { | ||||
| this._layer.delegate.entities.add(this._delegate) | this._layer.delegate.entities.add(this._delegate) | ||||
| this._addedHook && this._addedHook() | this._addedHook && this._addedHook() | ||||
| this._state = DC.OverlayState.ADDED | |||||
| this._state = State.ADDED | |||||
| } | } | ||||
| } | } | ||||
| if (this._layer && this._layer.delegate && this._layer.delegate.entities) { | if (this._layer && this._layer.delegate && this._layer.delegate.entities) { | ||||
| this._layer.delegate.entities.remove(this._delegate) | this._layer.delegate.entities.remove(this._delegate) | ||||
| this._removedHook && this._removedHook() | this._removedHook && this._removedHook() | ||||
| this._state = DC.OverlayState.REMOVED | |||||
| this._state = State.REMOVED | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| DC.Overlay = Overlay | |||||
| export default Overlay | export default Overlay |
| * @Author: Caven | * @Author: Caven | ||||
| * @Date: 2020-05-10 08:24:57 | * @Date: 2020-05-10 08:24:57 | ||||
| * @Last Modified by: Caven | * @Last Modified by: Caven | ||||
| * @Last Modified time: 2020-05-10 09:08:49 | |||||
| * @Last Modified time: 2020-05-11 22:11:19 | |||||
| */ | */ | ||||
| let OverlayType = {} | let OverlayType = {} | ||||
| * @Author: Caven | * @Author: Caven | ||||
| * @Date: 2020-01-19 10:18:23 | * @Date: 2020-01-19 10:18:23 | ||||
| * @Last Modified by: Caven | * @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 { Util } from '../../utils' | ||||
| import Transform from '../../transform/Transform' | import Transform from '../../transform/Transform' | ||||
| import State from '../../state/State' | import State from '../../state/State' | ||||
| import Overlay from '../Overlay' | import Overlay from '../Overlay' | ||||
| const { Cesium } = DC.Namespace | |||||
| class Billboard extends Overlay { | class Billboard extends Overlay { | ||||
| constructor(position, icon) { | constructor(position, icon) { | ||||
| if (!Util.checkPosition(position)) { | if (!Util.checkPosition(position)) { |
| * @Author: Caven | * @Author: Caven | ||||
| * @Date: 2020-01-31 18:57:02 | * @Date: 2020-01-31 18:57:02 | ||||
| * @Last Modified by: Caven | * @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 { Util } from '../../utils' | ||||
| import Transform from '../../transform/Transform' | import Transform from '../../transform/Transform' | ||||
| import State from '../../state/State' | import State from '../../state/State' | ||||
| import Overlay from '../Overlay' | import Overlay from '../Overlay' | ||||
| const { Cesium } = DC.Namespace | |||||
| class Circle extends Overlay { | class Circle extends Overlay { | ||||
| constructor(center, radius) { | constructor(center, radius) { | ||||
| if (!Util.checkPosition(center)) { | if (!Util.checkPosition(center)) { | ||||
| set center(center) { | set center(center) { | ||||
| if (!Util.checkPosition(center)) { | if (!Util.checkPosition(center)) { | ||||
| throw new Error('DC.Circle: the center invalid') | |||||
| throw new Error('Circle: the center invalid') | |||||
| } | } | ||||
| this._center = center | this._center = center | ||||
| } | } |
| * @Author: Caven | * @Author: Caven | ||||
| * @Date: 2020-02-12 21:46:22 | * @Date: 2020-02-12 21:46:22 | ||||
| * @Last Modified by: Caven | * @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 { DomUtil, Util } from '../../utils' | ||||
| import { isBetween } from '../../math' | import { isBetween } from '../../math' | ||||
| import Transform from '../../transform/Transform' | import Transform from '../../transform/Transform' | ||||
| import State from '../State' | |||||
| import State from '../../state/State' | |||||
| import Overlay from '../Overlay' | import Overlay from '../Overlay' | ||||
| class DivIcon extends Overlay { | class DivIcon extends Overlay { |
| * @Author: Caven | * @Author: Caven | ||||
| * @Date: 2020-02-01 11:59:28 | * @Date: 2020-02-01 11:59:28 | ||||
| * @Last Modified by: Caven | * @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 { Util } from '../../utils' | ||||
| import Transform from '../../transform/Transform' | import Transform from '../../transform/Transform' | ||||
| import State from '../../state/State' | import State from '../../state/State' | ||||
| import Overlay from '../Overlay' | import Overlay from '../Overlay' | ||||
| const { Cesium } = DC.Namespace | |||||
| class Label extends Overlay { | class Label extends Overlay { | ||||
| constructor(position, text) { | constructor(position, text) { | ||||
| if (!Util.checkPosition(position)) { | if (!Util.checkPosition(position)) { | ||||
| throw new Error('DC.Label: the position invalid') | |||||
| throw new Error('Label: the position invalid') | |||||
| } | } | ||||
| super() | super() | ||||
| this._position = position | this._position = position | ||||
| set position(position) { | set position(position) { | ||||
| if (!Util.checkPosition(position)) { | if (!Util.checkPosition(position)) { | ||||
| throw new Error('DC.Label: the position invalid') | |||||
| throw new Error('Label: the position invalid') | |||||
| } | } | ||||
| this._position = position | this._position = position | ||||
| } | } |
| * @Author: Caven | * @Author: Caven | ||||
| * @Date: 2020-01-06 15:03:25 | * @Date: 2020-01-06 15:03:25 | ||||
| * @Last Modified by: Caven | * @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 { Util } from '../../utils' | ||||
| import Transform from '../../transform/Transform' | import Transform from '../../transform/Transform' | ||||
| import State from '../../state/State' | import State from '../../state/State' | ||||
| import Overlay from '../Overlay' | import Overlay from '../Overlay' | ||||
| const { Cesium } = DC.Namespace | |||||
| const DEF_STYLE = { | const DEF_STYLE = { | ||||
| pixelSize: 8, | pixelSize: 8, | ||||
| outlineColor: Cesium.Color.BLUE, | outlineColor: Cesium.Color.BLUE, |
| * @Author: Caven | * @Author: Caven | ||||
| * @Date: 2020-01-09 09:10:37 | * @Date: 2020-01-09 09:10:37 | ||||
| * @Last Modified by: Caven | * @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 { Util } from '../../utils' | ||||
| import { center, area } from '../../math' | import { center, area } from '../../math' | ||||
| import Transform from '../../transform/Transform' | import Transform from '../../transform/Transform' | ||||
| import State from '../../state/State' | import State from '../../state/State' | ||||
| import Overlay from '../Overlay' | import Overlay from '../Overlay' | ||||
| const { Cesium } = DC.Namespace | |||||
| class Polygon extends Overlay { | class Polygon extends Overlay { | ||||
| constructor(positions) { | constructor(positions) { | ||||
| if (!Util.checkPositions(positions)) { | if (!Util.checkPositions(positions)) { |
| * @Author: Caven | * @Author: Caven | ||||
| * @Date: 2020-01-06 15:03:25 | * @Date: 2020-01-06 15:03:25 | ||||
| * @Last Modified by: Caven | * @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 { Util } from '../../utils' | ||||
| import { center, distance } from '../../math' | import { center, distance } from '../../math' | ||||
| import Transform from '../../transform/Transform' | import Transform from '../../transform/Transform' | ||||
| import State from '../../state/State' | import State from '../../state/State' | ||||
| import Overlay from '../Overlay' | import Overlay from '../Overlay' | ||||
| const { Cesium } = DC.Namespace | |||||
| class Polyline extends Overlay { | class Polyline extends Overlay { | ||||
| constructor(positions) { | constructor(positions) { | ||||
| if (!Util.checkPositions(positions)) { | if (!Util.checkPositions(positions)) { |
| * @Author: Caven | * @Author: Caven | ||||
| * @Date: 2020-01-06 15:03:25 | * @Date: 2020-01-06 15:03:25 | ||||
| * @Last Modified by: Caven | * @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 { Util } from '../../utils' | ||||
| import Transform from '../../transform/Transform' | import Transform from '../../transform/Transform' | ||||
| import State from '../../state/State' | import State from '../../state/State' | ||||
| import Overlay from '../Overlay' | import Overlay from '../Overlay' | ||||
| const { Cesium } = DC.Namespace | |||||
| class Model extends Overlay { | class Model extends Overlay { | ||||
| constructor(position, modelUrl) { | constructor(position, modelUrl) { | ||||
| if (!Util.checkPosition(position)) { | if (!Util.checkPosition(position)) { |
| * @Author: Caven | * @Author: Caven | ||||
| * @Date: 2020-01-07 08:51:56 | * @Date: 2020-01-07 08:51:56 | ||||
| * @Last Modified by: Caven | * @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 { Util } from '../../utils' | ||||
| import State from '../../state/State' | import State from '../../state/State' | ||||
| import Overlay from '../Overlay' | import Overlay from '../Overlay' | ||||
| const { Cesium } = DC.Namespace | |||||
| class Tileset extends Overlay { | class Tileset extends Overlay { | ||||
| constructor(url, options = {}) { | constructor(url, options = {}) { | ||||
| super() | super() |
| * @Author: Caven | * @Author: Caven | ||||
| * @Date: 2020-03-22 00:10:25 | * @Date: 2020-03-22 00:10:25 | ||||
| * @Last Modified by: Caven | * @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' | import Position from '../position/Position' |
| * @Author: Caven | * @Author: Caven | ||||
| * @Date: 2019-12-27 14:35:02 | * @Date: 2019-12-27 14:35:02 | ||||
| * @Last Modified by: Caven | * @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' | import Transform from '../transform/Transform' | ||||
| const { Cesium } = DC.Namespace | |||||
| class Position { | class Position { | ||||
| constructor(lng, lat, alt, heading, pitch, roll) { | constructor(lng, lat, alt, heading, pitch, roll) { | ||||
| this._lng = lng || 0 | this._lng = lng || 0 |
| * @Author: Caven | * @Author: Caven | ||||
| * @Date: 2020-05-11 16:39:23 | * @Date: 2020-05-11 16:39:23 | ||||
| * @Last Modified by: Caven | * @Last Modified by: Caven | ||||
| * @Last Modified time: 2020-05-11 16:54:51 | |||||
| * @Last Modified time: 2020-05-11 22:11:28 | |||||
| */ | */ | ||||
| const State = { | const State = { |
| * @Author: Caven | * @Author: Caven | ||||
| * @Date: 2020-01-21 15:54:56 | * @Date: 2020-01-21 15:54:56 | ||||
| * @Last Modified by: Caven | * @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 { | class TerrainFactory { | ||||
| /** | /** |
| * @Author: Caven | * @Author: Caven | ||||
| * @Date: 2020-01-07 09:00:32 | * @Date: 2020-01-07 09:00:32 | ||||
| * @Last Modified by: Caven | * @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' | import Position from '../position/Position' | ||||
| const { Cesium } = DC.Namespace | |||||
| const WMP = new Cesium.WebMercatorProjection() | const WMP = new Cesium.WebMercatorProjection() | ||||
| class Transform { | class Transform { | ||||
| let mp = WMP.project( | let mp = WMP.project( | ||||
| Cesium.Cartographic.fromDegrees(position.lng, position.lat, position.alt) | 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) | |||||
| } | } | ||||
| /** | /** | ||||
| let mp = WMP.unproject( | let mp = WMP.unproject( | ||||
| new Cesium.Cartesian3(position.lng, position.lat, position.alt) | 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.longitude), | ||||
| Cesium.Math.toDegrees(mp.latitude), | Cesium.Math.toDegrees(mp.latitude), | ||||
| mp.height | mp.height |
| * @Author: Caven | * @Author: Caven | ||||
| * @Date: 2019-12-31 17:58:01 | * @Date: 2019-12-31 17:58:01 | ||||
| * @Last Modified by: Caven | * @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' | import Position from '../position/Position' |
| * @Author: Caven | * @Author: Caven | ||||
| * @Date: 2020-01-06 16:38:49 | * @Date: 2020-01-06 16:38:49 | ||||
| * @Last Modified by: Caven | * @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 DomUtil } from './DomUtil' | ||||
| export { default as Util } from './Util' | export { default as Util } from './Util' |
| * @Author: Caven | * @Author: Caven | ||||
| * @Date: 2019-12-27 17:13:24 | * @Date: 2019-12-27 17:13:24 | ||||
| * @Last Modified by: Caven | * @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 { ViewerOption, CameraOption } from '../option' | ||||
| import { MouseEvent, ViewerEvent, SceneEvent } from '../event' | |||||
| import { LayerEventType, EffectEventType } from '../event/EventType' | |||||
| import { | import { | ||||
| Attribution, | Attribution, | ||||
| ContextMenu, | ContextMenu, | ||||
| HawkeyeMap, | HawkeyeMap, | ||||
| Compass | Compass | ||||
| } from '../widget' | } from '../widget' | ||||
| import { DomUtil } from '../utils' | import { DomUtil } from '../utils' | ||||
| import Transform from '../transform/Transform' | import Transform from '../transform/Transform' | ||||
| import Position from '../position/Position' | import Position from '../position/Position' | ||||
| const { Cesium } = DC.Namespace | |||||
| const DEF_OPTS = { | const DEF_OPTS = { | ||||
| animation: false, //Whether to create animated widgets, lower left corner of the meter | animation: false, //Whether to create animated widgets, lower left corner of the meter | ||||
| baseLayerPicker: false, //Whether to display the layer selector | baseLayerPicker: false, //Whether to display the layer selector |
| * @Author: Caven | * @Author: Caven | ||||
| * @Date: 2020-02-11 21:08:01 | * @Date: 2020-02-11 21:08:01 | ||||
| * @Last Modified by: Caven | * @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 { DomUtil } from '../utils' | ||||
| import State from '../state/State' | import State from '../state/State' | ||||
| import Widget from './Widget' | import Widget from './Widget' |
| * @Author: Caven | * @Author: Caven | ||||
| * @Date: 2020-03-19 13:11:12 | * @Date: 2020-03-19 13:11:12 | ||||
| * @Last Modified by: Caven | * @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 { DomUtil } from '../utils' | ||||
| import State from '../state/State' | import State from '../state/State' | ||||
| import Widget from './Widget' | import Widget from './Widget' | ||||
| const { Cesium } = DC.Namespace | |||||
| const svg_out_ring = | 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' | '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 = | const svg_rotation_marker = |
| * @Author: Caven | * @Author: Caven | ||||
| * @Date: 2019-12-31 17:32:01 | * @Date: 2019-12-31 17:32:01 | ||||
| * @Last Modified by: Caven | * @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 { DomUtil } from '../utils' | ||||
| import { MouseEventType } from '../event/EventType' | |||||
| import { MouseEventType } from '../event' | |||||
| import State from '../state/State' | import State from '../state/State' | ||||
| import Widget from './Widget' | import Widget from './Widget' | ||||
| const { Cesium } = DC.Namespace | |||||
| class ContextMenu extends Widget { | class ContextMenu extends Widget { | ||||
| constructor() { | constructor() { | ||||
| super() | super() |
| * @Author: Caven | * @Author: Caven | ||||
| * @Date: 2020-03-15 17:47:42 | * @Date: 2020-03-15 17:47:42 | ||||
| * @Last Modified by: Caven | * @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 { DomUtil, Util } from '../utils' | ||||
| import State from '../state/State' | import State from '../state/State' | ||||
| import Widget from './Widget' | import Widget from './Widget' | ||||
| const { Cesium } = DC.Namespace | |||||
| const DEF_OPTS = { | const DEF_OPTS = { | ||||
| animation: false, | animation: false, | ||||
| baseLayerPicker: false, | baseLayerPicker: false, |
| * @Author: Caven | * @Author: Caven | ||||
| * @Date: 2020-03-04 18:02:32 | * @Date: 2020-03-04 18:02:32 | ||||
| * @Last Modified by: Caven | * @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 { DomUtil } from '../utils' | ||||
| import State from '../state/State' | |||||
| import Widget from './Widget' | import Widget from './Widget' | ||||
| import WidgetState from './WidgetState' | |||||
| class LocationBar extends Widget { | class LocationBar extends Widget { | ||||
| constructor() { | constructor() { | ||||
| this._mouseEl = DomUtil.create('div', 'mouse-location', this._wrapper) | this._mouseEl = DomUtil.create('div', 'mouse-location', this._wrapper) | ||||
| this._cameraEl = DomUtil.create('div', 'camera-location', this._wrapper) | this._cameraEl = DomUtil.create('div', 'camera-location', this._wrapper) | ||||
| this.type = Widget.getWidgetType('location_bar') | this.type = Widget.getWidgetType('location_bar') | ||||
| this._state = WidgetState.INITIALIZED | |||||
| this._state = State.INITIALIZED | |||||
| } | } | ||||
| _installHook() { | _installHook() { |
| * @Author: Caven | * @Author: Caven | ||||
| * @Date: 2020-03-04 15:38:40 | * @Date: 2020-03-04 15:38:40 | ||||
| * @Last Modified by: Caven | * @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 { DomUtil } from '../utils' | ||||
| import State from '../state/State' | |||||
| import Widget from './Widget' | import Widget from './Widget' | ||||
| import WidgetState from './WidgetState' | |||||
| const { Cesium } = DC.Namespace | |||||
| class MapSplit extends Widget { | class MapSplit extends Widget { | ||||
| constructor() { | constructor() { | ||||
| this._baseLayer = undefined | this._baseLayer = undefined | ||||
| this._moveActive = false | this._moveActive = false | ||||
| this.type = Widget.getWidgetType('map_split') | this.type = Widget.getWidgetType('map_split') | ||||
| this._state = WidgetState.INITIALIZED | |||||
| this._state = State.INITIALIZED | |||||
| } | } | ||||
| _installHook() { | _installHook() { |
| * @Author: Caven | * @Author: Caven | ||||
| * @Date: 2020-02-11 18:34:46 | * @Date: 2020-02-11 18:34:46 | ||||
| * @Last Modified by: Caven | * @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 { DomUtil } from '../utils' | ||||
| import State from '../state/State' | |||||
| import Widget from './Widget' | import Widget from './Widget' | ||||
| import WidgetState from './WidgetState' | |||||
| class MapSwitch extends Widget { | class MapSwitch extends Widget { | ||||
| constructor() { | constructor() { | ||||
| this._config = undefined | this._config = undefined | ||||
| this._cache = [] | this._cache = [] | ||||
| this.type = Widget.getWidgetType('map_switch') | this.type = Widget.getWidgetType('map_switch') | ||||
| this._state = WidgetState.INITIALIZED | |||||
| this._state = State.INITIALIZED | |||||
| } | } | ||||
| /** | /** |
| * @Author: Caven | * @Author: Caven | ||||
| * @Date: 2020-01-15 19:16:45 | * @Date: 2020-01-15 19:16:45 | ||||
| * @Last Modified by: Caven | * @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 { DomUtil } from '../utils' | ||||
| import State from '../state/State' | |||||
| import Widget from './Widget' | import Widget from './Widget' | ||||
| import WidgetState from './WidgetState' | |||||
| class Popup extends Widget { | class Popup extends Widget { | ||||
| constructor() { | constructor() { | ||||
| this._config = undefined | this._config = undefined | ||||
| this._positionChangeable = true | this._positionChangeable = true | ||||
| this.type = Widget.getWidgetType('popup') | this.type = Widget.getWidgetType('popup') | ||||
| this._state = WidgetState.INITIALIZED | |||||
| this._state = State.INITIALIZED | |||||
| } | } | ||||
| set config(config) { | set config(config) { |
| * @Author: Caven | * @Author: Caven | ||||
| * @Date: 2020-02-01 12:07:54 | * @Date: 2020-02-01 12:07:54 | ||||
| * @Last Modified by: Caven | * @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 { DomUtil } from '../utils' | ||||
| import State from '../state/State' | |||||
| import Widget from './Widget' | import Widget from './Widget' | ||||
| import WidgetState from './WidgetState' | |||||
| class Tooltip extends Widget { | class Tooltip extends Widget { | ||||
| constructor() { | constructor() { | ||||
| super() | super() | ||||
| this._wrapper = DomUtil.create('div', 'dc-tool-tip') | this._wrapper = DomUtil.create('div', 'dc-tool-tip') | ||||
| this.type = Widget.getWidgetType('tooltip') | this.type = Widget.getWidgetType('tooltip') | ||||
| this._state = WidgetState.INITIALIZED | |||||
| this._state = State.INITIALIZED | |||||
| } | } | ||||
| /** | /** |
| * @Author: Caven | * @Author: Caven | ||||
| * @Date: 2020-01-15 19:17:52 | * @Date: 2020-01-15 19:17:52 | ||||
| * @Last Modified by: Caven | * @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 State from '../state/State' | ||||
| import WidgetType from './WidgetType' | import WidgetType from './WidgetType' | ||||
| const { Cesium } = DC.Namespace | |||||
| class Widget { | class Widget { | ||||
| constructor() { | constructor() { | ||||
| this._viewer = undefined | this._viewer = undefined |
| * @Author: Caven | * @Author: Caven | ||||
| * @Date: 2020-05-10 10:15:46 | * @Date: 2020-05-10 10:15:46 | ||||
| * @Last Modified by: Caven | * @Last Modified by: Caven | ||||
| * @Last Modified time: 2020-05-10 10:16:24 | |||||
| * @Last Modified time: 2020-05-11 22:39:58 | |||||
| */ | */ | ||||
| let WidgetType = {} | let WidgetType = {} | ||||
| export default WidgetType | export default WidgetType |
| * @Author: Caven | * @Author: Caven | ||||
| * @Date: 2020-05-06 13:25:36 | * @Date: 2020-05-06 13:25:36 | ||||
| * @Last Modified by: Caven | * @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' | import Widget from './Widget' | ||||
| class ZoomController extends Widget { | class ZoomController extends Widget { |
| /* | |||||
| * @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 } |
| /* | |||||
| * @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' |
| /* | |||||
| * @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 | |||||
| }) |
| * @Author: Caven | * @Author: Caven | ||||
| * @Date: 2020-02-25 18:28:36 | * @Date: 2020-02-25 18:28:36 | ||||
| * @Last Modified by: Caven | * @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) { | 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() | super() | ||||
| this._position = position | this._position = position | ||||
| this._width = width | this._width = width | ||||
| this._height = height | this._height = height | ||||
| this._delegate = new Cesium.Entity() | 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) { | 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 | this._position = position | ||||
| } | } | ||||
| * set the location | * set the location | ||||
| */ | */ | ||||
| this._delegate.position = new Cesium.CallbackProperty(time => { | this._delegate.position = new Cesium.CallbackProperty(time => { | ||||
| return DC.T.transformWGS84ToCartesian(this._position) | |||||
| return Transform.transformWGS84ToCartesian(this._position) | |||||
| }) | }) | ||||
| /** | /** | ||||
| * set the orientation | * set the orientation | ||||
| */ | */ | ||||
| this._delegate.orientation = new Cesium.CallbackProperty(time => { | this._delegate.orientation = new Cesium.CallbackProperty(time => { | ||||
| return Cesium.Transforms.headingPitchRollQuaternion( | return Cesium.Transforms.headingPitchRollQuaternion( | ||||
| DC.T.transformWGS84ToCartesian(this._position), | |||||
| Transform.transformWGS84ToCartesian(this._position), | |||||
| new Cesium.HeadingPitchRoll( | new Cesium.HeadingPitchRoll( | ||||
| Cesium.Math.toRadians(this._position.heading), | Cesium.Math.toRadians(this._position.heading), | ||||
| Cesium.Math.toRadians(this._position.pitch), | Cesium.Math.toRadians(this._position.pitch), | ||||
| return this | return this | ||||
| } | } | ||||
| this._style = style | 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 | return this | ||||
| } | } | ||||
| } | } | ||||
| DC.OverlayType.BOX = 'box' | |||||
| Overlay.registerType('box') | |||||
| export default Box |
| * @Author: Caven | * @Author: Caven | ||||
| * @Date: 2020-04-11 12:58:17 | * @Date: 2020-04-11 12:58:17 | ||||
| * @Last Modified by: Caven | * @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) { | 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() | super() | ||||
| this._positions = DC.P.parsePositions(positions) | |||||
| this._positions = Parse.parsePositions(positions) | |||||
| this._delegate = new Cesium.Entity() | 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) { | 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() { | get positions() { | ||||
| this._delegate.corridor = { | this._delegate.corridor = { | ||||
| ...this._style, | ...this._style, | ||||
| positions: new Cesium.CallbackProperty(time => { | positions: new Cesium.CallbackProperty(time => { | ||||
| return DC.T.transformWGS84ArrayToCartesianArray(this._positions) | |||||
| return Transform.transformWGS84ArrayToCartesianArray(this._positions) | |||||
| }) | }) | ||||
| } | } | ||||
| } | } | ||||
| return this | return this | ||||
| } | } | ||||
| this._style = style | 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 | return this | ||||
| } | } | ||||
| } | } | ||||
| DC.OverlayType.CORRIDOR = 'corridor' | |||||
| Overlay.registerType('corridor') | |||||
| export default Corridor |
| * @Author: Caven | * @Author: Caven | ||||
| * @Date: 2020-04-14 11:10:00 | * @Date: 2020-04-14 11:10:00 | ||||
| * @Last Modified by: Caven | * @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) { | 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() | super() | ||||
| this._position = position | this._position = position | ||||
| this._topRadius = topRadius | this._topRadius = topRadius | ||||
| this._bottomRadius = bottomRadius | this._bottomRadius = bottomRadius | ||||
| this._delegate = new Cesium.Entity() | 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) { | 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 | this._position = position | ||||
| } | } | ||||
| * set the location | * set the location | ||||
| */ | */ | ||||
| this._delegate.position = new Cesium.CallbackProperty(time => { | this._delegate.position = new Cesium.CallbackProperty(time => { | ||||
| return DC.T.transformWGS84ToCartesian(this._position) | |||||
| return Transform.transformWGS84ToCartesian(this._position) | |||||
| }) | }) | ||||
| /** | /** | ||||
| * set the orientation | * set the orientation | ||||
| */ | */ | ||||
| this._delegate.orientation = new Cesium.CallbackProperty(time => { | this._delegate.orientation = new Cesium.CallbackProperty(time => { | ||||
| return Cesium.Transforms.headingPitchRollQuaternion( | return Cesium.Transforms.headingPitchRollQuaternion( | ||||
| DC.T.transformWGS84ToCartesian(this._position), | |||||
| Transform.transformWGS84ToCartesian(this._position), | |||||
| new Cesium.HeadingPitchRoll( | new Cesium.HeadingPitchRoll( | ||||
| Cesium.Math.toRadians(this._position.heading), | Cesium.Math.toRadians(this._position.heading), | ||||
| Cesium.Math.toRadians(this._position.pitch), | Cesium.Math.toRadians(this._position.pitch), | ||||
| return this | return this | ||||
| } | } | ||||
| this._style = style | 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 | return this | ||||
| } | } | ||||
| } | } | ||||
| DC.OverlayType.CYLINDER = 'cylinder' | |||||
| Overlay.registerType('cylinder') | |||||
| export default Cylinder |
| /* | |||||
| * @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' |
| * @Author: Caven | * @Author: Caven | ||||
| * @Date: 2020-04-14 11:10:00 | * @Date: 2020-04-14 11:10:00 | ||||
| * @Last Modified by: Caven | * @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) { | 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() | super() | ||||
| this._position = position | this._position = position | ||||
| this._semiMajorAxis = semiMajorAxis || 0 | this._semiMajorAxis = semiMajorAxis || 0 | ||||
| this._semiMinorAxis = semiMinorAxis || 0 | this._semiMinorAxis = semiMinorAxis || 0 | ||||
| this._delegate = new Cesium.Entity() | 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) { | 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 | this._position = position | ||||
| } | } | ||||
| * set the location | * set the location | ||||
| */ | */ | ||||
| this._delegate.position = new Cesium.CallbackProperty(time => { | this._delegate.position = new Cesium.CallbackProperty(time => { | ||||
| return DC.T.transformWGS84ToCartesian(this._position) | |||||
| return Transform.transformWGS84ToCartesian(this._position) | |||||
| }) | }) | ||||
| /** | /** | ||||
| * set the orientation | * set the orientation | ||||
| */ | */ | ||||
| this._delegate.orientation = new Cesium.CallbackProperty(time => { | this._delegate.orientation = new Cesium.CallbackProperty(time => { | ||||
| return Cesium.Transforms.headingPitchRollQuaternion( | return Cesium.Transforms.headingPitchRollQuaternion( | ||||
| DC.T.transformWGS84ToCartesian(this._position), | |||||
| Transform.transformWGS84ToCartesian(this._position), | |||||
| new Cesium.HeadingPitchRoll( | new Cesium.HeadingPitchRoll( | ||||
| Cesium.Math.toRadians(this._position.heading), | Cesium.Math.toRadians(this._position.heading), | ||||
| Cesium.Math.toRadians(this._position.pitch), | Cesium.Math.toRadians(this._position.pitch), | ||||
| return this | return this | ||||
| } | } | ||||
| this._style = style | 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 | return this | ||||
| } | } | ||||
| } | } | ||||
| DC.OverlayType.ELLIPSE = 'ellipse' | |||||
| Overlay.registerType('ellipse') | |||||
| export default Ellipse |
| * @Author: Caven | * @Author: Caven | ||||
| * @Date: 2020-04-14 11:10:00 | * @Date: 2020-04-14 11:10:00 | ||||
| * @Last Modified by: Caven | * @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) { | 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() | super() | ||||
| this._position = position | this._position = position | ||||
| this._radius = radius || 0 | this._radius = radius || 0 | ||||
| this._delegate = new Cesium.Entity() | 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) { | 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 | this._position = position | ||||
| } | } | ||||
| * set the location | * set the location | ||||
| */ | */ | ||||
| this._delegate.position = new Cesium.CallbackProperty(time => { | this._delegate.position = new Cesium.CallbackProperty(time => { | ||||
| return DC.T.transformWGS84ToCartesian(this._position) | |||||
| return Transform.transformWGS84ToCartesian(this._position) | |||||
| }) | }) | ||||
| /** | /** | ||||
| * set the orientation | * set the orientation | ||||
| */ | */ | ||||
| this._delegate.orientation = new Cesium.CallbackProperty(time => { | this._delegate.orientation = new Cesium.CallbackProperty(time => { | ||||
| return Cesium.Transforms.headingPitchRollQuaternion( | return Cesium.Transforms.headingPitchRollQuaternion( | ||||
| DC.T.transformWGS84ToCartesian(this._position), | |||||
| Transform.transformWGS84ToCartesian(this._position), | |||||
| new Cesium.HeadingPitchRoll( | new Cesium.HeadingPitchRoll( | ||||
| Cesium.Math.toRadians(this._position.heading), | Cesium.Math.toRadians(this._position.heading), | ||||
| Cesium.Math.toRadians(this._position.pitch), | Cesium.Math.toRadians(this._position.pitch), | ||||
| } | } | ||||
| this._style = style | this._style = style | ||||
| this._delegate.ellipsoid && | this._delegate.ellipsoid && | ||||
| DC.Util.merge(this._delegate.ellipsoid, this._style) | |||||
| Util.merge(this._delegate.ellipsoid, this._style) | |||||
| return this | return this | ||||
| } | } | ||||
| } | } | ||||
| DC.OverlayType.ELLIPSOID = 'ellipsoid' | |||||
| Overlay.registerType('ellipsoid') | |||||
| export default Ellipsoid |
| * @Author: Caven | * @Author: Caven | ||||
| * @Date: 2020-02-18 16:08:26 | * @Date: 2020-02-18 16:08:26 | ||||
| * @Last Modified by: Caven | * @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) { | 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() | super() | ||||
| this._position = position | this._position = position | ||||
| this._height = height | this._height = height | ||||
| this._plane = new Cesium.Plane(Cesium.Cartesian3.clone(direction), 0.0) | this._plane = new Cesium.Plane(Cesium.Cartesian3.clone(direction), 0.0) | ||||
| this._delegate = new Cesium.Entity() | 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) { | 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 | this._position = position | ||||
| } | } | ||||
| * set the location | * set the location | ||||
| */ | */ | ||||
| this._delegate.position = new Cesium.CallbackProperty(time => { | this._delegate.position = new Cesium.CallbackProperty(time => { | ||||
| return DC.T.transformWGS84ToCartesian(this._position) | |||||
| return Transform.transformWGS84ToCartesian(this._position) | |||||
| }) | }) | ||||
| /** | /** | ||||
| */ | */ | ||||
| this._delegate.orientation = new Cesium.CallbackProperty(time => { | this._delegate.orientation = new Cesium.CallbackProperty(time => { | ||||
| return Cesium.Transforms.headingPitchRollQuaternion( | return Cesium.Transforms.headingPitchRollQuaternion( | ||||
| DC.T.transformWGS84ToCartesian(this._center), | |||||
| Transform.transformWGS84ToCartesian(this._center), | |||||
| new Cesium.HeadingPitchRoll( | new Cesium.HeadingPitchRoll( | ||||
| Cesium.Math.toRadians(this._position.heading), | Cesium.Math.toRadians(this._position.heading), | ||||
| Cesium.Math.toRadians(this._position.pitch), | Cesium.Math.toRadians(this._position.pitch), | ||||
| return this | return this | ||||
| } | } | ||||
| this._style = style | 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 | return this | ||||
| } | } | ||||
| } | } | ||||
| DC.OverlayType.PLANE = 'plane' | |||||
| Overlay.registerType('plane') | |||||
| export default Plane |
| * @Author: Caven | * @Author: Caven | ||||
| * @Date: 2020-04-14 11:10:00 | * @Date: 2020-04-14 11:10:00 | ||||
| * @Last Modified by: Caven | * @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) { | 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() | super() | ||||
| this._positions = DC.P.parsePositions(positions) | |||||
| this._positions = Parse.parsePositions(positions) | |||||
| this._shape = shape | this._shape = shape | ||||
| this._delegate = new Cesium.Entity() | 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) { | 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() { | get positions() { | ||||
| set shape(shape) { | set shape(shape) { | ||||
| if (!shape || !Array.isArray(shape)) { | if (!shape || !Array.isArray(shape)) { | ||||
| throw new Error('DC.PolylineVolume: the shape invalid') | |||||
| throw new Error('PolylineVolume: the shape invalid') | |||||
| } | } | ||||
| this._shape = shape | this._shape = shape | ||||
| } | } | ||||
| this._delegate.polylineVolume = { | this._delegate.polylineVolume = { | ||||
| ...this._style, | ...this._style, | ||||
| positions: new Cesium.CallbackProperty(time => { | positions: new Cesium.CallbackProperty(time => { | ||||
| return DC.T.transformWGS84ArrayToCartesianArray(this._positions) | |||||
| return Transform.transformWGS84ArrayToCartesianArray(this._positions) | |||||
| }), | }), | ||||
| shape: new Cesium.CallbackProperty(time => { | shape: new Cesium.CallbackProperty(time => { | ||||
| return this._shape | return this._shape | ||||
| } | } | ||||
| this._style = style | this._style = style | ||||
| this._delegate.polylineVolume && | this._delegate.polylineVolume && | ||||
| DC.Util.merge(this._delegate.polylineVolume, this._style) | |||||
| Util.merge(this._delegate.polylineVolume, this._style) | |||||
| return this | return this | ||||
| } | } | ||||
| } | } | ||||
| DC.OverlayType.POLYLINE_VOLUME = 'polylineVolume' | |||||
| Overlay.registerType('polyline_volume') | |||||
| export default PolylineVolume |
| /* | |||||
| * @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 |
| * @Author: Caven | * @Author: Caven | ||||
| * @Date: 2020-02-12 21:44:24 | * @Date: 2020-02-12 21:44:24 | ||||
| * @Last Modified by: Caven | * @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) { | constructor(position, icon) { | ||||
| super(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') | |||||
| } | } | ||||
| /** | /** | ||||
| */ | */ | ||||
| setVLine(style) { | setVLine(style) { | ||||
| if (this._position.alt > 0 && !this._delegate.polyline) { | if (this._position.alt > 0 && !this._delegate.polyline) { | ||||
| let position = new DC.Position() | |||||
| let position = new Position() | |||||
| this._delegate.polyline = { | this._delegate.polyline = { | ||||
| ...style, | ...style, | ||||
| positions: new Cesium.CallbackProperty(time => { | positions: new Cesium.CallbackProperty(time => { | ||||
| position.lng = this._position.lng | position.lng = this._position.lng | ||||
| position.lat = this._position.lat | position.lat = this._position.lat | ||||
| position.alt = 0 | position.alt = 0 | ||||
| return DC.T.transformWGS84ArrayToCartesianArray([ | |||||
| return Transform.transformWGS84ArrayToCartesianArray([ | |||||
| position, | position, | ||||
| this._position | this._position | ||||
| ]) | ]) | ||||
| } | } | ||||
| } | } | ||||
| DC.OverlayType.CUSTOM_BILLBOARD = 'customBillboard' | |||||
| Overlay.registerType('custom_billboard') | |||||
| export default CustomBillboard |
| * @Author: Caven | * @Author: Caven | ||||
| * @Date: 2020-04-09 20:02:37 | * @Date: 2020-04-09 20:02:37 | ||||
| * @Last Modified by: Caven | * @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) { | 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(() => { | DC.init(() => { | ||||
| require('./DC.Overlay.Loader') | |||||
| require('./Overlay.Loader') | |||||
| }) | }) | ||||
| } | } | ||||
| * @Author: Caven | * @Author: Caven | ||||
| * @Date: 2020-01-31 15:51:32 | * @Date: 2020-01-31 15:51:32 | ||||
| * @Last Modified by: Caven | * @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 DrawPoint from './draw/DrawPoint' | ||||
| import DrawPolyline from './draw/DrawPolyline' | import DrawPolyline from './draw/DrawPolyline' | ||||
| import DrawPolygon from './draw/DrawPolygon' | import DrawPolygon from './draw/DrawPolygon' | ||||
| import EditPoint from './edit/EditPoint' | import EditPoint from './edit/EditPoint' | ||||
| import EditPolyline from './edit/EditPolyline' | import EditPolyline from './edit/EditPolyline' | ||||
| DC.Plot = class { | |||||
| const { VectorLayer, OverlayType } = DC | |||||
| const { Cesium } = DC.Namespace | |||||
| class Plot { | |||||
| constructor(viewer) { | constructor(viewer) { | ||||
| this._viewer = viewer | this._viewer = viewer | ||||
| this._plotEvent = new Cesium.Event() | this._plotEvent = new Cesium.Event() | ||||
| this._editWorker = undefined | this._editWorker = undefined | ||||
| this._drawLayer = new Cesium.CustomDataSource('plot-draw-layer') | this._drawLayer = new Cesium.CustomDataSource('plot-draw-layer') | ||||
| this._viewer.delegate.dataSources.add(this._drawLayer) | 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._viewer.addLayer(this._markerLayer) | ||||
| this._state = undefined | this._state = undefined | ||||
| } | } | ||||
| layer: this._drawLayer | layer: this._drawLayer | ||||
| } | } | ||||
| switch (type) { | switch (type) { | ||||
| case DC.OverlayType.POINT: | |||||
| case OverlayType.POINT: | |||||
| this._drawWorker = new DrawPoint(info, style) | this._drawWorker = new DrawPoint(info, style) | ||||
| break | break | ||||
| case DC.OverlayType.POLYLINE: | |||||
| case OverlayType.POLYLINE: | |||||
| this._drawWorker = new DrawPolyline(info, style) | this._drawWorker = new DrawPolyline(info, style) | ||||
| break | break | ||||
| case DC.OverlayType.POLYGON: | |||||
| case OverlayType.POLYGON: | |||||
| this._drawWorker = new DrawPolygon(info, style) | this._drawWorker = new DrawPolygon(info, style) | ||||
| break | break | ||||
| case DC.OverlayType.CIRCLE: | |||||
| case OverlayType.CIRCLE: | |||||
| this._drawWorker = new DrawCircle(info, style) | this._drawWorker = new DrawCircle(info, style) | ||||
| break | break | ||||
| case DC.OverlayType.RECT: | |||||
| case OverlayType.RECT: | |||||
| this._drawWorker = new DrawRect(info, style) | this._drawWorker = new DrawRect(info, style) | ||||
| break | break | ||||
| default: | default: | ||||
| overlay: overlay | overlay: overlay | ||||
| } | } | ||||
| switch (overlay.type) { | switch (overlay.type) { | ||||
| case DC.OverlayType.POINT: | |||||
| case OverlayType.POINT: | |||||
| this._editWorker = new EditPoint(info) | this._editWorker = new EditPoint(info) | ||||
| break | break | ||||
| case DC.OverlayType.POLYLINE: | |||||
| case OverlayType.POLYLINE: | |||||
| this._editWorker = new EditPolyline(info) | this._editWorker = new EditPolyline(info) | ||||
| break | break | ||||
| case DC.OverlayType.POLYGON: | |||||
| case OverlayType.POLYGON: | |||||
| this._drawWorker = new DrawPolygon(info) | this._drawWorker = new DrawPolygon(info) | ||||
| break | break | ||||
| case DC.OverlayType.CIRCLE: | |||||
| case OverlayType.CIRCLE: | |||||
| this._drawWorker = new DrawCircle(info) | this._drawWorker = new DrawCircle(info) | ||||
| break | break | ||||
| case DC.OverlayType.RECT: | |||||
| case OverlayType.RECT: | |||||
| this._drawWorker = new DrawRect(info) | this._drawWorker = new DrawRect(info) | ||||
| break | break | ||||
| default: | default: | ||||
| this._editWorker && this._editWorker.start() | this._editWorker && this._editWorker.start() | ||||
| } | } | ||||
| } | } | ||||
| export default Plot |
| * @Author: Caven | * @Author: Caven | ||||
| * @Date: 2020-01-31 19:44:41 | * @Date: 2020-01-31 19:44:41 | ||||
| * @Last Modified by: Caven | * @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' | import Draw from './Draw' | ||||
| const { OverlayType, Transform } = DC | |||||
| const { Cesium } = DC.NameSpace | const { Cesium } = DC.NameSpace | ||||
| const DEF_STYLE = { | const DEF_STYLE = { | ||||
| this._computeRadius(this._center, position) | this._computeRadius(this._center, position) | ||||
| this._unbindEnvet() | this._unbindEnvet() | ||||
| this._plotEvent.raiseEvent({ | this._plotEvent.raiseEvent({ | ||||
| type: DC.OverlayType.CIRCLE, | |||||
| points: [DC.T.transformCartesianToWGS84(this._center)], | |||||
| type: OverlayType.CIRCLE, | |||||
| points: [Transform.transformCartesianToWGS84(this._center)], | |||||
| radius: this._radius | radius: this._radius | ||||
| }) | }) | ||||
| } | } |
| * @Author: Caven | * @Author: Caven | ||||
| * @Date: 2020-01-31 16:25:29 | * @Date: 2020-01-31 16:25:29 | ||||
| * @Last Modified by: Caven | * @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' | import Draw from './Draw' | ||||
| const { OverlayType, Transform } = DC | |||||
| const { Cesium } = DC.NameSpace | const { Cesium } = DC.NameSpace | ||||
| const DEF_STYLE = { | const DEF_STYLE = { | ||||
| this._position = e.target ? e.position : e.surfacePosition | this._position = e.target ? e.position : e.surfacePosition | ||||
| this._unbindEnvet() | this._unbindEnvet() | ||||
| this._plotEvent.raiseEvent({ | this._plotEvent.raiseEvent({ | ||||
| type: DC.OverlayType.POINT, | |||||
| points: [DC.T.transformCartesianToWGS84(this._position)] | |||||
| type: OverlayType.POINT, | |||||
| points: [Transform.transformCartesianToWGS84(this._position)] | |||||
| }) | }) | ||||
| } | } | ||||
| * @Author: Caven | * @Author: Caven | ||||
| * @Date: 2020-01-31 18:59:31 | * @Date: 2020-01-31 18:59:31 | ||||
| * @Last Modified by: Caven | * @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' | import Draw from './Draw' | ||||
| const { OverlayType, Transform } = DC | |||||
| const { Cesium } = DC.NameSpace | const { Cesium } = DC.NameSpace | ||||
| const DEF_STYLE = { | const DEF_STYLE = { | ||||
| _mouseRightClickHandler(e) { | _mouseRightClickHandler(e) { | ||||
| this._unbindEnvet() | this._unbindEnvet() | ||||
| this._plotEvent.raiseEvent({ | this._plotEvent.raiseEvent({ | ||||
| type: DC.OverlayType.POLYGON, | |||||
| points: DC.T.transformCartesianArrayToWGS84Array(this._positions) | |||||
| type: OverlayType.POLYGON, | |||||
| points: Transform.transformCartesianArrayToWGS84Array(this._positions) | |||||
| }) | }) | ||||
| } | } | ||||
| * @Author: Caven | * @Author: Caven | ||||
| * @Date: 2020-01-31 18:18:44 | * @Date: 2020-01-31 18:18:44 | ||||
| * @Last Modified by: Caven | * @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' | import Draw from './Draw' | ||||
| const { OverlayType, Transform } = DC | |||||
| const { Cesium } = DC.NameSpace | const { Cesium } = DC.NameSpace | ||||
| const DEF_STYLE = { | const DEF_STYLE = { | ||||
| _mouseRightClickHandler(e) { | _mouseRightClickHandler(e) { | ||||
| this._unbindEnvet() | this._unbindEnvet() | ||||
| this._plotEvent.raiseEvent({ | this._plotEvent.raiseEvent({ | ||||
| type: DC.OverlayType.POLYLINE, | |||||
| points: DC.T.transformCartesianArrayToWGS84Array(this._positions) | |||||
| type: OverlayType.POLYLINE, | |||||
| points: Transform.transformCartesianArrayToWGS84Array(this._positions) | |||||
| }) | }) | ||||
| } | } | ||||
| * @Author: Caven | * @Author: Caven | ||||
| * @Date: 2020-01-31 20:52:01 | * @Date: 2020-01-31 20:52:01 | ||||
| * @Last Modified by: Caven | * @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' | import Draw from './Draw' | ||||
| const { OverlayType, Transform } = DC | |||||
| const { Cesium } = DC.NameSpace | const { Cesium } = DC.NameSpace | ||||
| const DEF_STYLE = { | const DEF_STYLE = { | ||||
| ) | ) | ||||
| this._unbindEnvet() | this._unbindEnvet() | ||||
| this._plotEvent.raiseEvent({ | this._plotEvent.raiseEvent({ | ||||
| type: DC.OverlayType.RECT, | |||||
| points: DC.T.transformCartesianArrayToWGS84Array(this._positions) | |||||
| type: OverlayType.RECT, | |||||
| points: Transform.transformCartesianArrayToWGS84Array(this._positions) | |||||
| }) | }) | ||||
| } | } | ||||
| } | } |
| * @Author: Caven | * @Author: Caven | ||||
| * @Date: 2020-03-17 16:19:15 | * @Date: 2020-03-17 16:19:15 | ||||
| * @Last Modified by: Caven | * @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 | const { Cesium } = DC.NameSpace | ||||
| class Edit { | class Edit { | ||||
| this._unbindEnvet() | this._unbindEnvet() | ||||
| this._layer.clear() | this._layer.clear() | ||||
| this._plotEvent.raiseEvent({ | this._plotEvent.raiseEvent({ | ||||
| type: DC.OverlayType.POLYLINE, | |||||
| points: DC.T.transformCartesianArrayToWGS84Array(this._positions) | |||||
| type: OverlayType.POLYLINE, | |||||
| points: Transform.transformCartesianArrayToWGS84Array(this._positions) | |||||
| }) | }) | ||||
| } | } | ||||
| * @Author: Caven | * @Author: Caven | ||||
| * @Date: 2020-03-17 18:23:25 | * @Date: 2020-03-17 18:23:25 | ||||
| * @Last Modified by: Caven | * @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' | import Edit from './Edit' | ||||
| const { OverlayType, Transform } = DC | |||||
| class EditCircle extends Edit { | class EditCircle extends Edit { | ||||
| constructor(plotInfo) { | constructor(plotInfo) { | ||||
| super(plotInfo) | super(plotInfo) | ||||
| } | } | ||||
| _prepareMarkers() { | _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] | |||||
| } | } | ||||
| } | } | ||||
| * @Author: Caven | * @Author: Caven | ||||
| * @Date: 2020-03-17 17:52:29 | * @Date: 2020-03-17 17:52:29 | ||||
| * @Last Modified by: Caven | * @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' | import Edit from './Edit' | ||||
| const { OverlayType, Transform } = DC | |||||
| class EditPoint extends Edit { | class EditPoint extends Edit { | ||||
| constructor(plotInfo) { | constructor(plotInfo) { | ||||
| super(plotInfo) | super(plotInfo) | ||||
| this._position = e.target ? e.position : e.surfacePosition | this._position = e.target ? e.position : e.surfacePosition | ||||
| this._unbindEnvet() | this._unbindEnvet() | ||||
| this._plotEvent.raiseEvent({ | this._plotEvent.raiseEvent({ | ||||
| type: DC.OverlayType.POINT, | |||||
| points: [DC.T.transformCartesianToWGS84(this._position)] | |||||
| type: OverlayType.POINT, | |||||
| points: [Transform.transformCartesianToWGS84(this._position)] | |||||
| }) | }) | ||||
| } | } | ||||
| * @Author: Caven | * @Author: Caven | ||||
| * @Date: 2020-03-17 21:59:39 | * @Date: 2020-03-17 21:59:39 | ||||
| * @Last Modified by: Caven | * @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' | import Edit from './Edit' | ||||
| const { Transform, MouseEventType, Point } = DC | |||||
| class EditPolyline extends Edit { | class EditPolyline extends Edit { | ||||
| constructor(plotInfo) { | constructor(plotInfo) { | ||||
| super(plotInfo) | super(plotInfo) | ||||
| _mouseMoveHandler(e) { | _mouseMoveHandler(e) { | ||||
| if (this._currentMarker) { | 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) | this._overlay.positions = this._markers.map(item => item.position) | ||||
| } | } | ||||
| } | } | ||||
| _prepareMarkers() { | _prepareMarkers() { | ||||
| this._positions.forEach(item => { | 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._layer.addOverlay(marker) | ||||
| this._markers.push(marker) | this._markers.push(marker) | ||||
| }) | }) |
| * @Author: Caven | * @Author: Caven | ||||
| * @Date: 2020-04-03 10:13:42 | * @Date: 2020-04-03 10:13:42 | ||||
| * @Last Modified by: Caven | * @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) { | 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 */ | /* istanbul ignore if */ |