react-google-maps-api
react-google-maps-api copied to clipboard
Data-driven style
Hello, I am trying to use data-driven styling. Tried implementing it like this:
const onLoad = useCallback(function callback(map) {
const bounds = new window.google.maps.LatLngBounds(center)
map.fitBounds(bounds);
let layer = map.getFeatureLayer(window.google.maps.FeatureType.COUNTRY)
layer.style = {
'strokeColor': 'blue',
'strokeWeight' : 1
}
setMap(map)
}, [])
Does anyone know how to implement this correctly? I am kinda scratching my head right now. Tried using the information from this video https://www.youtube.com/watch?v=tAR63GBwk90 but not getting anywhere with it.
Any help would be much appreciated. Thanks!
I implemented Data driven using @ubilabs/google-maps-react-hooks this library