diff --git a/platforms/android/.gradle/2.2.1/taskArtifacts/cache.properties.lock b/platforms/android/.gradle/2.2.1/taskArtifacts/cache.properties.lock index 822f385..cf35cda 100644 Binary files a/platforms/android/.gradle/2.2.1/taskArtifacts/cache.properties.lock and b/platforms/android/.gradle/2.2.1/taskArtifacts/cache.properties.lock differ diff --git a/platforms/android/.gradle/2.2.1/taskArtifacts/fileHashes.bin b/platforms/android/.gradle/2.2.1/taskArtifacts/fileHashes.bin index cb6fe8a..e5e5bd9 100644 Binary files a/platforms/android/.gradle/2.2.1/taskArtifacts/fileHashes.bin and b/platforms/android/.gradle/2.2.1/taskArtifacts/fileHashes.bin differ diff --git a/platforms/android/.gradle/2.2.1/taskArtifacts/fileSnapshots.bin b/platforms/android/.gradle/2.2.1/taskArtifacts/fileSnapshots.bin index d115e0f..fddc7fd 100644 Binary files a/platforms/android/.gradle/2.2.1/taskArtifacts/fileSnapshots.bin and b/platforms/android/.gradle/2.2.1/taskArtifacts/fileSnapshots.bin differ diff --git a/platforms/android/.gradle/2.2.1/taskArtifacts/taskArtifacts.bin b/platforms/android/.gradle/2.2.1/taskArtifacts/taskArtifacts.bin index 0146abc..f13e364 100644 Binary files a/platforms/android/.gradle/2.2.1/taskArtifacts/taskArtifacts.bin and b/platforms/android/.gradle/2.2.1/taskArtifacts/taskArtifacts.bin differ diff --git a/platforms/android/assets/www/assets/bars.svg b/platforms/android/assets/www/assets/bars.svg new file mode 100644 index 0000000..a3cd72b --- /dev/null +++ b/platforms/android/assets/www/assets/bars.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/platforms/android/assets/www/css/main.css b/platforms/android/assets/www/css/main.css index 71505a5..7ccc5f3 100644 --- a/platforms/android/assets/www/css/main.css +++ b/platforms/android/assets/www/css/main.css @@ -193,4 +193,37 @@ body { .chatbox #chatmsgs .chat-username { color: green; font-weight: bold; +} + +#buttons { + position: absolute; + right: 0px; + top: 25%; + width: 70px; + padding-top: auto; + padding-bottom: auto; + padding-right: 10px; + display: block; + z-index: 9000; +} + +#buttons .circlebutton { + border: 1px solid black; + background: rgba(255,255,255,.8); + border-radius: 50%; + box-shadow: 0 0 5px grey; + width: 60px; + height: 60px; +} + +#buttons .circlebutton img { + position: absolute; + top: 5px; + left: 5px; + width: 50px; + height: 50px; +} + +.scrollable-box { + overflow-y: auto; } \ No newline at end of file diff --git a/platforms/android/assets/www/js/auth.js b/platforms/android/assets/www/js/auth.js index bf89c78..1690630 100644 --- a/platforms/android/assets/www/js/auth.js +++ b/platforms/android/assets/www/js/auth.js @@ -4,6 +4,14 @@ var authOpInProgress = false; +function logout() { + localStorage.setItem("username", ''); + localStorage.setItem("password", ''); + username = null; + password = null; + $('#content-zone').load("screens/login.html"); +} + function dosignup() { if (authOpInProgress) { return; diff --git a/platforms/android/assets/www/js/home.js b/platforms/android/assets/www/js/home.js index 88f8da5..ff06c71 100644 --- a/platforms/android/assets/www/js/home.js +++ b/platforms/android/assets/www/js/home.js @@ -20,7 +20,7 @@ var lastgpstime = 0; var terraintypeid = 0; var map = L.map('map'); var tileurl = "http://tile.stamen.com/terrain/{z}/{x}/{y}.jpg"; -map.setZoom(16); +map.setZoom(17); map.dragging.disable(); //map.touchZoom.disable(); //map.doubleClickZoom.disable(); @@ -64,13 +64,28 @@ var lc = L.control.locate({ }, locateOptions: {} // define location options e.g enableHighAccuracy: true or maxZoom: 10 }).addTo(map); -map.addLayer(new L.tileLayer(tileurl, {minZoom: 15, maxZoom: 17})); - +map.addLayer(new L.tileLayer(tileurl, {minZoom: 17, maxZoom: 17})); +// GeoJSON layer +var placeLayer = L.geoJson( + {"name": "Places", "type": "FeatureCollection", "features": [{"type": "Feature", "geometry": {"type": "Point", "coordinates": [0, 0]}, "properties": {"osm_id": -1, "name": null}}]}, +{ + onEachFeature: onPlaceTap, + pointToLayer: function (feature, latlng) { + return L.circleMarker(latlng, { + radius: 8, + fillColor: "#ff7800", + color: "#000", + weight: 1, + opacity: 1, + fillOpacity: 0.8 + }); + } +}).addTo(map); lc.start(); - function mapPos(lat, lon) { lockGot = true; hideLoading(); + loadPlaces(latitude, longitude); //map.setView(new L.LatLng(lat, lon), 16, {animate: true}); //map.panTo(new L.LatLng(lat, lon)); //map.invalidateSize(); @@ -82,6 +97,30 @@ function mapPos(lat, lon) { // }, 100); } +function onPlaceTap(feature, layer) { + layer.on('click', function (e) { + + }); +} + +function loadPlaces(lat, long) { + $.getJSON( + "http://earth.apis.netsyms.net/places.php?format=geojson&lat=" + lat + "&long=" + long + "&radius=.25&names=1", + function (data) { + if (data.type === 'FeatureCollection') { + placeLayer.clearLayers(); + data.features.forEach(function (item) { + item.properties.popupContent = "" + item.properties.name + ""; + placeLayer.addData(item); + }); + } + }); +} + +function openplace(osmid) { + alert(osmid); +} + /** * Hide the loading overlay if everything is loaded, otherwise do nothing */ @@ -105,7 +144,6 @@ var updatePosition = function (position) { } mapPos(latitude, longitude); }; - var updateTerrain = function (position) { latitude = position.coords.latitude; longitude = position.coords.longitude; @@ -125,14 +163,12 @@ var updateTerrain = function (position) { $('#terrain-image').attr('src', 'assets/terrain/0.png'); }); }; - function pingServer() { if (lockGot && gpsaccuracy < 30) { $.get(mkApiUrl('ping') + "?user=" + username + "&lat=" + latitude + "&long=" + longitude); } } ; - function onError(error) { $('#loading-error').text("Check your device's network and location settings, and ensure a clear view of the sky."); } @@ -149,7 +185,6 @@ function popGPS() { $('#terrain-image').click(function () { popGPS(); }); - // Initial GPS position and stuff navigator.geolocation.getCurrentPosition(updateTerrain, onError, {timeout: 10000, enableHighAccuracy: true}); // Update position @@ -159,18 +194,14 @@ setInterval(function () { // Update position + terrain setInterval(function () { navigator.geolocation.getCurrentPosition(updateTerrain, onError, {timeout: 10000, enableHighAccuracy: true}); -}, 1000 * 10); + loadPlaces(latitude, longitude); +}, 1000 * 20); // Ping the server with coordinates setInterval(pingServer, 5000); // Show error if it's taking too long setTimeout(function () { onError(); }, 15 * 1000); - - - - - ////////////////////////////////////////////// // Profile, stats, and chat stuff ////////////////////////////////////////////// @@ -228,7 +259,6 @@ setInterval(function () { setInterval(function () { getChat(); }, 2000); - // Send chat messages $("#chatsendform").submit(function (event) { message = $('#chatbox-input').val(); @@ -248,7 +278,6 @@ $("#chatsendform").submit(function (event) { event.preventDefault(); return false; }); - function toggleChat() { if ($('#chatmsgs').css('display') === 'none') { openChat(); @@ -280,6 +309,15 @@ function openRules() { }); } +function openMenu(topage) { + topage = typeof topage !== 'undefined' ? topage : ""; + $('#main-content').load("screens/menu.html", null, function (x) { + $('#overlay-main').css('display', 'block'); + if (topage !== '') { + $('#' + topage + '-tab').tab('show'); + } + }); +} @@ -302,7 +340,6 @@ document.addEventListener("backbutton", function (event) { toggleChat(); } }, false); - // Show the rules if (localStorage.getItem("seenrules") !== 'yes') { openRules(); diff --git a/platforms/android/assets/www/screens/home.html b/platforms/android/assets/www/screens/home.html index 7445801..ad6f529 100644 --- a/platforms/android/assets/www/screens/home.html +++ b/platforms/android/assets/www/screens/home.html @@ -23,7 +23,7 @@
-

+

@@ -31,6 +31,13 @@

Energy

+ +
+
+ Menu +
+
+
diff --git a/platforms/android/assets/www/screens/inventory.html b/platforms/android/assets/www/screens/inventory.html index e69de29..d6694d0 100644 --- a/platforms/android/assets/www/screens/inventory.html +++ b/platforms/android/assets/www/screens/inventory.html @@ -0,0 +1,3 @@ +
+ +
\ No newline at end of file diff --git a/platforms/android/assets/www/screens/login.html b/platforms/android/assets/www/screens/login.html index 37cf105..3d75bd1 100644 --- a/platforms/android/assets/www/screens/login.html +++ b/platforms/android/assets/www/screens/login.html @@ -40,11 +40,11 @@ \ No newline at end of file diff --git a/platforms/android/assets/www/screens/profile.html b/platforms/android/assets/www/screens/profile.html index ed04291..e13a063 100644 --- a/platforms/android/assets/www/screens/profile.html +++ b/platforms/android/assets/www/screens/profile.html @@ -1,59 +1,61 @@ -
-

-
Badges
-
- Loading... -
-
+
+
+

+
Badges
+
+ Loading... +
+
-
- \ No newline at end of file + ).fail( + function (err) { + $('#loading-badges').html('Loading failed. Reload"'); + } + ); + } + +
\ No newline at end of file diff --git a/platforms/android/assets/www/screens/rules.html b/platforms/android/assets/www/screens/rules.html index 6ccde85..24d06ce 100644 --- a/platforms/android/assets/www/screens/rules.html +++ b/platforms/android/assets/www/screens/rules.html @@ -1,18 +1,20 @@ -
Rules
-

