qy-vue-plugins 1.0.7-beta → 1.0.8-beta
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/chunks/utils-Xq2KWcMy.js +1 -0
- package/dist/chunks/{utils-BelS503a.js → utils-xXl9a14X.js} +174 -165
- package/dist/mapboxV2/MapView.cjs +1 -1
- package/dist/mapboxV2/MapView.mjs +2878 -2064
- package/dist/mapboxV2/components/mapTopic.cjs +1 -1
- package/dist/mapboxV2/components/mapTopic.mjs +294 -309
- package/dist/mapboxV2/useTif.cjs +1 -1
- package/dist/mapboxV2/useTif.mjs +1 -1
- package/dist/mapboxV2/utils.cjs +1 -1
- package/dist/mapboxV2/utils.mjs +189 -180
- package/dist/mapboxV2/widgets/CustomShapeDialog.cjs +1 -1
- package/dist/mapboxV2/widgets/CustomShapeDialog.mjs +1 -1
- package/dist/mapboxV2/widgets/LegendDialogLine.cjs +1 -1
- package/dist/mapboxV2/widgets/LegendDialogLine.mjs +1 -1
- package/dist/mapboxV2/widgets/LegendDialogPoint.cjs +1 -1
- package/dist/mapboxV2/widgets/LegendDialogPoint.mjs +1 -1
- package/dist/mapboxV2/widgets/LegendLine.cjs +1 -1
- package/dist/mapboxV2/widgets/LegendLine.mjs +1 -1
- package/dist/mapboxV2/widgets/LegendPoint.cjs +1 -1
- package/dist/mapboxV2/widgets/LegendPoint.mjs +1 -1
- package/dist/mapboxV2/widgets/LegendPopPoint.cjs +1 -1
- package/dist/mapboxV2/widgets/LegendPopPoint.mjs +1 -1
- package/dist/mapboxV2/widgets/LegendShape.cjs +1 -1
- package/dist/mapboxV2/widgets/LegendShape.mjs +1 -1
- package/dist/mapboxV2/widgets/ShapeDialog.cjs +1 -1
- package/dist/mapboxV2/widgets/ShapeDialog.mjs +1483 -1396
- package/dist/mapboxV2.cjs +2 -2
- package/dist/mapboxV2.mjs +653 -736
- package/dist/qy-vue-plugins.css +1 -1
- package/dist/types/mapboxV2/components/mapTopic.vue.d.ts +0 -585
- package/dist/types/mapboxV2/types/map-layer.d.ts +168 -0
- package/dist/types/mapboxV2/utils/geojsonRenderer.d.ts +111 -0
- package/package/mapboxV2/utils.ts +42 -6
- package/package.json +1 -1
- package/dist/chunks/utils-D9WFOos8.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const L=require("vue"),p=require("./constant-CMqVPn7l.js");function x(i,e){let t={marginTop:"-2px"};switch(i){case"solid":case"solid-line":t.borderBottom=`4px solid ${e}`;break;case"dash":case"dotted":case"simple-dash":t.borderBottom=`4px dashed ${e}`;break;case"dot-dash":t.backgroundImage=`linear-gradient(to right, ${e} 25%, rgba(255, 255, 255, 0) 25%, rgba(255, 255, 255, 0) 50%, ${e} 50%, ${e} 75%, rgba(255, 255, 255, 0) 75%)`;break;case"long-dash":t.backgroundImage=`linear-gradient(to right, ${e} 50%, rgba(255, 255, 255, 0) 50%)`;break;case"dot-line":t.backgroundImage=`linear-gradient(to right, ${e} 25%, rgba(255, 255, 255, 0) 10%)`;break;case"complex-pattern":t.backgroundImage=`linear-gradient(to right, ${e} 20%, rgba(255, 255, 255, 0) 20%, rgba(255, 255, 255, 0) 40%, ${e} 40%, ${e} 60%, rgba(255, 255, 255, 0) 60%)`;break;default:t.borderBottom=`4px solid ${e}`;break}return t}function A(i,e){if(i&&typeof i!="string")return i;switch(e){case"symbol":case"geojson":case"species-group":case"sample-group":case"track":case"interest-point":return i?JSON.parse(i||"{}"):p.defaultPointLayerPaintConfig;case"point":return JSON.parse(i||"{}");case"line":return JSON.parse(i||"{}");case"shape":case"shp":case"kml":case"kmz":case"tif":return i?JSON.parse(i||"{}"):p.defaultStyleConfig;default:throw new Error(`Unsupported layer type: ${e}`)}}function $(i){try{return`layer-id-${i.id}`}catch(e){return console.error("Error getting layer ID:",e),`layer-id-${L.useId()}`}}function F(i){try{return`source-id-${i.id}`}catch(e){return console.error("Error getting source ID:",e),`source-id-${L.useId()}`}}function C(i){try{const e=i.layerPaintConfig?JSON.parse(i.layerPaintConfig):p.defaultStyleConfig;if(e&&typeof e=="object"){const t=e,s=Array.isArray(t.symbolConfigList)?t.symbolConfigList:[],f=Array.isArray(t.circleConfigList)?t.circleConfigList:[];!s.length&&f.length&&(t.symbolConfigList=JSON.parse(JSON.stringify(f))),!f.length&&s.length&&(t.circleConfigList=JSON.parse(JSON.stringify(s)))}return e}catch{return p.defaultStyleConfig}}const w=i=>{const e=i.symbolConfigList,t=i.circleConfigList;return Array.isArray(e)&&e.length>0?JSON.parse(JSON.stringify(e)):Array.isArray(t)&&t.length>0?JSON.parse(JSON.stringify(t)):JSON.parse(JSON.stringify(p.defaultStyleConfig.circleConfigList||[]))};function E(i){let e="fill";switch(i.layerType){case"shp":case"kml":case"kmz":if(i.layerShapes){const t=i.layerShapes.split(",").map(s=>s.trim().toLowerCase());t.length===1?t[0]==="point"?e="circle":t[0]==="line"?e="line":e="fill":e="fill"}else e="fill";break;case"line":e="line";break;case"symbol":if(e="circle",i.layerPaintConfig){const t=JSON.parse(i.layerPaintConfig),s=t.symbolConfigList||t.circleConfigList;s&&s?.length>0&&s[0].circleType=="symbol"&&(e="symbol")}break;default:e="fill"}return e}function I(i){try{let e={},t=JSON.parse(JSON.stringify(i.fillColorList));const s=t.find(o=>o.type==="default"),f=t.filter(o=>o.type==="custom");s&&(t=[...f,s]),console.log("[getFillStyle] 排序后的 fillColorList:",t);let n=t.filter(o=>o.type==="custom"?o.key&&o.value:!0);const u=n[n.length-1];if(!u||u.type!=="default")return console.warn("[getFillStyle] 未找到默认配置,使用系统默认颜色"),e["fill-color"]="rgba(103, 194, 58, 0.6)",e["fill-outline-color"]="rgba(103, 194, 58, 1)",e;console.log("[getFillStyle] 默认颜色配置:",u);let r=[];if(n.forEach(o=>{if(o.type=="custom"){let a=-1;r.forEach((l,c)=>{l.key==o.key&&(a=c)}),a>-1?r[a].list.push(o):r.push({key:o.key,list:[o]})}}),console.log("[getFillStyle] fillColorGroupList:",r),r.length>0){let o=u.color;[...r].reverse().forEach(a=>{const l=["match",["to-string",["get",a.key]]];a.list.forEach(c=>{l.push(String(c.value)),l.push(c.color)}),l.push(o),o=l}),e["fill-color"]=o,console.log("[getFillStyle] 使用条件渲染,colorExpression:",o)}else e["fill-color"]=u.color,console.log("[getFillStyle] 使用单一颜色:",u.color);return e["fill-outline-color"]=u.color,console.log("[getFillStyle] 生成 fillStyle 成功:",e),e}catch(e){console.log("[getFillStyle] 生成 fillStyle 失败:",e)}}function J(i){if(!i||!i.showLabel)return null;const e={"text-field":["get",i.labelField||"FID"],"text-size":i.fontSize||14,"text-color":i.fontColor||"#000000","text-font":["Open Sans Regular"],"text-anchor":"center","text-offset":[0,0],"text-allow-overlap":!1,"text-avoid-edges":!0};return console.log("生成labelStyle成功---->",e),e}function N(i){try{let{outlineConfigList:e}=i;if(!e||e.length===0)return console.warn("[getOutLineStyle] outlineConfigList 为空,使用默认样式"),{"line-color":"rgba(103, 194, 58, 1)","line-width":2,"line-dasharray":["literal",[]]};let t=JSON.parse(JSON.stringify(e));const s=t.find(o=>o.type==="default"),f=t.filter(o=>o.type==="custom");s&&(t=[...f,s]);const n=t[t.length-1];if(!n||n.type!=="default")return console.warn("[getOutLineStyle] 未找到默认配置,使用系统默认值"),{"line-color":"rgba(103, 194, 58, 1)","line-width":1};let u={"line-color":n.outlineColor||"rgba(103, 194, 58, 1)","line-width":n.outlineWidth??1};n.lineStyle==="dash"?u["line-dasharray"]=[2,2]:u["line-dasharray"]=["literal",[]];let r=[];if(t.forEach(o=>{if(o.type==="custom"&&o.key&&o.value){let a=-1;r.forEach((l,c)=>{l.key===o.key&&(a=c)}),a>-1?r[a].list.push(o):r.push({key:o.key,list:[o]})}}),r.length>0&&(["line-color","line-width"].forEach(a=>{const l=a==="line-color"?"outlineColor":"outlineWidth";if(r.some(g=>g.list.some(y=>y[l]!==void 0))){const g=["match",["to-string",["get",r[0].key]]];r.forEach(y=>{y.list.forEach(d=>{d.value!==void 0&&d[l]!==void 0&&(g.push(String(d.value)),g.push(d[l]))})}),g.push(s[l]??u[a]),u[a]=g}}),r.some(a=>a.list.some(l=>l.lineStyle!==void 0)))){const a=["match",["to-string",["get",r[0].key]]];r.forEach(l=>{l.list.forEach(c=>{c.value!==void 0&&c.lineStyle&&(a.push(String(c.value)),a.push(c.lineStyle==="dash"?[2,2]:["literal",[]]))})}),a.push(s.lineStyle==="dash"?[2,2]:["literal",[]]),u["line-dasharray"]=a}return u}catch(e){return console.log("生成outlineStyle失败",e),{"line-color":"rgba(103, 194, 58, 1)","line-width":2,"line-dasharray":[]}}}function O(i){let e=w(i),t=JSON.parse(JSON.stringify(e));const s=t.find(l=>l.type==="default"),f=t.filter(l=>l.type==="custom");s&&(t=[...f,s]),console.log("[getCircleStyle] 排序后的 circleConfigList:",t);const n=t[t.length-1],u=n&&(n.renderMode==="color"||n.renderMode==="icon");if(!n||n.type!=="default")return console.warn("[getCircleStyle] 未找到默认配置,使用系统默认值"),{_useNewFormat:!0,_circleConfigList:[{type:"default",renderMode:"color",pointStyle:"地图点.svg",pointTintColor:"rgba(103, 194, 58, 1)",pointSize:10}],"icon-image":"custom-icon-default-地图点-67c23a","icon-size":1};if(console.log("[getCircleStyle] 默认配置:",n),u){const l={_useNewFormat:!0,_circleConfigList:t};l["icon-image"]=[],l["icon-size"]=[];const c=t.filter(g=>g.type==="custom"&&g.value!==""&&g.value!=null);if(c.length>0){const g=c[0].key;let y="string";for(const h of c)if(typeof h.value=="number"){y="number";break}const d=h=>y==="number"?typeof h=="number"?h:Number(h):String(h),m=["match",["get",g]];c.forEach(h=>{let k;if(h.renderMode==="color"){const v=(h.pointTintColor||"rgba(103, 194, 58, 1)").replace(/[^a-zA-Z0-9]/g,"");k=`custom-icon-${h.key}-${(h.pointStyle||"地图点.svg").replace(".svg","")}-${v}`}else k=h.iconImageName||"hiper-map-icon-1.png";m.push(d(h.value)),m.push(k)});let b;if(n.renderMode==="color"){const h=(n.pointTintColor||"#67c23a").replace(/[^a-zA-Z0-9]/g,"");b=`custom-icon-default-${(n.pointStyle||"地图点.svg").replace(".svg","")}-${h}`}else b=n.iconImageName||"hiper-map-icon-1.png";m.push(b),l["icon-image"]=m;const S=["match",["get",g]];c.forEach(h=>{S.push(d(h.value)),S.push((h.pointSize||10)/20)}),S.push((n.pointSize||10)/20),l["icon-size"]=S}else{let g;if(n.renderMode==="color"){const y=(n.pointTintColor||"#67c23a").replace(/[^a-zA-Z0-9]/g,"");g=`custom-icon-default-${(n.pointStyle||"地图点.svg").replace(".svg","")}-${y}`}else g=n.iconImageName||"hiper-map-icon-1.png";l["icon-image"]=g,l["icon-size"]=(n.pointSize||10)/20}return l}const r={"circle-radius":[],"circle-stroke-width":[],"circle-color":[],"circle-stroke-color":[],"icon-image":[]};e=[...e];const o=e[e.length-1];e.splice(e.length-1,1),r["circle-radius"]=[o.circleRadius],r["circle-stroke-width"]=[o.circleStrokeWidth],r["circle-color"]=[o.circleColor],r["circle-stroke-color"]=[o.circleStrokeColor],r["icon-image"]=[o.iconImageUrl||"hiper-map-icon-1.png"];let a=[];return e.forEach(l=>{if(l.type=="custom"){let c=-1;a.forEach((g,y)=>{g.key==l.key&&(c=y)}),c>-1?a[c].list.push(l):a.push({key:l.key,list:[l]})}}),a.forEach(l=>{o.circleType!="symbol"&&(l.list.forEach(c=>{r["circle-radius"].unshift(c.circleRadius),r["circle-radius"].unshift(c.value)}),r["circle-radius"].unshift(["get",l.key]),r["circle-radius"].unshift("match"),l.list.forEach(c=>{r["circle-stroke-width"].unshift(c.circleStrokeWidth),r["circle-stroke-width"].unshift(c.value)}),r["circle-stroke-width"].unshift(["get",l.key]),r["circle-stroke-width"].unshift("match"),l.list.forEach(c=>{r["circle-color"].unshift(c.circleColor),r["circle-color"].unshift(c.value)}),r["circle-color"].unshift(["get",l.key]),r["circle-color"].unshift("match"),l.list.forEach(c=>{r["circle-stroke-color"].unshift(c.circleStrokeColor),r["circle-stroke-color"].unshift(c.value)}),r["circle-stroke-color"].unshift(["get",l.key]),r["circle-stroke-color"].unshift("match")),o.circleType=="symbol"&&(l.list.forEach(c=>{r["icon-image"].unshift(c.iconImageUrl||"hiper-map-icon-1.png"),r["icon-image"].unshift(c.value)}),r["icon-image"].unshift(["get",l.key]),r["icon-image"].unshift("match"))}),e.length==0&&(r["circle-radius"]=r["circle-radius"][0],r["circle-stroke-width"]=r["circle-stroke-width"][0],r["circle-color"]=r["circle-color"][0],r["circle-stroke-color"]=r["circle-stroke-color"][0],r["icon-image"]=r["icon-image"][0]),r}function T(i){let e=w(i);const t={"icon-image":[]},s=e[e.length-1];e=e.slice(0,-1),t["icon-image"]=[s.iconImageUrl||"hiper-map-icon-1.png"];let f=[];return e.forEach(n=>{if(n.type=="custom"){let u=-1;f.forEach((r,o)=>{r.key==n.key&&(u=o)}),u>-1?f[u].list.push(n):f.push({key:n.key,list:[n]})}}),f.forEach(n=>{s.circleType=="symbol"&&(n.list.forEach(u=>{t["icon-image"].unshift(u.iconImageUrl||"hiper-map-icon-1.png"),t["icon-image"].unshift(u.value)}),t["icon-image"].unshift(["get",n.key]),t["icon-image"].unshift("match"))}),e.length==0&&(t["icon-image"]=t["icon-image"][0]),t}function z(i){const e=C(i),t=E(i),s={"fill-color":"rgba(103, 194, 58, 0.6)","fill-opacity":1,"fill-outline-color":"rgba(103, 194, 58, 1)"},f={"line-width":2,"line-color":"rgba(103, 194, 58, 1)"},n={"circle-radius":["interpolate",["linear"],["zoom"],1,6,10,8,22,12],"circle-stroke-width":["interpolate",["linear"],["zoom"],1,2,10,5,22,10],"circle-stroke-color":["interpolate",["linear"],["zoom"],0,"rgba(103, 194, 58, 0.6)",22,"rgba(103, 194, 58, 0.6)"],"circle-stroke-opacity":["interpolate",["linear"],["zoom"],0,1,22,1],"circle-color":"rgba(103, 194, 58, 0.6)"};if(!e)switch(console.warn("当前图层样式配置不存在,使用默认样式,还有执行到这里的情况?"),t){case"fill":return s;case"line":return f;case"circle":return n}switch(t){case"fill":const u=I(e);return u||s;case"line":const r=N(e);return r||f;case"circle":const o=O(e);return o||n;case"symbol":const a=T(e);return a||{"icon-image":"hiper-map-icon-1.png"}}}function M(i){return new Promise((e,t)=>{const s=new FileReader;s.onload=()=>{s.result instanceof ArrayBuffer?e(s.result):t(new Error("Failed to read file as ArrayBuffer"))},s.onerror=t,s.readAsArrayBuffer(i)})}function B(i){const e=i.fileDirectory||{},t=e.ModelTiepoint||[],s=e.ModelPixelScale||[];if(t.length>=6&&s.length>=3){console.log("情况1:使用ModelTiepoint和ModelPixelScale计算边界",t,s);const f=t[3],n=t[4],u=s[0],r=s[1],o=i.getWidth(),a=i.getHeight(),l=f,c=n,g=f+o*u,y=n-a*Math.abs(r);return[l,y,g,c]}else if(e.ModelTransformation){console.log("情况2:使用ModelTransformation矩阵计算边界");const f=e.ModelTransformation;if(f&&f.length>=16){const n=i.getWidth(),u=i.getHeight(),r=f[3],o=f[7],a=r+n*f[0],l=o+u*f[5];return[r,o,a,l]}}else if(e.GeographicTypeGeoKey)return console.warn("Limited geographic information. Using approximated bounds."),[-180,-90,180,90];return console.warn("No geographic reference found. Using default bounds."),[-180,-90,180,90]}function U(i){i=i.replace(/^#/,"");let e=0,t=0,s=0;return i.length===3?(e=parseInt(i.charAt(0)+i.charAt(0),16),t=parseInt(i.charAt(1)+i.charAt(1),16),s=parseInt(i.charAt(2)+i.charAt(2),16)):i.length===6&&(e=parseInt(i.substring(0,2),16),t=parseInt(i.substring(2,4),16),s=parseInt(i.substring(4,6),16)),[e,t,s]}function R(i,e,t){return Math.max(e,Math.min(t,i))}exports.calculateBounds=B;exports.clamp=R;exports.getCircleStyle=O;exports.getFillStyle=I;exports.getLabelStyle=J;exports.getLayerId=$;exports.getLayerStyle=z;exports.getLayerType=E;exports.getLineLegendStyle=x;exports.getOutLineStyle=N;exports.getSourceId=F;exports.hexToRgb=U;exports.parseLayerPaintConfig=A;exports.parseStyleConfig=C;exports.readFileAsArrayBuffer=M;
|
|
@@ -1,40 +1,40 @@
|
|
|
1
|
-
import { useId as
|
|
2
|
-
import { d as
|
|
3
|
-
function
|
|
4
|
-
let
|
|
1
|
+
import { useId as L } from "vue";
|
|
2
|
+
import { d as S, a as E } from "./constant-Bm7_cQCV.js";
|
|
3
|
+
function z(i, e) {
|
|
4
|
+
let t = {
|
|
5
5
|
marginTop: "-2px"
|
|
6
6
|
};
|
|
7
|
-
switch (
|
|
7
|
+
switch (i) {
|
|
8
8
|
case "solid":
|
|
9
9
|
case "solid-line":
|
|
10
|
-
|
|
10
|
+
t.borderBottom = `4px solid ${e}`;
|
|
11
11
|
break;
|
|
12
12
|
case "dash":
|
|
13
13
|
case "dotted":
|
|
14
14
|
case "simple-dash":
|
|
15
|
-
|
|
15
|
+
t.borderBottom = `4px dashed ${e}`;
|
|
16
16
|
break;
|
|
17
17
|
case "dot-dash":
|
|
18
|
-
|
|
18
|
+
t.backgroundImage = `linear-gradient(to right, ${e} 25%, rgba(255, 255, 255, 0) 25%, rgba(255, 255, 255, 0) 50%, ${e} 50%, ${e} 75%, rgba(255, 255, 255, 0) 75%)`;
|
|
19
19
|
break;
|
|
20
20
|
case "long-dash":
|
|
21
|
-
|
|
21
|
+
t.backgroundImage = `linear-gradient(to right, ${e} 50%, rgba(255, 255, 255, 0) 50%)`;
|
|
22
22
|
break;
|
|
23
23
|
case "dot-line":
|
|
24
|
-
|
|
24
|
+
t.backgroundImage = `linear-gradient(to right, ${e} 25%, rgba(255, 255, 255, 0) 10%)`;
|
|
25
25
|
break;
|
|
26
26
|
case "complex-pattern":
|
|
27
|
-
|
|
27
|
+
t.backgroundImage = `linear-gradient(to right, ${e} 20%, rgba(255, 255, 255, 0) 20%, rgba(255, 255, 255, 0) 40%, ${e} 40%, ${e} 60%, rgba(255, 255, 255, 0) 60%)`;
|
|
28
28
|
break;
|
|
29
29
|
default:
|
|
30
|
-
|
|
30
|
+
t.borderBottom = `4px solid ${e}`;
|
|
31
31
|
break;
|
|
32
32
|
}
|
|
33
|
-
return
|
|
33
|
+
return t;
|
|
34
34
|
}
|
|
35
|
-
function
|
|
36
|
-
if (
|
|
37
|
-
return
|
|
35
|
+
function F(i, e) {
|
|
36
|
+
if (i && typeof i != "string")
|
|
37
|
+
return i;
|
|
38
38
|
switch (e) {
|
|
39
39
|
case "symbol":
|
|
40
40
|
// 符号图层
|
|
@@ -46,11 +46,11 @@ function T(t, e) {
|
|
|
46
46
|
case "track":
|
|
47
47
|
// 调查轨迹
|
|
48
48
|
case "interest-point":
|
|
49
|
-
return
|
|
49
|
+
return i ? JSON.parse(i || "{}") : E;
|
|
50
50
|
case "point":
|
|
51
|
-
return JSON.parse(
|
|
51
|
+
return JSON.parse(i || "{}");
|
|
52
52
|
case "line":
|
|
53
|
-
return JSON.parse(
|
|
53
|
+
return JSON.parse(i || "{}");
|
|
54
54
|
case "shape":
|
|
55
55
|
// 形状图层
|
|
56
56
|
case "shp":
|
|
@@ -60,41 +60,50 @@ function T(t, e) {
|
|
|
60
60
|
case "kmz":
|
|
61
61
|
// KMZ 文件图层
|
|
62
62
|
case "tif":
|
|
63
|
-
return
|
|
63
|
+
return i ? JSON.parse(i || "{}") : S;
|
|
64
64
|
default:
|
|
65
65
|
throw new Error(`Unsupported layer type: ${e}`);
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
|
-
function
|
|
68
|
+
function T(i) {
|
|
69
69
|
try {
|
|
70
|
-
return `layer-id-${
|
|
70
|
+
return `layer-id-${i.id}`;
|
|
71
71
|
} catch (e) {
|
|
72
|
-
return console.error("Error getting layer ID:", e), `layer-id-${
|
|
72
|
+
return console.error("Error getting layer ID:", e), `layer-id-${L()}`;
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
|
-
function
|
|
75
|
+
function M(i) {
|
|
76
76
|
try {
|
|
77
|
-
return `source-id-${
|
|
77
|
+
return `source-id-${i.id}`;
|
|
78
78
|
} catch (e) {
|
|
79
|
-
return console.error("Error getting source ID:", e), `source-id-${
|
|
79
|
+
return console.error("Error getting source ID:", e), `source-id-${L()}`;
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
|
-
function
|
|
82
|
+
function N(i) {
|
|
83
83
|
try {
|
|
84
|
-
|
|
84
|
+
const e = i.layerPaintConfig ? JSON.parse(i.layerPaintConfig) : S;
|
|
85
|
+
if (e && typeof e == "object") {
|
|
86
|
+
const t = e, s = Array.isArray(t.symbolConfigList) ? t.symbolConfigList : [], f = Array.isArray(t.circleConfigList) ? t.circleConfigList : [];
|
|
87
|
+
!s.length && f.length && (t.symbolConfigList = JSON.parse(JSON.stringify(f))), !f.length && s.length && (t.circleConfigList = JSON.parse(JSON.stringify(s)));
|
|
88
|
+
}
|
|
89
|
+
return e;
|
|
85
90
|
} catch {
|
|
86
|
-
return
|
|
91
|
+
return S;
|
|
87
92
|
}
|
|
88
93
|
}
|
|
89
|
-
|
|
94
|
+
const C = (i) => {
|
|
95
|
+
const e = i.symbolConfigList, t = i.circleConfigList;
|
|
96
|
+
return Array.isArray(e) && e.length > 0 ? JSON.parse(JSON.stringify(e)) : Array.isArray(t) && t.length > 0 ? JSON.parse(JSON.stringify(t)) : JSON.parse(JSON.stringify(S.circleConfigList || []));
|
|
97
|
+
};
|
|
98
|
+
function I(i) {
|
|
90
99
|
let e = "fill";
|
|
91
|
-
switch (
|
|
100
|
+
switch (i.layerType) {
|
|
92
101
|
case "shp":
|
|
93
102
|
case "kml":
|
|
94
103
|
case "kmz":
|
|
95
|
-
if (
|
|
96
|
-
const
|
|
97
|
-
|
|
104
|
+
if (i.layerShapes) {
|
|
105
|
+
const t = i.layerShapes.split(",").map((s) => s.trim().toLowerCase());
|
|
106
|
+
t.length === 1 ? t[0] === "point" ? e = "circle" : t[0] === "line" ? e = "line" : e = "fill" : e = "fill";
|
|
98
107
|
} else
|
|
99
108
|
e = "fill";
|
|
100
109
|
break;
|
|
@@ -102,9 +111,9 @@ function I(t) {
|
|
|
102
111
|
e = "line";
|
|
103
112
|
break;
|
|
104
113
|
case "symbol":
|
|
105
|
-
if (e = "circle",
|
|
106
|
-
const
|
|
107
|
-
|
|
114
|
+
if (e = "circle", i.layerPaintConfig) {
|
|
115
|
+
const t = JSON.parse(i.layerPaintConfig), s = t.symbolConfigList || t.circleConfigList;
|
|
116
|
+
s && s?.length > 0 && s[0].circleType == "symbol" && (e = "symbol");
|
|
108
117
|
}
|
|
109
118
|
break;
|
|
110
119
|
default:
|
|
@@ -112,12 +121,12 @@ function I(t) {
|
|
|
112
121
|
}
|
|
113
122
|
return e;
|
|
114
123
|
}
|
|
115
|
-
function
|
|
124
|
+
function O(i) {
|
|
116
125
|
try {
|
|
117
|
-
let e = {},
|
|
118
|
-
const
|
|
119
|
-
|
|
120
|
-
let n =
|
|
126
|
+
let e = {}, t = JSON.parse(JSON.stringify(i.fillColorList));
|
|
127
|
+
const s = t.find((o) => o.type === "default"), f = t.filter((o) => o.type === "custom");
|
|
128
|
+
s && (t = [...f, s]), console.log("[getFillStyle] 排序后的 fillColorList:", t);
|
|
129
|
+
let n = t.filter((o) => o.type === "custom" ? o.key && o.value : !0);
|
|
121
130
|
const u = n[n.length - 1];
|
|
122
131
|
if (!u || u.type !== "default")
|
|
123
132
|
return console.warn("[getFillStyle] 未找到默认配置,使用系统默认颜色"), e["fill-color"] = "rgba(103, 194, 58, 0.6)", e["fill-outline-color"] = "rgba(103, 194, 58, 1)", e;
|
|
@@ -126,8 +135,8 @@ function x(t) {
|
|
|
126
135
|
if (n.forEach((o) => {
|
|
127
136
|
if (o.type == "custom") {
|
|
128
137
|
let a = -1;
|
|
129
|
-
r.forEach((l,
|
|
130
|
-
l.key == o.key && (a =
|
|
138
|
+
r.forEach((l, c) => {
|
|
139
|
+
l.key == o.key && (a = c);
|
|
131
140
|
}), a > -1 ? r[a].list.push(o) : r.push({
|
|
132
141
|
key: o.key,
|
|
133
142
|
list: [o]
|
|
@@ -140,8 +149,8 @@ function x(t) {
|
|
|
140
149
|
"match",
|
|
141
150
|
["to-string", ["get", a.key]]
|
|
142
151
|
];
|
|
143
|
-
a.list.forEach((
|
|
144
|
-
l.push(String(
|
|
152
|
+
a.list.forEach((c) => {
|
|
153
|
+
l.push(String(c.value)), l.push(c.color);
|
|
145
154
|
}), l.push(o), o = l;
|
|
146
155
|
}), e["fill-color"] = o, console.log("[getFillStyle] 使用条件渲染,colorExpression:", o);
|
|
147
156
|
} else
|
|
@@ -151,16 +160,16 @@ function x(t) {
|
|
|
151
160
|
console.log("[getFillStyle] 生成 fillStyle 失败:", e);
|
|
152
161
|
}
|
|
153
162
|
}
|
|
154
|
-
function
|
|
155
|
-
if (!
|
|
163
|
+
function B(i) {
|
|
164
|
+
if (!i || !i.showLabel)
|
|
156
165
|
return null;
|
|
157
166
|
const e = {
|
|
158
167
|
// 设置标注文本字段
|
|
159
|
-
"text-field": ["get",
|
|
168
|
+
"text-field": ["get", i.labelField || "FID"],
|
|
160
169
|
// 设置字体大小
|
|
161
|
-
"text-size":
|
|
170
|
+
"text-size": i.fontSize || 14,
|
|
162
171
|
// 设置字体颜色
|
|
163
|
-
"text-color":
|
|
172
|
+
"text-color": i.fontColor || "#000000",
|
|
164
173
|
// 设置字体 - 使用 Mapbox 默认字体
|
|
165
174
|
"text-font": ["Open Sans Regular"],
|
|
166
175
|
// 文本锚点设置为多边形中心
|
|
@@ -174,19 +183,19 @@ function J(t) {
|
|
|
174
183
|
};
|
|
175
184
|
return console.log("生成labelStyle成功---->", e), e;
|
|
176
185
|
}
|
|
177
|
-
function
|
|
186
|
+
function x(i) {
|
|
178
187
|
try {
|
|
179
|
-
let { outlineConfigList: e } =
|
|
188
|
+
let { outlineConfigList: e } = i;
|
|
180
189
|
if (!e || e.length === 0)
|
|
181
190
|
return console.warn("[getOutLineStyle] outlineConfigList 为空,使用默认样式"), {
|
|
182
191
|
"line-color": "rgba(103, 194, 58, 1)",
|
|
183
192
|
"line-width": 2,
|
|
184
193
|
"line-dasharray": ["literal", []]
|
|
185
194
|
};
|
|
186
|
-
let
|
|
187
|
-
const
|
|
188
|
-
|
|
189
|
-
const n =
|
|
195
|
+
let t = JSON.parse(JSON.stringify(e));
|
|
196
|
+
const s = t.find((o) => o.type === "default"), f = t.filter((o) => o.type === "custom");
|
|
197
|
+
s && (t = [...f, s]);
|
|
198
|
+
const n = t[t.length - 1];
|
|
190
199
|
if (!n || n.type !== "default")
|
|
191
200
|
return console.warn("[getOutLineStyle] 未找到默认配置,使用系统默认值"), {
|
|
192
201
|
"line-color": "rgba(103, 194, 58, 1)",
|
|
@@ -198,11 +207,11 @@ function v(t) {
|
|
|
198
207
|
};
|
|
199
208
|
n.lineStyle === "dash" ? u["line-dasharray"] = [2, 2] : u["line-dasharray"] = ["literal", []];
|
|
200
209
|
let r = [];
|
|
201
|
-
if (
|
|
210
|
+
if (t.forEach((o) => {
|
|
202
211
|
if (o.type === "custom" && o.key && o.value) {
|
|
203
212
|
let a = -1;
|
|
204
|
-
r.forEach((l,
|
|
205
|
-
l.key === o.key && (a =
|
|
213
|
+
r.forEach((l, c) => {
|
|
214
|
+
l.key === o.key && (a = c);
|
|
206
215
|
}), a > -1 ? r[a].list.push(o) : r.push({
|
|
207
216
|
key: o.key,
|
|
208
217
|
list: [o]
|
|
@@ -210,16 +219,16 @@ function v(t) {
|
|
|
210
219
|
}
|
|
211
220
|
}), r.length > 0 && (["line-color", "line-width"].forEach((a) => {
|
|
212
221
|
const l = a === "line-color" ? "outlineColor" : "outlineWidth";
|
|
213
|
-
if (r.some((
|
|
214
|
-
const
|
|
222
|
+
if (r.some((g) => g.list.some((d) => d[l] !== void 0))) {
|
|
223
|
+
const g = [
|
|
215
224
|
"match",
|
|
216
225
|
["to-string", ["get", r[0].key]]
|
|
217
226
|
];
|
|
218
227
|
r.forEach((d) => {
|
|
219
|
-
d.list.forEach((
|
|
220
|
-
|
|
228
|
+
d.list.forEach((y) => {
|
|
229
|
+
y.value !== void 0 && y[l] !== void 0 && (g.push(String(y.value)), g.push(y[l]));
|
|
221
230
|
});
|
|
222
|
-
}),
|
|
231
|
+
}), g.push(s[l] ?? u[a]), u[a] = g;
|
|
223
232
|
}
|
|
224
233
|
}), r.some((a) => a.list.some((l) => l.lineStyle !== void 0)))) {
|
|
225
234
|
const a = [
|
|
@@ -227,10 +236,10 @@ function v(t) {
|
|
|
227
236
|
["to-string", ["get", r[0].key]]
|
|
228
237
|
];
|
|
229
238
|
r.forEach((l) => {
|
|
230
|
-
l.list.forEach((
|
|
231
|
-
|
|
239
|
+
l.list.forEach((c) => {
|
|
240
|
+
c.value !== void 0 && c.lineStyle && (a.push(String(c.value)), a.push(c.lineStyle === "dash" ? [2, 2] : ["literal", []]));
|
|
232
241
|
});
|
|
233
|
-
}), a.push(
|
|
242
|
+
}), a.push(s.lineStyle === "dash" ? [2, 2] : ["literal", []]), u["line-dasharray"] = a;
|
|
234
243
|
}
|
|
235
244
|
return u;
|
|
236
245
|
} catch (e) {
|
|
@@ -241,11 +250,11 @@ function v(t) {
|
|
|
241
250
|
};
|
|
242
251
|
}
|
|
243
252
|
}
|
|
244
|
-
function
|
|
245
|
-
let
|
|
246
|
-
const
|
|
247
|
-
|
|
248
|
-
const n =
|
|
253
|
+
function v(i) {
|
|
254
|
+
let e = C(i), t = JSON.parse(JSON.stringify(e));
|
|
255
|
+
const s = t.find((l) => l.type === "default"), f = t.filter((l) => l.type === "custom");
|
|
256
|
+
s && (t = [...f, s]), console.log("[getCircleStyle] 排序后的 circleConfigList:", t);
|
|
257
|
+
const n = t[t.length - 1], u = n && (n.renderMode === "color" || n.renderMode === "icon");
|
|
249
258
|
if (!n || n.type !== "default")
|
|
250
259
|
return console.warn("[getCircleStyle] 未找到默认配置,使用系统默认值"), {
|
|
251
260
|
_useNewFormat: !0,
|
|
@@ -265,48 +274,48 @@ function N(t) {
|
|
|
265
274
|
const l = {
|
|
266
275
|
_useNewFormat: !0,
|
|
267
276
|
// 标记使用了新格式
|
|
268
|
-
_circleConfigList:
|
|
277
|
+
_circleConfigList: t
|
|
269
278
|
// 保存完整配置列表供后续使用
|
|
270
279
|
};
|
|
271
280
|
l["icon-image"] = [], l["icon-size"] = [];
|
|
272
|
-
const
|
|
273
|
-
if (
|
|
274
|
-
const
|
|
281
|
+
const c = t.filter((g) => g.type === "custom" && g.value !== "" && g.value != null);
|
|
282
|
+
if (c.length > 0) {
|
|
283
|
+
const g = c[0].key;
|
|
275
284
|
let d = "string";
|
|
276
|
-
for (const
|
|
277
|
-
if (typeof
|
|
285
|
+
for (const h of c)
|
|
286
|
+
if (typeof h.value == "number") {
|
|
278
287
|
d = "number";
|
|
279
288
|
break;
|
|
280
289
|
}
|
|
281
|
-
const
|
|
282
|
-
|
|
290
|
+
const y = (h) => d === "number" ? typeof h == "number" ? h : Number(h) : String(h), p = ["match", ["get", g]];
|
|
291
|
+
c.forEach((h) => {
|
|
283
292
|
let k;
|
|
284
|
-
if (
|
|
285
|
-
const
|
|
286
|
-
k = `custom-icon-${
|
|
293
|
+
if (h.renderMode === "color") {
|
|
294
|
+
const w = (h.pointTintColor || "rgba(103, 194, 58, 1)").replace(/[^a-zA-Z0-9]/g, "");
|
|
295
|
+
k = `custom-icon-${h.key}-${(h.pointStyle || "地图点.svg").replace(".svg", "")}-${w}`;
|
|
287
296
|
} else
|
|
288
|
-
k =
|
|
289
|
-
|
|
297
|
+
k = h.iconImageName || "hiper-map-icon-1.png";
|
|
298
|
+
p.push(y(h.value)), p.push(k);
|
|
290
299
|
});
|
|
291
|
-
let
|
|
300
|
+
let b;
|
|
292
301
|
if (n.renderMode === "color") {
|
|
293
|
-
const
|
|
294
|
-
|
|
302
|
+
const h = (n.pointTintColor || "#67c23a").replace(/[^a-zA-Z0-9]/g, "");
|
|
303
|
+
b = `custom-icon-default-${(n.pointStyle || "地图点.svg").replace(".svg", "")}-${h}`;
|
|
295
304
|
} else
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
const m = ["match", ["get",
|
|
299
|
-
|
|
300
|
-
m.push(
|
|
305
|
+
b = n.iconImageName || "hiper-map-icon-1.png";
|
|
306
|
+
p.push(b), l["icon-image"] = p;
|
|
307
|
+
const m = ["match", ["get", g]];
|
|
308
|
+
c.forEach((h) => {
|
|
309
|
+
m.push(y(h.value)), m.push((h.pointSize || 10) / 20);
|
|
301
310
|
}), m.push((n.pointSize || 10) / 20), l["icon-size"] = m;
|
|
302
311
|
} else {
|
|
303
|
-
let
|
|
312
|
+
let g;
|
|
304
313
|
if (n.renderMode === "color") {
|
|
305
314
|
const d = (n.pointTintColor || "#67c23a").replace(/[^a-zA-Z0-9]/g, "");
|
|
306
|
-
|
|
315
|
+
g = `custom-icon-default-${(n.pointStyle || "地图点.svg").replace(".svg", "")}-${d}`;
|
|
307
316
|
} else
|
|
308
|
-
|
|
309
|
-
l["icon-image"] =
|
|
317
|
+
g = n.iconImageName || "hiper-map-icon-1.png";
|
|
318
|
+
l["icon-image"] = g, l["icon-size"] = (n.pointSize || 10) / 20;
|
|
310
319
|
}
|
|
311
320
|
return l;
|
|
312
321
|
}
|
|
@@ -325,41 +334,41 @@ function N(t) {
|
|
|
325
334
|
let a = [];
|
|
326
335
|
return e.forEach((l) => {
|
|
327
336
|
if (l.type == "custom") {
|
|
328
|
-
let
|
|
329
|
-
a.forEach((
|
|
330
|
-
|
|
331
|
-
}),
|
|
337
|
+
let c = -1;
|
|
338
|
+
a.forEach((g, d) => {
|
|
339
|
+
g.key == l.key && (c = d);
|
|
340
|
+
}), c > -1 ? a[c].list.push(l) : a.push({
|
|
332
341
|
key: l.key,
|
|
333
342
|
list: [l]
|
|
334
343
|
});
|
|
335
344
|
}
|
|
336
345
|
}), a.forEach((l) => {
|
|
337
|
-
o.circleType != "symbol" && (l.list.forEach((
|
|
338
|
-
r["circle-radius"].unshift(
|
|
339
|
-
}), r["circle-radius"].unshift(["get", l.key]), r["circle-radius"].unshift("match"), l.list.forEach((
|
|
340
|
-
r["circle-stroke-width"].unshift(
|
|
346
|
+
o.circleType != "symbol" && (l.list.forEach((c) => {
|
|
347
|
+
r["circle-radius"].unshift(c.circleRadius), r["circle-radius"].unshift(c.value);
|
|
348
|
+
}), r["circle-radius"].unshift(["get", l.key]), r["circle-radius"].unshift("match"), l.list.forEach((c) => {
|
|
349
|
+
r["circle-stroke-width"].unshift(c.circleStrokeWidth), r["circle-stroke-width"].unshift(c.value);
|
|
341
350
|
}), r["circle-stroke-width"].unshift([
|
|
342
351
|
"get",
|
|
343
352
|
l.key
|
|
344
|
-
]), r["circle-stroke-width"].unshift("match"), l.list.forEach((
|
|
345
|
-
r["circle-color"].unshift(
|
|
346
|
-
}), r["circle-color"].unshift(["get", l.key]), r["circle-color"].unshift("match"), l.list.forEach((
|
|
347
|
-
r["circle-stroke-color"].unshift(
|
|
353
|
+
]), r["circle-stroke-width"].unshift("match"), l.list.forEach((c) => {
|
|
354
|
+
r["circle-color"].unshift(c.circleColor), r["circle-color"].unshift(c.value);
|
|
355
|
+
}), r["circle-color"].unshift(["get", l.key]), r["circle-color"].unshift("match"), l.list.forEach((c) => {
|
|
356
|
+
r["circle-stroke-color"].unshift(c.circleStrokeColor), r["circle-stroke-color"].unshift(c.value);
|
|
348
357
|
}), r["circle-stroke-color"].unshift([
|
|
349
358
|
"get",
|
|
350
359
|
l.key
|
|
351
|
-
]), r["circle-stroke-color"].unshift("match")), o.circleType == "symbol" && (l.list.forEach((
|
|
352
|
-
r["icon-image"].unshift(
|
|
360
|
+
]), r["circle-stroke-color"].unshift("match")), o.circleType == "symbol" && (l.list.forEach((c) => {
|
|
361
|
+
r["icon-image"].unshift(c.iconImageUrl || "hiper-map-icon-1.png"), r["icon-image"].unshift(c.value);
|
|
353
362
|
}), r["icon-image"].unshift(["get", l.key]), r["icon-image"].unshift("match"));
|
|
354
363
|
}), e.length == 0 && (r["circle-radius"] = r["circle-radius"][0], r["circle-stroke-width"] = r["circle-stroke-width"][0], r["circle-color"] = r["circle-color"][0], r["circle-stroke-color"] = r["circle-stroke-color"][0], r["icon-image"] = r["icon-image"][0]), r;
|
|
355
364
|
}
|
|
356
|
-
function
|
|
357
|
-
let
|
|
358
|
-
const
|
|
365
|
+
function A(i) {
|
|
366
|
+
let e = C(i);
|
|
367
|
+
const t = {
|
|
359
368
|
"icon-image": []
|
|
360
|
-
},
|
|
361
|
-
e.
|
|
362
|
-
|
|
369
|
+
}, s = e[e.length - 1];
|
|
370
|
+
e = e.slice(0, -1), t["icon-image"] = [
|
|
371
|
+
s.iconImageUrl || "hiper-map-icon-1.png"
|
|
363
372
|
];
|
|
364
373
|
let f = [];
|
|
365
374
|
return e.forEach((n) => {
|
|
@@ -373,13 +382,13 @@ function $(t) {
|
|
|
373
382
|
});
|
|
374
383
|
}
|
|
375
384
|
}), f.forEach((n) => {
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
}),
|
|
379
|
-
}), e.length == 0 && (
|
|
385
|
+
s.circleType == "symbol" && (n.list.forEach((u) => {
|
|
386
|
+
t["icon-image"].unshift(u.iconImageUrl || "hiper-map-icon-1.png"), t["icon-image"].unshift(u.value);
|
|
387
|
+
}), t["icon-image"].unshift(["get", n.key]), t["icon-image"].unshift("match"));
|
|
388
|
+
}), e.length == 0 && (t["icon-image"] = t["icon-image"][0]), t;
|
|
380
389
|
}
|
|
381
|
-
function
|
|
382
|
-
const e =
|
|
390
|
+
function U(i) {
|
|
391
|
+
const e = N(i), t = I(i), s = {
|
|
383
392
|
"fill-color": "rgba(103, 194, 58, 0.6)",
|
|
384
393
|
// 默认填充颜色为浅绿色,半透明
|
|
385
394
|
"fill-opacity": 1,
|
|
@@ -422,79 +431,79 @@ function B(t) {
|
|
|
422
431
|
// 默认圆点颜色为浅绿色,半透明
|
|
423
432
|
};
|
|
424
433
|
if (!e)
|
|
425
|
-
switch (console.warn("当前图层样式配置不存在,使用默认样式,还有执行到这里的情况?"),
|
|
434
|
+
switch (console.warn("当前图层样式配置不存在,使用默认样式,还有执行到这里的情况?"), t) {
|
|
426
435
|
case "fill":
|
|
427
|
-
return
|
|
436
|
+
return s;
|
|
428
437
|
case "line":
|
|
429
438
|
return f;
|
|
430
439
|
case "circle":
|
|
431
440
|
return n;
|
|
432
441
|
}
|
|
433
|
-
switch (
|
|
442
|
+
switch (t) {
|
|
434
443
|
case "fill":
|
|
435
|
-
const u =
|
|
436
|
-
return u ||
|
|
444
|
+
const u = O(e);
|
|
445
|
+
return u || s;
|
|
437
446
|
case "line":
|
|
438
|
-
const r =
|
|
447
|
+
const r = x(e);
|
|
439
448
|
return r || f;
|
|
440
449
|
case "circle":
|
|
441
|
-
const o =
|
|
450
|
+
const o = v(e);
|
|
442
451
|
return o || n;
|
|
443
452
|
case "symbol":
|
|
444
|
-
const a =
|
|
453
|
+
const a = A(e);
|
|
445
454
|
return a || {
|
|
446
455
|
"icon-image": "hiper-map-icon-1.png"
|
|
447
456
|
// 默认图标图片
|
|
448
457
|
};
|
|
449
458
|
}
|
|
450
459
|
}
|
|
451
|
-
function
|
|
452
|
-
return new Promise((e,
|
|
453
|
-
const
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
},
|
|
460
|
+
function W(i) {
|
|
461
|
+
return new Promise((e, t) => {
|
|
462
|
+
const s = new FileReader();
|
|
463
|
+
s.onload = () => {
|
|
464
|
+
s.result instanceof ArrayBuffer ? e(s.result) : t(new Error("Failed to read file as ArrayBuffer"));
|
|
465
|
+
}, s.onerror = t, s.readAsArrayBuffer(i);
|
|
457
466
|
});
|
|
458
467
|
}
|
|
459
|
-
function
|
|
460
|
-
const e =
|
|
461
|
-
if (
|
|
462
|
-
console.log("情况1:使用ModelTiepoint和ModelPixelScale计算边界",
|
|
463
|
-
const f =
|
|
464
|
-
return [l, d,
|
|
468
|
+
function D(i) {
|
|
469
|
+
const e = i.fileDirectory || {}, t = e.ModelTiepoint || [], s = e.ModelPixelScale || [];
|
|
470
|
+
if (t.length >= 6 && s.length >= 3) {
|
|
471
|
+
console.log("情况1:使用ModelTiepoint和ModelPixelScale计算边界", t, s);
|
|
472
|
+
const f = t[3], n = t[4], u = s[0], r = s[1], o = i.getWidth(), a = i.getHeight(), l = f, c = n, g = f + o * u, d = n - a * Math.abs(r);
|
|
473
|
+
return [l, d, g, c];
|
|
465
474
|
} else if (e.ModelTransformation) {
|
|
466
475
|
console.log("情况2:使用ModelTransformation矩阵计算边界");
|
|
467
476
|
const f = e.ModelTransformation;
|
|
468
477
|
if (f && f.length >= 16) {
|
|
469
|
-
const n =
|
|
478
|
+
const n = i.getWidth(), u = i.getHeight(), r = f[3], o = f[7], a = r + n * f[0], l = o + u * f[5];
|
|
470
479
|
return [r, o, a, l];
|
|
471
480
|
}
|
|
472
481
|
} else if (e.GeographicTypeGeoKey)
|
|
473
482
|
return console.warn("Limited geographic information. Using approximated bounds."), [-180, -90, 180, 90];
|
|
474
483
|
return console.warn("No geographic reference found. Using default bounds."), [-180, -90, 180, 90];
|
|
475
484
|
}
|
|
476
|
-
function
|
|
477
|
-
|
|
478
|
-
let e = 0,
|
|
479
|
-
return
|
|
485
|
+
function R(i) {
|
|
486
|
+
i = i.replace(/^#/, "");
|
|
487
|
+
let e = 0, t = 0, s = 0;
|
|
488
|
+
return i.length === 3 ? (e = parseInt(i.charAt(0) + i.charAt(0), 16), t = parseInt(i.charAt(1) + i.charAt(1), 16), s = parseInt(i.charAt(2) + i.charAt(2), 16)) : i.length === 6 && (e = parseInt(i.substring(0, 2), 16), t = parseInt(i.substring(2, 4), 16), s = parseInt(i.substring(4, 6), 16)), [e, t, s];
|
|
480
489
|
}
|
|
481
|
-
function
|
|
482
|
-
return Math.max(e, Math.min(
|
|
490
|
+
function P(i, e, t) {
|
|
491
|
+
return Math.max(e, Math.min(t, i));
|
|
483
492
|
}
|
|
484
493
|
export {
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
494
|
+
P as a,
|
|
495
|
+
T as b,
|
|
496
|
+
D as c,
|
|
488
497
|
I as d,
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
498
|
+
O as e,
|
|
499
|
+
x as f,
|
|
500
|
+
z as g,
|
|
501
|
+
R as h,
|
|
502
|
+
U as i,
|
|
503
|
+
B as j,
|
|
504
|
+
M as k,
|
|
505
|
+
N as l,
|
|
506
|
+
v as m,
|
|
507
|
+
F as p,
|
|
508
|
+
W as r
|
|
500
509
|
};
|