From a6d0709260793481aa8f498047c55d8d5446346f Mon Sep 17 00:00:00 2001
From: wenc000 <450292408@qq.com>
Date: Sat, 23 May 2020 12:01:47 +0800
Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E4=BC=81=E4=B8=9A=E5=AE=9A?=
=?UTF-8?q?=E4=BD=8D?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../route/enterprise/get-enterprise.html | 629 ++++++++++++++++++
.../get-enterprise-location.html | 31 +-
2 files changed, 655 insertions(+), 5 deletions(-)
create mode 100644 src/main/resources/static/route/enterprise/get-enterprise.html
diff --git a/src/main/resources/static/route/enterprise/get-enterprise.html b/src/main/resources/static/route/enterprise/get-enterprise.html
new file mode 100644
index 0000000..3bf1120
--- /dev/null
+++ b/src/main/resources/static/route/enterprise/get-enterprise.html
@@ -0,0 +1,629 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/main/resources/static/route/gridpersonnel/get-enterprise-location.html b/src/main/resources/static/route/gridpersonnel/get-enterprise-location.html
index 1d8a61f..b1c01d2 100644
--- a/src/main/resources/static/route/gridpersonnel/get-enterprise-location.html
+++ b/src/main/resources/static/route/gridpersonnel/get-enterprise-location.html
@@ -42,8 +42,15 @@
// 默认包头市安监局
var point = new BMap.Point('109.850206', '40.66852');
map.centerAndZoom(point, 15);
- var marker = new BMap.Marker(point);
- map.addOverlay(marker);
+ var vectorMarker = new BMap.Marker(point, {
+ // 指定Marker的icon属性为Symbol
+ icon: new BMap.Symbol(BMap_Symbol_SHAPE_POINT, {
+ scale: 1,
+ fillColor: "orange",
+ fillOpacity: 0.8
+ })
+ });
+ map.addOverlay(vectorMarker);
// 计算中心点
function getCenterPoint(path) {
var x = 0.0;
@@ -62,7 +69,21 @@
for(var i = 0, item; item = pointArray[i++];) {
// 打点
var markPoint = new BMap.Point(item.lng, item.lat);
- map.addOverlay(marker);
+ var markerPoint = new BMap.Marker(markPoint);
+ markerPoint.enterpriseId = item.enterpriseId;
+ markerPoint.addEventListener('click', function(e) {
+ layer.open({
+ type: 2,
+ title: false,
+ closeBtn: 0,
+ area: ['100%', '100%'],
+ shadeClose: true,
+ anim: 2,
+ content: top.restAjax.path('route/enterprise/get-enterprise.html?enterpriseId={enterpriseId}', [this.enterpriseId]),
+ end: function() {}
+ });
+ });
+ map.addOverlay(markerPoint);
// 计算距离
var distance = map.getDistance(centerPoint, markPoint);
if(distance > maxDistance) {
@@ -87,12 +108,12 @@
if(pointArray.length > 0) {
// 获取中心点
var centerPoint = getCenterPoint(pointArray);
- map.centerAndZoom(centerPoint, 15);
+ map.centerAndZoom(centerPoint, 16);
// 找出最大半径
var maxDistance = getMaxDistance(centerPoint, pointArray);
// 画圆
if(maxDistance > 0) {
- var circle = new BMap.Circle(point, maxDistance,{strokeColor:'blue', strokeWeight:2, strokeOpacity:0.5});
+ var circle = new BMap.Circle(centerPoint, maxDistance, {strokeColor: 'blue', strokeWeight: 2, strokeOpacity: 0.5});
map.addOverlay(circle);
}
}