Angular-google-maps: Property controls is not available on NativeMap object

Created on 8 Sep 2016  ·  3Comments  ·  Source: SebastianM/angular-google-maps

Issue description
I am inserting a searchbox on the map to search for addresses as you can see on this tutorial at (Google Maps API doc)[https://developers.google.com/maps/documentation/javascript/examples/places-searchbox].

In order to to that, I got the NativeMap and push the input element into the map using something like this:

this.gmaps.getNativeMap().then(map => {
      let input = document.getElementById('my-search-box');
      let searchBox = new google.maps.places.SearchBox(input);
      map.controls[google.maps.ControlPosition.TOP_LEFT].push(input);
      searchBox.addListener('places_changed', () => this.placesChanged(searchBox));
    });

As the controls is not mapped on the object returned from map I always get the error message:
Property 'controls' does not exist on type 'GoogleMap'.

but it works anyway.

As the controls property allows us to do cool stuff once we got the nativeMap, I think implement it could be nice for future releases.

angular2 & angular2-google-maps version
angular2 - 2.0.0-rc.6
angular2-google-maps 0.14.0

PRs welcome! stale feature-request

Most helpful comment

It would be very nice to have this implemented :)

All 3 comments

Any update on this issue ?

btw, thanks for the hard work !

It would be very nice to have this implemented :)

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

vamsibassetty08 picture vamsibassetty08  ·  3Comments

DeveloperAdd007 picture DeveloperAdd007  ·  3Comments

nthonymiller picture nthonymiller  ·  4Comments

Subhojit1992 picture Subhojit1992  ·  3Comments

ostapch picture ostapch  ·  4Comments