[gnome-maps/wip/mlundblad/replace-bbox-and-ensure-visible: 6/7] Add constants module




commit 42f4465a1b775e9f4f3fb84d9e5ec2166a544b08
Author: Marcus Lundblad <ml update uu se>
Date:   Sat Feb 20 15:23:43 2021 +0100

    Add constants module
    
    Add module with common constants, for now containing
    coordinate constrains nessesary to re-implement
    the bounding box from libchamplain.

 src/constants.js                     | 28 ++++++++++++++++++++++++++++
 src/org.gnome.Maps.src.gresource.xml |  1 +
 2 files changed, 29 insertions(+)
---
diff --git a/src/constants.js b/src/constants.js
new file mode 100644
index 00000000..a3419ec7
--- /dev/null
+++ b/src/constants.js
@@ -0,0 +1,28 @@
+/* -*- Mode: JS2; indent-tabs-mode: nil; js2-basic-offset: 4 -*- */
+/* vim: set et ts=4 sw=4: */
+/*
+ * Copyright (c) 2021, Marcus Lundblad
+ *
+ * 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/>.
+ *
+ * Author: Marcus Lundblad <ml update uu se>
+ */
+
+/**
+ * Constraints of visible location in the standard Mercaartor projection.
+ */
+var MIN_LATITUDE = -85.0511287798;
+var MAX_LATITUDE = 85.0511287798;
+var MIN_LONGITUDE = -180;
+var MAX_LONGITUDE = 180;
diff --git a/src/org.gnome.Maps.src.gresource.xml b/src/org.gnome.Maps.src.gresource.xml
index af1f606b..70fa7df9 100644
--- a/src/org.gnome.Maps.src.gresource.xml
+++ b/src/org.gnome.Maps.src.gresource.xml
@@ -9,6 +9,7 @@
     <file>color.js</file>
     <file>contactPlace.js</file>
     <file>contextMenu.js</file>
+    <file>constants.js</file>
     <file>epaf.js</file>
     <file>exportViewDialog.js</file>
     <file>facebookBackend.js</file>


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