Fixed center marker Maps

He does not return anything? Sorry I’m not very good. :confused:

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:

image

image

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.

127042_compress

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.

and

That is not good. Native map was used in lot of apps :frowning:

You can still use the @ionic-native/google-maps as well as before.
The new documentation is here.

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.