I am using the vue2-google-maps
module and came across the following syntax when needing to refer to the google instance from inside a component prop.
scaledSize: google && new google.maps.Size(50, 50)
It's used as such:
<GmapMarker
:key="e.coordinates.lat + e.coordinates.lng"
v-for="e in poi"
:position="e.coordinates"
:icon="{
url: require(`@/assets/${e.icon}`),
scaledSize: google && new google.maps.Size(50, 50)
}"
/>
And google
is a computed property.
import { gmapApi } from 'vue2-google-maps'
export default {
computed: {
google: gmapApi
}
}
What is the meaning of google &&
and why is it required before new google.maps.Size(50, 50)
?
Thank you!