capacitor-community / google-maps

Capacitor Plugin using native Google Maps SDK for Android and iOS.
https://capacitor-community.github.io/google-maps/
MIT License
153 stars 64 forks source link

Map pan #217

Closed betim closed 1 year ago

betim commented 1 year ago

Describe the bug Panning does not work on Android. It works on iOS.

To Reproduce I'm using this with Svelte. Map is displayed but cannot be dragged. There are some markers in the map which are clickable but requires to find a spot where it actually fires the map.setOnMarkerClickListener() -- it feels very sluggish.

At first I thought it could be a z-index problem, but as you can see in the screenshot, the events are passed to native element.

Here's the HTML/CSS/JS:

<style>
capacitor-google-map {
  display: inline-block;
  position: absolute;
  top: 100px;
  width: 100%;
  height: 100px;
}
</style>
<capacitor-google-map id="map"></capacitor-google-map>

  const createMap = async (lat, lng) => {
    newMap = await GoogleMap.create({
      id: "my-map", // Unique identifier for this map instance
      element: mapRef, // reference to the capacitor-google-map element
      apiKey: "<KEY>", // Your Google Maps API Key for iOS
      config: {
        // androidLiteMode: true,
        center: {
          // The initial position to be rendered by the map
          lat: lat,
          lng: lng,
        },
        zoom: 12, // The initial zoom level to be rendered by the map
        // styles: ["Normal"],
      },
    });
  };

Expected behavior To be able to move the map around with fingers.

Screenshots image

Any help would be very welcome :)

tafelnl commented 1 year ago

You are most likely using @capacitor/google-maps. You are now in the @capacitor-community/google-maps repository.