Commit 8339909c by hank

Merge branch 'develop' of gitlab.maxrocky.com:hanjixin/MeteorologicalBureau into develop

parents fca58595 5bacae97
...@@ -57,7 +57,10 @@ ...@@ -57,7 +57,10 @@
window.delPoi() window.delPoi()
window.review() window.review()
$.getJSON(api).then(res => { $.getJSON(api).then(res => {
var currentDetailList = JSON.parse(res).currentDetailList var currentDetailList = JSON.parse(res).currentDetailList.slice(
0,
2000
);
console.log(currentDetailList); console.log(currentDetailList);
if(type == 'MassMarks'){ if(type == 'MassMarks'){
window.pois = map3d.addPoisMassMarks(currentDetailList) window.pois = map3d.addPoisMassMarks(currentDetailList)
......
import { bounds2Path, MaskLayer } from "./tools.js" import { bounds2Path, MaskLayer } from "./tools.js"
var _renderClusterMarker = function (context) {
var factor = Math.pow(context.count / count, 1 / 18);
var div = document.createElement('div');
var Hue = 180 - factor * 180;
var bgColor = 'hsla(' + Hue + ',100%,50%,0.7)';
var fontColor = 'hsla(' + Hue + ',100%,20%,1)';
var borderColor = 'hsla(' + Hue + ',100%,40%,1)';
var shadowColor = 'hsla(' + Hue + ',100%,50%,1)';
div.style.backgroundColor = bgColor;
var size = Math.round(30 + Math.pow(context.count / count, 1 / 5) * 20);
div.style.width = div.style.height = size + 'px';
div.style.border = 'solid 1px ' + borderColor;
div.style.borderRadius = size / 2 + 'px';
div.style.boxShadow = '0 0 1px ' + shadowColor;
div.innerHTML = context.count;
div.style.lineHeight = size + 'px';
div.style.color = fontColor;
div.style.fontSize = '14px';
div.style.textAlign = 'center';
context.marker.setOffset(new AMap.Pixel(-size / 2, -size / 2));
context.marker.setContent(div)
};
class Map3D { class Map3D {
constructor(cityCode, domId, params, cb) { constructor(cityCode, domId, params, cb) {
let opts = { let opts = {
...@@ -46,7 +67,12 @@ class Map3D { ...@@ -46,7 +67,12 @@ class Map3D {
if(this.cluster ){ if(this.cluster ){
this.cluster.addMarkers(markers) this.cluster.addMarkers(markers)
}else{ }else{
this.cluster = new AMap.MarkerClusterer(this.map, markers, { gridSize: 80 }); this.cluster = new AMap.MarkerClusterer(this.map, markers, {
gridSize: 80,
renderClusterMarker: function (context) {
// _renderClusterMarker(context,markers.length);
}
});
} }
return markers return markers
} }
...@@ -91,7 +117,7 @@ class Map3D { ...@@ -91,7 +117,7 @@ class Map3D {
let marker = new AMap.Marker({ let marker = new AMap.Marker({
map: this.map, map: this.map,
position: new AMap.LngLat(Number(item.lon), Number(item.lat)), //基点位置 position: new AMap.LngLat(Number(item.lon), Number(item.lat)), //基点位置
icon: 'https://a.amap.com/jsapi_demos/static/images/darkRed.png', //marker图标,直接传递地址url icon:'img/1.png', //marker图标,直接传递地址url
offset: { x: -8, y: -34 } //相对于基点的位置 offset: { x: -8, y: -34 } //相对于基点的位置
}); });
return marker return marker
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment