[gnome-maps] MapView: Add userLocationVisible() method
- From: Zeeshan Ali Khattak <zeeshanak src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-maps] MapView: Add userLocationVisible() method
- Date: Wed, 17 Apr 2013 14:10:34 +0000 (UTC)
commit 9c66c5140807ad710ed395bd0de1e3fd4eb00697
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date: Wed Apr 17 17:04:53 2013 +0300
MapView: Add userLocationVisible() method
A method to check if user location is currently visible on the map view.
src/mapView.js | 6 ++++++
1 file changed, 6 insertions(+)
---
diff --git a/src/mapView.js b/src/mapView.js
index c854dcf..da13698 100644
--- a/src/mapView.js
+++ b/src/mapView.js
@@ -142,6 +142,12 @@ const MapView = new Lang.Class({
this._userLocation.goTo(animate);
},
+ userLocationVisible: function() {
+ let box = this.view.get_bounding_box();
+
+ return box.covers(this._userLocation.latitude, this._userLocation.longitude);
+ },
+
_showUserLocation: function() {
let lastLocation = Application.settings.get_value('last-location');
if (lastLocation.n_children() >= 3) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]