保安服务企业管理项目备份
guoshilong
2023-12-23 6ad672fc958a43042c7fec8616d7d0c83a4abfce
代码提交
1 files modified
70 ■■■■ changed files
src/views/check/components/OlMapBox.vue 70 ●●●● patch | view | raw | blame | history
src/views/check/components/OlMapBox.vue
@@ -348,40 +348,40 @@
                    layersObjcect[layerName] = new VectorLayer({
                        source: layer,
                        zIndex: 24,
                        // style: (feature, resolution) => {
                        //     let size = feature.get('features').length
                        //
                        //     let radius = 10
                        //
                        //     if (size > 900) {
                        //         radius = 19
                        //     } else if (size > 600) {
                        //         radius = 16
                        //     } else if (size > 400) {
                        //         radius = 13
                        //     }
                        //
                        //     let style = new Style({
                        //         image: new Circle({
                        //             radius: radius,
                        //             stroke: new Stroke({
                        //                 color: 'blue',
                        //                 width: 1
                        //             }),
                        //             fill: new Fill({
                        //                 color: 'blue'
                        //             })
                        //         }),
                        //         text: new Text({
                        //             text: size.toString(),
                        //             fill: new Fill({
                        //                 color: 'white'
                        //             })
                        //         })
                        //     })
                        //
                        //     return style
                        // }
                        style: (feature, resolution) => {
                            let size = feature.get('features').length
                            let radius = 10
                            if (size > 900) {
                                radius = 19
                            } else if (size > 600) {
                                radius = 16
                            } else if (size > 400) {
                                radius = 13
                            }
                            let style = new Style({
                                image: new Circle({
                                    radius: radius,
                                    stroke: new Stroke({
                                        color: 'blue',
                                        width: 1
                                    }),
                                    fill: new Fill({
                                        color: 'blue'
                                    })
                                }),
                                text: new Text({
                                    text: size.toString(),
                                    fill: new Fill({
                                        color: 'white'
                                    })
                                })
                            })
                            return style
                        }
                    })
                    mapView.addLayer(layersObjcect[layerName])
@@ -411,7 +411,7 @@
            })
            mapView.getView().animate({ // 只设置需要的属性即可
                center: [positionData[0].lng, positionData[0].lat], // 中心点
                zoom: 18, // 缩放级别
                // zoom: 18, // 缩放级别
                rotation: undefined, // 缩放完成view视图旋转弧度
                // duration: 1000 // 缩放持续时间,默认不需要设置
            })