[gnome-maps] Add Location class



commit 419b93f7262578a6f48356b28b55ccb7f476d20d
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date:   Wed Jun 3 12:17:57 2015 +0100

    Add Location class
    
    Add a subclass of Geocode.Location that adds a 'heading' property to
    indicate the current heading as the clock-wise angle relative to prime
    meridian.

 src/location.js                      |   46 ++++++++++++++++++++++++++++++++++
 src/org.gnome.Maps.src.gresource.xml |    1 +
 2 files changed, 47 insertions(+), 0 deletions(-)
---
diff --git a/src/location.js b/src/location.js
new file mode 100644
index 0000000..f33f111
--- /dev/null
+++ b/src/location.js
@@ -0,0 +1,46 @@
+/* -*- Mode: JS2; indent-tabs-mode: nil; js2-basic-offset: 4 -*- */
+/* vim: set et ts=4 sw=4: */
+/*
+ * Copyright (c) 2015 Red Hat Inc.
+ * Copyright (c) 2014 Jonas Danielsson
+ *
+ * GNOME Maps is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * GNOME Maps is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with GNOME Maps; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Authors: Zeeshan Ali (Khattak) <zeeshanak gnome org>
+ *          Jonas Danielsson <jonas threetimestwo org>
+ */
+
+const Geocode = imports.gi.GeocodeGlib;
+const Lang = imports.lang;
+
+/* Adds heading to Geocode.Location */
+const Location = new Lang.Class({
+    Name: 'Location',
+    Extends: Geocode.Location,
+
+    _init: function(params) {
+        this._heading = params.heading;
+        delete params.heading;
+
+        this.parent(params);
+    },
+
+    get heading() {
+        return this._heading;
+    },
+
+    set heading(v) {
+        this._heading = v;
+    },
+});
diff --git a/src/org.gnome.Maps.src.gresource.xml b/src/org.gnome.Maps.src.gresource.xml
index 1e6cdb9..247c812 100644
--- a/src/org.gnome.Maps.src.gresource.xml
+++ b/src/org.gnome.Maps.src.gresource.xml
@@ -17,6 +17,7 @@
     <file>geocodeService.js</file>
     <file>http.js</file>
     <file>layersPopover.js</file>
+    <file>location.js</file>
     <file>locationServiceNotification.js</file>
     <file>main.js</file>
     <file>mainWindow.js</file>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]