ionViewWillEnter()
{
this.loadMap();
}
loadMap() {
// Create a map after the view is loaded.
// (platform is already ready in app.component.ts)
this.map = GoogleMaps.create('map_canvas', {
camera: {
target: {
lat: 24.713552,
lng: 46.675296
},
zoom: 18,
tilt: 30
}
});
// Wait the maps plugin is ready until the MAP_READY event
this.map.one(GoogleMapsEvent.MAP_READY).then(() => {
this.mapReady = true;
var w = this.map.getDiv().offsetWidth;
var h = this.map.getDiv().offsetHeight;
console.log("height" + h + "width"+w);
this.get_your_location();
});
this.map.on(GoogleMapsEvent.MAP_CLICK).subscribe((params: any[]) =>
{
this.map.clear();
let latLng: ILatLng = params[0];
this.map.addMarkerSync({
"position": latLng
});
this.Get_address_by_Lat_lng(latLng["lat"], latLng["lng"]);
}
);
}
{
"name": "Green",
"version": "0.0.1",
"author": "Ionic Framework",
"homepage": "http://ionicframework.com/",
"private": true,
"scripts": {
"clean": "ionic-app-scripts clean",
"build": "ionic-app-scripts build",
"lint": "ionic-app-scripts lint",
"ionic:build": "ionic-app-scripts build",
"ionic:serve": "ionic-app-scripts serve"
},
"dependencies": {
"@angular/animations": "5.2.11",
"@angular/common": "5.2.11",
"@angular/compiler": "5.2.11",
"@angular/compiler-cli": "5.2.11",
"@angular/core": "5.2.11",
"@angular/forms": "5.2.11",
"@angular/http": "5.2.11",
"@angular/platform-browser": "5.2.11",
"@angular/platform-browser-dynamic": "5.2.11",
"@ionic-native/core": "^4.8.0",
"@ionic-native/geolocation": "^4.9.0",
"@ionic-native/google-maps": "^4.8.2",
"@ionic-native/onesignal": "^4.8.0",
"@ionic-native/social-sharing": "^4.8.0",
"@ionic-native/splash-screen": "4.7.0",
"@ionic-native/status-bar": "4.7.0",
"@ionic-native/unique-device-id": "^4.9.0",
"@ionic/storage": "2.1.3",
"@ngx-translate/core": "^9.1.1",
"@ngx-translate/http-loader": "^2.0.1",
"cordova-android": "7.0.0",
"cordova-android-play-services-gradle-release": "^1.4.3",
"cordova-android-support-gradle-release": "^1.4.4",
"cordova-plugin-device": "^2.0.2",
"cordova-plugin-geolocation": "^4.0.1",
"cordova-plugin-googlemaps": "^2.3.6",
"cordova-plugin-ionic-keyboard": "^2.0.5",
"cordova-plugin-ionic-webview": "^1.1.19",
"cordova-plugin-splashscreen": "^5.0.2",
"cordova-plugin-uniquedeviceid": "^1.3.2",
"cordova-plugin-whitelist": "^1.3.3",
"cordova-plugin-x-socialsharing": "^5.4.0",
"es6-promise-plugin": "^4.2.2",
"ionic-angular": "3.9.2",
"ionicons": "3.0.0",
"minimist": "^1.2.0",
"onesignal-cordova-plugin": "^2.4.1",
"rxjs": "5.5.11",
"sw-toolbox": "3.6.0",
"xml2js": "^0.4.19",
"zone.js": "0.8.26"
},
"devDependencies": {
"@ionic/app-scripts": "3.1.10",
"typescript": "~2.6.2"
},
"description": "An Ionic project",
"cordova": {
"plugins": {
"onesignal-cordova-plugin": {},
"cordova-plugin-googlemaps": {
"API_KEY_FOR_ANDROID": "AIzaSyBtFtgozwjRT_KY5AmzhvDmWfxer5T_UbU",
"API_KEY_FOR_IOS": "AIzaSyBtFtgozwjRT_KY5AmzhvDmWfxer5T_UbU",
"LOCATION_WHEN_IN_USE_DESCRIPTION": "This app wants to get your location while this app runs only.",
"LOCATION_ALWAYS_USAGE_DESCRIPTION": "This app wants to get your location always, even this app runs in background."
},
"cordova-plugin-whitelist": {},
"cordova-plugin-device": {},
"cordova-plugin-splashscreen": {},
"cordova-plugin-ionic-webview": {},
"cordova-plugin-ionic-keyboard": {},
"cordova-android-play-services-gradle-release": {
"PLAY_SERVICES_VERSION": "15.+"
},
"cordova-android-support-gradle-release": {
"ANDROID_SUPPORT_VERSION": "27.+"
},
"cordova-plugin-x-socialsharing": {},
"cordova-plugin-geolocation": {
"GEOLOCATION_USAGE_DESCRIPTION": "Allow Green to get your location"
},
"cordova-plugin-uniquedeviceid": {}
},
"platforms": [
"android"
]
}
}