mirage2d 1.1.11 → 1.1.13
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.
- package/dist/mirage2d.es.js +467 -172
- package/dist/mirage2d.umd.js +23 -23
- package/dist/src/Enum/typeEnum.d.ts +12 -0
- package/dist/src/Enum/typeEnum.d.ts.map +1 -1
- package/dist/src/Layer/XMap.d.ts +2 -0
- package/dist/src/Layer/XMap.d.ts.map +1 -1
- package/dist/src/Tools/SpatialAnalysis.d.ts +0 -6
- package/dist/src/Tools/SpatialAnalysis.d.ts.map +1 -1
- package/dist/src/Tools/util/format.d.ts +9 -0
- package/dist/src/Tools/util/format.d.ts.map +1 -1
- package/dist/src/graphic/Curve.d.ts.map +1 -1
- package/dist/src/graphic/Polygon.d.ts.map +1 -1
- package/dist/src/graphic/baseGraphic.d.ts +3 -1
- package/dist/src/graphic/baseGraphic.d.ts.map +1 -1
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/proj4/proj.d.ts +73 -4
- package/dist/src/proj4/proj.d.ts.map +1 -1
- package/dist/src/query/GaodePOI.d.ts +22 -0
- package/dist/src/query/GaodePOI.d.ts.map +1 -0
- package/dist/src/query/GaodeRoute.d.ts +14 -0
- package/dist/src/query/GaodeRoute.d.ts.map +1 -0
- package/dist/src/query/baseGaode.d.ts +9 -0
- package/dist/src/query/baseGaode.d.ts.map +1 -0
- package/dist/src/query/index.d.ts +3 -0
- package/dist/src/query/index.d.ts.map +1 -0
- package/package.json +1 -1
- package/readme.md +13 -2
package/dist/mirage2d.es.js
CHANGED
|
@@ -35684,6 +35684,7 @@ var crsType;
|
|
|
35684
35684
|
crsType2["IMAGE"] = "IMAGE";
|
|
35685
35685
|
crsType2["PGIS"] = "PGIS";
|
|
35686
35686
|
crsType2["BAIDU"] = "BAIDU";
|
|
35687
|
+
crsType2["GCJ02"] = "GCJ02";
|
|
35687
35688
|
crsType2["CGCS2000_GK_Zone_3"] = "CGCS2000_GK_Zone_3";
|
|
35688
35689
|
crsType2["CGCS2000_GK_Zone_6"] = "CGCS2000_GK_Zone_6";
|
|
35689
35690
|
crsType2["CGCS2000_GK_CM_3"] = "CGCS2000_GK_CM_3";
|
|
@@ -35795,6 +35796,15 @@ var featureStyleType;
|
|
|
35795
35796
|
featureStyleType2["rock"] = "rock";
|
|
35796
35797
|
featureStyleType2["rocks"] = "rocks";
|
|
35797
35798
|
})(featureStyleType || (featureStyleType = {}));
|
|
35799
|
+
var QueryType;
|
|
35800
|
+
(function(QueryType2) {
|
|
35801
|
+
QueryType2[QueryType2["gaode_poi_text"] = 1] = "gaode_poi_text";
|
|
35802
|
+
QueryType2[QueryType2["gaode_poi_around"] = 0] = "gaode_poi_around";
|
|
35803
|
+
QueryType2[QueryType2["gaode_poi_polygon"] = 2] = "gaode_poi_polygon";
|
|
35804
|
+
QueryType2[QueryType2["gaode_route_driving"] = 0] = "gaode_route_driving";
|
|
35805
|
+
QueryType2[QueryType2["gaode_route_walking"] = 1] = "gaode_route_walking";
|
|
35806
|
+
QueryType2[QueryType2["gaode_route_integrated"] = 2] = "gaode_route_integrated";
|
|
35807
|
+
})(QueryType || (QueryType = {}));
|
|
35798
35808
|
var typeEnum = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
35799
35809
|
__proto__: null,
|
|
35800
35810
|
get featuretype() {
|
|
@@ -35829,6 +35839,9 @@ var typeEnum = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProper
|
|
|
35829
35839
|
},
|
|
35830
35840
|
get featureStyleType() {
|
|
35831
35841
|
return featureStyleType;
|
|
35842
|
+
},
|
|
35843
|
+
get QueryType() {
|
|
35844
|
+
return QueryType;
|
|
35832
35845
|
}
|
|
35833
35846
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
35834
35847
|
const _MirageDefaultStyle = class {
|
|
@@ -49498,13 +49511,13 @@ var difference$1 = function difference(subjectGeom) {
|
|
|
49498
49511
|
}
|
|
49499
49512
|
return operation.run("difference", subjectGeom, clippingGeoms);
|
|
49500
49513
|
};
|
|
49501
|
-
var index$
|
|
49514
|
+
var index$6 = {
|
|
49502
49515
|
union,
|
|
49503
49516
|
intersection: intersection$1,
|
|
49504
49517
|
xor,
|
|
49505
49518
|
difference: difference$1
|
|
49506
49519
|
};
|
|
49507
|
-
var polygonClipping = index$
|
|
49520
|
+
var polygonClipping = index$6;
|
|
49508
49521
|
function difference2(polygon1, polygon22) {
|
|
49509
49522
|
var geom1 = getGeom$1(polygon1);
|
|
49510
49523
|
var geom2 = getGeom$1(polygon22);
|
|
@@ -79425,74 +79438,6 @@ class SpatialAnalysis {
|
|
|
79425
79438
|
return getCenter$1(feature2.getExtent());
|
|
79426
79439
|
}
|
|
79427
79440
|
}
|
|
79428
|
-
static ConvertCoordinatesTo3857(wkid, Coordinates) {
|
|
79429
|
-
return proj4("EPSG:" + wkid, "EPSG:3857", Coordinates);
|
|
79430
|
-
}
|
|
79431
|
-
static ConvertCoordinatesTo4326(wkid, Coordinates) {
|
|
79432
|
-
return proj4("EPSG:" + wkid, "EPSG:4326", Coordinates);
|
|
79433
|
-
}
|
|
79434
|
-
static ConvertLnglatToCGCS2000(lng, lat2, zone = 3) {
|
|
79435
|
-
let daihao;
|
|
79436
|
-
if (zone == 3) {
|
|
79437
|
-
daihao = parseInt(((lng + 1.5) / 3).toString()) * 3;
|
|
79438
|
-
} else {
|
|
79439
|
-
daihao = parseInt(((lng + 6) / 6).toString()) * 6 - 3;
|
|
79440
|
-
}
|
|
79441
|
-
let data2 = [];
|
|
79442
|
-
data2.push({ dh: 13, wkid: 4502 });
|
|
79443
|
-
data2.push({ dh: 14, wkid: 4503 });
|
|
79444
|
-
data2.push({ dh: 15, wkid: 4504 });
|
|
79445
|
-
data2.push({ dh: 16, wkid: 4505 });
|
|
79446
|
-
data2.push({ dh: 17, wkid: 4506 });
|
|
79447
|
-
data2.push({ dh: 18, wkid: 4507 });
|
|
79448
|
-
data2.push({ dh: 19, wkid: 4508 });
|
|
79449
|
-
data2.push({ dh: 20, wkid: 4509 });
|
|
79450
|
-
data2.push({ dh: 21, wkid: 4510 });
|
|
79451
|
-
data2.push({ dh: 22, wkid: 4511 });
|
|
79452
|
-
data2.push({ dh: 23, wkid: 4512 });
|
|
79453
|
-
data2.push({ dh: 78, wkid: 4535 });
|
|
79454
|
-
data2.push({ dh: 81, wkid: 4536 });
|
|
79455
|
-
data2.push({ dh: 84, wkid: 4537 });
|
|
79456
|
-
data2.push({ dh: 87, wkid: 4538 });
|
|
79457
|
-
data2.push({ dh: 90, wkid: 4539 });
|
|
79458
|
-
data2.push({ dh: 93, wkid: 4540 });
|
|
79459
|
-
data2.push({ dh: 96, wkid: 4541 });
|
|
79460
|
-
data2.push({ dh: 99, wkid: 4542 });
|
|
79461
|
-
data2.push({ dh: 102, wkid: 4543 });
|
|
79462
|
-
data2.push({ dh: 105, wkid: 4544 });
|
|
79463
|
-
data2.push({ dh: 108, wkid: 4545 });
|
|
79464
|
-
data2.push({ dh: 111, wkid: 4546 });
|
|
79465
|
-
data2.push({ dh: 114, wkid: 4547 });
|
|
79466
|
-
data2.push({ dh: 117, wkid: 4548 });
|
|
79467
|
-
data2.push({ dh: 120, wkid: 4549 });
|
|
79468
|
-
data2.push({ dh: 123, wkid: 4550 });
|
|
79469
|
-
data2.push({ dh: 126, wkid: 4551 });
|
|
79470
|
-
data2.push({ dh: 129, wkid: 4552 });
|
|
79471
|
-
data2.push({ dh: 132, wkid: 4553 });
|
|
79472
|
-
data2.push({ dh: 135, wkid: 4554 });
|
|
79473
|
-
let wkid;
|
|
79474
|
-
data2.forEach((element) => {
|
|
79475
|
-
if (element.dh == daihao) {
|
|
79476
|
-
wkid = element.wkid;
|
|
79477
|
-
return;
|
|
79478
|
-
}
|
|
79479
|
-
});
|
|
79480
|
-
if (wkid) {
|
|
79481
|
-
return proj4("EPSG:4326", "EPSG:" + wkid, [lng, lat2]);
|
|
79482
|
-
} else {
|
|
79483
|
-
return [0, 0];
|
|
79484
|
-
}
|
|
79485
|
-
}
|
|
79486
|
-
static ConvertWebMercatorToCGCS2000(x2, y2, zone = 3) {
|
|
79487
|
-
let lnglat = toLonLat([x2, y2]);
|
|
79488
|
-
return SpatialAnalysis.ConvertLnglatToCGCS2000(lnglat[0], lnglat[1], zone);
|
|
79489
|
-
}
|
|
79490
|
-
static webMktToLngLat(Coordinates) {
|
|
79491
|
-
return toLonLat(Coordinates);
|
|
79492
|
-
}
|
|
79493
|
-
static lngLatToWebMkt(Coordinates) {
|
|
79494
|
-
return fromLonLat(Coordinates);
|
|
79495
|
-
}
|
|
79496
79441
|
static to3857(Feature2) {
|
|
79497
79442
|
let format2 = new GeoJSON$1();
|
|
79498
79443
|
return format2.readFeature(Feature2, {
|
|
@@ -79668,10 +79613,61 @@ function ToDegreeMinuteSecond(val) {
|
|
|
79668
79613
|
}
|
|
79669
79614
|
return { degree: parseInt(strDu), minute: parseInt(strFen), second: parseFloat(strMiao) };
|
|
79670
79615
|
}
|
|
79616
|
+
function formatDistance(m2) {
|
|
79617
|
+
var n2 = "";
|
|
79618
|
+
if (m2) {
|
|
79619
|
+
if (m2 >= 1e3) {
|
|
79620
|
+
n2 = (m2 / 1e3).toFixed(2) + "\u516C\u91CC";
|
|
79621
|
+
} else {
|
|
79622
|
+
n2 = m2 + "\u7C73";
|
|
79623
|
+
}
|
|
79624
|
+
} else {
|
|
79625
|
+
n2 = "0\u7C73";
|
|
79626
|
+
}
|
|
79627
|
+
return n2;
|
|
79628
|
+
}
|
|
79629
|
+
function SecondToHHMMSS(value) {
|
|
79630
|
+
let second = parseInt(value);
|
|
79631
|
+
let minute = 0;
|
|
79632
|
+
let hour = 0;
|
|
79633
|
+
if (second > 60) {
|
|
79634
|
+
minute = Math.floor(second / 60);
|
|
79635
|
+
second = Math.floor(second % 60);
|
|
79636
|
+
if (minute > 60) {
|
|
79637
|
+
hour = Math.floor(minute / 60);
|
|
79638
|
+
minute = Math.floor(minute % 60);
|
|
79639
|
+
}
|
|
79640
|
+
}
|
|
79641
|
+
let result = "" + Math.floor(second) + "\u79D2";
|
|
79642
|
+
if (minute > 0) {
|
|
79643
|
+
result = "" + Math.floor(minute) + "\u5206" + result;
|
|
79644
|
+
}
|
|
79645
|
+
if (hour > 0) {
|
|
79646
|
+
result = "" + Math.floor(hour) + "\u5C0F\u65F6" + result;
|
|
79647
|
+
}
|
|
79648
|
+
console.log("result\uFF1A", result);
|
|
79649
|
+
return result;
|
|
79650
|
+
}
|
|
79651
|
+
function paramsToUrl(obj) {
|
|
79652
|
+
let result = "";
|
|
79653
|
+
let item;
|
|
79654
|
+
for (item in obj) {
|
|
79655
|
+
if (obj[item] && String(obj[item])) {
|
|
79656
|
+
result += `&${item}=${obj[item]}`;
|
|
79657
|
+
}
|
|
79658
|
+
}
|
|
79659
|
+
if (result) {
|
|
79660
|
+
result = "?" + result.slice(1);
|
|
79661
|
+
}
|
|
79662
|
+
return result;
|
|
79663
|
+
}
|
|
79671
79664
|
var format$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
79672
79665
|
__proto__: null,
|
|
79673
79666
|
ToDegree,
|
|
79674
|
-
ToDegreeMinuteSecond
|
|
79667
|
+
ToDegreeMinuteSecond,
|
|
79668
|
+
formatDistance,
|
|
79669
|
+
SecondToHHMMSS,
|
|
79670
|
+
paramsToUrl
|
|
79675
79671
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
79676
79672
|
function fetchJson(url) {
|
|
79677
79673
|
return getData4(url);
|
|
@@ -79690,7 +79686,7 @@ async function getData4(url) {
|
|
|
79690
79686
|
});
|
|
79691
79687
|
return response.json();
|
|
79692
79688
|
}
|
|
79693
|
-
var index$
|
|
79689
|
+
var index$5 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
79694
79690
|
__proto__: null,
|
|
79695
79691
|
isutil: UIsUtil,
|
|
79696
79692
|
json: UJson,
|
|
@@ -159633,6 +159629,240 @@ class SelectTransform {
|
|
|
159633
159629
|
this.transformInteraction.setActive(b2);
|
|
159634
159630
|
}
|
|
159635
159631
|
}
|
|
159632
|
+
class proj {
|
|
159633
|
+
constructor() {
|
|
159634
|
+
__publicField(this, "data");
|
|
159635
|
+
__publicField(this, "pi");
|
|
159636
|
+
__publicField(this, "x_pi");
|
|
159637
|
+
__publicField(this, "a");
|
|
159638
|
+
__publicField(this, "ee");
|
|
159639
|
+
registerProj4();
|
|
159640
|
+
register$3(proj4);
|
|
159641
|
+
this.data = [];
|
|
159642
|
+
this.data.push({ dh: 13, wkid: 4502 });
|
|
159643
|
+
this.data.push({ dh: 14, wkid: 4503 });
|
|
159644
|
+
this.data.push({ dh: 15, wkid: 4504 });
|
|
159645
|
+
this.data.push({ dh: 16, wkid: 4505 });
|
|
159646
|
+
this.data.push({ dh: 17, wkid: 4506 });
|
|
159647
|
+
this.data.push({ dh: 18, wkid: 4507 });
|
|
159648
|
+
this.data.push({ dh: 19, wkid: 4508 });
|
|
159649
|
+
this.data.push({ dh: 20, wkid: 4509 });
|
|
159650
|
+
this.data.push({ dh: 21, wkid: 4510 });
|
|
159651
|
+
this.data.push({ dh: 22, wkid: 4511 });
|
|
159652
|
+
this.data.push({ dh: 23, wkid: 4512 });
|
|
159653
|
+
this.data.push({ dh: 78, wkid: 4535 });
|
|
159654
|
+
this.data.push({ dh: 81, wkid: 4536 });
|
|
159655
|
+
this.data.push({ dh: 84, wkid: 4537 });
|
|
159656
|
+
this.data.push({ dh: 87, wkid: 4538 });
|
|
159657
|
+
this.data.push({ dh: 90, wkid: 4539 });
|
|
159658
|
+
this.data.push({ dh: 93, wkid: 4540 });
|
|
159659
|
+
this.data.push({ dh: 96, wkid: 4541 });
|
|
159660
|
+
this.data.push({ dh: 99, wkid: 4542 });
|
|
159661
|
+
this.data.push({ dh: 102, wkid: 4543 });
|
|
159662
|
+
this.data.push({ dh: 105, wkid: 4544 });
|
|
159663
|
+
this.data.push({ dh: 108, wkid: 4545 });
|
|
159664
|
+
this.data.push({ dh: 111, wkid: 4546 });
|
|
159665
|
+
this.data.push({ dh: 114, wkid: 4547 });
|
|
159666
|
+
this.data.push({ dh: 117, wkid: 4548 });
|
|
159667
|
+
this.data.push({ dh: 120, wkid: 4549 });
|
|
159668
|
+
this.data.push({ dh: 123, wkid: 4550 });
|
|
159669
|
+
this.data.push({ dh: 126, wkid: 4551 });
|
|
159670
|
+
this.data.push({ dh: 129, wkid: 4552 });
|
|
159671
|
+
this.data.push({ dh: 132, wkid: 4553 });
|
|
159672
|
+
this.data.push({ dh: 135, wkid: 4554 });
|
|
159673
|
+
this.pi = 3.141592653589793;
|
|
159674
|
+
this.x_pi = 3.141592653589793 * 3e3 / 180;
|
|
159675
|
+
this.a = 6378245;
|
|
159676
|
+
this.ee = 0.006693421622965943;
|
|
159677
|
+
}
|
|
159678
|
+
ConvertToMapCoord(wkid, Coordinates) {
|
|
159679
|
+
return { "Coord3857": this.ConvertCoordinatesTo3857(wkid, Coordinates), "Coord4326": this.ConvertCoordinatesTo4326(wkid, Coordinates) };
|
|
159680
|
+
}
|
|
159681
|
+
ConvertCoordinatesTo3857(wkid, Coordinates) {
|
|
159682
|
+
if (wkid.toUpperCase().indexOf("EPSG:") == -1) {
|
|
159683
|
+
wkid = "EPSG:" + wkid;
|
|
159684
|
+
}
|
|
159685
|
+
return proj4(wkid, "EPSG:3857", Coordinates);
|
|
159686
|
+
}
|
|
159687
|
+
ConvertCoordinatesTo4326(wkid, Coordinates) {
|
|
159688
|
+
if (wkid.toUpperCase().indexOf("EPSG:") == -1) {
|
|
159689
|
+
wkid = "EPSG:" + wkid;
|
|
159690
|
+
}
|
|
159691
|
+
return proj4(wkid, "EPSG:4326", Coordinates);
|
|
159692
|
+
}
|
|
159693
|
+
formatJsonTo3857(GeoJson) {
|
|
159694
|
+
let featureList;
|
|
159695
|
+
if (GeoJson.crs.properties.name == "EPSG:3857") {
|
|
159696
|
+
featureList = new GeoJSON$1().readFeatures(GeoJson);
|
|
159697
|
+
} else if (GeoJson.crs.properties.name == "EPSG:4326") {
|
|
159698
|
+
featureList = new GeoJSON$1().readFeatures(GeoJson, {
|
|
159699
|
+
dataProjection: "EPSG:4326",
|
|
159700
|
+
featureProjection: "EPSG:3857"
|
|
159701
|
+
});
|
|
159702
|
+
} else {
|
|
159703
|
+
featureList = new GeoJSON$1().readFeatures(GeoJson, {
|
|
159704
|
+
dataProjection: GeoJson.crs.properties.name,
|
|
159705
|
+
featureProjection: "EPSG:3857"
|
|
159706
|
+
});
|
|
159707
|
+
}
|
|
159708
|
+
return featureList;
|
|
159709
|
+
}
|
|
159710
|
+
formatJsonTo4326Json(GeoJson) {
|
|
159711
|
+
let featureList;
|
|
159712
|
+
let format2 = new GeoJSON$1();
|
|
159713
|
+
if (GeoJson.crs.properties.name == "EPSG:4326") {
|
|
159714
|
+
featureList = format2.readFeatures(GeoJson);
|
|
159715
|
+
} else if (GeoJson.crs.properties.name == "EPSG:3857") {
|
|
159716
|
+
featureList = format2.readFeatures(GeoJson, {
|
|
159717
|
+
dataProjection: "EPSG:3857",
|
|
159718
|
+
featureProjection: "EPSG:4326"
|
|
159719
|
+
});
|
|
159720
|
+
} else {
|
|
159721
|
+
featureList = format2.readFeatures(GeoJson, {
|
|
159722
|
+
dataProjection: GeoJson.crs.properties.name,
|
|
159723
|
+
featureProjection: "EPSG:4326"
|
|
159724
|
+
});
|
|
159725
|
+
}
|
|
159726
|
+
return format2.writeFeaturesObject(featureList);
|
|
159727
|
+
}
|
|
159728
|
+
formatJsonToPoint(GeoJson) {
|
|
159729
|
+
let featureList = this.formatJsonTo3857(GeoJson);
|
|
159730
|
+
let newFeature = [];
|
|
159731
|
+
featureList.forEach((feature2) => {
|
|
159732
|
+
switch (feature2.getGeometry().getType()) {
|
|
159733
|
+
case "Polygon":
|
|
159734
|
+
newFeature.push(new Feature$1({
|
|
159735
|
+
geometry: feature2.getGeometry().getInteriorPoint(),
|
|
159736
|
+
properties: feature2.getProperties().properties
|
|
159737
|
+
}));
|
|
159738
|
+
break;
|
|
159739
|
+
case "Point":
|
|
159740
|
+
newFeature.push(feature2);
|
|
159741
|
+
break;
|
|
159742
|
+
}
|
|
159743
|
+
});
|
|
159744
|
+
return newFeature;
|
|
159745
|
+
}
|
|
159746
|
+
LnglatToCGCS2000(lng, lat2, zone = 3) {
|
|
159747
|
+
let daihao;
|
|
159748
|
+
if (zone == 3) {
|
|
159749
|
+
daihao = parseInt(((lng + 1.5) / 3).toString()) * 3;
|
|
159750
|
+
} else {
|
|
159751
|
+
daihao = parseInt(((lng + 6) / 6).toString()) * 6 - 3;
|
|
159752
|
+
}
|
|
159753
|
+
let wkid;
|
|
159754
|
+
this.data.forEach((element) => {
|
|
159755
|
+
if (element.dh == daihao) {
|
|
159756
|
+
wkid = element.wkid;
|
|
159757
|
+
return;
|
|
159758
|
+
}
|
|
159759
|
+
});
|
|
159760
|
+
if (wkid) {
|
|
159761
|
+
return proj4("EPSG:4326", "EPSG:" + wkid, [lng, lat2]);
|
|
159762
|
+
} else {
|
|
159763
|
+
return [0, 0];
|
|
159764
|
+
}
|
|
159765
|
+
}
|
|
159766
|
+
ConvertWebMercatorToCGCS2000(x2, y2, zone = 3) {
|
|
159767
|
+
let lnglat = toLonLat([x2, y2]);
|
|
159768
|
+
return this.LnglatToCGCS2000(lnglat[0], lnglat[1], zone);
|
|
159769
|
+
}
|
|
159770
|
+
webMktToLngLat(Coordinates) {
|
|
159771
|
+
return toLonLat(Coordinates);
|
|
159772
|
+
}
|
|
159773
|
+
lngLatToWebMkt(Coordinates) {
|
|
159774
|
+
return fromLonLat(Coordinates);
|
|
159775
|
+
}
|
|
159776
|
+
transformLat(x2, y2) {
|
|
159777
|
+
let ret = -100 + 2 * x2 + 3 * y2 + 0.2 * y2 * y2 + 0.1 * x2 * y2 + 0.2 * Math.sqrt(Math.abs(x2));
|
|
159778
|
+
ret += (20 * Math.sin(6 * x2 * this.pi) + 20 * Math.sin(2 * x2 * this.pi)) * 2 / 3;
|
|
159779
|
+
ret += (20 * Math.sin(y2 * this.pi) + 40 * Math.sin(y2 / 3 * this.pi)) * 2 / 3;
|
|
159780
|
+
ret += (160 * Math.sin(y2 / 12 * this.pi) + 320 * Math.sin(y2 * this.pi / 30)) * 2 / 3;
|
|
159781
|
+
return ret;
|
|
159782
|
+
}
|
|
159783
|
+
transformLon(x2, y2) {
|
|
159784
|
+
let ret = 300 + x2 + 2 * y2 + 0.1 * x2 * x2 + 0.1 * x2 * y2 + 0.1 * Math.sqrt(Math.abs(x2));
|
|
159785
|
+
ret += (20 * Math.sin(6 * x2 * this.pi) + 20 * Math.sin(2 * x2 * this.pi)) * 2 / 3;
|
|
159786
|
+
ret += (20 * Math.sin(x2 * this.pi) + 40 * Math.sin(x2 / 3 * this.pi)) * 2 / 3;
|
|
159787
|
+
ret += (150 * Math.sin(x2 / 12 * this.pi) + 300 * Math.sin(x2 / 30 * this.pi)) * 2 / 3;
|
|
159788
|
+
return ret;
|
|
159789
|
+
}
|
|
159790
|
+
transform(lat2, lon2) {
|
|
159791
|
+
if (this.outOfChina(lat2, lon2)) {
|
|
159792
|
+
return [lat2, lon2];
|
|
159793
|
+
}
|
|
159794
|
+
let dLat = this.transformLat(lon2 - 105, lat2 - 35);
|
|
159795
|
+
let dLon = this.transformLon(lon2 - 105, lat2 - 35);
|
|
159796
|
+
let radLat = lat2 / 180 * this.pi;
|
|
159797
|
+
let magic = Math.sin(radLat);
|
|
159798
|
+
magic = 1 - this.ee * magic * magic;
|
|
159799
|
+
let sqrtMagic = Math.sqrt(magic);
|
|
159800
|
+
dLat = dLat * 180 / (this.a * (1 - this.ee) / (magic * sqrtMagic) * this.pi);
|
|
159801
|
+
dLon = dLon * 180 / (this.a / sqrtMagic * Math.cos(radLat) * this.pi);
|
|
159802
|
+
let mgLat = lat2 + dLat;
|
|
159803
|
+
let mgLon = lon2 + dLon;
|
|
159804
|
+
return [mgLat, mgLon];
|
|
159805
|
+
}
|
|
159806
|
+
outOfChina(lat2, lon2) {
|
|
159807
|
+
if (lon2 < 72.004 || lon2 > 137.8347)
|
|
159808
|
+
return true;
|
|
159809
|
+
if (lat2 < 0.8293 || lat2 > 55.8271)
|
|
159810
|
+
return true;
|
|
159811
|
+
return false;
|
|
159812
|
+
}
|
|
159813
|
+
wgs84ToGcj02(lat2, lon2) {
|
|
159814
|
+
if (this.outOfChina(lat2, lon2)) {
|
|
159815
|
+
return { lat: lat2, lon: lon2 };
|
|
159816
|
+
}
|
|
159817
|
+
let dLat = this.transformLat(lon2 - 105, lat2 - 35);
|
|
159818
|
+
let dLon = this.transformLon(lon2 - 105, lat2 - 35);
|
|
159819
|
+
let radLat = lat2 / 180 * this.pi;
|
|
159820
|
+
let magic = Math.sin(radLat);
|
|
159821
|
+
magic = 1 - this.ee * magic * magic;
|
|
159822
|
+
let sqrtMagic = Math.sqrt(magic);
|
|
159823
|
+
dLat = dLat * 180 / (this.a * (1 - this.ee) / (magic * sqrtMagic) * this.pi);
|
|
159824
|
+
dLon = dLon * 180 / (this.a / sqrtMagic * Math.cos(radLat) * this.pi);
|
|
159825
|
+
let mgLat = lat2 + dLat;
|
|
159826
|
+
let mgLon = lon2 + dLon;
|
|
159827
|
+
return { mgLat, mgLon };
|
|
159828
|
+
}
|
|
159829
|
+
gcj02ToWgs84(lat2, lon2) {
|
|
159830
|
+
let gps = this.transform(lat2, lon2);
|
|
159831
|
+
let lontitude = lon2 * 2 - gps[1];
|
|
159832
|
+
let latitude = lat2 * 2 - gps[0];
|
|
159833
|
+
return { latitude, lontitude };
|
|
159834
|
+
}
|
|
159835
|
+
gcj02ToBd09(lat2, lon2) {
|
|
159836
|
+
let x2 = lon2, y2 = lat2;
|
|
159837
|
+
let z2 = Math.sqrt(x2 * x2 + y2 * y2) + 2e-5 * Math.sin(y2 * this.x_pi);
|
|
159838
|
+
let theta = Math.atan2(y2, x2) + 3e-6 * Math.cos(x2 * this.x_pi);
|
|
159839
|
+
let tempLon = z2 * Math.cos(theta) + 65e-4;
|
|
159840
|
+
let tempLat = z2 * Math.sin(theta) + 6e-3;
|
|
159841
|
+
let gps = { tempLat, tempLon };
|
|
159842
|
+
return gps;
|
|
159843
|
+
}
|
|
159844
|
+
bd09ToGcj02(lat2, lon2) {
|
|
159845
|
+
let x2 = lon2 - 65e-4, y2 = lat2 - 6e-3;
|
|
159846
|
+
let z2 = Math.sqrt(x2 * x2 + y2 * y2) - 2e-5 * Math.sin(y2 * this.x_pi);
|
|
159847
|
+
let theta = Math.atan2(y2, x2) - 3e-6 * Math.cos(x2 * this.x_pi);
|
|
159848
|
+
let tempLon = z2 * Math.cos(theta);
|
|
159849
|
+
let tempLat = z2 * Math.sin(theta);
|
|
159850
|
+
let gps = { tempLat, tempLon };
|
|
159851
|
+
return gps;
|
|
159852
|
+
}
|
|
159853
|
+
wgs84ToBd09(lat2, lon2) {
|
|
159854
|
+
let gcj02 = this.wgs84ToGcj02(lat2, lon2);
|
|
159855
|
+
let bd09 = this.gcj02ToBd09(gcj02[0], gcj02[1]);
|
|
159856
|
+
return bd09;
|
|
159857
|
+
}
|
|
159858
|
+
bd09_To_gps84(lat2, lon2) {
|
|
159859
|
+
let gcj02 = this.bd09ToGcj02(lat2, lon2);
|
|
159860
|
+
let gps84 = this.gcj02ToWgs84(gcj02[0], gcj02[1]);
|
|
159861
|
+
gps84[0] = gps84[0].toFixed(6);
|
|
159862
|
+
gps84[1] = gps84[1].toFixed(6);
|
|
159863
|
+
return gps84;
|
|
159864
|
+
}
|
|
159865
|
+
}
|
|
159636
159866
|
class MirageMap extends baseMap {
|
|
159637
159867
|
constructor(mapID = "map", option) {
|
|
159638
159868
|
super();
|
|
@@ -159657,6 +159887,7 @@ class MirageMap extends baseMap {
|
|
|
159657
159887
|
__publicField(this, "option");
|
|
159658
159888
|
__publicField(this, "controls");
|
|
159659
159889
|
__publicField(this, "selectTransform");
|
|
159890
|
+
__publicField(this, "Proj");
|
|
159660
159891
|
this._mapOption = {
|
|
159661
159892
|
zoom: 13,
|
|
159662
159893
|
center: { lng: 102.103952024454, lat: 26.1693520685273 },
|
|
@@ -159725,6 +159956,7 @@ class MirageMap extends baseMap {
|
|
|
159725
159956
|
baseLayerSwitch: null,
|
|
159726
159957
|
swipe: new swipeControl(this)
|
|
159727
159958
|
};
|
|
159959
|
+
this.Proj = new proj();
|
|
159728
159960
|
this.init(mapID);
|
|
159729
159961
|
} else {
|
|
159730
159962
|
return;
|
|
@@ -159873,14 +160105,14 @@ class MirageMap extends baseMap {
|
|
|
159873
160105
|
let xy = (_a2 = this._map) == null ? void 0 : _a2.getEventCoordinate(evt.originalEvent);
|
|
159874
160106
|
if (xy) {
|
|
159875
160107
|
let lnglat = transform$4(xy, "EPSG:3857", "EPSG:4326");
|
|
160108
|
+
let xy2000 = this.Proj.LnglatToCGCS2000(lnglat[0], lnglat[1], 3);
|
|
159876
160109
|
this.trigger(XMapEventType.onMapMove, {
|
|
159877
160110
|
lng: lnglat[0],
|
|
159878
160111
|
lat: lnglat[1],
|
|
159879
|
-
crsx:
|
|
159880
|
-
crsy:
|
|
160112
|
+
crsx: xy2000[0].toFixed(2),
|
|
160113
|
+
crsy: xy2000[1].toFixed(2),
|
|
159881
160114
|
level: Math.round(this._view.getZoom())
|
|
159882
160115
|
});
|
|
159883
|
-
let xy2000 = SpatialAnalysis.ConvertLnglatToCGCS2000(lnglat[0], lnglat[1], 3);
|
|
159884
160116
|
this.controls.locationbar.updateMousePosition(toolbox.format(this._mapOption.controls.locationBar.template, {
|
|
159885
160117
|
lng: lnglat[0].toFixed(6),
|
|
159886
160118
|
lat: lnglat[1].toFixed(6),
|
|
@@ -159898,11 +160130,12 @@ class MirageMap extends baseMap {
|
|
|
159898
160130
|
if (evt.frameState) {
|
|
159899
160131
|
const state = evt.frameState.viewState;
|
|
159900
160132
|
let lnglat = transform$4(state.center, "EPSG:3857", "EPSG:4326");
|
|
160133
|
+
let xy2000 = this.Proj.LnglatToCGCS2000(lnglat[0], lnglat[1], 3);
|
|
159901
160134
|
this.trigger(XMapEventType.onMapMove, {
|
|
159902
160135
|
lng: lnglat[0],
|
|
159903
160136
|
lat: lnglat[1],
|
|
159904
|
-
crsx:
|
|
159905
|
-
crsy:
|
|
160137
|
+
crsx: xy2000[0].toFixed(2),
|
|
160138
|
+
crsy: xy2000[1].toFixed(2),
|
|
159906
160139
|
level: Math.round(state.zoom)
|
|
159907
160140
|
});
|
|
159908
160141
|
}
|
|
@@ -160178,11 +160411,11 @@ class MirageMap extends baseMap {
|
|
|
160178
160411
|
setCenter(lnglat, zoom, dataWkID = crsType.EPSG3857, flash = false) {
|
|
160179
160412
|
let mlnglat;
|
|
160180
160413
|
if (dataWkID == crsType.EPSG4326) {
|
|
160181
|
-
mlnglat =
|
|
160414
|
+
mlnglat = this.Proj.ConvertCoordinatesTo3857(dataWkID, lnglat);
|
|
160182
160415
|
} else if (dataWkID == crsType.EPSG3857) {
|
|
160183
160416
|
mlnglat = lnglat;
|
|
160184
160417
|
} else {
|
|
160185
|
-
mlnglat =
|
|
160418
|
+
mlnglat = this.Proj.ConvertCoordinatesTo3857(dataWkID, lnglat);
|
|
160186
160419
|
}
|
|
160187
160420
|
this._view.setCenter(mlnglat);
|
|
160188
160421
|
if (zoom) {
|
|
@@ -168092,7 +168325,7 @@ var csv = {
|
|
|
168092
168325
|
return new DataSet(data2);
|
|
168093
168326
|
}
|
|
168094
168327
|
};
|
|
168095
|
-
var index$
|
|
168328
|
+
var index$4 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
168096
168329
|
__proto__: null,
|
|
168097
168330
|
canvasClear: clear2,
|
|
168098
168331
|
canvasResolutionScale: resolutionScale$1,
|
|
@@ -169422,6 +169655,7 @@ class baseGraphic extends Feature$1 {
|
|
|
169422
169655
|
constructor(options) {
|
|
169423
169656
|
super();
|
|
169424
169657
|
__publicField(this, "option");
|
|
169658
|
+
__publicField(this, "Proj");
|
|
169425
169659
|
this.option = {
|
|
169426
169660
|
lnglat: [0, 0],
|
|
169427
169661
|
dataWkID: crsType.EPSG3857,
|
|
@@ -169429,14 +169663,14 @@ class baseGraphic extends Feature$1 {
|
|
|
169429
169663
|
popupOption: { offset: [0, 0] },
|
|
169430
169664
|
style: {
|
|
169431
169665
|
text: {
|
|
169432
|
-
font: "
|
|
169666
|
+
font: "14px Microsoft YaHei",
|
|
169433
169667
|
text: "",
|
|
169434
169668
|
fill: {
|
|
169435
|
-
color: "
|
|
169669
|
+
color: "#8B4513"
|
|
169436
169670
|
},
|
|
169437
169671
|
stroke: {
|
|
169438
169672
|
color: "rgba(255, 255, 255,1)",
|
|
169439
|
-
width:
|
|
169673
|
+
width: 2
|
|
169440
169674
|
},
|
|
169441
169675
|
backgroundFill: {
|
|
169442
169676
|
color: "rgba(255, 255, 255, 0.0)"
|
|
@@ -169452,7 +169686,7 @@ class baseGraphic extends Feature$1 {
|
|
|
169452
169686
|
},
|
|
169453
169687
|
image: {
|
|
169454
169688
|
scale: 1,
|
|
169455
|
-
radius:
|
|
169689
|
+
radius: 5,
|
|
169456
169690
|
fill: {
|
|
169457
169691
|
color: "rgba(255, 0, 0,1)"
|
|
169458
169692
|
},
|
|
@@ -169496,6 +169730,7 @@ class baseGraphic extends Feature$1 {
|
|
|
169496
169730
|
attribute: null
|
|
169497
169731
|
};
|
|
169498
169732
|
this.option = UJson.merge(this.option, options, true);
|
|
169733
|
+
this.Proj = new proj();
|
|
169499
169734
|
}
|
|
169500
169735
|
setAttribute(attribute) {
|
|
169501
169736
|
let featureAtt = UJson.merge(this.getProperties(), attribute, true);
|
|
@@ -169568,7 +169803,7 @@ class LabelGraphic extends baseGraphic {
|
|
|
169568
169803
|
case crsType.CGCS2000_GK_CM_6:
|
|
169569
169804
|
break;
|
|
169570
169805
|
default:
|
|
169571
|
-
this.setGeometry(new Point$4(
|
|
169806
|
+
this.setGeometry(new Point$4(this.Proj.ConvertCoordinatesTo3857(this.option.dataWkID, options.lnglat)));
|
|
169572
169807
|
break;
|
|
169573
169808
|
}
|
|
169574
169809
|
}
|
|
@@ -169622,7 +169857,7 @@ class LabelGraphic extends baseGraphic {
|
|
|
169622
169857
|
} else if (this.option.dataWkID == crsType.EPSG3857) {
|
|
169623
169858
|
pp.setCoordinates([lng, lat2]);
|
|
169624
169859
|
} else {
|
|
169625
|
-
pp.setCoordinates(
|
|
169860
|
+
pp.setCoordinates(this.Proj.ConvertCoordinatesTo3857(this.option.dataWkID, [lng, lat2]));
|
|
169626
169861
|
}
|
|
169627
169862
|
}
|
|
169628
169863
|
}
|
|
@@ -169643,7 +169878,7 @@ class PointGraphic extends baseGraphic {
|
|
|
169643
169878
|
case crsType.CGCS2000_GK_CM_6:
|
|
169644
169879
|
break;
|
|
169645
169880
|
default:
|
|
169646
|
-
this.setGeometry(new Point$4(
|
|
169881
|
+
this.setGeometry(new Point$4(this.Proj.ConvertCoordinatesTo3857(this.option.dataWkID, options.lnglat)));
|
|
169647
169882
|
break;
|
|
169648
169883
|
}
|
|
169649
169884
|
}
|
|
@@ -169685,7 +169920,7 @@ class PointGraphic extends baseGraphic {
|
|
|
169685
169920
|
} else if (this.option.dataWkID == crsType.EPSG3857) {
|
|
169686
169921
|
pp.setCoordinates([lng, lat2]);
|
|
169687
169922
|
} else {
|
|
169688
|
-
pp.setCoordinates(
|
|
169923
|
+
pp.setCoordinates(this.Proj.ConvertCoordinatesTo3857(this.option.dataWkID, [lng, lat2]));
|
|
169689
169924
|
}
|
|
169690
169925
|
}
|
|
169691
169926
|
}
|
|
@@ -169705,7 +169940,7 @@ class ImagePointGraphic extends baseGraphic {
|
|
|
169705
169940
|
case crsType.CGCS2000_GK_CM_6:
|
|
169706
169941
|
break;
|
|
169707
169942
|
default:
|
|
169708
|
-
this.setGeometry(new Point$4(
|
|
169943
|
+
this.setGeometry(new Point$4(this.Proj.ConvertCoordinatesTo3857(this.option.dataWkID, options.lnglat)));
|
|
169709
169944
|
break;
|
|
169710
169945
|
}
|
|
169711
169946
|
}
|
|
@@ -169767,7 +170002,7 @@ class ImagePointGraphic extends baseGraphic {
|
|
|
169767
170002
|
} else if (this.option.dataWkID == crsType.EPSG3857) {
|
|
169768
170003
|
pp.setCoordinates([lng, lat2]);
|
|
169769
170004
|
} else {
|
|
169770
|
-
pp.setCoordinates(
|
|
170005
|
+
pp.setCoordinates(this.Proj.ConvertCoordinatesTo3857(this.option.dataWkID, [lng, lat2]));
|
|
169771
170006
|
}
|
|
169772
170007
|
}
|
|
169773
170008
|
}
|
|
@@ -170002,7 +170237,7 @@ class LineGraphic extends baseGraphic {
|
|
|
170002
170237
|
break;
|
|
170003
170238
|
default:
|
|
170004
170239
|
this.option.lnglat.forEach((element, index2) => {
|
|
170005
|
-
this.option.lnglat[index2] =
|
|
170240
|
+
this.option.lnglat[index2] = this.Proj.ConvertCoordinatesTo3857(this.option.dataWkID, element);
|
|
170006
170241
|
});
|
|
170007
170242
|
this.setGeometry(new LineString$2(this.option.lnglat));
|
|
170008
170243
|
break;
|
|
@@ -170084,7 +170319,7 @@ class PolygonGraphic extends baseGraphic {
|
|
|
170084
170319
|
default:
|
|
170085
170320
|
this.option.lnglat.forEach((element) => {
|
|
170086
170321
|
element.forEach((xy, index2) => {
|
|
170087
|
-
element[index2] =
|
|
170322
|
+
element[index2] = this.Proj.ConvertCoordinatesTo3857(this.option.dataWkID, xy);
|
|
170088
170323
|
});
|
|
170089
170324
|
});
|
|
170090
170325
|
this.setGeometry(new ol_geom_Polygon(this.option.lnglat));
|
|
@@ -170195,8 +170430,12 @@ class CurveGraphic extends baseGraphic {
|
|
|
170195
170430
|
break;
|
|
170196
170431
|
case crsType.CGCS2000_GK_CM_6:
|
|
170197
170432
|
break;
|
|
170433
|
+
case crsType.BAIDU:
|
|
170434
|
+
break;
|
|
170435
|
+
case crsType.GCJ02:
|
|
170436
|
+
break;
|
|
170198
170437
|
default:
|
|
170199
|
-
this.setGeometry(this.createRegularPolygonCurve(
|
|
170438
|
+
this.setGeometry(this.createRegularPolygonCurve(this.Proj.ConvertCoordinatesTo4326(this.option.dataWkID, this.option.lnglat), this.option.style.radius, this.option.style.startAngle, this.option.style.stopAngle, this.option.style.rotation));
|
|
170200
170439
|
break;
|
|
170201
170440
|
}
|
|
170202
170441
|
}
|
|
@@ -170232,7 +170471,7 @@ class CurveGraphic extends baseGraphic {
|
|
|
170232
170471
|
} else if (this.option.dataWkID == crsType.EPSG3857) {
|
|
170233
170472
|
this.setGeometry(this.createRegularPolygonCurve(toLonLat(this.option.lnglat), this.option.style.radius, startAngle, stopAngle, this.option.style.rotation));
|
|
170234
170473
|
} else {
|
|
170235
|
-
this.setGeometry(this.createRegularPolygonCurve(
|
|
170474
|
+
this.setGeometry(this.createRegularPolygonCurve(this.Proj.ConvertCoordinatesTo4326(this.option.dataWkID, this.option.lnglat), this.option.style.radius, startAngle, stopAngle, this.option.style.rotation));
|
|
170236
170475
|
}
|
|
170237
170476
|
}
|
|
170238
170477
|
createRegularPolygonCurve(origin, radius, startAngle, stopAngle, rotation) {
|
|
@@ -170241,7 +170480,7 @@ class CurveGraphic extends baseGraphic {
|
|
|
170241
170480
|
return poly2;
|
|
170242
170481
|
}
|
|
170243
170482
|
}
|
|
170244
|
-
var index$
|
|
170483
|
+
var index$3 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
170245
170484
|
__proto__: null,
|
|
170246
170485
|
LabelGraphic,
|
|
170247
170486
|
PointGraphic,
|
|
@@ -174720,13 +174959,13 @@ class PbfLayer extends baseLayer {
|
|
|
174720
174959
|
map7.addLayer(this.layer);
|
|
174721
174960
|
}
|
|
174722
174961
|
}
|
|
174723
|
-
var index$
|
|
174962
|
+
var index$2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
174724
174963
|
__proto__: null,
|
|
174725
174964
|
ClusterLayer,
|
|
174726
174965
|
HeatmapLayer,
|
|
174727
174966
|
EchartLayer,
|
|
174728
174967
|
MapVLayer,
|
|
174729
|
-
MapV: index$
|
|
174968
|
+
MapV: index$4,
|
|
174730
174969
|
MirageEChartsLayersOption,
|
|
174731
174970
|
TileXyzLayer,
|
|
174732
174971
|
ArcGisMapServerLayer,
|
|
@@ -210844,80 +211083,6 @@ var resource = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProper
|
|
|
210844
211083
|
__proto__: null,
|
|
210845
211084
|
getJSON
|
|
210846
211085
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
210847
|
-
class proj {
|
|
210848
|
-
constructor() {
|
|
210849
|
-
registerProj4();
|
|
210850
|
-
register$3(proj4);
|
|
210851
|
-
}
|
|
210852
|
-
ConvertToMapCoord(wkid, Coordinates) {
|
|
210853
|
-
return { "Coord3857": this.ConvertCoordinatesTo3857(wkid, Coordinates), "Coord4326": this.ConvertCoordinatesTo4326(wkid, Coordinates) };
|
|
210854
|
-
}
|
|
210855
|
-
ConvertCoordinatesTo3857(wkid, Coordinates) {
|
|
210856
|
-
if (wkid.toUpperCase().indexOf("EPSG:") == -1) {
|
|
210857
|
-
wkid = "EPSG:" + wkid;
|
|
210858
|
-
}
|
|
210859
|
-
return proj4(wkid, "EPSG:3857", Coordinates);
|
|
210860
|
-
}
|
|
210861
|
-
ConvertCoordinatesTo4326(wkid, Coordinates) {
|
|
210862
|
-
if (wkid.toUpperCase().indexOf("EPSG:") == -1) {
|
|
210863
|
-
wkid = "EPSG:" + wkid;
|
|
210864
|
-
}
|
|
210865
|
-
return proj4(wkid, "EPSG:4326", Coordinates);
|
|
210866
|
-
}
|
|
210867
|
-
formatJsonTo3857(GeoJson) {
|
|
210868
|
-
let featureList;
|
|
210869
|
-
if (GeoJson.crs.properties.name == "EPSG:3857") {
|
|
210870
|
-
featureList = new GeoJSON$1().readFeatures(GeoJson);
|
|
210871
|
-
} else if (GeoJson.crs.properties.name == "EPSG:4326") {
|
|
210872
|
-
featureList = new GeoJSON$1().readFeatures(GeoJson, {
|
|
210873
|
-
dataProjection: "EPSG:4326",
|
|
210874
|
-
featureProjection: "EPSG:3857"
|
|
210875
|
-
});
|
|
210876
|
-
} else {
|
|
210877
|
-
featureList = new GeoJSON$1().readFeatures(GeoJson, {
|
|
210878
|
-
dataProjection: GeoJson.crs.properties.name,
|
|
210879
|
-
featureProjection: "EPSG:3857"
|
|
210880
|
-
});
|
|
210881
|
-
}
|
|
210882
|
-
return featureList;
|
|
210883
|
-
}
|
|
210884
|
-
formatJsonTo4326Json(GeoJson) {
|
|
210885
|
-
let featureList;
|
|
210886
|
-
let format2 = new GeoJSON$1();
|
|
210887
|
-
if (GeoJson.crs.properties.name == "EPSG:4326") {
|
|
210888
|
-
featureList = format2.readFeatures(GeoJson);
|
|
210889
|
-
} else if (GeoJson.crs.properties.name == "EPSG:3857") {
|
|
210890
|
-
featureList = format2.readFeatures(GeoJson, {
|
|
210891
|
-
dataProjection: "EPSG:3857",
|
|
210892
|
-
featureProjection: "EPSG:4326"
|
|
210893
|
-
});
|
|
210894
|
-
} else {
|
|
210895
|
-
featureList = format2.readFeatures(GeoJson, {
|
|
210896
|
-
dataProjection: GeoJson.crs.properties.name,
|
|
210897
|
-
featureProjection: "EPSG:4326"
|
|
210898
|
-
});
|
|
210899
|
-
}
|
|
210900
|
-
return format2.writeFeaturesObject(featureList);
|
|
210901
|
-
}
|
|
210902
|
-
formatJsonToPoint(GeoJson) {
|
|
210903
|
-
let featureList = this.formatJsonTo3857(GeoJson);
|
|
210904
|
-
let newFeature = [];
|
|
210905
|
-
featureList.forEach((feature2) => {
|
|
210906
|
-
switch (feature2.getGeometry().getType()) {
|
|
210907
|
-
case "Polygon":
|
|
210908
|
-
newFeature.push(new Feature$1({
|
|
210909
|
-
geometry: feature2.getGeometry().getInteriorPoint(),
|
|
210910
|
-
properties: feature2.getProperties().properties
|
|
210911
|
-
}));
|
|
210912
|
-
break;
|
|
210913
|
-
case "Point":
|
|
210914
|
-
newFeature.push(feature2);
|
|
210915
|
-
break;
|
|
210916
|
-
}
|
|
210917
|
-
});
|
|
210918
|
-
return newFeature;
|
|
210919
|
-
}
|
|
210920
|
-
}
|
|
210921
211086
|
class eventTarget {
|
|
210922
211087
|
constructor() {
|
|
210923
211088
|
__publicField(this, "events", new Map());
|
|
@@ -210959,6 +211124,136 @@ class eventTarget {
|
|
|
210959
211124
|
this.events.set(type, (this.events.get(type) || []).filter((item) => item.handler !== handler));
|
|
210960
211125
|
}
|
|
210961
211126
|
}
|
|
211127
|
+
class baseGaode {
|
|
211128
|
+
constructor(options) {
|
|
211129
|
+
__publicField(this, "option");
|
|
211130
|
+
this.option = {
|
|
211131
|
+
key: "50da1a3686015849769f4a414bfdfb8f"
|
|
211132
|
+
};
|
|
211133
|
+
this.option = Object.assign({}, this.option, options);
|
|
211134
|
+
}
|
|
211135
|
+
}
|
|
211136
|
+
class GaodeRoute extends baseGaode {
|
|
211137
|
+
constructor(options) {
|
|
211138
|
+
super(options);
|
|
211139
|
+
}
|
|
211140
|
+
query(option) {
|
|
211141
|
+
let ccf = new proj();
|
|
211142
|
+
let apitype = [{
|
|
211143
|
+
type: "\u9A7E\u8F66",
|
|
211144
|
+
url: "/amap/v3/direction/driving"
|
|
211145
|
+
}, {
|
|
211146
|
+
type: "\u6B65\u884C",
|
|
211147
|
+
url: "/amap/v3/direction/walking"
|
|
211148
|
+
}, {
|
|
211149
|
+
type: "\u516C\u4EA4",
|
|
211150
|
+
url: "/amap/v3/direction/transit/integrated"
|
|
211151
|
+
}];
|
|
211152
|
+
const obj = {
|
|
211153
|
+
key: this.option.key,
|
|
211154
|
+
origin: option.startPoint.toString(),
|
|
211155
|
+
destination: option.endPoint.toString(),
|
|
211156
|
+
extensions: "base"
|
|
211157
|
+
};
|
|
211158
|
+
let url = apitype[option.queryType].url + paramsToUrl(obj);
|
|
211159
|
+
fetchJson(url).then(function(data2) {
|
|
211160
|
+
data2.route.paths.forEach((paths) => {
|
|
211161
|
+
paths.points = [];
|
|
211162
|
+
paths.steps.forEach((element) => {
|
|
211163
|
+
let points = element.polyline.split(";");
|
|
211164
|
+
points.forEach((element2) => {
|
|
211165
|
+
let p5 = element2.split(",");
|
|
211166
|
+
debugger;
|
|
211167
|
+
let wgs = ccf.gcj02ToWgs84(parseFloat(p5[1]), parseFloat(p5[0]));
|
|
211168
|
+
paths.points.push([wgs.lontitude, wgs.latitude]);
|
|
211169
|
+
});
|
|
211170
|
+
});
|
|
211171
|
+
console.log(paths.points);
|
|
211172
|
+
});
|
|
211173
|
+
option.success(data2);
|
|
211174
|
+
}).catch(function(e2) {
|
|
211175
|
+
if (option.error)
|
|
211176
|
+
option.error(e2);
|
|
211177
|
+
});
|
|
211178
|
+
}
|
|
211179
|
+
}
|
|
211180
|
+
class GaodePOI extends baseGaode {
|
|
211181
|
+
constructor(options) {
|
|
211182
|
+
super(options);
|
|
211183
|
+
}
|
|
211184
|
+
query(option) {
|
|
211185
|
+
let ccf = new proj();
|
|
211186
|
+
let obj = {
|
|
211187
|
+
queryType: 1,
|
|
211188
|
+
keywords: "",
|
|
211189
|
+
location: "",
|
|
211190
|
+
radius: "3000",
|
|
211191
|
+
city: "\u897F\u5B89\u5E02",
|
|
211192
|
+
city_limit: true,
|
|
211193
|
+
polygon: "",
|
|
211194
|
+
extensions: "base",
|
|
211195
|
+
offset: 20,
|
|
211196
|
+
page: 1,
|
|
211197
|
+
success: null,
|
|
211198
|
+
error: null
|
|
211199
|
+
};
|
|
211200
|
+
obj = Object.assign({}, obj, option);
|
|
211201
|
+
let apitype = [{
|
|
211202
|
+
type: "\u5468\u8FB9\u641C\u7D22",
|
|
211203
|
+
url: "/amap/v3/place/around",
|
|
211204
|
+
parameters: {
|
|
211205
|
+
key: this.option.key,
|
|
211206
|
+
keywords: obj.keywords,
|
|
211207
|
+
location: obj.location,
|
|
211208
|
+
radius: obj.radius,
|
|
211209
|
+
offset: obj.offset,
|
|
211210
|
+
page: obj.page
|
|
211211
|
+
}
|
|
211212
|
+
}, {
|
|
211213
|
+
type: "\u5173\u952E\u5B57\u641C\u7D22",
|
|
211214
|
+
url: "/amap/v3/place/text",
|
|
211215
|
+
parameters: {
|
|
211216
|
+
key: this.option.key,
|
|
211217
|
+
keywords: obj.keywords,
|
|
211218
|
+
city: option.city,
|
|
211219
|
+
city_limit: option.city_limit,
|
|
211220
|
+
offset: obj.offset,
|
|
211221
|
+
page: obj.page
|
|
211222
|
+
}
|
|
211223
|
+
}, {
|
|
211224
|
+
type: "\u591A\u8FB9\u5F62\u533A\u57DF\u641C\u7D22",
|
|
211225
|
+
url: "/amap/v3/place/polygon",
|
|
211226
|
+
parameters: {
|
|
211227
|
+
key: this.option.key,
|
|
211228
|
+
keywords: option.keywords,
|
|
211229
|
+
polygon: option.polygon,
|
|
211230
|
+
offset: obj.offset,
|
|
211231
|
+
page: obj.page
|
|
211232
|
+
}
|
|
211233
|
+
}];
|
|
211234
|
+
obj.keywords = obj.keywords.replace("", "|");
|
|
211235
|
+
let url = apitype[obj.queryType].url + paramsToUrl(apitype[obj.queryType].parameters);
|
|
211236
|
+
fetchJson(url).then(function(data2) {
|
|
211237
|
+
data2.pois.forEach((element) => {
|
|
211238
|
+
let p5 = element.location.split(",");
|
|
211239
|
+
debugger;
|
|
211240
|
+
let wgs = ccf.gcj02ToWgs84(parseFloat(p5[1]), parseFloat(p5[0]));
|
|
211241
|
+
element.lnglat = [wgs.lontitude, wgs.latitude];
|
|
211242
|
+
});
|
|
211243
|
+
option.success(data2);
|
|
211244
|
+
}).catch(function(e2) {
|
|
211245
|
+
if (option.error)
|
|
211246
|
+
option.error(e2);
|
|
211247
|
+
});
|
|
211248
|
+
}
|
|
211249
|
+
queryUrl() {
|
|
211250
|
+
}
|
|
211251
|
+
}
|
|
211252
|
+
var index$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
211253
|
+
__proto__: null,
|
|
211254
|
+
GaodeRoute,
|
|
211255
|
+
GaodePOI
|
|
211256
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
210962
211257
|
function decodeRowAcc(row, stride) {
|
|
210963
211258
|
let length3 = row.length - stride;
|
|
210964
211259
|
let offset2 = 0;
|
|
@@ -233359,4 +233654,4 @@ var index_es = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProper
|
|
|
233359
233654
|
vectorsAngle,
|
|
233360
233655
|
vectorsRatio
|
|
233361
233656
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
233362
|
-
export { typeEnum as DataType, echartsGl$1 as Echartsgl, EventType, index$
|
|
233657
|
+
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 };
|