Please read these rules. Because TerranQuest is a game involving other - people and the environment, it's important to show good etiquette.

-
    -
  1. Do not endanger yourself or others
  2. -
  3. be considerate and polite in the in-game chat, and don't swear
  4. -
  5. Observe all local laws and rules
  6. -
  7. Respect property rights and obtain permission for playing on private land
  8. -
  9. Be nice to other people and try not to look too creepy
  10. -
  11. Respect and minimize your impact on the environment
  12. -
  13. Don't tamper with or deface any objects, landmarks, barcodes, or other real-world items
  14. -
  15. Pick up any trash you find and dispose of it properly if you can
  16. -
  17. Socialize with any players of other games, such as Geocaching and Ingress, you might meet
  18. -
  19. Follow the Netsyms Technologies Terms of Service at netsyms.com/legal
  20. - -
\ No newline at end of file +
+
Rules
+

Please read these rules. Because TerranQuest is a game involving other + people and the environment, it's important to show good etiquette.

+
    +
  1. Do not endanger yourself or others
  2. +
  3. Be considerate and polite in the in-game chat, and don't swear
  4. +
  5. Observe all local laws and rules
  6. +
  7. Respect property rights and obtain permission for playing on private land
  8. +
  9. Be nice to other people and try not to look too creepy
  10. +
  11. Respect and minimize your impact on the environment
  12. +
  13. Don't tamper with or deface any objects, landmarks, barcodes, or other real-world items
  14. +
  15. Pick up any trash you find and dispose of it properly if you can
  16. +
  17. Socialize with any players of other games, such as Geocaching and Ingress, you might meet
  18. +
  19. Follow the Netsyms Technologies Terms of Service at netsyms.com/legal
  20. + +
