diff --git a/src/app/pages/generate/generate.page.html b/src/app/pages/generate/generate.page.html
index 51d9dd4..9fe66cc 100644
--- a/src/app/pages/generate/generate.page.html
+++ b/src/app/pages/generate/generate.page.html
@@ -215,6 +215,25 @@
+
+
+
+
+ {{ 'LATITUDE' | translate}}
+
+
+
+
+
+
+
+ {{ 'LONGITUDE' | translate}}
+
+
+
+
+
+
diff --git a/src/app/pages/generate/generate.page.ts b/src/app/pages/generate/generate.page.ts
index d1bc0ee..8056be8 100644
--- a/src/app/pages/generate/generate.page.ts
+++ b/src/app/pages/generate/generate.page.ts
@@ -5,7 +5,7 @@ import { Haptics, ImpactStyle, NotificationType } from '@capacitor/haptics';
import { AlertController, LoadingController, ToastController } from '@ionic/angular';
import { TranslateService } from '@ngx-translate/core';
import { format } from 'date-fns';
-import { EnvService } from 'src/app/services/env.service';
+import { EnvService, QrCreateContentTypeType } from 'src/app/services/env.service';
import { Toast } from '@capacitor/toast';
import { fadeIn } from 'src/app/utils/animations';
import { SplashScreen } from '@capacitor/splash-screen';
@@ -23,6 +23,7 @@ export class GeneratePage {
freeTxtText: string = "Free Text";
urlText: string = "URL";
contactText: string = "vCard Contact";
+ geolocationText: string = "Geolocation";
phoneText: string = "Phone";
smsText: string = "Message";
emailW3CText: string = "Email (W3C Standard)";
@@ -37,6 +38,9 @@ export class GeneratePage {
emailSubject: string = "";
emailBody: string = "";
+ latitude: number = 0;
+ longitude: number = 0;
+
phoneNumber: string = "";
smsMessage: string = "";
@@ -84,17 +88,18 @@ export class GeneratePage {
{ text: this.wpaText, value: "WPA" },
]
- contentTypes: { text: string, value: "freeText" | "url" | "contact" | "phone" | "sms" | "emailW3C" | "emailDocomo" | "wifi" }[] = [
+ contentTypes: { text: string, value: QrCreateContentTypeType }[] = [
{ text: this.freeTxtText, value: 'freeText' },
{ text: this.emailW3CText, value: 'emailW3C' },
{ text: this.emailDocomoText, value: 'emailDocomo' },
+ { text: this.geolocationText, value: 'geo' },
{ text: this.phoneText, value: 'phone' },
{ text: this.smsText, value: 'sms' },
{ text: this.urlText, value: 'url' },
{ text: this.contactText, value: 'contact' },
{ text: this.wifiText, value: 'wifi' },
];
- contentType: "freeText" | "url" | "contact" | "phone" | "sms" | "emailW3C" | "emailDocomo" | "wifi" = "freeText";
+ contentType: QrCreateContentTypeType = "freeText";
constructor(
public translate: TranslateService,
@@ -113,6 +118,7 @@ export class GeneratePage {
this.freeTxtText = this.translate.instant("FREE_TEXT");
this.urlText = this.translate.instant("URL");
this.contactText = this.translate.instant("VCARD_CONTACT");
+ this.geolocationText = this.translate.instant("GEOLOCATION");
this.phoneText = this.translate.instant("PHONE_NO");
this.smsText = this.translate.instant("MESSAGE");
this.emailW3CText = this.translate.instant("EMAIL_W3C_STANDARD");
@@ -122,6 +128,7 @@ export class GeneratePage {
{ text: this.freeTxtText, value: 'freeText' },
{ text: this.emailW3CText, value: 'emailW3C' },
{ text: this.emailDocomoText, value: 'emailDocomo' },
+ { text: this.geolocationText, value: 'geo' },
{ text: this.phoneText, value: 'phone' },
{ text: this.smsText, value: 'sms' },
{ text: this.urlText, value: 'url' },
@@ -195,6 +202,9 @@ export class GeneratePage {
this.emailSubject = "";
this.emailBody = "";
+ this.latitude = 0;
+ this.longitude = 0;
+
this.phoneNumber = "";
this.smsMessage = "";
@@ -263,6 +273,9 @@ export class GeneratePage {
this.qrCodeContent = `MATMSG:TO:${this.toEmails[0]};SUB:${this.emailSubject};BODY:${this.emailBody};;`;
this.qrCodeContent = encodeURI(this.qrCodeContent);
break;
+ case "geo":
+ this.qrCodeContent = `geo:${this.latitude},${this.longitude}`;
+ break;
case "phone":
this.qrCodeContent = "tel:";
this.qrCodeContent += this.phoneNumber;
@@ -348,7 +361,7 @@ export class GeneratePage {
return format(new Date(), "yyyy-MM-dd");
}
- getIcon(type: "freeText" | "url" | "contact" | "phone" | "sms" | "emailW3C" | "emailDocomo" | "wifi"): string {
+ getIcon(type: QrCreateContentTypeType): string {
switch (type) {
case "freeText":
return "format_align_left";
@@ -356,6 +369,8 @@ export class GeneratePage {
return "link";
case "contact":
return "contact_phone";
+ case "geo":
+ return "location_on";
case "phone":
return "call";
case "sms":
@@ -371,7 +386,7 @@ export class GeneratePage {
}
}
- getText(type: "freeText" | "url" | "contact" | "phone" | "sms" | "emailW3C" | "emailDocomo" | "wifi"): string {
+ getText(type: QrCreateContentTypeType): string {
switch (type) {
case "freeText":
return this.freeTxtText;
@@ -379,6 +394,8 @@ export class GeneratePage {
return this.urlText;
case "contact":
return this.contactText;
+ case "geo":
+ return this.geolocationText;
case "phone":
return this.phoneText;
case "sms":
diff --git a/src/app/pages/result/result.page.html b/src/app/pages/result/result.page.html
index 877ba4b..8f46a12 100644
--- a/src/app/pages/result/result.page.html
+++ b/src/app/pages/result/result.page.html
@@ -96,6 +96,15 @@
[ngTemplateOutletContext]="{ label: 'HIDDEN_NETWORK_?' | translate, content: wifiHidden === true? ('YES' | translate) : ('NO' | translate) }">
+ 0 && latitude != null"
+ [ngTemplateOutlet]="contentBlock" [ngTemplateOutletContext]="{ label: 'LATITUDE' | translate, content: latitude }">
+
+
+ 0 && longitude != null"
+ [ngTemplateOutlet]="contentBlock"
+ [ngTemplateOutletContext]="{ label: 'LONGITUDE' | translate, content: longitude }">
+
+
@@ -126,6 +135,13 @@
+
+
+
+
+
+
@@ -245,10 +261,11 @@
{{ 'BROWSE' | translate}}
-
-
+
{{ 'OPEN' | translate}}
{{ hint }}
-