Repository navigation
feat(google-maps): support setting the map type - #18578
Conversation
| mapConstructorSpy = createMapConstructorSpy(mapSpy).and.callThrough(); | ||
|
|
||
| const fixture = TestBed.createComponent(TestApp); | ||
| fixture.componentInstance.mapTypeId = 'terrain' as unknown as google.maps.MapTypeId; |
There was a problem hiding this comment.
Why not google.maps.MapTypeId.TERRAIN
There was a problem hiding this comment.
Because the global google variable isn't available when running unit tests.
| ngOnChanges() { | ||
| this._setSize(); | ||
| if (this._googleMap && this.mapTypeId) { | ||
| this._googleMap.setMapTypeId(this.mapTypeId); |
There was a problem hiding this comment.
This will call setMapTypeId for every change. My preference would be to continue the existing pattern, or failing that, at least include a check that the mapTypeId has changed.
There was a problem hiding this comment.
That's correct, but from what I can tell, the Google Maps API already knows not to do anything if you're giving it the same map type that it already has.
|
LGTM |
|
Needs rebase |
Adds support for setting the `mapTypeId` which determines the kind of map that will be shown (e.g. terrain map, roadmap etc). Fixes angular#18577.
ded2308 to
5be0633
Compare
|
Rebased. |
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Adds support for setting the
mapTypeIdwhich determines the kind of map that will be shown (e.g. terrain map, roadmap etc).Fixes #18577.