Skip to content
This repository was archived by the owner on Jun 23, 2025. It is now read-only.

Commit 509b610

Browse files
committed
fix(SebmGoogleMap): allow styling via comp styles
With v0.8.0, styling the map via the styles setting of a component was NOT possible any more: ``` @component({ selector: 'my-map-cmp', directives: [SebmGoogleMap], styles: [` .sebm-google-map-container { height: 300px; } `] } ``` Fixes #162 Closes #169
1 parent e4ca50b commit 509b610

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/directives/google-map.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,15 @@ import {MouseEvent} from '../events';
3434
providers: [GoogleMapsAPIWrapper, MarkerManager],
3535
inputs: ['longitude', 'latitude', 'zoom', 'disableDoubleClickZoom', 'disableDefaultUI'],
3636
outputs: ['mapClick', 'mapRightClick', 'mapDblClick'],
37+
host: {'[class.sebm-google-map-container]': 'true'},
38+
styles: [`
39+
.sebm-google-map-container-inner {
40+
width: inherit;
41+
height: inherit;
42+
}
43+
`],
3744
template: `
38-
<div class="sebm-google-map-container"></div>
45+
<div class="sebm-google-map-container-inner"></div>
3946
<ng-content></ng-content>
4047
`
4148
})
@@ -82,7 +89,7 @@ export class SebmGoogleMap implements OnChanges,
8289

8390
/** @internal */
8491
ngOnInit() {
85-
const container = this._elem.nativeElement.querySelector('.sebm-google-map-container');
92+
const container = this._elem.nativeElement.querySelector('.sebm-google-map-container-inner');
8693
this._initMapInstance(container);
8794
}
8895

0 commit comments

Comments
 (0)