aboutsummaryrefslogtreecommitdiff
path: root/web/app/view
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2015-11-21 11:42:39 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2015-11-21 11:42:39 +1300
commit9eed88cba15f8fc7e12a0a6d5083fa7bfd890165 (patch)
tree1ac893e39ce69a84733cc3847b3ed8c9cb9583fe /web/app/view
parent6280260c9d767844e8233912064443f166900406 (diff)
downloadtraccar-server-9eed88cba15f8fc7e12a0a6d5083fa7bfd890165.tar.gz
traccar-server-9eed88cba15f8fc7e12a0a6d5083fa7bfd890165.tar.bz2
traccar-server-9eed88cba15f8fc7e12a0a6d5083fa7bfd890165.zip
Implement clustering for report
Diffstat (limited to 'web/app/view')
-rw-r--r--web/app/view/Map.js16
1 files changed, 4 insertions, 12 deletions
diff --git a/web/app/view/Map.js b/web/app/view/Map.js
index a2bbdc92c..d9b041535 100644
--- a/web/app/view/Map.js
+++ b/web/app/view/Map.js
@@ -99,21 +99,13 @@ Ext.define('Traccar.view.Map', {
this.reportSource = new ol.source.Vector({});
reportLayer = new ol.layer.Vector({
source: new ol.source.Cluster({
- distance: 40,
+ distance: Traccar.Style.mapClusterDistance,
source: this.reportSource
}),
style: function (feature, resolution) {
- style = [new ol.style.Style({
- image: new ol.style.Circle({
- radius: feature.get('radius'),
- fill: new ol.style.Fill({
- color: [255, 153, 0, Math.min(0.8, 0.4 + (feature.get('features').length / 100))]
- })
- }),
- text: new ol.style.Text({
- text: feature.get('features').length.toString()
- })
- })];
+ if (feature.get('features').length == 1) {
+ return [feature.get('features')[0].getStyle()];
+ }
}
});