+
\ No newline at end of file diff --git a/platforms/android/assets/www/screens/settings.html b/platforms/android/assets/www/screens/settings.html new file mode 100644 index 0000000..b370c7d --- /dev/null +++ b/platforms/android/assets/www/screens/settings.html @@ -0,0 +1,26 @@ +
+
+
+ Logout from app +
+
+

+ Third-Party Licenses +
+ Map tiles by Stamen Design (stamen.com), under CC BY 3.0 (creativecommons.org/licenses/by/3.0). +
+ Map tile data by OpenStreetMap (openstreetmap.org), under CC BY-SA (creativecommons.org/licenses/by-sa/3.0). +
+ Places from OpenStreetMap and contributers, licensed under the ODbL (opendatacommons.org/licenses/odbl). Email apis@netsyms.com for free access to our API. +
+ Map display is powered by Leaflet (leafletjs.com), copyright (c) 2010-2016, Vladimir Agafonkin and copyright (c) 2010-2011, CloudMade. BSD 2-clause license. +
+ Terrain information for the United States from the MRLC National Land Cover Database 2011 (mrlc.gov). +
+ Weather data Powered by Forecast (forecast.io). +
+ Geocache data from the OpenCaching.US OKAPI. Data licensed under the CC BY-NC-SA 2.5 (creativecommons.org/licenses/by-nc-sa/2.5). +

