Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Applying styles to google maps #772

Open
VictorCostaOliveira opened this issue Mar 29, 2021 · 0 comments
Open

Applying styles to google maps #772

VictorCostaOliveira opened this issue Mar 29, 2021 · 0 comments

Comments

@VictorCostaOliveira
Copy link

If you want to styling your maps like https://developers.google.com/maps/documentation/javascript/styling, you can pass to GmapMap options prop the style array who you want to apply.

Like this:

<template>
  <div class="my-app-map">
    <GmapMap
      ref="mapRef"
      :center="mapCenter"
      :zoom="15"
      map-type-id="roadmap"
      :options="mapOptions"
      style="height: 500px"
     />
  </div>
</template>
<script>
export default {
  name: 'MyAppMap',
  data() {
    return {
      mapOptions: {
        zoomControll: true,
        mapTypeControl: false,
        styles: [
          {
             featureType: 'all',
             elementType: 'all',
             anotherConfigsToGoogleMapsStyle,
          }
        ],
      }
    }
  }
}
</script>

Done, your map has your personalized styles.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant