addMarker callback not executed
See original GitHub issueI’m using ionic 2 and executing on Android M (device, not emulator) I need to add a marker to a map and retain a reference so I can rotate it later. If I add it via e.g.
this.mapping.map.addMarker({'position': coords, 'icon': icon, 'rotation': 90}, (marker) => {
alert("TEST");
});
The marker is placed but the callback is never executed. I’ve put some debugging output into googlemaps-cdv-plugin.js and everything looks like it’s working fine, I’ve verified via alerts that typeof callback === “function” returns true and that both self and marker in callback.call are objects.
Issue Analytics
- State:
- Created 7 years ago
- Comments:21 (11 by maintainers)
Top Results From Across the Web
Why does my add marker button not work? - Stack Overflow
I am currently working on an Android studio app where I need a map. In this map I have a button called, add...
Read more >addMarker: markers not showing up using google.maps ...
At this point I'm only trying to get the markers to show up - I know the use of title is wrong etc....
Read more >GoogleMap | Maps SDK for Android - Google Developers
Sets a callback that is invoked repeatedly while the camera is in motion. The callback may be invoked as often as once every...
Read more >Geolocation with add marker function - Google Groups
... addmarker) together on the google map api javascript, because the geolocation function not working when there are add marker function on ...
Read more >Add Custom Markers with the Google Maps JavaScript API
Now notice that it has a parameter called callback that's set to an ... function addMarker(coordinates) { var marker = new google.maps.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Brilliant thank you! I’m using v2 now without the wrapper and it works. Thank you so much for your help. I think I’ve found a very minor bug in the marker btw. Lines 238 to 245 in Marker.js read
The issue is that 0 and 0.0 are both falsy, so setRotation(0) will not work. Perhaps something like
if (!rotation && typeof rotation !== 'number')or even just the second condition would be better.
@janrg Thanks for inspecting. I fixed the problem position.