Registry / maps / googlemaps-v3-utility-library

googlemaps-v3-utility-library

JSON →
library1.0.1jsnpmunverified

A collection of utility classes and functions for the Google Maps JavaScript API V3, automatically exported from the original Google Code repository. Version 1.0.1 is the latest stable release. This package includes common utilities such as `google.maps.LatLng` extensions, `MarkerWithLabel`, `InfoBox`, and `MarkerClusterer`. It was originally hosted on Google Code and has not been actively maintained since the migration to GitHub, with many utilities now obsolete due to changes in the Google Maps API. Users are strongly encouraged to migrate to the official `@googlemaps/` scoped packages or the modern `MarkerClustererPlus` library. The library is published as a Node package for convenience, but serves mostly as an archive.

npm install googlemaps-v3-utility-library
INSTALL
IMPORT
SIG · GOOGLEMAPS-V3-UTIL
G
googlemaps-v3-utility-library
mapsjavascriptv1.0.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

InfoBox
// Not available via npm import; use script tag from CDN: <script src='https://unpkg.com/googlemaps-v3-utility-library@1.0.1/infobox/infobox.js'></script>
This package does not support es modules or CommonJS. All utilities are designed to be loaded via script tags in a browser and extend the global google.maps namespace.
MarkerClusterer
// Not available via npm import; use script tag from CDN: <script src='https://unpkg.com/googlemaps-v3-utility-library@1.0.1/markerclusterer/markerclusterer.js'></script>
MarkerClusterer is deprecated; use @googlemaps/markerclusterer instead.
MarkerWithLabel
// Not available via npm import; use script tag from CDN: <script src='https://unpkg.com/googlemaps-v3-utility-library@1.0.1/markerwithlabel/markerwithlabel.js'></script>
This library is outdated; consider using @googlemaps/markerwithlabel or custom overlays.

A complete HTML page that initializes a Google Map and demonstrates using InfoBox and MarkerClusterer from script tags via CDN.

<!DOCTYPE html> <html> <head> <title>Google Maps V3 Utility Demo</title> <script src='https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY'></script> <script src='https://unpkg.com/googlemaps-v3-utility-library@1.0.1/infobox/infobox.js'></script> <script src='https://unpkg.com/googlemaps-v3-utility-library@1.0.1/markerclusterer/markerclusterer.js'></script> </head> <body> <div id='map' style='height:400px;'></div> <script> const map = new google.maps.Map(document.getElementById('map'), { center: {lat: -34.397, lng: 150.644}, zoom: 8 }); // InfoBox example const infowindow = new InfoBox({ content: 'Hello', pixelOffset: new google.maps.Size(-50, 0) }); infowindow.open(map); // MarkerClusterer example const markers = []; const locations = [ {lat: -34.397, lng: 150.644}, {lat: -34.497, lng: 150.744} ]; locations.forEach(pos => markers.push(new google.maps.Marker({position: pos, map: map}))); new MarkerClusterer(map, markers); </script> </body> </html>
Debug
Known issues
gotchaThis package is a direct export from the old Google Code repository and is not maintained. It has not been updated to work with modern Google Maps API versions or bundlers.
fix
Migrate to modern equivalents: @googlemaps/markerclusterer, @googlemaps/infobox (not official), or custom implementation.
affects: >=1.0.0
deprecatedMarkerClusterer is deprecated and does not support the newer map rendering options (WebGL).
fix
Use @googlemaps/markerclusterer instead, which is the official Google library.
affects: >=1.0.0
gotchaAll utilities extend the global google.maps namespace and cannot be imported via ES modules or CommonJS. Using require() or import will fail.
fix
Use script tags from a CDN to load the JavaScript files directly in a browser.
affects: >=1.0.0
gotchaThe package is published on npm but the source files are not designed for Node.js or bundlers. The package contains .js files that are meant to be script-included, not required/imported.
fix
Do not use npm install for this package in a module-based project. Use CDN script tags instead.
affects: >=1.0.0
gotchaSome utilities may rely on older Google Maps API behavior that has been removed or deprecated (e.g., MarkerClusterer not working with the latest API keys).
fix
Check the Google Maps API changelog and test thoroughly. Consider using modern libraries.
affects: >=1.0.0
Errors
Common errors & fixes
import { InfoBox } from 'googlemaps-v3-utility-library'; // SyntaxError: The requested module 'googlemaps-v3-utility-library' does not provide an export named 'InfoBox'
The package does not export any ES modules; it only adds to the global scope via script tags.
fix
Remove the import statement. Use a script tag pointing to the CDN URL instead.
const MarkerClusterer = require('googlemaps-v3-utility-library/markerclusterer'); // Error: Cannot find module 'googlemaps-v3-utility-library/markerclusterer'
The package does not have a proper module entry point; require() will look for an index.js in the subfolder, which does not exist.
fix
Do not use require(). Load the script via a <script> tag in your HTML.
MarkerClusterer is not defined
The MarkerClusterer script has not been loaded, or has been loaded after the code that uses it.
fix
Ensure the script tag for markerclusterer.js is placed before the code that uses MarkerClusterer, and that Google Maps API script is loaded first.
google is not defined
The Google Maps API script has not been loaded, or loaded after the utility scripts.
fix
Load the Google Maps JS API script (with key) before the utility scripts.
Upgrade
Version history
1.0.1latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
34 hits · last 30 days
node
32
Resources
googlemaps-v3-utility-library — npm install googlemaps-v3-utility-library · libregistry