I tried to apply what is in the docs gor the google maps in ionic 2 as it is in the official site: Ionic Docs Google Maps
I got this error:
Type 'Promise<void>' is not assignable to type 'Marker'. Property '_objectInstance' is missing in type 'Promise<void>'. Ionic 2
as it is figured in the screenshot below:
I had this error too, and the solution i've found is to not use marker variable, but only write
map.addMarker(markerOptions).then(...)
And it works, my marker was displayed.
try this:
map.addMarker(markerOptions)
.then((marker: Marker) => {
marker.showInfoWindow();
});
instead of
const marker: Marker = map.addMarker(markerOptions)
.then((marker: Marker) => {
marker.showInfoWindow();
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With