Skip to content

Commit

Permalink
Fix app refresh, android map visibility, and share url
Browse files Browse the repository at this point in the history
  • Loading branch information
paulnagle committed Jan 7, 2024
1 parent deb486f commit 7d561b7
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 15 deletions.
12 changes: 7 additions & 5 deletions src/app/components/meeting-card/meeting-card.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ export class MeetingCardComponent implements OnInit, AfterContentInit {
}
});
}


shareMeeting(meeting: any) {

Expand All @@ -55,7 +56,7 @@ export class MeetingCardComponent implements OnInit, AfterContentInit {
+ daysOfWeek[meeting.weekday_tinyint] + ' '
+ meeting.start_time_raw + ' - ' + meeting.end_time_formatted + ' : '

if (meeting.location_text) { shareText += ' , ' + meeting.location_text }
if (meeting.location_text) { shareText += + meeting.location_text }
if (meeting.location_street) { shareText += ' , ' + meeting.location_street }
if (meeting.location_city_subsection) { shareText += ' , ' + meeting.location_city_subsection }
if (meeting.location_neighborhood) { shareText += ' , ' + meeting.location_neighborhood }
Expand All @@ -66,21 +67,21 @@ export class MeetingCardComponent implements OnInit, AfterContentInit {
if (meeting.comments) { shareText += ' , ' + meeting.comments }
if (meeting.train_lines) { shareText += ' , ' + meeting.train_lines }
if (meeting.bus_lines) { shareText += ' , ' + meeting.bus_lines }
if (meeting.phone_meeting_number) { shareText += meeting.phone_meeting_number }
if (meeting.phone_meeting_number) { shareText += ' , ' + meeting.phone_meeting_number }

let shareLink = ''
if (meeting.virtual_meeting_link) {
shareLink = meeting.virtual_meeting_link
shareLink = meeting.virtual_meeting_link
} else {
shareLink = 'https://www.google.com/maps/search/?api=1&query=' + meeting.latitude + ',' + meeting.longitude
shareLink = 'https://www.google.com/maps/search/?api=1&query=' + meeting.latitude + ',' + meeting.longitude
}

shareText += ' url: ' + shareLink

Share.share({
title: meeting.meeting_name,
text: shareText,
url: meeting.virtual_meeting_link,
url: shareLink,
dialogTitle: 'Share this meeting',
});
} else {
Expand All @@ -89,6 +90,7 @@ export class MeetingCardComponent implements OnInit, AfterContentInit {
});
}


public openMapsLink(destLatitude: string, destLongitude: string) {
const browser = Browser.open({url: 'https://www.google.com/maps/search/?api=1&query=' + destLatitude + ',' + destLongitude});
}
Expand Down
2 changes: 1 addition & 1 deletion src/app/pages/map-search/map-search.page.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ ion-content {
}

body {
background: transparent;
background: transparent;
}
24 changes: 16 additions & 8 deletions src/app/pages/map-search/map-search.page.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Component, ElementRef, NgZone, OnInit, ViewChild } from '@angular/core';
import { Component, NgZone, OnDestroy } from '@angular/core';
import { StorageService } from '../../services/storage.service';
import { Platform, ModalController, RangeCustomEvent } from '@ionic/angular';
import { ModalController } from '@ionic/angular';
import { MeetingListService } from '../../services/meeting-list.service';
import { LoadingService } from '../../services/loading.service';
import { TranslateService } from '@ngx-translate/core';
Expand All @@ -16,11 +16,11 @@ declare const google: any;
templateUrl: './map-search.page.html',
styleUrls: ['./map-search.page.scss'],
})
export class MapSearchPage implements OnInit {
export class MapSearchPage implements OnDestroy {

performSearch: boolean = true;

public map!: GoogleMap;
map!: GoogleMap ;
addressLatitude: any;
addressLongitude: any;
loader!: Promise<void> | Promise<boolean> | null;
Expand Down Expand Up @@ -52,9 +52,17 @@ export class MapSearchPage implements OnInit {
private zone: NgZone) {

}


ngOnDestroy() {
this.map.removeAllMapListeners();
this.map.destroy();
this.currentMarkerIDs = [];
this.currentMarkerList = [];
this.currentMeetings = [];
// this.map = null;
}

async ngOnInit() {
async ionViewDidEnter() {
this.GoogleAutocomplete = new google.maps.places.AutocompleteService();

this.storage.get('language').then(langValue => {
Expand Down Expand Up @@ -223,7 +231,7 @@ export class MapSearchPage implements OnInit {
this.data = {
coordinate: markerLatLng,
title: this.ids,
iconUrl: './assets/markercluster/MarkerRed.png',
iconUrl: 'assets/markercluster/MarkerRed.png',
iconAnchor: { x: 29, y: 100 }
};

Expand Down Expand Up @@ -280,7 +288,7 @@ export class MapSearchPage implements OnInit {
this.data = {
coordinate: markerLatLng,
title: meeting['id_bigint'],
iconUrl: './assets/markercluster/MarkerBlue.png',
iconUrl: 'assets/markercluster/MarkerBlue.png',
iconAnchor: {
x: 29,
y: 100,
Expand Down
2 changes: 1 addition & 1 deletion src/theme/variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

/** Ionic CSS Variables **/
:root {
--ion-background-color: #dddddd;
// --ion-background-color: #dddddd;

--ion-font-family: 'Plex';

Expand Down

0 comments on commit 7d561b7

Please sign in to comment.