Skip to content


Repository files navigation

Google Maps JavaScript MarkerWithLabel

npm Build Release codecov GitHub contributors semantic-release Discord


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!


Available via npm as the package @googlemaps/markerwithlabel.

npm i @googlemaps/markerwithlabel


yarn add @googlemaps/markerwithlabel

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

<script src=""></script>

When adding via unpkg, the marker with labels can be accessed at new markerWithLabel.MarkerWithLabel().

A version can be specified by using


The reference documentation can be found at this link.


import { MarkerWithLabel } from '@googlemaps/markerwithlabel';

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: