Access to full google.maps object
See original GitHub issueHi, loving your work so far, but am curious, will this library ever grant access to the full google.maps object, similar to angular1’s implementation of google-maps? (see here: http://angular-ui.github.io/angular-google-maps/#!/api/GoogleMapApi)
Getting the google.maps object lets you create, for example…
A1 code to create new DirectionsRenderer and DirectionsService:
uiGmapGoogleMapApi.then(function(maps) {
vm.gmaps = maps;
vm.map.directionsDisplay = new vm.gmaps.DirectionsRenderer();
vm.map.directionsService = new vm.gmaps.DirectionsService();
});
Or to create a new LatLng object:
var latlng = new vm.gmaps.LatLng(lat, lng);
Is this going to be possible with this library?
EDIT: I do see that the google object is available globally… so we can do var latlng = new google.maps.LatLng(lat,lng); However, isn’t it one goals of the project to prevent the google object from polluting the global namespace?
EDIT to EDIT: Also see now we can use LatLngLiteral interface, so that deals with one problem:
import {LatLngLiteral} from 'angular2-google-maps/core';
...
var latlng = <LatLngLiteral>{lat: this.latitude, lng: this.longitude};
this.map.setCenter(latlng);
Issue Analytics
- State:
- Created 8 years ago
- Reactions:1
- Comments:8 (3 by maintainers)
Top GitHub Comments
If I’m understanding everything here correctly, wouldn’t the most angular way of handling this be to have a service that returns the global object? This would enable mocking for testing and avoid global dependencies.
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.