mirage2d 1.1.11 → 1.1.12

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.
@@ -35795,6 +35795,15 @@ var featureStyleType;
35795
35795
  featureStyleType2["rock"] = "rock";
35796
35796
  featureStyleType2["rocks"] = "rocks";
35797
35797
  })(featureStyleType || (featureStyleType = {}));
35798
+ var QueryType;
35799
+ (function(QueryType2) {
35800
+ QueryType2[QueryType2["gaode_poi_text"] = 1] = "gaode_poi_text";
35801
+ QueryType2[QueryType2["gaode_poi_around"] = 0] = "gaode_poi_around";
35802
+ QueryType2[QueryType2["gaode_poi_polygon"] = 2] = "gaode_poi_polygon";
35803
+ QueryType2[QueryType2["gaode_route_driving"] = 0] = "gaode_route_driving";
35804
+ QueryType2[QueryType2["gaode_route_walking"] = 1] = "gaode_route_walking";
35805
+ QueryType2[QueryType2["gaode_route_integrated"] = 2] = "gaode_route_integrated";
35806
+ })(QueryType || (QueryType = {}));
35798
35807
  var typeEnum = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
35799
35808
  __proto__: null,
35800
35809
  get featuretype() {
@@ -35829,6 +35838,9 @@ var typeEnum = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProper
35829
35838
  },
35830
35839
  get featureStyleType() {
35831
35840
  return featureStyleType;
35841
+ },
35842
+ get QueryType() {
35843
+ return QueryType;
35832
35844
  }
35833
35845
  }, Symbol.toStringTag, { value: "Module" }));
35834
35846
  const _MirageDefaultStyle = class {
@@ -49498,13 +49510,13 @@ var difference$1 = function difference(subjectGeom) {
49498
49510
  }
49499
49511
  return operation.run("difference", subjectGeom, clippingGeoms);
49500
49512
  };
49501
- var index$5 = {
49513
+ var index$6 = {
49502
49514
  union,
49503
49515
  intersection: intersection$1,
49504
49516
  xor,
49505
49517
  difference: difference$1
49506
49518
  };
49507
- var polygonClipping = index$5;
49519
+ var polygonClipping = index$6;
49508
49520
  function difference2(polygon1, polygon22) {
49509
49521
  var geom1 = getGeom$1(polygon1);
49510
49522
  var geom2 = getGeom$1(polygon22);
@@ -79668,10 +79680,61 @@ function ToDegreeMinuteSecond(val) {
79668
79680
  }
79669
79681
  return { degree: parseInt(strDu), minute: parseInt(strFen), second: parseFloat(strMiao) };
79670
79682
  }
79683
+ function formatDistance(m2) {
79684
+ var n2 = "";
79685
+ if (m2) {
79686
+ if (m2 >= 1e3) {
79687
+ n2 = (m2 / 1e3).toFixed(2) + "\u516C\u91CC";
79688
+ } else {
79689
+ n2 = m2 + "\u7C73";
79690
+ }
79691
+ } else {
79692
+ n2 = "0\u7C73";
79693
+ }
79694
+ return n2;
79695
+ }
79696
+ function SecondToHHMMSS(value) {
79697
+ let second = parseInt(value);
79698
+ let minute = 0;
79699
+ let hour = 0;
79700
+ if (second > 60) {
79701
+ minute = Math.floor(second / 60);
79702
+ second = Math.floor(second % 60);
79703
+ if (minute > 60) {
79704
+ hour = Math.floor(minute / 60);
79705
+ minute = Math.floor(minute % 60);
79706
+ }
79707
+ }
79708
+ let result = "" + Math.floor(second) + "\u79D2";
79709
+ if (minute > 0) {
79710
+ result = "" + Math.floor(minute) + "\u5206" + result;
79711
+ }
79712
+ if (hour > 0) {
79713
+ result = "" + Math.floor(hour) + "\u5C0F\u65F6" + result;
79714
+ }
79715
+ console.log("result\uFF1A", result);
79716
+ return result;
79717
+ }
79718
+ function paramsToUrl(obj) {
79719
+ let result = "";
79720
+ let item;
79721
+ for (item in obj) {
79722
+ if (obj[item] && String(obj[item])) {
79723
+ result += `&${item}=${obj[item]}`;
79724
+ }
79725
+ }
79726
+ if (result) {
79727
+ result = "?" + result.slice(1);
79728
+ }
79729
+ return result;
79730
+ }
79671
79731
  var format$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
79672
79732
  __proto__: null,
79673
79733
  ToDegree,
79674
- ToDegreeMinuteSecond
79734
+ ToDegreeMinuteSecond,
79735
+ formatDistance,
79736
+ SecondToHHMMSS,
79737
+ paramsToUrl
79675
79738
  }, Symbol.toStringTag, { value: "Module" }));
