From 0ce80a0d20b1dfdbfbfbd085414ac73080cc1bfd Mon Sep 17 00:00:00 2001 From: "CHIEFSOFT\\ameye" Date: Wed, 25 Oct 2023 17:34:16 -0400 Subject: [PATCH] location maps --- REMEMBER.txt | 8 ++- .../locationmaps-routing.module.ts | 17 +++++ .../locationmaps/locationmaps.module.ts | 20 ++++++ .../locationmaps/locationmaps.page.html | 9 +++ .../locationmaps/locationmaps.page.scss | 0 .../locationmaps/locationmaps.page.spec.ts | 24 +++++++ .../locationmaps/locationmaps.page.ts | 15 ++++ src/app/app-routing.module.ts | 4 ++ .../tracking/tracking.component.html | 3 + .../tracking/tracking.component.scss | 6 ++ .../tracking/tracking.component.spec.ts | 24 +++++++ .../components/tracking/tracking.component.ts | 70 +++++++++++++++++++ src/app/interfaces/location.ts | 14 ++++ src/app/interfaces/marker.ts | 11 +++ .../pages/familymember/familymember.page.html | 70 ++++++++++++++++++- .../pages/familymember/familymember.page.scss | 25 +++++++ .../pages/familymember/familymember.page.ts | 16 +++++ src/app/pages/home/home.module.ts | 10 ++- src/app/pages/home/home.page.html | 12 ++++ src/environments/environment.prod.ts | 5 +- src/environments/environment.ts | 5 +- 21 files changed, 360 insertions(+), 8 deletions(-) create mode 100644 src/app/accounts/locationmaps/locationmaps-routing.module.ts create mode 100644 src/app/accounts/locationmaps/locationmaps.module.ts create mode 100644 src/app/accounts/locationmaps/locationmaps.page.html create mode 100644 src/app/accounts/locationmaps/locationmaps.page.scss create mode 100644 src/app/accounts/locationmaps/locationmaps.page.spec.ts create mode 100644 src/app/accounts/locationmaps/locationmaps.page.ts create mode 100644 src/app/components/tracking/tracking.component.html create mode 100644 src/app/components/tracking/tracking.component.scss create mode 100644 src/app/components/tracking/tracking.component.spec.ts create mode 100644 src/app/components/tracking/tracking.component.ts create mode 100644 src/app/interfaces/location.ts create mode 100644 src/app/interfaces/marker.ts diff --git a/REMEMBER.txt b/REMEMBER.txt index 7cdf78b..850f225 100644 --- a/REMEMBER.txt +++ b/REMEMBER.txt @@ -39,6 +39,8 @@ ionic generate page startscan ionic generate page suggest ionic generate page suggestdetails +ionic generate page locationmaps + ionic generate page playground ionic generate page addbank @@ -47,12 +49,14 @@ ionic generate page addbank ionic generate service user-wallet +ionic generate component tracking - - +https://masteringionic.com/blog/working-with-capacitor-googlemaps-in-ionic +ionic generate interface interfaces/location +ionic generate interface interfaces/marker diff --git a/src/app/accounts/locationmaps/locationmaps-routing.module.ts b/src/app/accounts/locationmaps/locationmaps-routing.module.ts new file mode 100644 index 0000000..ad24721 --- /dev/null +++ b/src/app/accounts/locationmaps/locationmaps-routing.module.ts @@ -0,0 +1,17 @@ +import { NgModule } from '@angular/core'; +import { Routes, RouterModule } from '@angular/router'; + +import { LocationmapsPage } from './locationmaps.page'; + +const routes: Routes = [ + { + path: '', + component: LocationmapsPage + } +]; + +@NgModule({ + imports: [RouterModule.forChild(routes)], + exports: [RouterModule], +}) +export class LocationmapsPageRoutingModule {} diff --git a/src/app/accounts/locationmaps/locationmaps.module.ts b/src/app/accounts/locationmaps/locationmaps.module.ts new file mode 100644 index 0000000..c7015e9 --- /dev/null +++ b/src/app/accounts/locationmaps/locationmaps.module.ts @@ -0,0 +1,20 @@ +import { NgModule } from '@angular/core'; +import { CommonModule } from '@angular/common'; +import { FormsModule } from '@angular/forms'; + +import { IonicModule } from '@ionic/angular'; + +import { LocationmapsPageRoutingModule } from './locationmaps-routing.module'; + +import { LocationmapsPage } from './locationmaps.page'; + +@NgModule({ + imports: [ + CommonModule, + FormsModule, + IonicModule, + LocationmapsPageRoutingModule + ], + declarations: [LocationmapsPage] +}) +export class LocationmapsPageModule {} diff --git a/src/app/accounts/locationmaps/locationmaps.page.html b/src/app/accounts/locationmaps/locationmaps.page.html new file mode 100644 index 0000000..f2024ae --- /dev/null +++ b/src/app/accounts/locationmaps/locationmaps.page.html @@ -0,0 +1,9 @@ + + + locationmaps + + + + + + diff --git a/src/app/accounts/locationmaps/locationmaps.page.scss b/src/app/accounts/locationmaps/locationmaps.page.scss new file mode 100644 index 0000000..e69de29 diff --git a/src/app/accounts/locationmaps/locationmaps.page.spec.ts b/src/app/accounts/locationmaps/locationmaps.page.spec.ts new file mode 100644 index 0000000..43683a5 --- /dev/null +++ b/src/app/accounts/locationmaps/locationmaps.page.spec.ts @@ -0,0 +1,24 @@ +import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; +import { IonicModule } from '@ionic/angular'; + +import { LocationmapsPage } from './locationmaps.page'; + +describe('LocationmapsPage', () => { + let component: LocationmapsPage; + let fixture: ComponentFixture; + + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + declarations: [ LocationmapsPage ], + imports: [IonicModule.forRoot()] + }).compileComponents(); + + fixture = TestBed.createComponent(LocationmapsPage); + component = fixture.componentInstance; + fixture.detectChanges(); + })); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/accounts/locationmaps/locationmaps.page.ts b/src/app/accounts/locationmaps/locationmaps.page.ts new file mode 100644 index 0000000..b7619e2 --- /dev/null +++ b/src/app/accounts/locationmaps/locationmaps.page.ts @@ -0,0 +1,15 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'app-locationmaps', + templateUrl: './locationmaps.page.html', + styleUrls: ['./locationmaps.page.scss'], +}) +export class LocationmapsPage implements OnInit { + + constructor() { } + + ngOnInit() { + } + +} diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index 531b105..a284fb0 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -238,6 +238,10 @@ const routes: Routes = [ path: 'addbank', loadChildren: () => import('./accounts/addbank/addbank.module').then(m => m.AddbankPageModule) }, + { + path: 'locationmaps', + loadChildren: () => import('./accounts/locationmaps/locationmaps.module').then(m => m.LocationmapsPageModule) + }, ]; @NgModule({ diff --git a/src/app/components/tracking/tracking.component.html b/src/app/components/tracking/tracking.component.html new file mode 100644 index 0000000..1b0cc95 --- /dev/null +++ b/src/app/components/tracking/tracking.component.html @@ -0,0 +1,3 @@ +
+ +
diff --git a/src/app/components/tracking/tracking.component.scss b/src/app/components/tracking/tracking.component.scss new file mode 100644 index 0000000..4edec8d --- /dev/null +++ b/src/app/components/tracking/tracking.component.scss @@ -0,0 +1,6 @@ +capacitor-google-map { + display: inline-block; + width: 100%; + height: 340px; + //border-radius: 10px; +} \ No newline at end of file diff --git a/src/app/components/tracking/tracking.component.spec.ts b/src/app/components/tracking/tracking.component.spec.ts new file mode 100644 index 0000000..9eab0d3 --- /dev/null +++ b/src/app/components/tracking/tracking.component.spec.ts @@ -0,0 +1,24 @@ +import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; +import { IonicModule } from '@ionic/angular'; + +import { TrackingComponent } from './tracking.component'; + +describe('TrackingComponent', () => { + let component: TrackingComponent; + let fixture: ComponentFixture; + + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + declarations: [ TrackingComponent ], + imports: [IonicModule.forRoot()] + }).compileComponents(); + + fixture = TestBed.createComponent(TrackingComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + })); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/components/tracking/tracking.component.ts b/src/app/components/tracking/tracking.component.ts new file mode 100644 index 0000000..184c60b --- /dev/null +++ b/src/app/components/tracking/tracking.component.ts @@ -0,0 +1,70 @@ +import { Component, OnInit, ElementRef, OnDestroy, ViewChild } from '@angular/core'; +import { GoogleMap } from '@capacitor/google-maps'; +import { environment } from 'src/environments/environment'; +import { Location, Locations } from '../../interfaces/location'; +import { MarkerEl } from '../../interfaces/marker'; +@Component({ + selector: 'app-tracking', + templateUrl: './tracking.component.html', + styleUrls: ['./tracking.component.scss'], +}) +export class TrackingComponent implements OnInit { + + @ViewChild('map') public mapEl: ElementRef; + + public map: GoogleMap; + + public heading: string = null; + + public description: string = null; + + public locationOptions = { + header: 'Asia', + subHeader: 'Select a country from the list', + message: 'There\'s only three :)', + translucent: true, + }; + + private markers: Array = []; + + private ids: Array = []; + + constructor() { + this.heading = 'Select a country from the above menu'; + this.description = 'Interact with the markers that are displayed for each selected country'; + setTimeout(async () => { + await this.createMap(); + }, 500); + } + + ionViewDidEnter() { + debugger; + setTimeout(async () => { + await this.createMap(); + }, 500); + } + ngOnInit() {} + /** + * @private + * @async + * @method createMap + * @description Creates a GoogleMap instance which is rendered within the DOM + * @returns {Promise} + * @memberof HomePage + */ + private async createMap(): Promise { + this.map = await GoogleMap.create({ + id: 'google-map', + element: this.mapEl.nativeElement, + apiKey: environment.keys.googleMaps, + forceCreate: true, + config: { + center: { + lat: 1.0667172756631198, + lng: 103.96214500683499 + }, + zoom: 5 + } + }); + } +} diff --git a/src/app/interfaces/location.ts b/src/app/interfaces/location.ts new file mode 100644 index 0000000..f4472ed --- /dev/null +++ b/src/app/interfaces/location.ts @@ -0,0 +1,14 @@ +export interface Location { + country: string; + lat: number; + lng: number; + description: string; + locations: Array; +} + +export interface Locations { + name: string; + lat: number; + lng: number; + description: string; +} \ No newline at end of file diff --git a/src/app/interfaces/marker.ts b/src/app/interfaces/marker.ts new file mode 100644 index 0000000..360dd11 --- /dev/null +++ b/src/app/interfaces/marker.ts @@ -0,0 +1,11 @@ +export interface MarkerEl { + coordinate: Coordinate; + markerId: string; + title: string; + snippet: string; +} + +export interface Coordinate { + lat: number; + lng: number; +} \ No newline at end of file diff --git a/src/app/pages/familymember/familymember.page.html b/src/app/pages/familymember/familymember.page.html index f8fc482..6ec40ae 100644 --- a/src/app/pages/familymember/familymember.page.html +++ b/src/app/pages/familymember/familymember.page.html @@ -1,5 +1,8 @@ +
+ +
@@ -93,17 +96,77 @@ - + - + Add Fund - Plans + Plans + +
+ + + Amount({{item.description}}) + + + + + + From + + + + + + + To + + + + + + + Comment + + + + + + + + + Cancel + + + Send + + + + +
@@ -136,6 +199,7 @@
+
diff --git a/src/app/pages/familymember/familymember.page.scss b/src/app/pages/familymember/familymember.page.scss index 65d0337..cd8a5b0 100644 --- a/src/app/pages/familymember/familymember.page.scss +++ b/src/app/pages/familymember/familymember.page.scss @@ -1,6 +1,7 @@ ion-content { .back_image { + margin-top: 10px; width: auto; height: 130px; background-size: contain; @@ -12,6 +13,30 @@ ion-content { } } + .send-grid{ + background-color: #eff2f4; + border-radius: 10px; + font-size: 14px; + font-weight: bolder; + ion-select, ion-input{ + border-radius: 10px; + border-color: #383a3e; + background-color: white; + text-align: right; + } + .intr{ + text-align: right; + margin-top: 10px; + } + .txta{ + background-color: white; + border-radius: 10px; + } + .sendpart{ + text-align: right; + } + } + .flex { display: flex; justify-content: space-between; diff --git a/src/app/pages/familymember/familymember.page.ts b/src/app/pages/familymember/familymember.page.ts index 2f98f49..7f0f215 100644 --- a/src/app/pages/familymember/familymember.page.ts +++ b/src/app/pages/familymember/familymember.page.ts @@ -111,4 +111,20 @@ export class FamilymemberPage implements OnInit { ); } + + toolBarShow:string="1"; + + backToToolBar(){ + this.toolBarShow = "1"; + } + startAddfund(){ + this.toolBarShow = "2"; + } + sendReward(){ + + setTimeout(()=>{ + this.toolBarShow = "1"; + }, 3000); + } + startWalletPlan(){} } diff --git a/src/app/pages/home/home.module.ts b/src/app/pages/home/home.module.ts index fbba1f4..31bf1be 100644 --- a/src/app/pages/home/home.module.ts +++ b/src/app/pages/home/home.module.ts @@ -9,6 +9,13 @@ import { HomePageRoutingModule } from './home-routing.module'; import { HomePage } from './home.page'; import { SuggestedlistComponent } from "../../components/suggestedlist/suggestedlist.component"; import {FamilypendingComponent} from "../../components/familypending/familypending.component"; +import { TrackingComponent } from "../../components/tracking/tracking.component"; + +import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; + +// @NgModule({ +// schemas: [CUSTOM_ELEMENTS_SCHEMA] +// }) @NgModule({ imports: [ @@ -17,6 +24,7 @@ import {FamilypendingComponent} from "../../components/familypending/familypendi IonicModule, HomePageRoutingModule ], - declarations: [HomePage,SuggestedlistComponent,FamilypendingComponent] + declarations: [HomePage,SuggestedlistComponent,FamilypendingComponent,TrackingComponent], + schemas: [CUSTOM_ELEMENTS_SCHEMA] }) export class HomePageModule { } diff --git a/src/app/pages/home/home.page.html b/src/app/pages/home/home.page.html index 33b77d4..c97adc3 100644 --- a/src/app/pages/home/home.page.html +++ b/src/app/pages/home/home.page.html @@ -119,6 +119,18 @@ + + + + + + + Here's a small text description for the card content. Nothing more, nothing less. + + + + +
diff --git a/src/environments/environment.prod.ts b/src/environments/environment.prod.ts index d64b737..3da25ac 100644 --- a/src/environments/environment.prod.ts +++ b/src/environments/environment.prod.ts @@ -5,5 +5,8 @@ export const environment = { images: 'https://apigate.lotus.g1.wrenchboard.com/svs/user', appleRedirectUri: 'https://users.wrenchboard.com/loginWithApple', facebookAppId: '390204307987009', - loginSocial: false + loginSocial: false, + keys: { + googleMaps: 'AIzaSyCvsRozdnd1i1KBGWC6ewe1RaJYuGbrk3s' + } }; diff --git a/src/environments/environment.ts b/src/environments/environment.ts index cdf7160..dc11e72 100644 --- a/src/environments/environment.ts +++ b/src/environments/environment.ts @@ -5,6 +5,9 @@ export const environment = { images: 'https://apigate.lotus.g1.wrenchboard.com/en/wrench/api/v1/', appleRedirectUri: 'https://dev-users.wrenchboard.com/loginWithApple', facebookAppId: '677857427521030', - loginSocial: true + loginSocial: true, + keys: { + googleMaps: 'AIzaSyCvsRozdnd1i1KBGWC6ewe1RaJYuGbrk3s' + } };