| | |
| | | axios.get('http://60.220.177.113:2081/api/qrCode/getUserInfo?securityNumber=' + securityNumber).then(function (res) { |
| | | // axios.get('http://192.168.0.104:81/qrCode/getUserInfo?securityNumber=' + securityNumber).then(function(res) { |
| | | // axios.get('http://192.168.0.114:81/qrCode/getUserInfo?securityNumber=赣洪202115423').then(function(res) { |
| | | |
| | | var data = res.data; |
| | | var data = res.data.data; |
| | | // console.log(data, 456); |
| | | //计算生日 |
| | | var birthday = data.cardid.substring(6, 10) + "." + data.cardid.substring(10, 12) + "." + data.cardid.substring(12, 14); |
| | |
| | | layers: [], |
| | | view: new OlView({ |
| | | // 初始化中心点坐标,经纬度一会自己换一下 |
| | | center: [113, 24], |
| | | center: [114.89844546788195, 25.861142035590277], |
| | | zoom: 18, |
| | | projection: "EPSG:4326" |
| | | }), |
| | |
| | | } |
| | | |
| | | if (params.url) { |
| | | styleOptions.image = new Icon({ |
| | | scale: params.scale || 1, |
| | | imgSize: params.imgSize || [160, 221], |
| | | src: params.url, |
| | | }) |
| | | styleOptions.image = new Icon({ |
| | | scale: params.scale || 1, |
| | | imgSize: params.imgSize || [32, 32], |
| | | src: params.url, |
| | | }) |
| | | } |
| | | |
| | | if (params.text) { |
| | |
| | | }), |
| | | padding: [2, 5, 2, 5], |
| | | stroke: new Stroke({ color: '#00000000', width: 1 }), |
| | | offsetX: -60, |
| | | offsetY: -60 |
| | | // offsetX: -60, |
| | | offsetY: 30 |
| | | }) |
| | | } |
| | | |
| | |
| | | // 添加聚合图层的新模式,水库点分布 |
| | | mapAddClusterLayer (layerName, imgUrl, positionData, incident = (e) => { }, type = '') { |
| | | const that = this |
| | | |
| | | console.log(layersObjcect,layerName,positionData,"+++++++++++++") |
| | | if (!layersObjcect[layerName]) { |
| | | if (type == 'cluster') { |
| | | let source = new VectorSource() |
| | |
| | | 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]) |
| | |
| | | item, |
| | | lng: item.lng, |
| | | lat: item.lat, |
| | | text: item.text, |
| | | text: item.realName, |
| | | url: imgUrl, |
| | | event: incident |
| | | })) |