From c8de13d37661579d26ba81f82059e123e5ddc961 Mon Sep 17 00:00:00 2001 From: Trent Larson Date: Sun, 27 Aug 2023 20:20:16 -0600 Subject: [PATCH] add link to map on projects which have a location --- project.task.yaml | 8 ++------ src/main.ts | 2 ++ src/views/HomeView.vue | 2 +- src/views/ProjectViewView.vue | 28 ++++++++++++++++++++++++++++ 4 files changed, 33 insertions(+), 7 deletions(-) diff --git a/project.task.yaml b/project.task.yaml index 47d41055..e2d52d7c 100644 --- a/project.task.yaml +++ b/project.task.yaml @@ -2,16 +2,12 @@ tasks: - test alerts on all pages -- or refactor to new "notify" (since AlertMessage refactoring may require a change, et. ContactQRScanShowView) - .2 bug - on contacts view, click on "to" & "from" and nothing happens -- 01 add a location for a project via map pin : - - add with a "location" field containing this: { "geo":{ "@type":"GeoCoordinates", "latitude":40.883944, "longitude":-111.884787 } } - 40 notifications : - push, where we trigger a ServiceWorker(?) in the app to reach out and check for new data assignee:matthew -- 01 add a location for a project via map pin -- 04 search by a bounding box for local projects (see API by clicking on "Nearby") +- 01 add my bounding box(es) of interest for searches on Nearby part of Discovery page +- .5 search by a bounding box(s) of interest for local projects (see API by clicking on "Nearby") - 01 Replace Gifted/Give in ContactsView with GiftedDialog assignee:matthew -- 02 Fix images on projectview - allow choice of image from a pallete of images or a url image (discovery page display also) - - SEE: https://github.com/dmester/jdenticon assignee:jose - 08 Scan QR code to import into contacts assignee:matthew - SEE: https://github.com/gruhn/vue-qrcode-reader diff --git a/src/main.ts b/src/main.ts index d4d91958..980b0e84 100644 --- a/src/main.ts +++ b/src/main.ts @@ -35,6 +35,7 @@ import { faGift, faHand, faHouseChimney, + faLocationDot, faLongArrowAltLeft, faLongArrowAltRight, faMagnifyingGlass, @@ -80,6 +81,7 @@ library.add( faGift, faHand, faHouseChimney, + faLocationDot, faLongArrowAltLeft, faLongArrowAltRight, faMagnifyingGlass, diff --git a/src/views/HomeView.vue b/src/views/HomeView.vue index f2198cb0..6031e0b6 100644 --- a/src/views/HomeView.vue +++ b/src/views/HomeView.vue @@ -111,7 +111,7 @@

Quick Action

-

Show appreciation to a contact:

+

Record a gift from a contact:

+
+ + + Map View + +
@@ -231,6 +241,8 @@ export default class ProjectViewView extends Vue { expanded = false; givesToThis: Array = []; givesByThis: Array = []; + latitude = 0; + longitude = 0; name = ""; issuer = ""; projectId = localStorage.getItem("projectId") || ""; // handle ID @@ -326,6 +338,8 @@ export default class ProjectViewView extends Vue { this.name = resp.data.claim?.name || "(no name)"; this.description = resp.data.claim?.description || "(no description)"; this.truncatedDesc = this.description.slice(0, this.truncateLength); + this.latitude = resp.data.claim?.location?.geo?.latitude || 0; + this.longitude = resp.data.claim?.location?.geo?.longitude || 0; } else if (resp.status === 404) { // actually, axios throws an error so we never get here this.$notify( @@ -441,6 +455,20 @@ export default class ProjectViewView extends Vue { this.$refs.customDialog.open(contact); } + getOpenStreetMapUrl() { + // Google URL is https://maps.google.com/?q=LAT,LONG + return ( + "https://www.openstreetmap.org/?mlat=" + + this.latitude + + "&mlon=" + + this.longitude + + "#map=15/" + + this.latitude + + "/" + + this.longitude + ); + } + handleDialogResult(result) { if (result.action === "confirm") { return new Promise((resolve) => {