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); } }