Registry / gcp / googlemaps-v3-utility-library-latest

googlemaps-v3-utility-library-latest

JSON →
library1.0.1jsnpmunverified

This package is a community-maintained fork of the Google Maps JavaScript API v3 utility libraries, initially updated around 2018. It bundles a collection of client-side JavaScript components such as MarkerClusterer, InfoBox, InfoBubble, KeyDragZoom, and RouteBoxer. These utilities are designed to extend the core functionality of Google Maps v3 by providing enhanced marker management, custom information windows, and map interaction tools. Despite its `latest` moniker, the package's content reflects updates from 2018, making its compatibility with recent Google Maps API versions potentially limited. The current version is 1.0.1, and it does not appear to follow an active release cadence, suggesting it is in a frozen or abandoned state, differing from the potentially more current official Google Maps utility library repositories.

npm install googlemaps-v3-utility-library-latest
INSTALL
IMPORT
SIG · GOOGLEMAPS-V3-UTIL
G
googlemaps-v3-utility-library-latest
gcpjavascriptv1.0.1
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

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

MarkerClusterer
import MarkerClusterer from 'googlemaps-v3-utility-library-latest'; // Or for CommonJS: const MarkerClusterer = require('googlemaps-v3-utility-library-latest');
import { MarkerClusterer } from 'googlemaps-v3-utility-library-latest'; // Or (incorrect path): import MarkerClusterer from 'googlemaps-v3-utility-library-latest/markerclusterer';
The `googlemaps-v3-utility-library-latest` package's main entry point directly exports the MarkerClusterer class. It is a default export for ESM purposes, but often consumed via CommonJS `require`.
InfoBox
import InfoBox from 'googlemaps-v3-utility-library-latest/lib/InfoBox'; // Or for CommonJS: const InfoBox = require('googlemaps-v3-utility-library-latest/lib/InfoBox');
import { InfoBox } from 'googlemaps-v3-utility-library-latest'; // Or (incorrect path): import InfoBox from 'googlemaps-v3-utility-library-latest/InfoBox';
Other utility libraries like InfoBox are located in the `lib` subdirectory and must be imported via their specific path within the package. These are typically default exports for their respective modules.
KeyDragZoom
import KeyDragZoom from 'googlemaps-v3-utility-library-latest/lib/KeyDragZoom'; // Or for CommonJS: const KeyDragZoom = require('googlemaps-v3-utility-library-latest/lib/KeyDragZoom');
import { KeyDragZoom } from 'googlemaps-v3-utility-library-latest';
Similar to InfoBox, utilities other than MarkerClusterer are found in the `lib` folder. Always specify the full path to the desired utility module.

Demonstrates initializing a Google Map and adding a MarkerClusterer with random markers, using the package's primary export. Includes conditional loading for the Google Maps API.