+
+
+
\ No newline at end of file diff --git a/www/assets/bars.svg b/www/assets/bars.svg new file mode 100644 index 0000000..a3cd72b --- /dev/null +++ b/www/assets/bars.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/www/css/main.css b/www/css/main.css index 71505a5..468f96c 100644 --- a/www/css/main.css +++ b/www/css/main.css @@ -193,4 +193,37 @@ body { .chatbox #chatmsgs .chat-username { color: green; font-weight: bold; +} + +#buttons { + position: absolute; + right: 0px; + top: 25%; + width: 70px; + padding-top: auto; + padding-bottom: auto; + padding-right: 10px; + display: block; + z-index: 9000; +} + +#buttons .circlebutton { + border: 1px solid black; + background: rgba(255,255,255,.8); + border-radius: 50%; + box-shadow: 0 0 5px grey; + width: 60px; + height: 60px; +} + +#buttons .circlebutton img { + position: absolute; + top: 15px; + left: 15px; + width: 30px; + height: 30px; +} + +.scrollable-box { + overflow-y: auto; } \ No newline at end of file diff --git a/www/js/auth.js b/www/js/auth.js index bf89c78..1690630 100644 --- a/www/js/auth.js +++ b/www/js/auth.js @@ -4,6 +4,14 @@ var authOpInProgress = false; +function logout() { + localStorage.setItem("username", ''); + localStorage.setItem("password", ''); + username = null; + password = null; + $('#content-zone').load("screens/login.html"); +} + function dosignup() { if (authOpInProgress) { return; diff --git a/www/js/home.js b/www/js/home.js index 88f8da5..ff06c71 100644 --- a/www/js/home.js +++ b/www/js/home.js @@ -20,7 +20,7 @@ var lastgpstime = 0; var terraintypeid = 0; var map = L.map('map'); var tileurl = "http://tile.stamen.com/terrain/{z}/{x}/{y}.jpg"; -map.setZoom(16); +map.setZoom(17); map.dragging.disable(); //map.touchZoom.disable(); //map.doubleClickZoom.disable(); @@ -64,13 +64,28 @@ var lc = L.control.locate({ }, locateOptions: {} // define location options e.g enableHighAccuracy: true or maxZoom: 10 }).addTo(map); -map.addLayer(new L.tileLayer(tileurl, {minZoom: 15, maxZoom: 17})); - +map.addLayer(new L.tileLayer(tileurl, {minZoom: 17, maxZoom: 17})); +// GeoJSON layer +var placeLayer = L.geoJson( + {"name": "Places", "type": "FeatureCollection", "features": [{"type": "Feature", "geometry": {"type": "Point", "coordinates": [0, 0]}, "properties": {"osm_id": -1, "name": null}}]}, +{ + onEachFeature: onPlaceTap, + pointToLayer: function (feature, latlng) { + return L.circleMarker(latlng, { + radius: 8, + fillColor: "#ff7800", + color: "#000", + weight: 1, + opacity: 1, + fillOpacity: 0.8 + }); + } +}).addTo(map); lc.start(); - function mapPos(lat, lon) { lockGot = true; hideLoading(); + loadPlaces(latitude, longitude); //map.setView(new L.LatLng(lat, lon), 16, {animate: true}); //map.panTo(new L.LatLng(lat, lon)); //map.invalidateSize(); @@ -82,6 +97,30 @@ function mapPos(lat, lon) { // }, 100); } +function onPlaceTap(feature, layer) { + layer.on('click', function (e) { + + }); +} + +function loadPlaces(lat, long) { + $.getJSON( + "http://earth.apis.netsyms.net/places.php?format=geojson&lat=" + lat + "&long=" + long + "&radius=.25&names=1", + function (data) { + if (data.type === 'FeatureCollection') { + placeLayer.clearLayers(); + data.features.forEach(function (item) { + item.properties.popupContent = "" + item.properties.name + ""; + placeLayer.addData(item); + }); + } + }); +} + +function openplace(osmid) { + alert(osmid); +} + /** * Hide the loading overlay if everything is loaded, otherwise do nothing */ @@ -105,7 +144,6 @@ var updatePosition = function (position) { } mapPos(latitude, longitude); }; - var updateTerrain = function (position) { latitude = position.coords.latitude; longitude = position.coords.longitude; @@ -125,14 +163,12 @@ var updateTerrain = function (position) { $('#terrain-image').attr('src', 'assets/terrain/0.png'); }); }; - function pingServer() { if (lockGot && gpsaccuracy < 30) { $.get(mkApiUrl('ping') + "?user=" + username + "&lat=" + latitude + "&long=" + longitude); } } ; - function onError(error) { $('#loading-error').text("Check your device's network and location settings, and ensure a clear view of the sky."); } @@ -149,7 +185,6 @@ function popGPS() { $('#terrain-image').click(function () { popGPS(); }); - // Initial GPS position and stuff navigator.geolocation.getCurrentPosition(updateTerrain, onError, {timeout: 10000, enableHighAccuracy: true}); // Update position @@ -159,18 +194,14 @@ setInterval(function () { // Update position + terrain setInterval(function () { navigator.geolocation.getCurrentPosition(updateTerrain, onError, {timeout: 10000, enableHighAccuracy: true}); -}, 1000 * 10); + loadPlaces(latitude, longitude); +}, 1000 * 20); // Ping the server with coordinates setInterval(pingServer, 5000); // Show error if it's taking too long setTimeout(function () { onError(); }, 15 * 1000); - - - - - ////////////////////////////////////////////// // Profile, stats, and chat stuff ////////////////////////////////////////////// @@ -228,7 +259,6 @@ setInterval(function () { setInterval(function () { getChat(); }, 2000); - // Send chat messages $("#chatsendform").submit(function (event) { message = $('#chatbox-input').val(); @@ -248,7 +278,6 @@ $("#chatsendform").submit(function (event) { event.preventDefault(); return false; }); - function toggleChat() { if ($('#chatmsgs').css('display') === 'none') { openChat(); @@ -280,6 +309,15 @@ function openRules() { }); } +function openMenu(topage) { + topage = typeof topage !== 'undefined' ? topage : ""; + $('#main-content').load("screens/menu.html", null, function (x) { + $('#overlay-main').css('display', 'block'); + if (topage !== '') { + $('#' + topage + '-tab').tab('show'); + } + }); +} @@ -302,7 +340,6 @@ document.addEventListener("backbutton", function (event) { toggleChat(); } }, false); - // Show the rules if (localStorage.getItem("seenrules") !== 'yes') { openRules(); diff --git a/www/screens/home.html b/www/screens/home.html index 7445801..ad6f529 100644 --- a/www/screens/home.html +++ b/www/screens/home.html @@ -23,7 +23,7 @@
-

+

@@ -31,6 +31,13 @@

Energy

+ +
+
+ Menu +
+
+
diff --git a/www/screens/inventory.html b/www/screens/inventory.html index e69de29..d6694d0 100644 --- a/www/screens/inventory.html +++ b/www/screens/inventory.html @@ -0,0 +1,3 @@ +
+ +
\ No newline at end of file diff --git a/www/screens/login.html b/www/screens/login.html index 37cf105..3d75bd1 100644 --- a/www/screens/login.html +++ b/www/screens/login.html @@ -40,11 +40,11 @@ \ No newline at end of file diff --git a/www/screens/profile.html b/www/screens/profile.html index ed04291..e13a063 100644 --- a/www/screens/profile.html +++ b/www/screens/profile.html @@ -1,59 +1,61 @@ -
-

-
Badges
-
- Loading... -
-
+
+
+

+
Badges
+
+ Loading... +
+
-
- \ No newline at end of file + ).fail( + function (err) { + $('#loading-badges').html('Loading failed. Reload"'); + } + ); + } + +
\ No newline at end of file diff --git a/www/screens/rules.html b/www/screens/rules.html index ef62fa0..24d06ce 100644 --- a/www/screens/rules.html +++ b/www/screens/rules.html @@ -1,18 +1,20 @@ -
Rules
-

