vue-google-maps icon indicating copy to clipboard operation
vue-google-maps copied to clipboard

Using MapID for styling

Open danimalweb opened this issue 3 years ago • 3 comments

is it possible to add an extra prop to pass in the MapID which is used to access styles?

https://developers.google.com/maps/documentation/get-map-id

Sorry if I missed this somewhere, I looked through the code and could not find a reference for it.

danimalweb avatar Mar 19 '22 16:03 danimalweb

@danimalweb I haven't tried this myself, but just happened to notice it when perusing open PRs: https://github.com/fawmi/vue-google-maps/pull/76/commits/4c30b0168423ded7da64ffb1ead8201da0616a6f, which seems to document just what you are looking for. If that works, definitely add a review to https://github.com/fawmi/vue-google-maps/pull/76 😎

eric-schmidt avatar Mar 29 '22 22:03 eric-schmidt

@danimalweb It is possible to define mapId for cloud based styling. Please have a look at the following example. https://stackblitz.com/edit/vue-google-maps-marker-ylrxrd?file=src%2Fcomponents%2FComponentWithMap.vue

Look at the doc (which was added today, thanks to a PR) here: https://vue-map.netlify.app/components/map.html#cloud-based-styling-with-map-id

fawmi avatar Mar 30 '22 11:03 fawmi

@fawmi & @eric-schmidt This worked! Many thanks. If you have the attribute map-type-id="terrain" on GMapMap The mapId value in the options object will not work. Might be worth adding that as a note in the docs.

danimalweb avatar Apr 01 '22 18:04 danimalweb