import MarkerClusterer from 'googlemaps-v3-utility-library-latest'; function initMap() { const map = new google.maps.Map(document.getElementById('map'), { zoom: 3, center: { lat: -28.024, lng: 140.887 }, mapId: 'DEMO_MAP_ID' // Replace with your Map ID }); const markers = []; // Create some random markers for (let i = 0; i < 100; i++) { const latLng = new google.maps.LatLng( -28.024 + Math.random() * 10, 140.887 + Math.random() * 10 ); markers.push(new google.maps.Marker({ position: latLng })); } // Add a marker clusterer to the map. new MarkerClusterer(map, markers, { imagePath: 'https://developers.google.com/maps/documentation/javascript/examples/markerclusterer/m' }); } // Ensure the global `google` object is available (e.g., via script tag in HTML) // For demonstration purposes, if not using a global callback, call directly: // This assumes the Google Maps API script is loaded globally and defines `google` // For a real application, follow Google's recommended async loading with a callback. window.addEventListener('DOMContentLoaded', () => { if (typeof google !== 'undefined' && google.maps) { initMap(); } else { console.warn('Google Maps API not loaded. Ensure the script tag is present.'); // You might want to dynamically load it here or handle the missing global differently const script = document.createElement('script'); script.src = `https://maps.googleapis.com/maps/api/js?key=${process.env.GOOGLE_MAPS_API_KEY ?? 'YOUR_API_KEY'}&callback=initMap`; script.async = true; document.head.appendChild(script); window.initMap = initMap; // Attach to window for the callback } });
Debug
Known issues
breakingThis specific `googlemaps-v3-utility-library-latest` package reflects updates from 2018. It may not be fully compatible with newer versions of the Google Maps JavaScript API (e.g., v3.40+ or changes after 2018), potentially leading to unexpected behavior or breakage.
fix
Review the official Google Maps v3-utility-library for more current alternatives or be prepared to fork and adapt the code for newer API versions. Consider using `@googlemaps/markerclusterer` from the official Google Maps organization for a maintained MarkerClusterer.
affects: >=1.0.1
deprecatedThe 'Google Earth API for Google Maps v3' utility included in this collection is explicitly marked as deprecated within the package's own README. Using it may lead to errors or unsupported functionality.
fix
Avoid using the deprecated Google Earth API integration. Look for modern alternatives for 3D globe visualization if needed, potentially outside the Google Maps API context.
affects: >=1.0.1
gotchaThis package is primarily designed for CommonJS/UMD environments. Direct ESM `import` statements may require bundler configuration or specific import paths (e.g., `import * as pkg from 'package'`) to resolve correctly, especially if relying on Node.js module resolution.
fix
When using in a modern ESM project, ensure your bundler (Webpack, Rollup, Vite) is configured to handle CommonJS modules. For Node.js, consider dynamic `import()` or stick to `require()` if feasible.
affects: >=1.0.1
gotchaThe package name `googlemaps-v3-utility-library-latest` can be misleading. While it implies 'latest', its contents are from 2018. Relying on this package for 'latest' features or bug fixes from the Google Maps API can lead to outdated functionality.
fix
Always verify the actual last update date and maintenance status of libraries. For the most up-to-date Google Maps utilities, consult the official Google Maps Platform documentation and packages from `@googlemaps`.
affects: >=1.0.1
gotchaThe project's GitHub link in the README (github.com/nblavoie/v3-utility-library) appears to be broken or redirects. Support is directed to the main Google Maps GitHub repository, implying this specific npm package might not have dedicated support channels.
fix
Be aware that this package might not receive direct issue support or updates. Consider migrating to officially maintained libraries if active support is crucial for your project.
affects: >=1.0.1
Errors
Common errors & fixes
TypeError: google.maps.MarkerClusterer is not a constructor
The Google Maps API global object (`google`) is not loaded or the MarkerClusterer utility is not correctly imported and attached to the `google.maps` namespace.
fix
Ensure the Google Maps JavaScript API script tag is loaded before your application code, and that you are importing `MarkerClusterer` directly from the package: `const MarkerClusterer = require('googlemaps-v3-utility-library-latest');`
ReferenceError: google is not defined
The Google Maps JavaScript API has not been loaded into the browser environment.
fix
Make sure to include the Google Maps JavaScript API script tag in your HTML `head` or `body` with your API key and `callback` parameter, before any code that attempts to use the `google` object. Example: `<script src="https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&callback=initMap"></script>`
Error: Cannot find module 'googlemaps-v3-utility-library-latest/lib/InfoBox'
Incorrect path specified for a utility library or the file does not exist at the expected location after installation.
fix
Double-check the exact casing and path for the desired utility library. Ensure the package is correctly installed via `npm i`. The `/lib` directory contains most individual utilities.
Upgrade
Version history
1.0.1latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
24 hits · last 30 days
node
20
OpenAI (training)
1
Resources
googlemaps-v3-utility-library-latest — npm install googlemaps-v3-utility-library-latest · libregistry