Change ol.Object event name syntax
'changed' to 'change' and '<attribute>_changed' to 'change:<attribute>'.
This commit is contained in:
@@ -31,7 +31,7 @@ var marker = new ol.Overlay({
|
||||
// bind the marker position to the device location.
|
||||
marker.bindTo('position', geolocation);
|
||||
|
||||
geolocation.addEventListener('accuracy_changed', function() {
|
||||
geolocation.on('change:accuracy', function() {
|
||||
$(marker.getElement()).tooltip({
|
||||
title: this.getAccuracy() + 'm from this point'
|
||||
});
|
||||
|
||||
@@ -29,7 +29,7 @@ var geolocation = new ol.Geolocation({
|
||||
tracking: true
|
||||
});
|
||||
geolocation.bindTo('projection', view);
|
||||
geolocation.once('position_changed', function() {
|
||||
geolocation.once('change:position', function() {
|
||||
view.setCenter(geolocation.getPosition());
|
||||
view.setResolution(2.388657133911758);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user