UNPKG

cione-comp-lib

Version:

`$ yarn add cione-comp-lib` 或者 `$ npm i cione-comp-lib -S`

55 lines (54 loc) 1.71 kB
import "../../../../echarts/lib/echarts.mjs"; import componentPostEffectMixin from "../common/componentPostEffectMixin.mjs"; import componentLightMixin from "../common/componentLightMixin.mjs"; import ComponentModel from "../../../../echarts/lib/model/Component.mjs"; import { merge } from "../../../../zrender/lib/core/util.mjs"; var MAPTALKS_CAMERA_OPTION = ["zoom", "center", "pitch", "bearing"]; var Maptalks3DModel = ComponentModel.extend({ type: "maptalks3D", layoutMode: "box", coordinateSystem: null, defaultOption: { zlevel: -10, urlTemplate: "http://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}.png", attribution: '&copy; <a href="http://osm.org">OpenStreetMap</a> contributors, &copy; <a href="https://carto.com/">CARTO</a>', center: [0, 0], zoom: 0, pitch: 0, bearing: 0, light: { main: { alpha: 20, beta: 30 } }, altitudeScale: 1, boxHeight: "auto" }, getMaptalksCameraOption: function() { var self = this; return MAPTALKS_CAMERA_OPTION.reduce(function(obj, key) { obj[key] = self.get(key); return obj; }, {}); }, setMaptalksCameraOption: function(option) { if (option != null) { MAPTALKS_CAMERA_OPTION.forEach(function(key) { if (option[key] != null) { this.option[key] = option[key]; } }, this); } }, getMaptalks: function() { return this._maptalks; }, setMaptalks: function(maptalks) { this._maptalks = maptalks; } }); merge(Maptalks3DModel.prototype, componentPostEffectMixin); merge(Maptalks3DModel.prototype, componentLightMixin); var Maptalks3DModel$1 = Maptalks3DModel; export { Maptalks3DModel$1 as default };