公告
财富商城
积分规则
提问
发文
2019-09-06 02:35发布
啃猪蹄的小仙女
Is there any way to see when several placemarks superimposed on the same positions?
As the figure below, Google Earth, we have a way to see it. Thank you.
Yes, you can use your imagination and make a custom cluster. See this plunker demo, I use the following function to create a cluster like:
var displayOverlapping = function(pixel) { var f = map.forEachFeatureAtPixel(pixel, function(ft, l) { return ft; }); if (f && f.get('type') == 'cluster') { if(f.get('expanded') === true) return; var geom = f.getGeometry(), coord = geom.getCoordinates(), px = map.getPixelFromCoordinate(coord), extent = [coord[0], coord[1], coord[0], coord[1]], ar_features = []; sourceFeatures.forEachFeatureInExtent(extent, function(ft){ if(ft.get('type') == 'click') ar_features.push(ft); }); var angle = (100 / ar_features.length) * 3.6; f.set('expanded', true); f.setStyle(style_cluster_hover); multiLineString.setCoordinates([]); ar_features.forEach(function(row, index){ var angle2 = index * angle, px_end = rotate(px[0], px[1], angle2, 30), cd_end = map.getCoordinateFromPixel(px_end); multiLineString.appendLineString( new ol.geom.LineString([coord, cd_end]) ); row.setGeometry(new ol.geom.Point(cd_end)); row.setStyle(style_parada); }); } };
The function is triggered on pointermove event.
pointermove
最多设置5个标签!
Yes, you can use your imagination and make a custom cluster. See this plunker demo, I use the following function to create a cluster like:
The function is triggered on
pointermove
event.