Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Property controls is not available on NativeMap object #630

Closed
marcelinobadin opened this issue Sep 8, 2016 · 3 comments
Closed

Property controls is not available on NativeMap object #630

marcelinobadin opened this issue Sep 8, 2016 · 3 comments

Comments

@marcelinobadin
Copy link

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

@alexverdaguer
Copy link

Any update on this issue ?

btw, thanks for the hard work !

@kacperjurak
Copy link

It would be very nice to have this implemented :)

jgutix added a commit to jgutix/angular-google-maps that referenced this issue Feb 16, 2018
Introduces a new directive that allows to easily add a searchbox to the map. Include a common functionality to center the map when clicking one result

Closes sebholstein#1290
Closes sebholstein#630
@stale
Copy link

stale bot commented Nov 13, 2018

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.

@stale stale bot added the stale label Nov 13, 2018
@stale stale bot closed this as completed Nov 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants