-
Notifications
You must be signed in to change notification settings - Fork 820
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
Is there a way to get mapWrapper instance so that I can play with geocoding/reverseGeocoding #139
Comments
import {GoogleMapsAPIWrapper} from 'angular2-google-maps/services/google-maps-api-wrapper'; ... @component(... providers: [GoogleMapsAPIWrapper] ... constructor(private _mapsWrapper: GoogleMapsAPIWrapper){} |
Simply injecting GoogleMapsAPIWrapper will not do the trick there, because _map is private (private _map: Promise<mapTypes.GoogleMap>) and not accessible in component writing new google.maps.Geocoder() in component is also not working. due to google is undefined error. So how can i get map instance from GoogleMapsAPIWrapper Service ?? |
I could introduce a new method <sebm-google-map [latitude]="lat" [longitude]="lng">
<my-comp></my-comp>
</sebm-google-map> @Component({
selector: 'my-comp'
})
export class MyComp {
constructor(private _wrapper: GoogleMapsAPIWrapper) {
this._wrapper.getMap().then((m) => {
// implement your own logic
}
}
} |
sounds like a good idea =] |
I created a pull request. #155 (feat(SebmGoogleMap): exposing _map Instance from GoogleMapsAPIWrapper) but build is failing and i am not able to figure out why ? https://travis-ci.org/SebastianM/angular2-google-maps/builds/111165799 Can you look at the pull request and provide some kind of documentation for sending pull-requests. |
@parmod-arora thanks for the PR. There was an issue in Travis CI. Can you do a rebase (shorten the commit message and add only on commit to the PR)? Then the build should be green. |
Oh BTW: I will also add some contribution guidelines very soon. |
Thanks for your suggestions, Every things works as expected please merge below PR. |
Hi I put together a working example of accessing the native map, it seems to be a little confusing how to use it at first. https://github.com/philipbrack/example-angular2-google-maps-getNativeMap |
@SebastianM @philipbrack is the code you provided still working? |
Thanks for this wonderful repo and Is there a way to get mapWrapper instance so that I can play with geocoding/reverseGeocoding in my own components.
The text was updated successfully, but these errors were encountered: