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
295 stars 60 forks source link

Unable to change MapTypeId #198

Closed pierregremaud closed 9 months ago

pierregremaud commented 9 months ago

Looks like property "mapTypeId" is not working in component GoogleMap

My component template looks like :

        <GoogleMap
            api-key="xxxxxxxxxxxxxxx" 
            style="width: 100%; height: 600px"
            :mapTypeId="terrain"
        >

But the mapTypeId is allways the default ("roadmap")

JoseGoncalves commented 9 months ago

You need to pass the parameters in the hyphenated form. Try:

        <GoogleMap
            api-key="xxxxxxxxxxxxxxx" 
            style="width: 100%; height: 600px"
            :map-type-id="terrain"
        >
JoseGoncalves commented 9 months ago

If terrain is a String instead of a Vue Ref, you need to set it like this:

        <GoogleMap
            api-key="xxxxxxxxxxxxxxx" 
            style="width: 100%; height: 600px"
            map-type-id="terrain"
        >
pierregremaud commented 9 months ago

Yesss !!! Your solution works perfectely for me.

Many thanks for your help and for giving us that great software.

JoseGoncalves commented 9 months ago

@pierregremaud You're welcome but, I did not develop the software, I just use it and made some minor contributions.

HusamElbashir commented 9 months ago

@JoseGoncalves Is a regular contributor to this library and often steps in to answer questions when us maintainers are busy. Much appreciated chief 🙏