diff --git a/App/Ionic2/ocm-app/app/app.ts b/App/Ionic2/ocm-app/app/app.ts index 419e4c7..bc366be 100644 --- a/App/Ionic2/ocm-app/app/app.ts +++ b/App/Ionic2/ocm-app/app/app.ts @@ -1,7 +1,7 @@ -import {App, Platform, Config, Events, NavController} from 'ionic-angular'; +import {Platform, Config, Events, NavController, ionicBootstrap} from 'ionic-angular'; import {StatusBar} from 'ionic-native'; import {Http, ConnectionBackend} from '@angular/http'; -import {OnInit, provide, enableProdMode} from '@angular/core'; +import {Component, OnInit, provide, enableProdMode} from '@angular/core'; import {APIClient} from './core/ocm/services/APIClient'; import {AppManager} from './core/ocm/services/AppManager' @@ -20,25 +20,8 @@ declare var Connection: any; enableProdMode(); -@App({ - template: '', - providers: [ - AppManager, - POIManager, - Events, - provide(TranslateLoader, { - useFactory: (http: Http) => new TranslateStaticLoader(http, 'lang', '.json'), - deps: [Http] - }), - TranslateService, - APIClient, - SubmissionQueue, - JourneyManager, - ReferenceDataManager - ], - config: { - mode: "ios" - } +@Component({ + template: '' }) @@ -80,8 +63,8 @@ export class OpenChargeMapApp extends Base implements OnInit { //we can switch over to Native Maps API } if (platform.is("cordova") && StatusBar) { - // StatusBar.overlaysWebView(false); - // StatusBar.hide();//styleDefault(); + // StatusBar.overlaysWebView(false); + // StatusBar.hide();//styleDefault(); } @@ -168,3 +151,21 @@ export class OpenChargeMapApp extends Base implements OnInit { } } +ionicBootstrap(OpenChargeMapApp, [ + AppManager, + POIManager, + Events, + provide(TranslateLoader, { + useFactory: (http: Http) => new TranslateStaticLoader(http, 'lang', '.json'), + deps: [Http] + }), + TranslateService, + APIClient, + SubmissionQueue, + JourneyManager, + ReferenceDataManager +], { + //config + prodMode:true, + mode:"ios" + }); \ No newline at end of file diff --git a/App/Ionic2/ocm-app/app/core/ocm/mapping/providers/GoogleMapsNative.ts b/App/Ionic2/ocm-app/app/core/ocm/mapping/providers/GoogleMapsNative.ts index 47a6236..dd156ef 100644 --- a/App/Ionic2/ocm-app/app/core/ocm/mapping/providers/GoogleMapsNative.ts +++ b/App/Ionic2/ocm-app/app/core/ocm/mapping/providers/GoogleMapsNative.ts @@ -57,7 +57,7 @@ export class GoogleMapsNative extends Base implements IMapProvider { if (this.map == null) { var mapCanvas = document.getElementById(mapCanvasID); this.map = plugin.google.maps.Map.getMap(); -this.map.setDebuggable(true); +//this.map.setDebuggable(true); var mapManagerContext = this; //setup map manipulation events @@ -205,7 +205,8 @@ this.map.setDebuggable(true); } }, (marker) => { //show full details when info window tapped - marker.addEventListener(plugin.google.maps.event.INFO_CLICK, function () { + //marker.addEventListener(plugin.google.maps.event.INFO_CLICK, function () { + marker.addEventListener(plugin.google.maps.event.MARKER_CLICK, function () { var markerTitle = marker.getTitle(); var poiId = markerTitle.substr(4, markerTitle.indexOf(":") - 4); diff --git a/App/Ionic2/ocm-app/app/pages/comment/comment.ts b/App/Ionic2/ocm-app/app/pages/comment/comment.ts index ded2602..2bb69b4 100644 --- a/App/Ionic2/ocm-app/app/pages/comment/comment.ts +++ b/App/Ionic2/ocm-app/app/pages/comment/comment.ts @@ -1,9 +1,9 @@ -import {Page, NavController, NavParams, Modal, Alert, Loading} from 'ionic-angular'; +import {Component} from '@angular/core'; +import {NavController, NavParams, Modal, Alert, Loading} from 'ionic-angular'; import {AppManager} from '../../core/ocm/services/AppManager'; import {UserComment} from '../../core/ocm/model/AppModels'; - -@Page({ +@Component({ templateUrl: 'build/pages/comment/comment.html', directives: [] }) diff --git a/App/Ionic2/ocm-app/app/pages/journeys/favourite-editor.ts b/App/Ionic2/ocm-app/app/pages/journeys/favourite-editor.ts index 42b7383..e3ac45d 100644 --- a/App/Ionic2/ocm-app/app/pages/journeys/favourite-editor.ts +++ b/App/Ionic2/ocm-app/app/pages/journeys/favourite-editor.ts @@ -1,9 +1,10 @@ -import {Page, NavParams, NavController} from 'ionic-angular'; +import {Component} from '@angular/core'; +import {NavParams, NavController} from 'ionic-angular'; import {AppManager} from '../../core/ocm/services/AppManager'; import {Journey, WayPoint, GeoLatLng, BookmarkedPOI} from '../../core/ocm/model/AppModels'; import {JourneyManager} from '../../core/ocm/services/JourneyManager'; -@Page({ +@Component({ templateUrl: 'build/pages/journeys/favourite-editor.html', }) diff --git a/App/Ionic2/ocm-app/app/pages/journeys/journeys.ts b/App/Ionic2/ocm-app/app/pages/journeys/journeys.ts index 72c6686..8427ffe 100644 --- a/App/Ionic2/ocm-app/app/pages/journeys/journeys.ts +++ b/App/Ionic2/ocm-app/app/pages/journeys/journeys.ts @@ -1,11 +1,12 @@ -import {Page, Modal, NavController, Alert} from 'ionic-angular'; +import {Component} from '@angular/core'; +import {Modal, NavController, Alert} from 'ionic-angular'; import {AppManager} from '../../core/ocm/services/AppManager'; import {Journey, WayPoint, GeoLatLng} from '../../core/ocm/model/AppModels'; import {JourneyManager} from '../../core/ocm/services/JourneyManager'; import {APIClient} from '../../core/ocm/services/APIClient'; import {POIDetailsPage} from '../poi-details/poi-details'; -@Page({ +@Component({ templateUrl: 'build/pages/journeys/journeys.html', }) @@ -16,9 +17,9 @@ export class JourneysPage { constructor(private appManager: AppManager, private nav: NavController, private journeyManager: JourneyManager, private api: APIClient) { - this.discoverImages(); + //this.discoverImages(); - console.log(JSON.stringify(this.journeyManager.journeys, null, 4)); + //console.log(JSON.stringify(this.journeyManager.journeys, null, 4)); } discoverImages() { diff --git a/App/Ionic2/ocm-app/app/pages/mediaupload/mediaupload.ts b/App/Ionic2/ocm-app/app/pages/mediaupload/mediaupload.ts index 9621faa..4f92f6e 100644 --- a/App/Ionic2/ocm-app/app/pages/mediaupload/mediaupload.ts +++ b/App/Ionic2/ocm-app/app/pages/mediaupload/mediaupload.ts @@ -1,8 +1,9 @@ -import {Page, NavController, NavParams, Modal, Alert} from 'ionic-angular'; +import {Component} from '@angular/core'; +import {NavController, NavParams, Modal, Alert} from 'ionic-angular'; import {AppManager} from '../../core/ocm/services/AppManager'; import {Camera} from 'ionic-native'; -@Page({ +@Component({ templateUrl: 'build/pages/mediaupload/mediaupload.html' }) export class MediaUploadPage { @@ -31,14 +32,6 @@ export class MediaUploadPage { this.comment = "test"; } - onPageWillEnter() { - - - - } - - - loadCameraOrLibraryImage() { var _context = this; diff --git a/App/Ionic2/ocm-app/app/pages/poi-details/poi-details.ts b/App/Ionic2/ocm-app/app/pages/poi-details/poi-details.ts index 07e7963..30887c3 100644 --- a/App/Ionic2/ocm-app/app/pages/poi-details/poi-details.ts +++ b/App/Ionic2/ocm-app/app/pages/poi-details/poi-details.ts @@ -1,11 +1,12 @@ -import {IonicApp, Page, NavController, NavParams, ViewController, Modal, ActionSheet} from 'ionic-angular'; +import {Component} from '@angular/core'; +import {NavController, NavParams, ViewController, Modal, ActionSheet} from 'ionic-angular'; import {TranslateService, TranslatePipe} from 'ng2-translate/ng2-translate'; import {AppManager} from '../../core/ocm/services/AppManager'; import {MediaUploadPage} from '../mediaupload/mediaupload'; import {CommentPage} from '../comment/comment'; import {FavouriteEditorPage} from '../journeys/favourite-editor'; -@Page({ +@Component({ templateUrl: 'build/pages/poi-details/poi-details.html', pipes: [TranslatePipe] }) @@ -15,10 +16,14 @@ export class POIDetailsPage { selectedTab: string; json: string; - constructor(private appManager: AppManager, private nav: NavController, navParams: NavParams, private translate: TranslateService, private view: ViewController) { + constructor(private appManager: AppManager, private nav: NavController, private navParams: NavParams, private translate: TranslateService, private view: ViewController) { // If we navigated to this page, we will have an item available as a nav param - this.poi = navParams.get('item'); + + + //this.json = JSON.stringify(this.poi, null, 1); + + this.poi = this.navParams.get('item'); this.selectedTab = "location"; //create temporary properties for view model @@ -36,8 +41,10 @@ export class POIDetailsPage { } else { this.poi._hasComments = false; } + } - //this.json = JSON.stringify(this.poi, null, 1); + ionViewWillEnter() { + } get staticMapURL(): string { @@ -152,5 +159,9 @@ export class POIDetailsPage { this.nav.pop(); } - + dismiss() { + if (console && console.log) { + console.log("in poi details dismiss"); + } + } } diff --git a/App/Ionic2/ocm-app/app/pages/profile/profile.ts b/App/Ionic2/ocm-app/app/pages/profile/profile.ts index 49a1f60..36dc874 100644 --- a/App/Ionic2/ocm-app/app/pages/profile/profile.ts +++ b/App/Ionic2/ocm-app/app/pages/profile/profile.ts @@ -1,10 +1,11 @@ -import {Page, NavController, Modal, Alert} from 'ionic-angular'; +import {Component} from '@angular/core'; +import {NavController, Modal, Alert} from 'ionic-angular'; import {AppManager} from '../../core/ocm/services/AppManager'; import {SignInPage} from '../signin/signin'; import {MediaUploadPage} from '../mediaupload/mediaupload'; import {CommentPage} from '../comment/comment'; -@Page({ +@Component({ templateUrl: 'build/pages/profile/profile.html' }) export class ProfilePage { @@ -14,7 +15,7 @@ export class ProfilePage { } - onPageDidEnter() { + ionViewDidEnter() { this.userProfile = this.appManager.getUserProfile(); diff --git a/App/Ionic2/ocm-app/app/pages/search/search.html b/App/Ionic2/ocm-app/app/pages/search/search.html index f57b7b3..4945249 100644 --- a/App/Ionic2/ocm-app/app/pages/search/search.html +++ b/App/Ionic2/ocm-app/app/pages/search/search.html @@ -9,7 +9,7 @@ - + [debounce]="500">