gis-common 5.1.14 → 5.1.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,10 +3,10 @@ import { ColorRGBA } from '../types';
3
3
  * 基本的颜色类,支持RGB颜色
4
4
  */
5
5
  export default class Color {
6
- private _r;
7
- private _g;
8
- private _b;
9
- private _alpha;
6
+ _r: number;
7
+ _g: number;
8
+ _b: number;
9
+ _alpha: number;
10
10
  constructor(r: number, g: number, b: number, a?: number);
11
11
  private _validateColorChannel;
12
12
  toArray(): number[];
@@ -247,8 +247,6 @@ const Util = {
247
247
  return !value.length;
248
248
  case "Object":
249
249
  return !Object.keys(value).length;
250
- case "Boolean":
251
- return !value;
252
250
  default:
253
251
  return false;
254
252
  }
@@ -551,6 +549,7 @@ const ObjectUtil = {
551
549
  };
552
550
  const ImageUtil = {
553
551
  emptyImageUrl: "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",
552
+ transparentImageUrl: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAIAAADZF8uwAAAAGUlEQVQYV2M4gwH+YwCGIasIUwhT25BVBADtzYNYrHvv4gAAAABJRU5ErkJggg==",
554
553
  createCircle(radius, options = {}) {
555
554
  const lineWidth = options.lineWidth || 1;
556
555
  const canvas = CanvasDrawer.createCanvas(2 * radius, 2 * radius);
@@ -2820,10 +2819,6 @@ class MessageUtil {
2820
2819
  static resetWarned() {
2821
2820
  this.warned = {};
2822
2821
  }
2823
- static changeVoice() {
2824
- this.isMute = !!Number(!this.isMute);
2825
- localStorage.setItem("mute", Number(this.isMute).toString());
2826
- }
2827
2822
  static _call(method, message, options) {
2828
2823
  if (!this.warned[message]) {
2829
2824
  method(message, options);
@@ -2839,10 +2834,9 @@ class MessageUtil {
2839
2834
  * @returns 无返回值
2840
2835
  */
2841
2836
  static msg(type, message, options = {}) {
2842
- if (this.isMute) return;
2843
- const typename = Util.decodeDict(type, "success", "恭喜", "error", "发生错误", "warning", "警告", "info", "友情提示") + ":";
2837
+ this.speechSynthesisUtterance.lang = options.lang || this.LANG;
2838
+ const typename = this.speechSynthesisUtterance.lang === "zh-CN" ? Util.decodeDict(type, "success", "恭喜", "error", "发生错误", "warning", "警告", "info", "友情提示") + ":" : Util.decodeDict(type, "success", "congratulation", "error", "Error occurred", "warning", "Warning", "info", "Tips") + ":";
2844
2839
  this.speechSynthesisUtterance.text = typename + message;
2845
- this.speechSynthesisUtterance.lang = options.lang || "zh-CN";
2846
2840
  this.speechSynthesisUtterance.volume = options.volume || 1;
2847
2841
  this.speechSynthesisUtterance.rate = options.rate || 1;
2848
2842
  this.speechSynthesisUtterance.pitch = options.pitch || 1;
@@ -2885,8 +2879,8 @@ class MessageUtil {
2885
2879
  this._call(this.success.bind(this), message, options);
2886
2880
  }
2887
2881
  }
2882
+ __publicField(MessageUtil, "LANG", "zh-CN");
2888
2883
  __publicField(MessageUtil, "warned", {});
2889
- __publicField(MessageUtil, "isMute", !!Number(localStorage.getItem("mute")) || false);
2890
2884
  __publicField(MessageUtil, "speechSynthesis", window.speechSynthesis);
2891
2885
  __publicField(MessageUtil, "speechSynthesisUtterance", new SpeechSynthesisUtterance());
2892
2886
  const OptimizeUtil = {