Shows Maps with markers which contains descriptions with links to cleverroute main-page
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
googlemaps-bot 3cfd99b62f
chore: Synced local '.github/' with remote 'sync-files/js/.github/' (#386)
3 years ago
.github chore: Synced local '.github/' with remote 'sync-files/js/.github/' (#386) 3 years ago
e2e chore: init 4 years ago
examples chore: add license 4 years ago
src feat: set and get label content (#328) 3 years ago
.babelrc chore: Synced local '.babelrc' with remote 'sync-files/js/.babelrc' (#298) 3 years ago
.eslintignore chore: Created local '.eslintignore' from remote 'sync-files/js/.eslintignore' (#296) 3 years ago
.eslintrc.json chore: Synced local '.eslintrc.json' with remote 'sync-files/js/.eslintrc.json' (#348) 3 years ago
.gitignore chore: init 4 years ago
.releaserc chore: Synced file(s) with googlemaps/.github (#292) 3 years ago
CONTRIBUTING.md chore: init 4 years ago
LICENSE chore: init 4 years ago
README.md fix: update readme (#273) 3 years ago
SECURITY.md chore: Created local 'SECURITY.md' from remote 'SECURITY.md' (#316) 3 years ago
jest.config.js chore: init 4 years ago
package-lock.json chore(deps-dev): bump @types/google.maps from 3.47.0 to 3.47.1 (#385) 3 years ago
package.json chore(deps-dev): bump @types/google.maps from 3.47.0 to 3.47.1 (#385) 3 years ago
rollup.config.js fix: broken declarations (#371) 3 years ago
tsconfig.json fix: broken declarations (#371) 3 years ago
typedoc.js build: fix docs build (#131) 3 years ago

README.md

Google Maps JavaScript MarkerWithLabel

npm Build Release codecov GitHub contributors semantic-release Discord

Description

The library provides Markers with labels for Google Maps Platform.

Note: This library is the nearly the same interface as the existing library @google/markerwithlabel, but renamed and in its own repository. All future development will continue here.

Note: There are some breaking changes from @google/markerwithlabel including anchor position. This should be considered a major version bump!

Install

Available via npm as the package @googlemaps/markerwithlabel.

npm i @googlemaps/markerwithlabel

or

yarn add @googlemaps/markerwithlabel

Alternativly you may add the umd package directly to the html document using the unpkg link.

<script src="https://unpkg.com/@googlemaps/markerwithlabel/dist/index.min.js"></script>

When adding via unpkg, the marker with labels can be accessed at MarkerWithLabel.

A version can be specified by using https://unpkg.com/@googlemaps/markerwithlabel@VERSION/dist/....

Documentation

The reference documentation can be found at this link.

Example

new MarkerWithLabel({
    position: new google.maps.LatLng(49.475, -123.84),
    clickable: true,
    draggable: true,
    map: map,
    labelContent: "foo", // can also be HTMLElement
    labelAnchor: new google.maps.Point(-21, 3),
    labelClass: "labels", // the CSS class for the label
    labelStyle: { opacity: 1.0 },
})

View the package in action: