setMyLocationEnabled crash map
See original GitHub issueI’m submitting a … (check one with “x”) [ ] question [X] any problem or bug report [ ] feature request
The plugin version: (check one with “x”) [ ] 2.0-beta3 (github) [X] 2.0 (npm)
If you choose ‘problem or bug report’, please select OS: (check one with “x”) [X] Android [ ] iOS
cordova information: (run $> cordova plugin list
)
cordova-plugin-console 1.0.7 "Console"
cordova-plugin-googlemaps 2.0.11 "cordova-plugin-googlemaps"
cordova-plugin-whitelist 1.3.2 "Whitelist"
cordova-plugin-wkwebview-engine 1.1.3 "Cordova WKWebView Engine"
Current behavior: After opening the map sometimes, setMyLocationEnabled blocks all subsequent operations
Expected behavior: Maps should continue to run
Steps to reproduce: git clone https://github.com/sirhaplo/v2.0-demo.git cordova plugin add cordova-plugin-googlemaps --variable API_KEY_FOR_ANDROID=“” cordova platform add android cordova run
In the demo select Map -> getMap().
Kepp doing back and forward between this pages. At certain point the first map will not have the location button and the map below is not loaded
Related code, data or error log (please format your code or data): I added this line to the demo : map.setMyLocationEnabled(true);
var div = document.getElementById("map_canvas1");
var map = plugin.google.maps.Map.getMap(div);
map.one(plugin.google.maps.event.MAP_READY, function() {
map.setMyLocationEnabled(true);
console.log("--> map_canvas1 : ready.");
});
If setted in controls in getMap the current position did not create problems. Also if setted after a long processing after the map_ready did not create problems. Only sometimes in map_ready
I solved using controls in getMap, but this could be useful to others.
Thank you
Issue Analytics
- State:
- Created 6 years ago
- Comments:7 (4 by maintainers)
Top GitHub Comments
There it is : https://youtu.be/CoBoXjZL4wY
The problem is at 14s
I tested the new version and the bug it’s vanished.
Good job !