https://github.com/explooosion/agm-direction-docs
Document for Agm-Direction
https://github.com/explooosion/agm-direction-docs
agm agm-direction doc
Last synced: about 1 month ago
JSON representation
Document for Agm-Direction
- Host: GitHub
- URL: https://github.com/explooosion/agm-direction-docs
- Owner: explooosion
- License: mit
- Created: 2018-05-28T18:17:53.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2019-08-30T08:22:39.000Z (over 5 years ago)
- Last Synced: 2025-01-24T22:11:52.517Z (3 months ago)
- Topics: agm, agm-direction, doc
- Language: HTML
- Homepage: http://robby570.tw/Agm-Direction-Docs/
- Size: 1.16 MB
- Stars: 3
- Watchers: 2
- Forks: 1
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Agm-Direction
[](https://badge.fury.io/js/agm-direction)
[](https://github.com/explooosion/Agm-Direction)
[](https://david-dm.org/explooosion/Agm-Direction)
[](https://travis-ci.org/explooosion/Agm-Direction)
[](https://github.com/explooosion/Agm-Direction)
[](http://makeapullrequest.com)[Agm-Direction](https://github.com/explooosion/Agm-Direction) is the directive for [@agm/core](https://github.com/SebastianM/angular-google-maps) (not official)
- Angular 2~7
- Google Map API
- [Playground](https://stackblitz.com/edit/agm-direction-demo)How to use?
👉 [Start Reading](https://robby570.tw/Agm-Direction-Docs/)
## Installation
Installation is done using the
[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally):- Use npm
```bash
npm install --save @agm/core
npm install --save agm-direction
```- Use yarn
```bash
yarn add @agm/core
yarn add agm-direction
```## Importing Modules
```typescript
import { BrowserModule } from '@angular/platform-browser'
import { NgModule } from '@angular/core'
import { AppComponent } from './app.component'import { AgmCoreModule } from '@agm/core' // @agm/core
import { AgmDirectionModule } from 'agm-direction' // agm-direction@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
AgmCoreModule.forRoot({ // @agm/core
apiKey: 'your key',
}),
AgmDirectionModule, // agm-direction
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }
```## Usage
HTML
```html
```
CSS
```css
agm-map {
height: 400px;
}
```TS
```typescript
public lat: Number = 24.799448
public lng: Number = 120.979021public origin: any
public destination: anyngOnInit() {
this.getDirection()
}getDirection() {
this.origin = { lat: 24.799448, lng: 120.979021 }
this.destination = { lat: 24.799524, lng: 120.975017 }// this.origin = 'Taipei Main Station'
// this.destination = 'Taiwan Presidential Office'
}
```## Document
- Document [Agm-Direction-Docs](https://robby570.tw/Agm-Direction-Docs/)
- Less useful [AgmDirectionModule](https://robby570.tw/Agm-Direction/)## Development
👉 [Playground](https://github.com/explooosion/Agm-Direction/tree/master/playground)
```bash
git clone https://github.com/explooosion/Agm-Direction.git
``````bash
cd playground
``````bash
yarn start
```## Development Doc
This library generated by [angular-library-starter](https://github.com/robisim74/angular-library-starter).### Document
```bash
git clone https://github.com/explooosion/Agm-Direction-Docs.git
``````bash
npm install -g gitbook-cli
``````bash
gitbook update
``````bash
gitbook install
``````bash
yarn dev
```## License
[MIT](http://opensource.org/licenses/MIT)