This commit is contained in:
13684185576
2025-07-21 21:17:45 +08:00
parent 30d5a663ef
commit ad1b52a960
407 changed files with 87 additions and 125398 deletions

View File

@ -1,8 +1,7 @@
<template> <template>
<div :id="mapid" class="map"></div> <div :id="mapid" class="map"></div>
<div class="changeMap_box" v-if="props.isShow"> <div class="changeMap_box" v-if="props.isShow">
<el-switch v-model="conditionRoute" @change="handleSwitch" active-text="打开路况" inactive-text="关闭路况" <el-switch v-model="conditionRoute" @change="handleSwitch" active-text="打开路况" inactive-text="关闭路况" style="--el-switch-color:#13ce66;--el-switch-off-color:#ff4949;" />
style="--el-switch-color: #13ce66; --el-switch-off-color: #ff4949" />
<!-- <el-carousel type="card" height="75px" :autoplay="false" indicator-position="none" :initial-index="3" @change="onMapImageChange"> <!-- <el-carousel type="card" height="75px" :autoplay="false" indicator-position="none" :initial-index="3" @change="onMapImageChange">
<el-carousel-item> <el-carousel-item>
<div class="mapImageItem"> <div class="mapImageItem">
@ -75,7 +74,7 @@ const props = defineProps({
}); });
try { try {
const userInfo = getItem("deptId")[0].deptCode; const userInfo = getItem("deptId")[0].deptCode;
} catch (error) { } } catch (error) {}
let map; let map;
let mapLayer; let mapLayer;
let mapLayer1; let mapLayer1;
@ -89,32 +88,27 @@ onMounted(() => {
map = new EliMap({ map = new EliMap({
id: props.mapid, id: props.mapid,
crs: "EPSG:4490", crs: "EPSG:3857",
style: { style: {
glyphs: "./fonts/{fontstack}/{range}.pbf", glyphs: "./fonts/{fontstack}/{range}.pbf",
center: [94.36057012, 29.64276831], center: [94.36,29.65],
zoom: 15 zoom: 10
}, },
minZoom: 7, transformRequest: (url) => {
maxZoom: 18, if (url.indexOf("TileMatrix=") != -1) {
const arr = url.split("TileMatrix=");
const arr1 = arr[1].split("&");
const nurl = `${arr[0]}&TileMatrix=${Number(arr1[0])}&${arr1[1]}&${arr1[2]}`;
}
}
}); });
window.map = map; window.map = map;
map.mapboxGLMap.on("load", () => { map.mapboxGLMap.on("load", () => {
map.addWMTSLayer( map.addGaudLayer({
"/PGIS_S_TileMapServer/Maps/XZDJ_SL/EzMap", url: 'http://webrd02.is.autonavi.com/appmaptile?lang=zh_cn&size=1&scale=1&style=8&x={x}&y={y}&z={z}',
{ })
Service: "getImage",
Type: "RGB",
ZoomOffset: "0",
V: "0.3",
Zoom: "{z}",
Row: "{y}",
Col: "{x}"
},
{
tileSize: 300
}
);
zoomTarget.value = map.mapboxGLMap.getZoom(); zoomTarget.value = map.mapboxGLMap.getZoom();
}); });
mapUtil.value = new MapUtil(map); mapUtil.value = new MapUtil(map);
@ -134,6 +128,8 @@ onMounted(() => {
}); });
// 撒点 // 撒点
emitter.on("addPointArea", (obj) => { emitter.on("addPointArea", (obj) => {
console.log(obj);
mapUtil.value.makerSki(obj); mapUtil.value.makerSki(obj);
}); });
// 鼠标滑过提示文字的点位 // 鼠标滑过提示文字的点位
@ -172,7 +168,7 @@ onMounted(() => {
}); });
// 回显线 // 回显线
emitter.on("echoLine", (res) => { emitter.on("echoLine", (res) => {
mapUtil.value.createLine(res, res.flag); mapUtil.value.createLine(res);
}); });
//创建边界面geojson //创建边界面geojson
emitter.on("setBoundarys", (res) => { emitter.on("setBoundarys", (res) => {
@ -203,6 +199,11 @@ onMounted(() => {
mapUtil.value.diffusionCircle(res); mapUtil.value.diffusionCircle(res);
}); });
// 清除全部覆盖物
emitter.on("removeElementAll", () => {
mapUtil.value.removeElementAll();
});
// 展示盘曲 // 展示盘曲
emitter.on("showGapText", (obj) => { emitter.on("showGapText", (obj) => {
mapUtil.value.gapText(obj); mapUtil.value.gapText(obj);
@ -301,6 +302,7 @@ onUnmounted(() => {
emitter.off("diffusionCircle"); emitter.off("diffusionCircle");
emitter.off("SsCircle"); emitter.off("SsCircle");
emitter.off("ClearssCircle"); emitter.off("ClearssCircle");
emitter.off("removeElementAll");
}); });
</script> </script>
@ -323,35 +325,29 @@ onUnmounted(() => {
right: 398px; right: 398px;
bottom: 4px; bottom: 4px;
z-index: 9; z-index: 9;
.mapImageItem { .mapImageItem {
border: 1px solid #08aae8; border: 1px solid #08aae8;
background: rgb(9, 26, 70); background: rgb(9, 26, 70);
& > img {
&>img {
width: 100%; width: 100%;
height: 50px; height: 50px;
} }
& > div {
&>div {
text-align: center; text-align: center;
position: relative; position: relative;
top: -3px; top: -3px;
} }
} }
.zoomTargetBox { .zoomTargetBox {
margin-top: 10px; margin-top: 10px;
margin-left: 23px; margin-left: 23px;
} }
::v-deep .el-input-number__decrease, ::v-deep .el-input-number__decrease,
::v-deep .el-input-number__increase { ::v-deep .el-input-number__increase {
background: #133362; background: #133362;
color: #fff; color: #fff;
border: none; border: none;
} }
::v-deep .el-input__inner { ::v-deep .el-input__inner {
background: #0c1641; background: #0c1641;
} }

View File

@ -1,7 +1,8 @@
<template> <template>
<div :id="mapid" class="map"></div> <div :id="mapid" class="map"></div>
<div class="changeMap_box" v-if="props.isShow"> <div class="changeMap_box" v-if="props.isShow">
<el-switch v-model="conditionRoute" @change="handleSwitch" active-text="打开路况" inactive-text="关闭路况" style="--el-switch-color:#13ce66;--el-switch-off-color:#ff4949;" /> <el-switch v-model="conditionRoute" @change="handleSwitch" active-text="打开路况" inactive-text="关闭路况"
style="--el-switch-color: #13ce66; --el-switch-off-color: #ff4949" />
<!-- <el-carousel type="card" height="75px" :autoplay="false" indicator-position="none" :initial-index="3" @change="onMapImageChange"> <!-- <el-carousel type="card" height="75px" :autoplay="false" indicator-position="none" :initial-index="3" @change="onMapImageChange">
<el-carousel-item> <el-carousel-item>
<div class="mapImageItem"> <div class="mapImageItem">
@ -74,7 +75,7 @@ const props = defineProps({
}); });
try { try {
const userInfo = getItem("deptId")[0].deptCode; const userInfo = getItem("deptId")[0].deptCode;
} catch (error) {} } catch (error) { }
let map; let map;
let mapLayer; let mapLayer;
let mapLayer1; let mapLayer1;
@ -88,27 +89,32 @@ onMounted(() => {
map = new EliMap({ map = new EliMap({
id: props.mapid, id: props.mapid,
crs: "EPSG:3857", crs: "EPSG:4490",
style: { style: {
glyphs: "./fonts/{fontstack}/{range}.pbf", glyphs: "./fonts/{fontstack}/{range}.pbf",
center: [94.36,29.65], center: [94.36057012, 29.64276831],
zoom: 10 zoom: 15
}, },
transformRequest: (url) => { minZoom: 7,
if (url.indexOf("TileMatrix=") != -1) { maxZoom: 18,
const arr = url.split("TileMatrix=");
const arr1 = arr[1].split("&");
const nurl = `${arr[0]}&TileMatrix=${Number(arr1[0])}&${arr1[1]}&${arr1[2]}`;
}
}
}); });
window.map = map; window.map = map;
map.mapboxGLMap.on("load", () => { map.mapboxGLMap.on("load", () => {
map.addGaudLayer({ map.addWMTSLayer(
url: 'http://webrd02.is.autonavi.com/appmaptile?lang=zh_cn&size=1&scale=1&style=8&x={x}&y={y}&z={z}', "/PGIS_S_TileMapServer/Maps/XZDJ_SL/EzMap",
}) {
Service: "getImage",
Type: "RGB",
ZoomOffset: "0",
V: "0.3",
Zoom: "{z}",
Row: "{y}",
Col: "{x}"
},
{
tileSize: 300
}
);
zoomTarget.value = map.mapboxGLMap.getZoom(); zoomTarget.value = map.mapboxGLMap.getZoom();
}); });
mapUtil.value = new MapUtil(map); mapUtil.value = new MapUtil(map);
@ -128,8 +134,6 @@ onMounted(() => {
}); });
// //
emitter.on("addPointArea", (obj) => { emitter.on("addPointArea", (obj) => {
console.log(obj);
mapUtil.value.makerSki(obj); mapUtil.value.makerSki(obj);
}); });
// //
@ -168,7 +172,7 @@ onMounted(() => {
}); });
// 线 // 线
emitter.on("echoLine", (res) => { emitter.on("echoLine", (res) => {
mapUtil.value.createLine(res); mapUtil.value.createLine(res, res.flag);
}); });
//geojson //geojson
emitter.on("setBoundarys", (res) => { emitter.on("setBoundarys", (res) => {
@ -199,11 +203,6 @@ onMounted(() => {
mapUtil.value.diffusionCircle(res); mapUtil.value.diffusionCircle(res);
}); });
//
emitter.on("removeElementAll", () => {
mapUtil.value.removeElementAll();
});
// //
emitter.on("showGapText", (obj) => { emitter.on("showGapText", (obj) => {
mapUtil.value.gapText(obj); mapUtil.value.gapText(obj);
@ -302,7 +301,6 @@ onUnmounted(() => {
emitter.off("diffusionCircle"); emitter.off("diffusionCircle");
emitter.off("SsCircle"); emitter.off("SsCircle");
emitter.off("ClearssCircle"); emitter.off("ClearssCircle");
emitter.off("removeElementAll");
}); });
</script> </script>
@ -325,29 +323,35 @@ onUnmounted(() => {
right: 398px; right: 398px;
bottom: 4px; bottom: 4px;
z-index: 9; z-index: 9;
.mapImageItem { .mapImageItem {
border: 1px solid #08aae8; border: 1px solid #08aae8;
background: rgb(9, 26, 70); background: rgb(9, 26, 70);
& > img {
&>img {
width: 100%; width: 100%;
height: 50px; height: 50px;
} }
& > div {
&>div {
text-align: center; text-align: center;
position: relative; position: relative;
top: -3px; top: -3px;
} }
} }
.zoomTargetBox { .zoomTargetBox {
margin-top: 10px; margin-top: 10px;
margin-left: 23px; margin-left: 23px;
} }
::v-deep .el-input-number__decrease, ::v-deep .el-input-number__decrease,
::v-deep .el-input-number__increase { ::v-deep .el-input-number__increase {
background: #133362; background: #133362;
color: #fff; color: #fff;
border: none; border: none;
} }
::v-deep .el-input__inner { ::v-deep .el-input__inner {
background: #0c1641; background: #0c1641;
} }

View File

@ -19,12 +19,12 @@
<span class="tag">{{ item.yjBt }}</span> <span class="tag">{{ item.yjBt }}</span>
</div> </div>
<div class="info-item flex"> <div class="info-item flex">
<span class="label">性别</span> <span class="label">性别{{ IdCard(item.yjRysfzh, 'all').sex }}</span>
<dict-tag <!-- <dict-tag
:options="D_BZ_XB" :options="D_BZ_XB"
:value="IdCard(item.yjRysfzh, 3)" :value="IdCard(item.yjRysfzh, 'all').sex"
:tag="false" :tag="false"
></dict-tag> ></dict-tag> -->
</div> </div>
<div class="info-item"> <div class="info-item">
<span class="label">相似度</span> <span class="label">相似度</span>

View File

@ -21,14 +21,13 @@ const vehicleChartRef = ref(null);
const personChartRef = ref(null); const personChartRef = ref(null);
let vehicleChart = null; let vehicleChart = null;
let personChart = null; let personChart = null;
const createChartOption = (data, colors, total) => {
const createChartOption = (data, colors) => {
return { return {
title: { title: {
text: "100", text: `${total}`,
subtext: "总数", subtext: "总数",
left: "20%", left: 'center',
top: "center", top: 'center', //top待调整
textStyle: { textStyle: {
color: "#fff", color: "#fff",
fontSize: 24, fontSize: 24,
@ -43,9 +42,9 @@ const createChartOption = (data, colors) => {
trigger: "item" trigger: "item"
}, },
legend: { legend: {
orient: "vertical", orient: "horizontal",
left: "60%", top: 0,
top: "center", bottom: '50px',
textStyle: { textStyle: {
color: "#fff", color: "#fff",
rich: { rich: {
@ -71,14 +70,14 @@ const createChartOption = (data, colors) => {
}, },
formatter: (name) => { formatter: (name) => {
const item = data.find((d) => d.name === name); const item = data.find((d) => d.name === name);
return `${name} ${item.value} {${item.colorType}|(${item.value}%)}`; return `${name} ${item.value}`;
} }
}, },
series: [ series: [
{ {
type: "pie", type: "pie",
radius: ["55%", "70%"], radius: ["55%", "70%"],
center: ["28%", "50%"], center: ["50%", "55%"],
data: data.map((item) => ({ data: data.map((item) => ({
...item, ...item,
itemStyle: { itemStyle: {
@ -100,7 +99,7 @@ const createChartOption = (data, colors) => {
{ {
type: "pie", type: "pie",
radius: ["65%", "85%"], radius: ["65%", "85%"],
center: ["28%", "50%"], center: ["50%", "55%"],
data: data.map((item) => ({ data: data.map((item) => ({
...item, ...item,
itemStyle: { itemStyle: {
@ -128,13 +127,20 @@ const randomHexColor = () => {
}; };
const initCharts = async () => { const initCharts = async () => {
let clTotal = 0;
let ryTotal = 0;
vehicleChart = echarts.init(vehicleChartRef.value); vehicleChart = echarts.init(vehicleChartRef.value);
personChart = echarts.init(personChartRef.value); personChart = echarts.init(personChartRef.value);
const colors = ["#00f0ff", "#0066ff", "#ff9900", "#00cc66"]; const colors = ["#00f0ff", "#0066ff", "#ff9900", "#00cc66"];
// 车辆预警数据 // 车辆预警数据
const res = await jczgetYjbqtj({ yjLx: 1 }); const res = await jczgetYjbqtj({ yjLx: 1 });
const res2 = await jczgetYjbqtj({ yjLx: 2 }); const res2 = await jczgetYjbqtj({ yjLx: 2 });
console.log(res); console.log(res, 'res');
console.log(res2, 'res2');
clTotal = res2.map((el) => el.sl).reduce((accumulator, currentValue) => accumulator + currentValue, 0);
ryTotal = res.map((el) => el.sl).reduce((accumulator, currentValue) => accumulator + currentValue, 0);
console.log(clTotal, 'clTotal');
const vehicleData = res.map((item) => { const vehicleData = res.map((item) => {
const color = randomHexColor(); const color = randomHexColor();
const color2 = randomHexColor(); const color2 = randomHexColor();
@ -147,37 +153,6 @@ const initCharts = async () => {
}; };
}); });
// [
// {
// value: 25,
// name: "盗窃车辆",
// colorType: "blue",
// color: ["#00f0ff", "#00a0cc"],
// color1: [choseRbgb("#00f0ff", 0.3), choseRbgb("#00a0cc", 0.3)]
// },
// {
// value: 30,
// name: "车牌与车辆不符",
// colorType: "lightBlue",
// color: ["#0066ff", "#0044cc"],
// color1: [choseRbgb("#0066ff", 0.3), choseRbgb("#0044cc", 0.3)]
// },
// {
// value: 17,
// name: "车辆超高",
// colorType: "orange",
// color: ["#ff9900", "#cc7a00"],
// color1: [choseRbgb("#ff9900", 0.3), choseRbgb("#cc7a00", 0.3)]
// },
// {
// value: 28,
// name: "车辆超限",
// colorType: "green",
// color: ["#00cc66", "#009944"],
// color1: [choseRbgb("#00cc66", 0.3), choseRbgb("#009944", 0.3)]
// }
// ];
// 人员预警数据 // 人员预警数据
const personData = res2.map((item) => { const personData = res2.map((item) => {
const color = randomHexColor(); const color = randomHexColor();
@ -220,8 +195,8 @@ const initCharts = async () => {
// color1: [choseRbgb("#00cc66", 0.3), choseRbgb("#009944", 0.3)] // color1: [choseRbgb("#00cc66", 0.3), choseRbgb("#009944", 0.3)]
// } // }
// ]; // ];
vehicleChart.setOption(createChartOption(vehicleData, colors)); vehicleChart.setOption(createChartOption(vehicleData, colors, ryTotal));
personChart.setOption(createChartOption(personData, colors)); personChart.setOption(createChartOption(personData, colors, clTotal));
}; };
const handleResize = () => { const handleResize = () => {
@ -253,7 +228,7 @@ onUnmounted(() => {
.section-title { .section-title {
font-size: 18px; font-size: 18px;
margin-bottom: 20px; // margin-bottom: 20px;
position: relative; position: relative;
padding-left: 12px; padding-left: 12px;
background: linear-gradient(0deg, #59a6f4 0%, #ffffff 90%); background: linear-gradient(0deg, #59a6f4 0%, #ffffff 90%);

View File

@ -5,10 +5,10 @@
<div class="f18 pl104">{{ hour + ":" + minute + ":" + second }}</div> <div class="f18 pl104">{{ hour + ":" + minute + ":" + second }}</div>
</div> </div>
<div class="title absolute" @click="goPath">{{ props.title }}</div> <div class="title absolute" @click="goPath">{{ props.title }}</div>
<div class="wd absolute"> <!-- <div class="wd absolute">
<el-icon size="25px" style="top: 6px" color="#86C8EB"><Sunny /></el-icon> <el-icon size="25px" style="top: 6px" color="#86C8EB"><Sunny /></el-icon>
<span> 温度 1~7°C </span> <span> 温度 1~7°C </span>
</div> </div> -->
<div class="zbbb" v-if="query" @click="show = true">值班报备</div> <div class="zbbb" v-if="query" @click="show = true">值班报备</div>
</div> </div>
<el-dialog v-model="show" title="Shipping address"> <el-dialog v-model="show" title="Shipping address">

View File

@ -1,738 +0,0 @@
(function(b, c, a) {
c[b] = a()
})("h337", this, function() {
var c = {
defaultRadius: 40,
defaultRenderer: "canvas2d",
defaultGradient: {
0.35: "rgb(0,0,255)",
0.45: "rgb(0,255,255)",
0.75: "rgb(0,255,0)",
0.85: "yellow",
1: "rgb(255,0,0)"
},
defaultMaxOpacity: 1,
defaultMinOpacity: 0,
defaultBlur: 0.85,
defaultXField: "x",
defaultYField: "y",
defaultValueField: "value",
plugins: {}
};
var g = (function l() {
var n = function n(o) {
this._coordinator = {};
this._data = [];
this._radi = [];
this._min = 0;
this._max = 1;
this._xField = o.xField || o.defaultXField;
this._yField = o.yField || o.defaultYField;
this._valueField = o.valueField || o.defaultValueField;
if (o.radius) {
this._cfgRadius = o.radius
}
};
var m = c.defaultRadius;
n.prototype = {
_organiseData: function(o, q) {
var u = o[this._xField];
var s = o[this._yField];
var z = this._radi;
var w = this._data;
var t = this._max;
var p = this._min;
var v = o[this._valueField] || 1;
var r = o.radius || this._cfgRadius || m;
if (!w[u]) {
w[u] = [];
z[u] = []
}
if (!w[u][s]) {
w[u][s] = v;
z[u][s] = r
} else {
w[u][s] += v
}
if (w[u][s] > t) {
if (!q) {
this._max = w[u][s]
} else {
this.setDataMax(w[u][s])
}
return false
} else {
return {
x: u,
y: s,
value: v,
radius: r,
min: p,
max: t
}
}
},
_unOrganizeData: function() {
var r = [];
var q = this._data;
var p = this._radi;
for (var o in q) {
for (var s in q[o]) {
r.push({
x: o,
y: s,
radius: p[o][s],
value: q[o][s]
})
}
}
return {
min: this._min,
max: this._max,
data: r
}
},
_onExtremaChange: function() {
this._coordinator.emit("extremachange", {
min: this._min,
max: this._max
})
},
addData: function() {
if (arguments[0].length > 0) {
var p = arguments[0];
var o = p.length;
while (o--) {
this.addData.call(this, p[o])
}
} else {
var q = this._organiseData(arguments[0], true);
if (q) {
this._coordinator.emit("renderpartial", {
min: this._min,
max: this._max,
data: [q]
})
}
}
return this
},
setData: function(q) {
var p = q.data;
var r = p.length;
this._data = [];
this._radi = [];
for (var o = 0; o < r; o++) {
this._organiseData(p[o], false)
}
this._max = q.max;
this._min = q.min || 0;
this._onExtremaChange();
this._coordinator.emit("renderall", this._getInternalData());
return this
},
removeData: function() {},
setDataMax: function(o) {
this._max = o;
this._onExtremaChange();
this._coordinator.emit("renderall", this._getInternalData());
return this
},
setDataMin: function(o) {
this._min = o;
this._onExtremaChange();
this._coordinator.emit("renderall", this._getInternalData());
return this
},
setCoordinator: function(o) {
this._coordinator = o
},
_getInternalData: function() {
return {
max: this._max,
min: this._min,
data: this._data,
radi: this._radi
}
},
getData: function() {
return this._unOrganizeData()
}
};
return n
})();
var h = (function j() {
var p = function(q) {
var s = q.gradient || q.defaultGradient;
var v = document.createElement("canvas");
var u = v.getContext("2d");
v.width = 256;
v.height = 1;
var t = u.createLinearGradient(0, 0, 256, 1);
for (var r in s) {
t.addColorStop(r, s[r])
}
u.fillStyle = t;
u.fillRect(0, 0, 256, 1);
return u.getImageData(0, 0, 256, 1).data
};
var o = function(s, t) {
var v = document.createElement("canvas");
var r = v.getContext("2d");
var q = s;
var w = s;
v.width = v.height = s * 2;
if (t == 1) {
r.beginPath();
r.arc(q, w, s, 0, 2 * Math.PI, false);
r.fillStyle = "rgba(0,0,0,1)";
r.fill()
} else {
var u = r.createRadialGradient(q, w, s * t, q, w, s);
u.addColorStop(0, "rgba(0,0,0,1)");
u.addColorStop(1, "rgba(0,0,0,0)");
r.fillStyle = u;
r.fillRect(0, 0, 2 * s, 2 * s)
}
return v
};
var n = function(u) {
var B = [];
var t = u.min;
var x = u.max;
var C = u.radi;
var u = u.data;
var q = Object.keys(u);
var r = q.length;
while (r--) {
var s = q[r];
var y = Object.keys(u[s]);
var A = y.length;
while (A--) {
var w = y[A];
var z = u[s][w];
var v = C[s][w];
B.push({
x: s,
y: w,
value: z,
radius: v
})
}
}
return {
min: t,
max: x,
data: B
}
};
function m(t) {
var q = t.element;
var u = this.shadowCanvas = document.createElement("canvas");
var s = this.canvas = t.canvas || document.createElement("canvas");
var r = this._renderBoundaries = [10000, 10000, 0, 0];
var v = getComputedStyle(t.element) || {};
s.className = "heatmap-canvas";
this._width = s.width = u.width = +(v.width.replace(/px/, ""));
this._height = s.height = u.height = +(v.height.replace(/px/, ""));
this.shadowCtx = u.getContext("2d");
this.ctx = s.getContext("2d");
s.style.cssText = u.style.cssText = "position:absolute;left:0;top:0;";
q.style.position = "relative";
q.appendChild(s);
this._palette = p(t);
this._templates = {};
this._setStyles(t)
}
m.prototype = {
renderPartial: function(q) {
this._drawAlpha(q);
this._colorize()
},
renderAll: function(q) {
this._clear();
this._drawAlpha(n(q));
this._colorize()
},
_updateGradient: function(q) {
this._palette = p(q)
},
updateConfig: function(q) {
if (q.gradient) {
this._updateGradient(q)
}
this._setStyles(q)
},
setDimensions: function(r, q) {
this._width = r;
this._height = q;
this.canvas.width = this.shadowCanvas.width = r;
this.canvas.height = this.shadowCanvas.height = q
},
_clear: function() {
this.shadowCtx.clearRect(0, 0, this._width, this._height);
this.ctx.clearRect(0, 0, this._width, this._height)
},
_setStyles: function(q) {
this._blur = (q.blur == 0) ? 0 : (q.blur || q.defaultBlur);
if (q.backgroundColor) {
this.canvas.style.backgroundColor = q.backgroundColor
}
this._opacity = (q.opacity || 0) * 255;
this._maxOpacity = (q.maxOpacity || q.defaultMaxOpacity) * 255;
this._minOpacity = (q.minOpacity || q.defaultMinOpacity) * 255;
this._useGradientOpacity = !!q.useGradientOpacity
},
_drawAlpha: function(v) {
var u = this._min = v.min;
var B = this._max = v.max;
var v = v.data || [];
var s = v.length;
var t = 1 - this._blur;
while (s--) {
var F = v[s];
var D = F.x;
var A = F.y;
var z = F.radius;
var E = Math.min(F.value, B);
var r = D - z;
var q = A - z;
var C = this.shadowCtx;
var w;
if (!this._templates[z]) {
this._templates[z] = w = o(z, t)
} else {
w = this._templates[z]
}
C.globalAlpha = (E - u) / (B - u);
C.drawImage(w, r, q);
if (r < this._renderBoundaries[0]) {
this._renderBoundaries[0] = r
}
if (q < this._renderBoundaries[1]) {
this._renderBoundaries[1] = q
}
if (r + 2 * z > this._renderBoundaries[2]) {
this._renderBoundaries[2] = r + 2 * z
}
if (q + 2 * z > this._renderBoundaries[3]) {
this._renderBoundaries[3] = q + 2 * z
}
}
},
_colorize: function() {
var w = this._renderBoundaries[0];
var u = this._renderBoundaries[1];
var B = this._renderBoundaries[2] - w;
var z = this._renderBoundaries[3] - u;
var G = this._width;
var A = this._height;
var r = this._opacity;
var I = this._maxOpacity;
var C = this._minOpacity;
var v = this._useGradientOpacity;
if (w < 0) {
w = 0
}
if (u < 0) {
u = 0
}
if (w + B > G) {
B = G - w
}
if (u + z > A) {
z = A - u
}
var J = this.shadowCtx.getImageData(w, u, B, z);
var H = J.data;
var E = H.length;
var F = this._palette;
for (var D = 3; D < E; D += 4) {
var s = H[D];
var t = s * 4;
if (!t) {
continue
}
var q;
if (r > 0) {
q = r
} else {
if (s < I) {
if (s < C) {
q = C
} else {
q = s
}
} else {
q = I
}
}
H[D - 3] = F[t];
H[D - 2] = F[t + 1];
H[D - 1] = F[t + 2];
H[D] = v ? F[t + 3] : q
}
J.data = H;
this.ctx.putImageData(J, w, u);
this._renderBoundaries = [1000, 1000, 0, 0]
},
getValueAt: function(r) {
var w;
var t = this.shadowCtx;
var s = t.getImageData(r.x, r.y, 1, 1);
var v = s.data[3];
var q = this._max;
var u = this._min;
w = (Math.abs(q - u) * (v / 255)) >> 0;
return w
},
getDataURL: function() {
return this.canvas.toDataURL()
}
};
return m
})();
var e = (function b() {
var m = false;
if (c.defaultRenderer === "canvas2d") {
m = h
}
return m
})();
var i = {
merge: function() {
var m = {};
var n = arguments.length;
for (var p = 0; p < n; p++) {
var q = arguments[p];
for (var o in q) {
m[o] = q[o]
}
}
return m
}
};
var f = (function k() {
var m = (function o() {
function q() {
this.cStore = {}
}
q.prototype = {
on: function(s, u, r) {
var t = this.cStore;
if (!t[s]) {
t[s] = []
}
t[s].push((function(v) {
return u.call(r, v)
}))
},
emit: function(u, t) {
var w = this.cStore;
if (w[u]) {
var r = w[u].length;
for (var s = 0; s < r; s++) {
var v = w[u][s];
v(t)
}
}
}
};
return q
})();
var p = function(r) {
var s = r._renderer;
var t = r._coordinator;
var q = r._store;
t.on("renderpartial", s.renderPartial, s);
t.on("renderall", s.renderAll, s);
t.on("extremachange", function(u) {
r._config.onExtremaChange && r._config.onExtremaChange({
min: u.min,
max: u.max,
gradient: r._config.gradient || r._config.defaultGradient
})
});
q.setCoordinator(t)
};
function n() {
var q = this._config = i.merge(c, arguments[0] || {});
this._coordinator = new m();
if (q.plugin) {
var s = q.plugin;
if (!c.plugins[s]) {
throw new Error("Plugin '" + s + "' not found. Maybe it was not registered.")
} else {
var r = c.plugins[s];
this._renderer = new r.renderer(q);
this._store = new r.store(q)
}
} else {
this._renderer = new e(q);
this._store = new g(q)
}
p(this)
}
n.prototype = {
addData: function() {
this._store.addData.apply(this._store, arguments);
return this
},
removeData: function() {
this._store.removeData && this._store.removeData.apply(this._store, arguments);
return this
},
setData: function() {
this._store.setData.apply(this._store, arguments);
return this
},
setDataMax: function() {
this._store.setDataMax.apply(this._store, arguments);
return this
},
setDataMin: function() {
this._store.setDataMin.apply(this._store, arguments);
return this
},
configure: function(q) {
this._config = i.merge(this._config, q);
this._renderer.updateConfig(this._config);
this._coordinator.emit("renderall", this._store._getInternalData());
return this
},
repaint: function() {
this._coordinator.emit("renderall", this._store._getInternalData());
return this
},
getData: function() {
return this._store.getData()
},
getDataURL: function() {
return this._renderer.getDataURL()
},
getValueAt: function(q) {
if (this._store.getValueAt) {
return this._store.getValueAt(q)
} else {
if (this._renderer.getValueAt) {
return this._renderer.getValueAt(q)
} else {
return null
}
}
}
};
return n
})();
var a = {
create: function(m) {
return new f(m)
},
register: function(n, m) {
c.plugins[n] = m
}
};
return a
});
var BMapLib = window.BMapLib = BMapLib || {};
(function() {
var a = BMapLib.HeatmapOverlay = function(c) {
this.conf = c;
this.conf.visible = c.visible === undefined ? true : c.visible;
this.heatmap = null;
this.latlngs = [];
this.bounds = null
};
a.prototype = new BMapGL.Overlay();
a.prototype.initialize = function(f) {
this._map = f;
var c = document.createElement("div");
c.style.position = "absolute";
c.style.top = 0;
c.style.left = 0;
c.style.border = 0;
c.style.width = this._map.getSize().width + "px";
c.style.height = this._map.getSize().height + "px";
this.conf.element = c;
if (!b()) {
return c
}
f.getPanes().floatPane.appendChild(c);
this.conf.valueField = this.conf.valueField || "count";
this.heatmap = h337.create(this.conf);
var e = this;
f.addEventListener("resize", function(h) {
var g = h.size;
c.style.width = g.width + "px";
c.style.height = g.height + "px";
e.heatmap._renderer.setDimensions(g.width, g.height);
e.draw()
});
this._div = c;
return c
};
a.prototype.draw = function() {
if (!b()) {
return
}
var k = this._map.getBounds();
if (k.equals(this.bounds)) {
return
}
this.bounds = k;
var j = this._map.pointToOverlayPixel(k.getNorthEast()),
p = this._map.pointToOverlayPixel(k.getSouthWest()),
c = j.y,
i = p.x,
l = p.y - j.y,
o = j.x - p.x;
this.conf.element.style.left = i + "px";
this.conf.element.style.top = c + "px";
this.conf.element.style.width = o + "px";
this.conf.element.style.height = l + "px";
if (this.latlngs.length > 0) {
this.heatmap.removeData();
var n = this.latlngs.length;
d = {
max: this.heatmap._store.getData().max,
data: []
};
while (n--) {
var f = this.latlngs[n].latlng;
if (!k.containsPoint(f)) {
continue
}
var g = this._map.pointToOverlayPixel(f),
i = this._map.pointToOverlayPixel(k.getSouthWest()).x,
c = this._map.pointToOverlayPixel(k.getNorthEast()).y,
e = new BMapGL.Pixel(g.x - i, g.y - c);
var m = this.pixelTransform(e);
d.data.push({
x: m.x,
y: m.y,
count: this.latlngs[n].c
})
}
if (this.conf.radiusChangeByZoom) {
this.heatmap._store._cfgRadius = this.conf.radiusChangeByZoom(this._map.getZoom())
}
this.heatmap.setData(d)
}
};
a.prototype.pixelTransform = function(f) {
var c = this.heatmap.width,
e = this.heatmap.height;
while (f.x < 0) {
f.x += c
}
while (f.x > c) {
f.x -= c
}
while (f.y < 0) {
f.y += e
}
while (f.y > e) {
f.y -= e
}
f.x = (f.x >> 0);
f.y = (f.y >> 0);
return f
};
a.prototype.setDataSet = function(j) {
this.data = j;
if (!b()) {
return
}
var i = this._map.getBounds();
var l = {
max: j.max,
data: []
};
var m = j.data,
k = m.length;
this.latlngs = [];
this.heatmap.removeData();
if (this.conf.radiusChangeByZoom) {
this.heatmap._store._cfgRadius = this.conf.radiusChangeByZoom(this._map.getZoom())
}
while (k--) {
var f = new BMapGL.Point(m[k].lng, m[k].lat);
this.latlngs.push({
latlng: f,
c: m[k].count
});
if (!i.containsPoint(f)) {
continue
}
var g = this._map.pointToOverlayPixel(f),
h = this._map.pointToOverlayPixel(i.getSouthWest()).x,
c = this._map.pointToOverlayPixel(i.getNorthEast()).y,
e = new BMapGL.Pixel(g.x - h, g.y - c);
var n = this.pixelTransform(e);
l.data.push({
x: n.x,
y: n.y,
count: m[k].count
})
}
this.heatmap.setData(l)
};
a.prototype.addDataPoint = function(e, g, f) {
if (!b()) {
return
}
if (this.data && this.data.data) {
this.data.data.push({
lng: e,
lat: g,
count: f
})
}
var h = new BMapGL.Point(e, g),
c = this.pixelTransform(this._map.pointToOverlayPixel(h));
this.heatmap.store.addDataPoint(c.x, c.y, f);
this.latlngs.push({
latlng: h,
c: f
})
};
a.prototype.toggle = function() {
if (!b()) {
return
}
if (this.conf.visible === true) {
this.conf.visible = false
} else {
this.conf.visible = true
}
if (this.conf.visible) {
this.conf.element.style.display = "block"
} else {
this.conf.element.style.display = "none"
}
};
a.prototype.setOptions = function(c) {
if (!b()) {
return
}
for (var e in c) {
if (e == "radius") {
this.heatmap._store._cfgRadius = c[e]
}
if (e == "opacity") {
c[e] = c[e] / 100
}
}
this.heatmap.configure(c);
if (this.data) {
this.setDataSet(this.data)
}
};
function b() {
var c = document.createElement("canvas");
return !!(c.getContext && c.getContext("2d"))
}
})();

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.4 KiB

Binary file not shown.

Binary file not shown.

View File

@ -1,3 +0,0 @@

Microsoft YaHei 10240-10495

View File

@ -1,3 +0,0 @@

Microsoft YaHei 10496-10751

View File

@ -1,3 +0,0 @@

Microsoft YaHei 10752-11007

View File

@ -1,3 +0,0 @@

Microsoft YaHei 11008-11263

View File

@ -1,3 +0,0 @@

Microsoft YaHei 11264-11519

View File

@ -1,3 +0,0 @@

Microsoft YaHei 11520-11775

View File

@ -1,3 +0,0 @@

Microsoft YaHei 1280-1535

View File

@ -1,3 +0,0 @@

Microsoft YaHei 1536-1791

View File

@ -1,3 +0,0 @@

Microsoft YaHei 1792-2047

View File

@ -1,3 +0,0 @@

Microsoft YaHei 2048-2303

File diff suppressed because one or more lines are too long

View File

@ -1,3 +0,0 @@

Microsoft YaHei 2304-2559

View File

@ -1,3 +0,0 @@

Microsoft YaHei 2560-2815

View File

@ -1,3 +0,0 @@

Microsoft YaHei 2816-3071

View File

@ -1,3 +0,0 @@

Microsoft YaHei 3072-3327

Some files were not shown because too many files have changed in this diff Show More