79676
79739
  function fetchJson(url) {
79677
79740
  return getData4(url);
@@ -79690,7 +79753,7 @@ async function getData4(url) {
79690
79753
  });
79691
79754
  return response.json();
79692
79755
  }
79693
- var index$4 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
79756
+ var index$5 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
79694
79757
  __proto__: null,
79695
79758
  isutil: UIsUtil,
79696
79759
  json: UJson,
@@ -168092,7 +168155,7 @@ var csv = {
168092
168155
  return new DataSet(data2);
168093
168156
  }
168094
168157
  };
168095
- var index$3 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
168158
+ var index$4 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
168096
168159
  __proto__: null,
168097
168160
  canvasClear: clear2,
168098
168161
  canvasResolutionScale: resolutionScale$1,
@@ -169429,14 +169492,14 @@ class baseGraphic extends Feature$1 {
169429
169492
  popupOption: { offset: [0, 0] },
169430
169493
  style: {
169431
169494
  text: {
169432
- font: "12px Microsoft YaHei",
169495
+ font: "14px Microsoft YaHei",
169433
169496
  text: "",
169434
169497
  fill: {
169435
- color: "rgba(0, 153, 255,1)"
169498
+ color: "#8B4513"
169436
169499
  },
169437
169500
  stroke: {
169438
169501
  color: "rgba(255, 255, 255,1)",
169439
- width: 1
169502
+ width: 2
169440
169503
  },
169441
169504
  backgroundFill: {
169442
169505
  color: "rgba(255, 255, 255, 0.0)"
@@ -169452,7 +169515,7 @@ class baseGraphic extends Feature$1 {
169452
169515
  },
169453
169516
  image: {
169454
169517
  scale: 1,
169455
- radius: 8,
169518
+ radius: 5,
169456
169519
  fill: {
169457
169520
  color: "rgba(255, 0, 0,1)"
169458
169521
  },
@@ -170241,7 +170304,7 @@ class CurveGraphic extends baseGraphic {
170241
170304
  return poly2;
170242
170305
  }
170243
170306
  }
170244
- var index$2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
170307
+ var index$3 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
170245
170308
  __proto__: null,
170246
170309
  LabelGraphic,
170247
170310
  PointGraphic,
@@ -174720,13 +174783,13 @@ class PbfLayer extends baseLayer {
174720
174783
  map7.addLayer(this.layer);
174721
174784
  }
174722
174785
  }
174723
- var index$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
174786
+ var index$2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
174724
174787
  __proto__: null,
174725
174788
  ClusterLayer,
174726
174789
  HeatmapLayer,
174727
174790
  EchartLayer,
174728
174791
  MapVLayer,
174729
- MapV: index$3,
174792
+ MapV: index$4,
174730
174793
  MirageEChartsLayersOption,
174731
174794
  TileXyzLayer,
174732
174795
  ArcGisMapServerLayer,
@@ -210959,6 +211022,108 @@ class eventTarget {
210959
211022
  this.events.set(type, (this.events.get(type) || []).filter((item) => item.handler !== handler));
210960
211023
  }
210961
211024
  }
211025
+ class baseGaode {
211026
+ constructor(options) {
211027
+ __publicField(this, "option");
211028
+ this.option = {
211029
+ key: "50da1a3686015849769f4a414bfdfb8f"
211030
+ };
211031
+ this.option = Object.assign({}, this.option, options);
211032
+ }
211033
+ }
211034
+ class GaodeRoute extends baseGaode {
211035
+ constructor(options) {
211036
+ super(options);
211037
+ }
211038
+ query(option) {
211039
+ let apitype = [{
211040
+ type: "\u9A7E\u8F66",
211041
+ url: "/amap/v3/direction/driving"
211042
+ }, {
211043
+ type: "\u6B65\u884C",
211044
+ url: "/amap/v3/direction/walking"
211045
+ }, {
211046
+ type: "\u516C\u4EA4",
211047
+ url: "/amap/v3/direction/transit/integrated"
211048
+ }];
211049
+ const obj = {
211050
+ key: this.option.key,
211051
+ origin: option.startPoint.toString(),
211052
+ destination: option.endPoint.toString(),
211053
+ extensions: "base"
211054
+ };
211055
+ let url = apitype[option.queryType].url + paramsToUrl(obj);
211056
+ fetchJson(url).then(function(data2) {
211057
+ data2.route.paths.forEach((paths) => {
211058
+ paths.points = [];
211059
+ paths.steps.forEach((element) => {
211060
+ let points = element.polyline.split(";");
211061
+ points.forEach((element2) => {
211062
+ let p5 = element2.split(",");
211063
+ paths.points.push([parseFloat(p5[0]), parseFloat(p5[1])]);
211064
+ });
211065
+ });
211066
+ console.log(paths.points);
211067
+ });
211068
+ option.success(data2);
211069
+ }).catch(function(e2) {
211070
+ if (option.error)
211071
+ option.error(e2);
211072
+ });
211073
+ }
211074
+ }
211075
+ class GaodePOI extends baseGaode {
211076
+ constructor(options) {
211077
+ super(options);
211078
+ }
211079
+ query(option) {
211080
+ let apitype = [{
211081
+ type: "\u5468\u8FB9\u641C\u7D22",
211082
+ url: "/amap/v3/place/around",
211083
+ parameters: {
211084
+ keywords: option.keywords,
211085
+ location: option.location,
211086
+ radius: option.radius
211087
+ }
211088
+ }, {
211089
+ type: "\u5173\u952E\u5B57\u641C\u7D22",
211090
+ url: "/amap/v3/place/text",
211091
+ parameters: {
211092
+ keywords: option.keywords,
211093
+ region: option.region || "",
211094
+ city: option.city || "",
211095
+ city_limit: option.city_limit || false
211096
+ }
211097
+ }, {
211098
+ type: "\u591A\u8FB9\u5F62\u533A\u57DF\u641C\u7D22",
211099
+ url: "/amap/v3/place/polygon",
211100
+ parameters: {
211101
+ keywords: option.keywords,
211102
+ polygon: option.location,
211103
+ radius: option.radius
211104
+ }
211105
+ }];
211106
+ let obj = {
211107
+ key: this.option.key,
211108
+ extensions: "base"
211109
+ };
211110
+ obj = Object.assign({}, obj, apitype[option.queryType].parameters);
211111
+ let url = apitype[option.queryType].url + paramsToUrl(obj);
211112
+ fetchJson(url).then(function(data2) {
211113
+ option.success(data2);
211114
+ }).catch(function(e2) {
211115
+ if (option.error)
211116
+ option.error(e2);
211117
+ });
211118
+ }
211119
+ queryUrl() {
211120
+ }
211121
+ }
211122
+ var index$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
211123
+ __proto__: null,
211124
+ GaodeRoute,
211125
+ GaodePOI
211126
+ }, Symbol.toStringTag, { value: "Module" }));
210962
211127
  function decodeRowAcc(row, stride) {
210963
211128
  let length3 = row.length - stride;
210964
211129
  let offset2 = 0;
@@ -233359,4 +233524,4 @@ var index_es = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProper
233359
233524
  vectorsAngle,
233360
233525
  vectorsRatio
233361
233526
  }, Symbol.toStringTag, { value: "Module" }));
233362
- export { typeEnum as DataType, echartsGl$1 as Echartsgl, EventType, index$2 as Graphic, index$1 as Layer, MirageMap as Map, resource as Resource, SpatialAnalysis, style as Style, toolbox as Toolbox, index$4 as Util, MirageDefaultStyle as defaultStyle, eventTarget, proj, tykg };
233527
+ export { typeEnum as DataType, echartsGl$1 as Echartsgl, EventType, index$3 as Graphic, index$2 as Layer, MirageMap as Map, index$1 as Query, resource as Resource, SpatialAnalysis, style as Style, toolbox as Toolbox, index$5 as Util, MirageDefaultStyle as defaultStyle, eventTarget, proj, tykg };