Please read these rules. Because TerranQuest is a game involving other - people and the environment, it's important to show good etiquette.

-
    -
  1. Do not endanger yourself or others
  2. -
  3. Be considerate and polite in the in-game chat, and don't swear
  4. -
  5. Observe all local laws and rules
  6. -
  7. Respect property rights and obtain permission for playing on private land
  8. -
  9. Be nice to other people and try not to look too creepy
  10. -
  11. Respect and minimize your impact on the environment
  12. -
  13. Don't tamper with or deface any objects, landmarks, barcodes, or other real-world items
  14. -
  15. Pick up any trash you find and dispose of it properly if you can
  16. -
  17. Socialize with any players of other games, such as Geocaching and Ingress, you might meet
  18. -
  19. Follow the Netsyms Technologies Terms of Service at netsyms.com/legal
  20. - -
\ No newline at end of file +
+
Rules
+

Please read these rules. Because TerranQuest is a game involving other + people and the environment, it's important to show good etiquette.

+
    +
  1. Do not endanger yourself or others
  2. +
  3. Be considerate and polite in the in-game chat, and don't swear
  4. +
  5. Observe all local laws and rules
  6. +
  7. Respect property rights and obtain permission for playing on private land
  8. +
  9. Be nice to other people and try not to look too creepy
  10. +
  11. Respect and minimize your impact on the environment
  12. +
  13. Don't tamper with or deface any objects, landmarks, barcodes, or other real-world items
  14. +
  15. Pick up any trash you find and dispose of it properly if you can
  16. +
  17. Socialize with any players of other games, such as Geocaching and Ingress, you might meet
  18. +
  19. Follow the Netsyms Technologies Terms of Service at netsyms.com/legal
  20. + +
