I am looking for a way to use the zoomControlOptiions property available in regular google maps, like so:
zoomControlOptions: {
style: google.maps.ZoomControlStyle.SMALL,
position: google.maps.ControlPosition.LEFT_CENTER
},
Stackoverflow example showing code above
Same thing in the official google maps docs
Unfortunately, I don't see this option in Angular 2 Google Maps API Docs. Is there a way to do it? Is there a way to use the full functionality despite using the Angular 2 wrapper?
Note that just running this code works fine:
map.setOptions({
zoom: 1,
center: position,
zoomControl: true
});
console.log(map.getZoom());
I am able to get the native google maps object and run methods / set properties on it. The problem occurs when I try to use zoomControlOptions
, which is coming directly from the docs
Edit: So, it actually works, the problem now is getting around the Typescript compiler complaining.
Edit 2: I fixed the issue, but if anyone wants the bounty - feel free to explain why zoomControlOptions
aren't natively available.
You can get a reference to the native map object and then add the zoomControlOptions. A full example of getting the map reference is found at https://github.com/philipbrack/example-angular2-google-maps-getNativeMap: