Closed fdr2 closed 8 years ago
Hey @ofanged1,
I am having the same issue. Every time that I add a new marker on my map it doesn't automatically get centered.
I also added this in my ts files:
import {GoogleMapsAPIWrapper} from
'angular2-google-maps/services/google-maps-api-wrapper';
@Component(...
providers: [GoogleMapsAPIWrapper]
...
//But when I do this, nothing happens
constructor(private _wrapper: GoogleMapsAPIWrapper) { this._wrapper.getMap().then((m) => { console.log(m) }) }
Thanks @esnaremaussa, I think I'm going to move towards using a component to interact with the map as you have pointed out (and I should have realized from the angular2 quickstart).
I was easily able to get the plugin working with my ionic2 app and found it much easier and cleaner than working on the lazy loading myself. I'm just having some issues figuring out how to get access to the Injectables provided.
After Importing directives and providers
And passing them as arguments to Page
I'm unable to figure out how to access the GoogleMapsAPIWrapper in order to setCenter(), for example. Can you provide any direction on how this is possible? I'm thinking I would need to instantiate the Injectable in my constructor and assign it to a member of this for use in other class methods, but I'm not sure how...
PS: I know this is more of an Angular2 question than an Angular2-Google-Maps question and appreciate any direction you can send me. Thanks!