🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

@007.surajit2023/agm-direction

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@007.surajit2023/agm-direction

directive for agm (not official)

1.0.0
latest
Source
npm
Version published
Maintainers
1
Created
Source

Agm-Direction

npm version npm Build Status PRs Welcome

Agm-Direction is the directive for @007.surajit2023/agm-core (not official)

  • Angular
  • Google Map API

How to use?
👉 Start Reading 👉 Build With Ionic

Agm-Direction

Credit

SebastianM/angular-google-maps - Directions service #495

Installation

Installation is done using the npm install command:

  • Use npm

    npm install --save @007.surajit2023/agm-core agm-direction
    
  • Use yarn

    yarn add @007.surajit2023/agm-core agm-direction
    

Importing Modules

import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppComponent } from './app.component';

import { AgmCoreModule } from '@007.surajit2023/agm-core';            // @007.surajit2023/agm-core
import { AgmDirectionModule } from 'agm-direction';   // agm-direction

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    AgmCoreModule.forRoot({ // @007.surajit2023/agm-core
      apiKey: 'your key',
    }),
    AgmDirectionModule,     // agm-direction
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }

Usage

HTML

<agm-map [latitude]="lat" [longitude]="lng">
  <agm-direction 
    [origin]="origin" 
    [destination]="destination"
  >
  </agm-direction>
</agm-map>

CSS

agm-map {
    height: 400px;
}

TS

public lat = 24.799448;
public lng = 120.979021;

public origin: any;
public destination: any;

ngOnInit() {
  this.getDirection();
}

getDirection() {
  this.origin = { lat: 24.799448, lng: 120.979021 };
  this.destination = { lat: 24.799524, lng: 120.975017 };

  // Location within a string
  // this.origin = 'Taipei Main Station';
  // this.destination = 'Taiwan Presidential Office';
}

Document

Development

👉 Playground Project

git clone https://github.com/explooosion/Agm-Direction.git
npm install
npm run build
npm run pack:lib
cd playground && npm install
# Add gmap api key in environment.ts
npm start

Generator

This library generated by angular-library-starter.

License

MIT

Keywords

angular

FAQs

Package last updated on 04 Dec 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts