Commit 5e95e3f1 by hank

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

parents feb4158a 39204c49
No preview for this file type
...@@ -151,6 +151,8 @@ ...@@ -151,6 +151,8 @@
console.log(currentDetailList); console.log(currentDetailList);
if(type == 'MassMarks'){ if(type == 'MassMarks'){
window.pois = map3d.addPoisMassMarks(currentDetailList) window.pois = map3d.addPoisMassMarks(currentDetailList)
}else if(type == 'Single'){
window.pois = map3d.addPoisSingle(currentDetailList)
}else{ }else{
window.pois = map3d.addPoisMarkerClusterer(currentDetailList) window.pois = map3d.addPoisMarkerClusterer(currentDetailList)
} }
...@@ -158,7 +160,7 @@ ...@@ -158,7 +160,7 @@
}); });
} }
// addPoiByApi('./personal.json') // addPoiByApi('./personal.json')
// addPoiByApi('./led.json') // addPoiByApi('./led.json','Single')
</script> </script>
</body> </body>
......
import { bounds2Path, MaskLayer } from "./tools.js" import { bounds2Path, MaskLayer } from "./tools.js"
var _renderClusterMarker = function (context) { var _renderClusterMarker = function (context,count) {
var factor = Math.pow(context.count / count, 1 / 18); var factor = Math.pow(context.count / count, 1 / 18);
var div = document.createElement('div'); var div = document.createElement('div');
var Hue = 180 - factor * 180; var Hue = 180 - factor * 180;
...@@ -56,7 +56,15 @@ class Map3D { ...@@ -56,7 +56,15 @@ class Map3D {
this.cluster.removeMarkers(pois) this.cluster.removeMarkers(pois)
this.map.remove(pois) this.map.remove(pois)
} }
addPoisSingle(pois) {
//https://lbs.amap.com/api/javascript-api/guide/overlays/massmarker/
//https://lbs.amap.com/api/javascript-api/example/marker/markerclusterer
let markers = []
pois.map(item => {
markers.push(this.setPersonalPoint(item))
});
return markers
}
addPoisMarkerClusterer(pois) { addPoisMarkerClusterer(pois) {
//https://lbs.amap.com/api/javascript-api/guide/overlays/massmarker/ //https://lbs.amap.com/api/javascript-api/guide/overlays/massmarker/
//https://lbs.amap.com/api/javascript-api/example/marker/markerclusterer //https://lbs.amap.com/api/javascript-api/example/marker/markerclusterer
...@@ -70,7 +78,7 @@ class Map3D { ...@@ -70,7 +78,7 @@ class Map3D {
this.cluster = new AMap.MarkerClusterer(this.map, markers, { this.cluster = new AMap.MarkerClusterer(this.map, markers, {
gridSize: 80, gridSize: 80,
renderClusterMarker: function (context) { renderClusterMarker: function (context) {
// _renderClusterMarker(context,markers.length); _renderClusterMarker(context,markers.length);
} }
}); });
} }
......
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