gis-common 1.1.18 → 1.1.20

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.
@@ -460,7 +460,7 @@ var MeasureMode = {
460
460
  *
461
461
  * @param {*} url
462
462
  */
463
- loadScript: function loadScript(url) {
463
+ asyncLoadScript: function asyncLoadScript(url) {
464
464
  return new Promise(function (resolve, reject) {
465
465
  try {
466
466
  var oscript = document.createElement('script');
@@ -476,6 +476,7 @@ var MeasureMode = {
476
476
  resolve(oscript);
477
477
  };
478
478
  }
479
+ oscript.type = 'text/javascript';
479
480
  oscript.src = url;
480
481
  document.body.appendChild(oscript);
481
482
  } catch (error) {
@@ -483,6 +484,15 @@ var MeasureMode = {
483
484
  }
484
485
  });
485
486
  },
487
+ loadStyle: function loadStyle(urls) {
488
+ urls.forEach(function (url) {
489
+ var css = document.createElement('link');
490
+ css.href = url;
491
+ css.rel = 'stylesheet';
492
+ css.type = 'text/css';
493
+ document.head.appendChild(css);
494
+ });
495
+ },
486
496
 
487
497
  /**
488
498
  * 提取json中的value组成一个新的字符串
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "gis-common",
3
3
  "description": "gis-common",
4
4
  "main": "dist/resource.min.js",
5
- "version": "1.1.18",
5
+ "version": "1.1.20",
6
6
  "author": "Guo.Yan <luv02@vip.qq.com>",
7
7
  "license": "MIT",
8
8
  "private": false,