-
Notifications
You must be signed in to change notification settings - Fork 42
Open
Labels
Description
you can't use styles, but I didn't set the mapId anywhere, but set by default
capacitor-google-maps/plugin/src/web.ts
Line 495 in e26260d
config.mapId = `capacitor_map_${this.currMapId++}`; |
Google Maps JavaScript API: A Map's styles property cannot be set when a mapId is present. When a mapId is present, map styles are controlled via the cloud console. Please see documentation at https://developers.google.com/maps/documentation/javascript/styling#cloud_tooling

const map = await GoogleMap.create({
id: 'my-cool-map',
element: mapRef.value,
apiKey: '',
config: {
center: {
lat: 33.6,
lng: -117.9,
},
zoom: 8,
heading: 0,
minZoom: 0,
maxZoom: 16,
styles: [
{
featureType: 'poi.attraction',
elementType: 'all',
stylers: [{ visibility: 'off' }],
},
{
featureType: 'poi.business',
stylers: [{ visibility: 'off' }],
},
{
featureType: 'transit',
elementType: 'labels.icon',
stylers: [{ visibility: 'off' }],
},
],
},
})
I assume that we need to move away from using mapId and use our own id to get the maps
Current solution use cloud based