Browse Source

门店范围

wangningfei 3 years ago
parent
commit
357e1f415d
1 changed files with 62 additions and 25 deletions
  1. 62 25
      vue-admin-template-master/src/views/shapmap/marker/index.vue

+ 62 - 25
vue-admin-template-master/src/views/shapmap/marker/index.vue

@@ -52,40 +52,77 @@ export default {
       //   new qq.maps.MarkerImage(shop_icon);
       let res = await this.getData();
       res.forEach((v) => {
-        new qq.maps.Circle({
-          //圆形的中心点坐标。
-          center: new qq.maps.LatLng(v.latitude - 0, v.longitude - 0),
-          //圆形是否可点击。
-          clickable: true,
+        if (v.category == 2) {
+          new qq.maps.Circle({
+            //圆形的中心点坐标。
+            center: new qq.maps.LatLng(v.latitude - 0, v.longitude - 0),
+            //圆形是否可点击。
+            clickable: true,
 
-          //鼠标在圆形内的光标样式。
-          cursor: "pointer",
+            //鼠标在圆形内的光标样式。
+            cursor: "pointer",
 
-          //圆形的填充色,可通过Color对象的alpha属性设置透明度。
-          //fillColor: "#00f",
-          fillColor: new qq.maps.Color(0, 15, 255, 0.3),
+            //圆形的填充色,可通过Color对象的alpha属性设置透明度。
+            // fillColor: "#F56C6C",
+            fillColor: new qq.maps.Color(50, 150, 190, 0.3),
 
-          //要显示圆形的地图。
-          map: map,
+            //要显示圆形的地图。
+            map: map,
 
-          //圆形的半径。
-          radius: 3000,
+            //圆形的半径。
+            radius: 5000,
 
-          //圆形的边框颜色,可通过Color对象的alpha属性设置透明度。
-          strokeColor: "#fff",
+            //圆形的边框颜色,可通过Color对象的alpha属性设置透明度。
+            strokeColor: "#fff",
 
-          //圆形的边框样式。实线是solid,虚线是dash。
-          strokeDashStyle: "solid",
+            //圆形的边框样式。实线是solid,虚线是dash。
+            strokeDashStyle: "solid",
 
-          //圆形的边框线宽。
-          strokeWeight: 1,
+            //圆形的边框线宽。
+            strokeWeight: 1,
 
-          //圆形是否可见。
-          visible: true,
+            //圆形是否可见。
+            visible: true,
 
-          //圆形的zIndex值。
-          zIndex: 1000,
-        });
+            //圆形的zIndex值。
+            zIndex: 1000,
+          });
+        } else {
+          new qq.maps.Circle({
+            //圆形的中心点坐标。
+            center: new qq.maps.LatLng(v.latitude - 0, v.longitude - 0),
+            //圆形是否可点击。
+            clickable: true,
+
+            //鼠标在圆形内的光标样式。
+            cursor: "pointer",
+
+            //圆形的填充色,可通过Color对象的alpha属性设置透明度。
+            //fillColor: "#00f",
+            fillColor: new qq.maps.Color(0, 15, 255, 0.3),
+
+            //要显示圆形的地图。
+            map: map,
+
+            //圆形的半径。
+            radius: 3000,
+
+            //圆形的边框颜色,可通过Color对象的alpha属性设置透明度。
+            strokeColor: "#fff",
+
+            //圆形的边框样式。实线是solid,虚线是dash。
+            strokeDashStyle: "solid",
+
+            //圆形的边框线宽。
+            strokeWeight: 1,
+
+            //圆形是否可见。
+            visible: true,
+
+            //圆形的zIndex值。
+            zIndex: 1000,
+          });
+        }
       });
 
       var latlngBounds = new qq.maps.LatLngBounds();