Closed maninak closed 3 years ago
This is due to the use of the scoped .base-map
class. Since v0.5.2
we're painting the map on an internal non-root div of the GoogleMap
component. It does receive all the $attrs
so it will receive the class defined in the parent but the class won't be applied correctly due to the scoping. You'll need to either qualify the class with a deep selector or use inline styles instead to avoid the scoping:
::v-deep .base-map {
@include material-shadow($level: 1, $background: $color-platinum);
height: 100%;
border-radius: 4px;
:deep(.vue-map) {
border-radius: 4px;
}
}
See the example sandbox from your other issue: https://codesandbox.io/s/unruffled-bas-j8ly8
Got it, thank you for looking into it!
Turns out anything can be a breaking change, right? :)
FYI what you described you're doing ( receiving all the $attrs
) had another side-effect of two elements having the id map
in my DOM because I was doing <GoogleMap id="map">
and of course the id is part of the $attrs that get copied.
Also my scss code now looks odd because of it too.
.base-map {
width: 100%;
height: 100%;
}
// this confusing selector actually targets the lib-generated component that inherits
// (a.k.a has copy-pasted on it) the $attrs of `<GoogleMap>`. Ending up in two distinct components
// having the class `.base-map`
:deep(.base-map) {
height: 100%;
border-radius: 4px;
@include material-shadow($level: 1, $background: $color-platinum);
.vue-map {
border-radius: 4px;
}
}
Nothing I can't live with, just thought you may get some value out of a real-world use case. Thank you!
Thanks for pointing that out. Apparently we forgot to inheritAttrs: false
to prevent the root div from receiving those attrs as well. Will add that in the next release.
Hello,
it seems that there's a regression on v0.5.2. The map isn't rendering any tiles, apparently.
Going back to v0.5.1 the same code renders as expected but, obviously, I won't have the (necessary for me) fix https://github.com/inocan-group/vue3-google-map/pull/11 published in v0.5.2
Expected:
Actual:
Context:
Here's my (trimmed down) component code:
Additional info:
No errors or warnings in the console