He does not return anything? Sorry I’m not very good.
The method does not return a promise, just return an CameraPosition<ILatLng>
object.
So why when I’am doing that: this.cameraPosition = this.map.getCameraPosition();
it does not work ? because this.cameraPostion it’s that: private cameraPosition: CameraPosition;
What are you taking about?
You told me that the method return a CameraPosition object. So I did:
and at the end this.cameraPosition = Null
If you can’t resolve the problem by yourself, please share your project files (everything) on github.
You can help me if I put the project on github please?
I will check your code at least.
Ok I put it, thank you very much. Just a moment it takes a little time! thank you!
This code works as I expected.
import { Component } from '@angular/core';
import { IonicPage, NavController, NavParams, AlertController } from 'ionic-angular';
import {
GoogleMaps,
GoogleMap,
GoogleMapsEvent
} from '@ionic-native/google-maps';
@IonicPage()
@Component({
selector: 'page-get-camera-target',
templateUrl: 'get-camera-target.html',
})
export class GetCameraTargetPage {
map: GoogleMap;
constructor(public navCtrl: NavController, public navParams: NavParams, private googleMaps: GoogleMaps, private alertCtrl: AlertController) {
}
ionViewDidLoad() {
This file has been truncated. show original
3 Likes
Sorry for my late response I had an internet break! I thank you for your help! it works very well, I found the problem on my side was because my plugin google maps was not complete. I had less methods. In any case you are great! Thank you for the code ! Did you see that the plugin is no longer present? https://ionicframework.com/docs/native/google-maps/
404 on link.
The Ionic team uploaded the site without the maps plugin.
Discussion is here.
Well, I keep the same file stecture in order to manage by yours (and the repo is under the ionic team), you should generate the maps page, or at least keep the old one.
I take over the management because your team doesn’t manage the plugin in proper.
Anyway, there are couple of solutions:
generate the map page from this url.
https://github.com/ionic-team/ionic-native-google-maps
link to another url,
or use git sub repository.
(Git is able to make a subrepository for particular file…
and
opened 05:00PM - 19 Mar 18 UTC
closed 07:00PM - 03 May 18 UTC
discuss
not-an-issue
As the `cordova-plugin-googlemaps` author, I request to spin-out the `@ionic-nat… ive/google-maps` from the `@ionic-native` plugin family, or discontinue it.
First of all, I have never asked to create `@ionic-native/google-maps` plugin, but the ionic team created it.
Well, I don't mind if the ionic team maintains the `@ionic-native/google-maps` very well, but they don't at all. As the result, many ionic users claimed to me many bugs which are `@ionic-native/google-maps` itself.
I contributed to fix the bugs a lot in my private time. However I faced couple of unreliable things from the ionic-team, and they stops updating the ionic-native plugins, also ignore my e-mails.
Therefore, I have no reason to support the `@ionic-native/google-maps` plugin.
However I understand there are tons of users of `@ionic-native/google-maps` plugin.
If I don't support the `@ionic-native/google-maps`, nobody support it, and the tons of users would claim to me. This would be stressful also.
So, there are three choices:.
- 1. please spin-out the `@ionic-native/google-maps` from the `@ionic-native` family.
In that case, I will take over, and keep updating it.
- 2. remove the `@ionic-native/google-maps` everything.
- 3. release the current master version to npm, and support the `@ionic-native/google-maps` by community. In that case, I don't send updates, but I support the issue reports to my repo.
Until the discussion would reach to the satisfactory goal, I simply refuse the supporting of `@ionic-native/google-maps` plugin, including who use it, at my repo.
https://github.com/mapsplugin/cordova-plugin-googlemaps/issues/2162
Since the ionic-team ignores my contacts everything, this is only my choice.
If the ionic team ignores this discussion, I will implement the code which blocks ionic framework in code level.
That is not good. Native map was used in lot of apps
You can still use the @ionic-native/google-maps
as well as before.
The new documentation is here.
# \@ionic-native/google-maps document
This plugin used for [cordova-plugin-googlemaps](https://github.com/mapsplugin/cordova-plugin-googlemaps).
## Installation
In order to use this plugin, you need to generate API keys at the Google Developers Console.
Please follow the instruction.
- [How to generate API keys?](./api_key/generate_api_key.md)
```
$> ionic cordova plugin add cordova-plugin-googlemaps \
--variable API_KEY_FOR_ANDROID="(API_KEY_FOR_ANDROID)" \
--variable API_KEY_FOR_IOS="(API_KEY_FOR_IOS)"
$> npm install --save @ionic-native/core@latest @ionic-native/google-maps@latest
```
## Basic usage
This file has been truncated. show original
1 Like
Thanks Masashi!
I hope ionic team folks can add that page again somehow to the docs.
I had the same problem as you for a minute. It turns out that it is quite simple to fix.
Ensure that you declare
map: GoogleMap;
I just had it as public map; which caused some functions to not be accessible.
# \@ionic-native/google-maps document
This plugin used for [cordova-plugin-googlemaps](https://github.com/mapsplugin/cordova-plugin-googlemaps).
## Installation
In order to use this plugin, you need to generate API keys at the Google Developers Console.
Please follow the instruction.
- [How to generate API keys?](./api_key/generate_api_key.md)
```
$> ionic cordova plugin add cordova-plugin-googlemaps \
--variable API_KEY_FOR_ANDROID="(API_KEY_FOR_ANDROID)" \
--variable API_KEY_FOR_IOS="(API_KEY_FOR_IOS)"
$> npm install --save @ionic-native/core@latest @ionic-native/google-maps@latest
```
## Basic usage (Use \@ionic-native/google-maps@4.8.2)
This file has been truncated. show original