diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2015-06-13 18:28:38 +1200 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2015-06-13 18:28:38 +1200 |
commit | 9fea9e469c9856f6f6a90fb970474873fe4a9dfb (patch) | |
tree | 983b7199dbdcfab4708a57d56eeeda0ea6bbe7f3 /web/app/view/map/MapController.js | |
parent | 13448f34e263f27610391781d526353791c36026 (diff) | |
download | trackermap-server-9fea9e469c9856f6f6a90fb970474873fe4a9dfb.tar.gz trackermap-server-9fea9e469c9856f6f6a90fb970474873fe4a9dfb.tar.bz2 trackermap-server-9fea9e469c9856f6f6a90fb970474873fe4a9dfb.zip |
Implement selection panning
Diffstat (limited to 'web/app/view/map/MapController.js')
-rw-r--r-- | web/app/view/map/MapController.js | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/web/app/view/map/MapController.js b/web/app/view/map/MapController.js index 0d5176d09..5cde39494 100644 --- a/web/app/view/map/MapController.js +++ b/web/app/view/map/MapController.js @@ -144,7 +144,25 @@ Ext.define('Traccar.view.map.MapController', { }, selectPosition: function(position) { - console.log(position); // DELME + if (this.currentPosition === undefined) { + this.currentPosition = new ol.Feature({ + style: this.getLineStyle(styles.map_report_route) + }); + this.getView().vectorSource.addFeature(this.currentPosition); + } + + var point = ol.proj.fromLonLat([ + position.get('longitude'), position.get('latitude') + ]); + + this.currentPosition.setGeometry(new ol.geom.Point(point)); + + var pan = ol.animation.pan({ + duration: styles.map_delay, + source: this.getView().mapView.getCenter() + }); + this.getView().map.beforeRender(pan); + this.getView().mapView.setCenter(point); }, selectDevice: function(device) { |