| | |
| | | source: clusterSource, |
| | | style: function (feature) { |
| | | var size = feature.get("features").length; |
| | | if (size == 1) { |
| | | if (size <= 100) { |
| | | return new ol.style.Style({ |
| | | image: new ol.style.Icon({ |
| | | anchor: [0.5, 1], |
| | |
| | | source: clusterSource, |
| | | style: function (feature) { |
| | | var size = feature.get("features").length; |
| | | if (size == 1) { |
| | | if (size <= 100) { |
| | | return new ol.style.Style({ |
| | | image: new ol.style.Icon({ |
| | | anchor: [0.5, 1], |
| | |
| | | source: clusterSource, |
| | | style: function (feature) { |
| | | var size = feature.get("features").length; |
| | | if (size == 1) { |
| | | if (size <= 100) { |
| | | return new ol.style.Style({ |
| | | image: new ol.style.Icon({ |
| | | anchor: [0.5, 1], |
| | |
| | | |
| | | // 创建聚合层 |
| | | var clusterSource = new ol.source.Cluster({ |
| | | distance: 40, |
| | | distance: 200, |
| | | source: vectorSource, |
| | | }); |
| | | |
| | |
| | | source: clusterSource, |
| | | style: function (feature) { |
| | | var size = feature.get("features").length; |
| | | if (size == 1) { |
| | | if (size <= 1300) { |
| | | return new ol.style.Style({ |
| | | image: new ol.style.Icon({ |
| | | anchor: [0.5, 1], |