inocan-group / vue3-google-map

A set of composable components for easy use of Google Maps in your Vue 3 projects.
https://vue3-google-map.com
MIT License
296 stars 60 forks source link

Stylers dont work anymore #286

Open SanderBrijer opened 1 month ago

SanderBrijer commented 1 month ago

I recently updated google maps to 0.21.0, afterwards de stylers of the map dont work anymore.

What I tried:

 function getMapOptions() {
      return {
        styles: [
          {
            featureType: 'poi.business',
            stylers: [
              {
                visibility: 'off',
              },
            ],
          },
          {
            featureType: 'poi.government',
            stylers: [
              {
                visibility: 'off',
              },
            ],
          },
          {
            featureType: 'poi.school',
            stylers: [
              {
                visibility: 'off',
              },
            ],
          },
          {
            featureType: 'poi.medical',
            stylers: [
              {
                visibility: 'off',
              },
            ],
          },
          {
            featureType: 'poi.place_of_worship',
            stylers: [
              {
                visibility: 'off',
              },
            ],
          },
        ],
      };
    }

    watch(
      () => googleMap.value?.ready,
      (ready) => {
        if (!ready) return;

        googleMap.value.map.setOptions(getMapOptions());
      }
    );

and

 <google-map
      v-if="mapHeight"
      ref="googleMap"
      mapId="googleMap"
      style="width: 100%; height: 100%"
      :styles="mapstyles"
 mapstyles() {
      return [
        ...(this.layer?.labels?.companies === false
          ? [...this.styleRemoveLabels]
          : []),
        ...(this.darkmode.value ?? useQuasar()?.dark.isActive
          ? [...this.styles]
          : []),
      ];
    },

Darkmode is not working after the update, and the remove labels (POI companies) dont work anymore...

beliven-francesco-delgiudice commented 1 day ago

Same here!