googlemaps / v3-utility-library

Utility libraries for Google Maps JavaScript API v3
Apache License 2.0
1.1k stars 1.3k forks source link

How to install from npm? #648

Closed strarsis closed 4 years ago

strarsis commented 4 years ago

I want to use the MarkerLabel package, how can I install it using npm?

tkreyche commented 4 years ago

I wanted to use the package in an ASP.NET MVC app, so this may not exactly answer your question, since you are asking about NPM. However I finally figured out how to reference it from the unpkg.com content delivery network, after spending hours reading the documentation (not helpful) and looking over various examples online.

This appears to grab the latest version although you can also specify a particular version. It's unclear to me why this is neither documented nor obvious. Just add this reference or you can also just download it from the same link.

As far as I can tell the repo does not actually include the minified js.

strarsis commented 4 years ago

@tkreyche: Ah, this explains how to use the script at all. But I also want to build it into the app when using webpack, for this I have to somehow include the whole library with all of its files. Sure, one could download a zip/tar of this repo or clone it. But just having a npm package that can be easily installed would be so much better.

jpoehnelt commented 4 years ago

Marker with label is available from npm. https://github.com/googlemaps/v3-utility-library/tree/master/packages/markerwithlabel#npm