ionic-team / ionic-native-google-maps

Google maps plugin for Ionic Native
Other
221 stars 125 forks source link

draggable:true not working on android device #178

Closed utpaul closed 5 years ago

utpaul commented 5 years ago

I'm using ionic 3 apps. But marker draggable is not working.

    this.map.one(GoogleMapsEvent.MAP_READY).then(() => {
      this.mapReady = true;
      this.map.addMarker({
        title: 'Ionic',
        icon: 'blue',
        animation: 'DROP',
        draggable:true,
        position: {
          lat: CAMERA_DEFAULT_LAT,
          lng: CAMERA_DEFAULT_LONG
        }
      }).then((marker:Marker)=>{
          marker.showInfoWindow();
          marker.on(GoogleMapsEvent.MARKER_CLICK).subscribe(() => {
            alert('clicked');
          });
      })
    });
battika commented 5 years ago

I can see the same thing, my sample project is updated

https://github.com/battika/ionic-gmaps-test

Press the Add marker button on the bottom and try dragging the green marker. It drags the entire map, not the marker.

It works as expected on browser platform.

utpaul commented 5 years ago

@battika you are right . Need to fix this . If possible then you resolve it

battika commented 5 years ago

Sorry I don't really know the reason, just provided a sample for further investigation.

wf9a5m75 commented 5 years ago

I have no problem at all. capture

wf9a5m75 commented 5 years ago

ping

utpaul commented 5 years ago

Can you share your code @wf9a5m75

wf9a5m75 commented 5 years ago

I just run @battika's code

battika commented 5 years ago

I guess it will another emulator issue. Masashi, I assume you tested it on a real device.

utpaul commented 5 years ago
<plugin name="cordova-plugin-googlemaps" spec="2.5.1">
    <variable name="API_KEY_FOR_ANDROID" value="key" />
    <variable name="API_KEY_FOR_IOS" value="key" />
    <variable name="PLAY_SERVICES_VERSION" value="15.0.1" />
    <variable name="ANDROID_SUPPORT_V4_VERSION" value="27.+" />
</plugin>
<engine name="android" spec="7.1.4" />

and "@ionic-native/google-maps": "^4.21.0" draggable not work

 this.map.one(GoogleMapsEvent.MAP_READY).then(() => {
      this.mapReady = true;
      this.map.addMarker({
        title: 'Ionic',
        icon: 'blue',
        animation: 'DROP',
        draggable:true,
        position: {
          lat: CAMERA_DEFAULT_LAT,
          lng: CAMERA_DEFAULT_LONG
        }
      }).then((marker:Marker)=>{
        marker.showInfoWindow();
        marker.on(GoogleMapsEvent.MARKER_CLICK).subscribe(() => {
          alert('clicked');
        });

        marker.addEventListener(GoogleMapsEvent.MAP_DRAG).subscribe((event)=>{
          alert('drag');
        })

      })

    });
wf9a5m75 commented 5 years ago

His project uses the same conditions with you.

https://github.com/battika/ionic-gmaps-test/blob/master/package.json

wf9a5m75 commented 5 years ago

Please share your project files on GitHub repository. Otherwise we can not help you further ( in that case , I will close this thread).

utpaul commented 5 years ago

repo link https://github.com/utpaul/google-maps-test

i'm testing on nokia 6 version pie

wf9a5m75 commented 5 years ago

Android 9 (API level 28) on Emulator

drag

utpaul commented 5 years ago

i already check it my pie 9 on real device but not work ... please check it on real device

wf9a5m75 commented 5 years ago

I did test your code and @battika's code a lot on both emulator and real device.

I didn't change the code of the property around recently. If it's real bug, I should receive more craimes. However only you. Thus, I don't think this is a bug.

I don't want to waste my private time furthermore for you. At least you should test another device.

utpaul commented 5 years ago

tnx @wf9a5m75 for giving us such a valuable time.