Sivakavi J
Sivakavi J

Reputation: 11

Android 6.0 crash when google maps is dragged

I have an error with my app when i try to drag and move google-maps, the app crash and it's show me the classical error from android "Unfortunately the application is stopped". This issue happened with android and only with some devices , for example with a device Nexus 6 and 6.0.1(android version)

Steps to reproduce the problem:

  1. Run Android WebView in hybrid app container
  2. Open a map with markers
  3. Drag and move the map
  4. App crash with the message "Unfortunately the application is stopped"

Upvotes: 1

Views: 602

Answers (1)

user3774545
user3774545

Reputation: 31

I figured it out! :D

I literally spent hours till I got it. All you have to do is set draggable to true on the markers like this:

var marker = new google.maps.Marker({ position: markerLatLng, map: map,  title: "title", draggable: true });

The problem was only happening on my Nexus 5x, but it worked on an iPhone6, iPhone5c, and the Asus Zenphone 2. For me, it was ONLY the markers that where causing troubles.

Alternatively try this:

                      var userMarker = new google.maps.Marker({
                            position: markerLatLng,
                            icon: {
                              strokeColor: '#ffffff',
                              fillColor: '#4788F3',  
                              path: google.maps.SymbolPath.CIRCLE,
                              scale: 10,
                              fillOpacity: 1,
                              strokeWeight: 2
                            },
                            draggable: true,
                            map: map
                          }); 

Upvotes: 3

Related Questions