1.1.1 • Published 4 years ago

map-label-rotated v1.1.1

Weekly downloads
6
License
MIT
Repository
github
Last release
4 years ago

Map Label Rotated - A Google Maps JavaScript API utility library

Simple Javascript library to display rotated text on Google Maps.

Example usage along a polyline:

Demo image

Installation

To install the stable version:

npm install --save map-label-rotated

This assumes you are using npm as your package manager.

Usage

Import it:

import { RotatedLabel } from "map-label-rotated";

Hello world with default styles:

new RotatedLabel(new google.maps.LatLng(0, 0), "Hellow world", 45, map);

Hello world with custom styles:

new RotatedLabel(new google.maps.LatLng(0, 0), "Hellow world", 45, map, {
	color: "red",
	fontSize: "22px",
});

API

It simply extends the google.maps.OverlayView class with custom constructor:

ParamTypeDescription
positionLatLngLabel position. Required.
textstringLabel text. Required.
rotationnumberLabel rotation in degrees. Required.
mapMapMap on which to display label. Required.
customStylesStyle objectSet of CSS properties. Optional.

License

MIT

1.1.1

4 years ago

1.1.0

5 years ago

1.0.1

6 years ago

1.0.0

6 years ago