capacitor-plugins icon indicating copy to clipboard operation
capacitor-plugins copied to clipboard

[@capacitor/google-maps] Refactor options and extend a method to update the map options

Open AE1NS opened this issue 2 years ago • 4 comments

Feature Request

Plugin

@capacitor/google-maps

Description

This feature request has 2 topics

Refactor options

  • As styles also exists in google.maps.MapOptions it could be removed from GoogleMapsConfig. I think you added it here, to show it in the documentation, but I would rather write a comment above the class, which properties from google.maps.MapOptions are supported
  • To prevent overhead, the MapType class could be deleted, because its documented in google.maps.MapOptions
  • The following methods could be removed and implemented within the options object (this would require to have a update method, see below):
    • getMapType
    • setMapType
    • enableIndoorMaps
    • enableTrafficLayer
    • enableAccessibilityElements
    • enableCurrentLocation
    • setPadding
  • There should be some additional options in GoogleMapsConfig like:
    • isCompassEnabled
    • isRotateGesturesEnabled
    • isTiltGesturesEnabled
    • isToolbarEnabled
    • isZoomGesturesEnabled
  • Some more properties of google.maps.MapOptions should be handled by the native code like:
    • gestureHandling
    • restriction

Add an update method for map options

The above defined changes should also be appliable by an update method, to change them after the map instantiation.

Platform(s)

Android iOS Web

AE1NS avatar May 25 '23 15:05 AE1NS

Adding to this issue, I think it would be really nice to be able to update the map options as @AE1NS suggests.

In my case I need to set setMyLocationButtonEnabled to false.

My problem is that if I set enableCurrentLocation to true, on Android the default geolocation button is shown, even if I set disableDefaultUI: true in the map config options. On iOS it works fine.

Screenshot 2023-08-27 at 22 05 53

djabif avatar Aug 28 '23 14:08 djabif

@djabif The "disableDefaultUI" is only available for web. For iOS and Android only the config options declared on GoogleMapConfig are available.

matbravob avatar Sep 08 '23 19:09 matbravob

Are there any updates on this?

ngmiduc avatar Nov 10 '23 11:11 ngmiduc

Are there any uptades?

CSantosM avatar May 15 '24 14:05 CSantosM

Moved https://github.com/ionic-team/capacitor-google-maps/issues/25

AE1NS avatar Jun 18 '24 08:06 AE1NS

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of the plugin, please create a new issue and ensure the template is fully filled out.

ionitron-bot[bot] avatar Jul 03 '24 09:07 ionitron-bot[bot]