Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yagajs/leaflet-ng2-gps
GPS Module including service and directive for leaflet-ng2
https://github.com/yagajs/leaflet-ng2-gps
angular2 geolocation gps leaflet spatial typescript yaga
Last synced: 5 days ago
JSON representation
GPS Module including service and directive for leaflet-ng2
- Host: GitHub
- URL: https://github.com/yagajs/leaflet-ng2-gps
- Owner: yagajs
- License: isc
- Created: 2017-05-12T17:24:49.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-10-04T19:14:19.000Z (about 6 years ago)
- Last Synced: 2024-10-23T12:33:31.848Z (15 days ago)
- Topics: angular2, geolocation, gps, leaflet, spatial, typescript, yaga
- Language: TypeScript
- Size: 58.6 KB
- Stars: 1
- Watchers: 5
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# GPS Plugin for leaflet-ng2
This is a GPS service and directive for [YAGA's](https://yagajs.org) [leaflet-ng2](https://leaflet-ng2.yagajs.org).
## How to use
First install this module into your project with npm:
```bash
npm install --save @yaga/leaflet-ng2-gps
```*Keep in mind that you have to add `@yaga/leaflet-ng2` as peer dependency*
Insert this module into your app module
```typescript
import { YagaModule } from '@yaga/leaflet-ng2';
import { GpsService, YagaGpsModule } from '@yaga/leaflet-ng2-gps';// ...
@Component({
selector: 'app',
templateUrl: 'app.html',
})
export class AppComponent {
// ...
}@NgModule({
bootstrap: [ AppComponent ],
declarations: [ AppComponent ],
imports: [ YagaGpsModule, YagaModule ],
})
export class AppModule {}```
Use the `yaga-gps` directive in your template and use the Circle, CircleMarker or Marker directives within.
You can style the sub-directives like you with directly in the template. The `yaga-gps` directive take care about their
display state and position. In addition the radius of Circle directives gets set according to the GPS accuracy.```html
This is your current position...
```
*Note: The radius of the CircleMarker directive will not be set by this directive (it makes no sense!)*