+
\ No newline at end of file diff --git a/www/screens/settings.html b/www/screens/settings.html new file mode 100644 index 0000000..b370c7d --- /dev/null +++ b/www/screens/settings.html @@ -0,0 +1,26 @@ +
+
+
+ Logout from app +
+
+

+ Third-Party Licenses +
+ Map tiles by Stamen Design (stamen.com), under CC BY 3.0 (creativecommons.org/licenses/by/3.0). +
+ Map tile data by OpenStreetMap (openstreetmap.org), under CC BY-SA (creativecommons.org/licenses/by-sa/3.0). +
+ Places from OpenStreetMap and contributers, licensed under the ODbL (opendatacommons.org/licenses/odbl). Email apis@netsyms.com for free access to our API. +
+ Map display is powered by Leaflet (leafletjs.com), copyright (c) 2010-2016, Vladimir Agafonkin and copyright (c) 2010-2011, CloudMade. BSD 2-clause license. +
+ Terrain information for the United States from the MRLC National Land Cover Database 2011 (mrlc.gov). +
+ Weather data Powered by Forecast (forecast.io). +
+ Geocache data from the OpenCaching.US OKAPI. Data licensed under the CC BY-NC-SA 2.5 (creativecommons.org/licenses/by-nc-sa/2.5). +

+
+
+
\ No newline at end of file