0.2.6 • Published 3 years ago

ng2-heremaps-next v0.2.6

Weekly downloads
85
License
MIT
Repository
github
Last release
3 years ago

Angular Heremaps

Build Status npm

Allows you to interact with the HERE Maps API for JavaScript through Angular.

Check API Documentation

Install

npm install ng2-heremaps @types/heremaps --save

Setup

step 1: add ng2-heremaps to app NgModule

import { HereMapsModule } from 'ng2-heremaps';

@NgModule({
  imports: [
    ...
    HereMapsModule.forRoot({
      apiKey: 'your heremaps API key',
      appId: 'your heremaps API id',
      apiVersion: '3.0',
      libraries: ['core', 'service']
    }),
    ...
  ],
  bootstrap: [AppComponent],
  declarations: [AppComponent]
})
class AppModule {}

Use

Basic map

 <div style="height: 400px; width: 600px;">
    <heremap [center]="{latitude: 40.730610, longitude: -73.935242}"></heremap>
  </div>

Inputs

InputTypeDefaultDescription
autoFitMarkersbooleantrueShould map auto resize bounds to current set of markers
backgroundColorstringtransparentThis color will be visible when tiles have not yet loaded as the user pans.
centerLatLng or LocationREQUIREDThe initial Map center.
enableDoubleClickZoombooleantrueEnables/disables zoom and center on double click.
draggablebooleantrueIf false, prevents the map from being dragged.
keyboardShortcutsbooleantrueIf false, prevents the map from being controlled by the keyboard.
scrollwheelbooleantrueIf false, disables scrollwheel zooming on the map.
zoomnumber5Map zoom level
minZoomnumbernullThe minimum zoom level which will be displayed on the map.
maxZoomnumbernullThe maximum zoom level which will be displayed on the map.
disableDefaultUIbooleanfalseEnables/disables all default UI.
mapTypeControlbooleanfalseEnabled/Disabled state of the Map type control.
rotateControlbooleanfalseEnabled/Disabled state of the Rotate control.
scaleControlbooleantrueEnabled/Disabled state of the Scale control.
streetViewControlbooleanfalseEnabled/Disabled state of the Street View Pegman control.
animateZoombooleantrueEnabled/Disabled zoom animation.
zoomControlbooleantrueEnabled/Disabled state of the Zoom control.

Directives

There are directives for directions, markers, and polylines. Please see the files directly to see the available inputs and outputs.