RxJS Powered Google Maps for Angular
A relatively easy to use google maps
Installation
$ npm install ngx-ez-maps --save
Work in progress
This library is under heavy development and has only basic GoogleMap's functionality, feel free to contribute :)
To do list
- Testing
- Everything under the GooleMap Docs
Basic Usage
This basic app instantiates the google maps ( centered on Manila, Philippines in this case :) ) with a marker and an InfoWindow. When the marker is clicked, set the animation to BOUNCE
and when you click anywhere on the Map, Animation on the Marker will be removed
Import EzMapModule
to your root module:
...
For FeatureModule, just import without the .forRoot
static method call.
...on your component:
...
<!-- Required, put your templates inside #infoWindow Template Ref --> You are here!
LocationService
EzMaps is shipped with helper libraries like LocationService
LocationService
encapsulates navigator.geolocation
's methods with RxJS (because we all love observables)
Methods
- getCurrentLocation
- watchPosition
Usage
Just provide the service:
And on your component you'll do, for example, you want to get the current location:
PlacesService
PlacesService
encapsulates GoogleMaps' Places Library.
Methods
- nearbySearch
- textSearch
- getDetails
For more information about the parameters for these methods, check out the awesome GoogleMaps docs
Start by providing the service:
Usage
Use its methods within onMapReady
only because each method within the PlacesService
would need map
instance