提交 3d2b4ba2 编写于 作者: Q qiang

chore: build h5

上级 ec5088f7
...@@ -8190,6 +8190,40 @@ var MapMarker = /* @__PURE__ */ defineSystemComponent({ ...@@ -8190,6 +8190,40 @@ var MapMarker = /* @__PURE__ */ defineSystemComponent({
}; };
} }
}); });
function hexToRgba(hex) {
if (!hex) {
return {
r: 0,
g: 0,
b: 0,
a: 0
};
}
let tmpHex = hex.slice(1);
const tmpHexLen = tmpHex.length;
if (![3, 4, 6, 8].includes(tmpHexLen)) {
return {
r: 0,
g: 0,
b: 0,
a: 0
};
}
if (tmpHexLen === 3 || tmpHexLen === 4) {
tmpHex = tmpHex.replace(/(\w{1})/g, "$1$1");
}
let [sr, sg, sb, sa] = tmpHex.match(/(\w{2})/g);
const r = parseInt(sr, 16), g2 = parseInt(sg, 16), b = parseInt(sb, 16);
if (!sa) {
return { r, g: g2, b, a: 1 };
}
return {
r,
g: g2,
b,
a: (`0x100${sa}` - 65536) / 255
};
}
const props$6 = { const props$6 = {
points: { points: {
type: Array, type: Array,
...@@ -8260,25 +8294,48 @@ var MapPolyline = /* @__PURE__ */ defineSystemComponent({ ...@@ -8260,25 +8294,48 @@ var MapPolyline = /* @__PURE__ */ defineSystemComponent({
path.push(new maps.LatLng(point.latitude, point.longitude)); path.push(new maps.LatLng(point.latitude, point.longitude));
}); });
const strokeWeight = Number(option.width) || 1; const strokeWeight = Number(option.width) || 1;
polyline = new maps.Polyline({ const {
r: sr,
g: sg,
b: sb,
a: sa
} = hexToRgba(option.color);
const {
r: br,
g: bg,
b: bb,
a: ba
} = hexToRgba(option.borderColor);
const polylineOptions = {
map, map,
clickable: false, clickable: false,
path, path,
strokeWeight, strokeWeight,
strokeColor: option.color || void 0, strokeColor: option.color || void 0,
strokeDashStyle: option.dottedLine ? "dash" : "solid" strokeDashStyle: option.dottedLine ? "dash" : "solid"
}); };
const borderWidth = Number(option.borderWidth) || 0; const borderWidth = Number(option.borderWidth) || 0;
const polylineBorderOptions = {
map,
clickable: false,
path,
strokeWeight: strokeWeight + borderWidth * 2,
strokeColor: option.borderColor || void 0,
strokeDashStyle: option.dottedLine ? "dash" : "solid"
};
if ("Color" in maps) {
polylineOptions.strokeColor = new maps.Color(sr, sg, sb, sa);
polylineBorderOptions.strokeColor = new maps.Color(br, bg, bb, ba);
} else {
polylineOptions.strokeColor = `rgb(${sr}, ${sg}, ${sb})`;
polylineOptions.strokeOpacity = sa;
polylineBorderOptions.strokeColor = `rgb(${br}, ${bg}, ${bb})`;
polylineBorderOptions.strokeOpacity = ba;
}
if (borderWidth) { if (borderWidth) {
polylineBorder = new maps.Polyline({ polylineBorder = new maps.Polyline(polylineBorderOptions);
map,
clickable: false,
path,
strokeWeight: strokeWeight + borderWidth * 2,
strokeColor: option.borderColor || void 0,
strokeDashStyle: option.dottedLine ? "dash" : "solid"
});
} }
polyline = new maps.Polyline(polylineOptions);
} }
addPolyline(props2); addPolyline(props2);
vue.watch(props2, updatePolyline); vue.watch(props2, updatePolyline);
...@@ -8299,11 +8356,11 @@ const props$5 = { ...@@ -8299,11 +8356,11 @@ const props$5 = {
}, },
color: { color: {
type: String, type: String,
default: "" default: "#000000"
}, },
fillColor: { fillColor: {
type: String, type: String,
default: "" default: "#00000000"
}, },
radius: { radius: {
type: [Number, String], type: [Number, String],
...@@ -8336,27 +8393,36 @@ var MapCircle = /* @__PURE__ */ defineSystemComponent({ ...@@ -8336,27 +8393,36 @@ var MapCircle = /* @__PURE__ */ defineSystemComponent({
} }
function addCircle(option) { function addCircle(option) {
const center = new maps.LatLng(option.latitude, option.longitude); const center = new maps.LatLng(option.latitude, option.longitude);
function getColor(color) { const circleOptions = {
const c = color && color.match(/#[0-9A-Fa-f]{6}([0-9A-Fa-f]{2})?/);
if ("Color" in maps) {
if (c && c.length) {
return maps.Color.fromHex(c[0], Number("0x" + c[1] || 255) / 255).toRGBA();
} else {
return void 0;
}
}
return color;
}
circle = new maps.Circle({
map, map,
center, center,
clickable: false, clickable: false,
radius: option.radius, radius: option.radius,
strokeWeight: Number(option.strokeWidth) || 1, strokeWeight: Number(option.strokeWidth) || 1,
fillColor: getColor(option.fillColor) || getColor("#00000001"),
strokeColor: getColor(option.color) || "#000000",
strokeDashStyle: "solid" strokeDashStyle: "solid"
}); };
const {
r: fr,
g: fg,
b: fb,
a: fa
} = hexToRgba(option.fillColor);
const {
r: sr,
g: sg,
b: sb,
a: sa
} = hexToRgba(option.color);
if ("Color" in maps) {
circleOptions.fillColor = new maps.Color(fr, fg, fb, fa);
circleOptions.strokeColor = new maps.Color(sr, sg, sb, sa);
} else {
circleOptions.fillColor = `rgb(${fr}, ${fg}, ${fb})`;
circleOptions.fillOpacity = fa;
circleOptions.strokeColor = `rgb(${sr}, ${sg}, ${sb})`;
circleOptions.strokeOpacity = sa;
}
circle = new maps.Circle(circleOptions);
} }
addCircle(props2); addCircle(props2);
vue.watch(props2, updateCircle); vue.watch(props2, updateCircle);
...@@ -8488,40 +8554,6 @@ var props$3 = { ...@@ -8488,40 +8554,6 @@ var props$3 = {
default: 0 default: 0
} }
}; };
function hexToRgba(hex) {
if (!hex) {
return {
r: 0,
g: 0,
b: 0,
a: 0
};
}
let tmpHex = hex.slice(1);
const tmpHexLen = tmpHex.length;
if (![3, 4, 6, 8].includes(tmpHexLen)) {
return {
r: 0,
g: 0,
b: 0,
a: 0
};
}
if (tmpHexLen === 3 || tmpHexLen === 4) {
tmpHex = tmpHex.replace(/(\w{1})/g, "$1$1");
}
let [sr, sg, sb, sa] = tmpHex.match(/(\w{2})/g);
const r = parseInt(sr, 16), g2 = parseInt(sg, 16), b = parseInt(sb, 16);
if (!sa) {
return { r, g: g2, b, a: 1 };
}
return {
r,
g: g2,
b,
a: (`0x100${sa}` - 65536) / 255
};
}
var MapPolygon = /* @__PURE__ */ defineSystemComponent({ var MapPolygon = /* @__PURE__ */ defineSystemComponent({
name: "MapPolygon", name: "MapPolygon",
props: props$3, props: props$3,
......
...@@ -15814,6 +15814,40 @@ var MapMarker = /* @__PURE__ */ defineSystemComponent({ ...@@ -15814,6 +15814,40 @@ var MapMarker = /* @__PURE__ */ defineSystemComponent({
}; };
} }
}); });
function hexToRgba(hex) {
if (!hex) {
return {
r: 0,
g: 0,
b: 0,
a: 0
};
}
let tmpHex = hex.slice(1);
const tmpHexLen = tmpHex.length;
if (![3, 4, 6, 8].includes(tmpHexLen)) {
return {
r: 0,
g: 0,
b: 0,
a: 0
};
}
if (tmpHexLen === 3 || tmpHexLen === 4) {
tmpHex = tmpHex.replace(/(\w{1})/g, "$1$1");
}
let [sr, sg, sb, sa] = tmpHex.match(/(\w{2})/g);
const r = parseInt(sr, 16), g2 = parseInt(sg, 16), b = parseInt(sb, 16);
if (!sa) {
return { r, g: g2, b, a: 1 };
}
return {
r,
g: g2,
b,
a: (`0x100${sa}` - 65536) / 255
};
}
const props$d = { const props$d = {
points: { points: {
type: Array, type: Array,
...@@ -15884,25 +15918,48 @@ var MapPolyline = /* @__PURE__ */ defineSystemComponent({ ...@@ -15884,25 +15918,48 @@ var MapPolyline = /* @__PURE__ */ defineSystemComponent({
path.push(new maps2.LatLng(point.latitude, point.longitude)); path.push(new maps2.LatLng(point.latitude, point.longitude));
}); });
const strokeWeight = Number(option.width) || 1; const strokeWeight = Number(option.width) || 1;
polyline = new maps2.Polyline({ const {
r: sr,
g: sg,
b: sb,
a: sa
} = hexToRgba(option.color);
const {
r: br,
g: bg,
b: bb,
a: ba
} = hexToRgba(option.borderColor);
const polylineOptions = {
map, map,
clickable: false, clickable: false,
path, path,
strokeWeight, strokeWeight,
strokeColor: option.color || void 0, strokeColor: option.color || void 0,
strokeDashStyle: option.dottedLine ? "dash" : "solid" strokeDashStyle: option.dottedLine ? "dash" : "solid"
}); };
const borderWidth = Number(option.borderWidth) || 0; const borderWidth = Number(option.borderWidth) || 0;
const polylineBorderOptions = {
map,
clickable: false,
path,
strokeWeight: strokeWeight + borderWidth * 2,
strokeColor: option.borderColor || void 0,
strokeDashStyle: option.dottedLine ? "dash" : "solid"
};
if ("Color" in maps2) {
polylineOptions.strokeColor = new maps2.Color(sr, sg, sb, sa);
polylineBorderOptions.strokeColor = new maps2.Color(br, bg, bb, ba);
} else {
polylineOptions.strokeColor = `rgb(${sr}, ${sg}, ${sb})`;
polylineOptions.strokeOpacity = sa;
polylineBorderOptions.strokeColor = `rgb(${br}, ${bg}, ${bb})`;
polylineBorderOptions.strokeOpacity = ba;
}
if (borderWidth) { if (borderWidth) {
polylineBorder = new maps2.Polyline({ polylineBorder = new maps2.Polyline(polylineBorderOptions);
map,
clickable: false,
path,
strokeWeight: strokeWeight + borderWidth * 2,
strokeColor: option.borderColor || void 0,
strokeDashStyle: option.dottedLine ? "dash" : "solid"
});
} }
polyline = new maps2.Polyline(polylineOptions);
} }
addPolyline(props2); addPolyline(props2);
watch(props2, updatePolyline); watch(props2, updatePolyline);
...@@ -15924,11 +15981,11 @@ const props$c = { ...@@ -15924,11 +15981,11 @@ const props$c = {
}, },
color: { color: {
type: String, type: String,
default: "" default: "#000000"
}, },
fillColor: { fillColor: {
type: String, type: String,
default: "" default: "#00000000"
}, },
radius: { radius: {
type: [Number, String], type: [Number, String],
...@@ -15961,27 +16018,36 @@ var MapCircle = /* @__PURE__ */ defineSystemComponent({ ...@@ -15961,27 +16018,36 @@ var MapCircle = /* @__PURE__ */ defineSystemComponent({
} }
function addCircle(option) { function addCircle(option) {
const center = new maps2.LatLng(option.latitude, option.longitude); const center = new maps2.LatLng(option.latitude, option.longitude);
function getColor(color) { const circleOptions = {
const c = color && color.match(/#[0-9A-Fa-f]{6}([0-9A-Fa-f]{2})?/);
if ("Color" in maps2) {
if (c && c.length) {
return maps2.Color.fromHex(c[0], Number("0x" + c[1] || 255) / 255).toRGBA();
} else {
return void 0;
}
}
return color;
}
circle = new maps2.Circle({
map, map,
center, center,
clickable: false, clickable: false,
radius: option.radius, radius: option.radius,
strokeWeight: Number(option.strokeWidth) || 1, strokeWeight: Number(option.strokeWidth) || 1,
fillColor: getColor(option.fillColor) || getColor("#00000001"),
strokeColor: getColor(option.color) || "#000000",
strokeDashStyle: "solid" strokeDashStyle: "solid"
}); };
const {
r: fr,
g: fg,
b: fb,
a: fa
} = hexToRgba(option.fillColor);
const {
r: sr,
g: sg,
b: sb,
a: sa
} = hexToRgba(option.color);
if ("Color" in maps2) {
circleOptions.fillColor = new maps2.Color(fr, fg, fb, fa);
circleOptions.strokeColor = new maps2.Color(sr, sg, sb, sa);
} else {
circleOptions.fillColor = `rgb(${fr}, ${fg}, ${fb})`;
circleOptions.fillOpacity = fa;
circleOptions.strokeColor = `rgb(${sr}, ${sg}, ${sb})`;
circleOptions.strokeOpacity = sa;
}
circle = new maps2.Circle(circleOptions);
} }
addCircle(props2); addCircle(props2);
watch(props2, updateCircle); watch(props2, updateCircle);
...@@ -20214,40 +20280,6 @@ var props$3 = { ...@@ -20214,40 +20280,6 @@ var props$3 = {
default: 0 default: 0
} }
}; };
function hexToRgba(hex) {
if (!hex) {
return {
r: 0,
g: 0,
b: 0,
a: 0
};
}
let tmpHex = hex.slice(1);
const tmpHexLen = tmpHex.length;
if (![3, 4, 6, 8].includes(tmpHexLen)) {
return {
r: 0,
g: 0,
b: 0,
a: 0
};
}
if (tmpHexLen === 3 || tmpHexLen === 4) {
tmpHex = tmpHex.replace(/(\w{1})/g, "$1$1");
}
let [sr, sg, sb, sa] = tmpHex.match(/(\w{2})/g);
const r = parseInt(sr, 16), g2 = parseInt(sg, 16), b = parseInt(sb, 16);
if (!sa) {
return { r, g: g2, b, a: 1 };
}
return {
r,
g: g2,
b,
a: (`0x100${sa}` - 65536) / 255
};
}
var MapPolygon = /* @__PURE__ */ defineSystemComponent({ var MapPolygon = /* @__PURE__ */ defineSystemComponent({
name: "MapPolygon", name: "MapPolygon",
props: props$3, props: props$3,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册