This package is a re-publication of the `KeyDragZoom` utility library for Google Maps JavaScript API V3, originally hosted on Google Code. Its primary function is to enable a 'drag zoom' feature on a Google Map, allowing users to draw a rectangle while holding a specified key (e.g., Shift, Ctrl) to zoom into that area. This utility fills a gap left by the discontinuation of Google Code hosting, which made the original `keydragzoom.js` resource inaccessible. The current stable version, 2.0.9, directly corresponds to the last official release from the original project. As a direct re-host, this package is effectively in maintenance mode with no active feature development or breaking changes since its original Google Code release; its main purpose is to ensure the utility remains available and installable via npm and Bower. It differentiates itself from core Google Maps functionality by providing a convenience layer for an advanced zoom interaction pattern not natively built into the basic API controls.
npm install google-maps-utility-library-v3-keydragzoomVerified import paths — ran on the pinned version, not inferred.
Demonstrates initializing a Google Map and enabling the KeyDragZoom utility, configured to activate with the Shift key for drawing zoom rectangles.
Ensure the Google Maps JavaScript API (e.g., `https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY`) is fully loaded and `google.maps` is available on the global `window` object *before* importing or requiring `google-maps-utility-library-v3-keydragzoom`.
Regularly test the utility with new Google Maps API versions. Consider implementing similar drag-zoom functionality manually using `google.maps.Rectangle` and `map.fitBounds()` if stability and long-term maintenance are critical concerns.
Use a type assertion (`(map as any).enableKeyDragZoom(...)`) or create a custom declaration file (e.g., `keydragzoom.d.ts`) to extend the `google.maps.Map` interface: `declare module 'google.maps' { interface Map { enableKeyDragZoom(options?: KeyDragZoomOptions): void; disableKeyDragZoom(): void; } }`.Ensure the Google Maps API script is loaded first and fully initialized, and then verify that the utility package is imported/required correctly and without errors. Check network requests for script loading issues.
Place the Google Maps API script tag (e.g., `<script src="https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&callback=initMap"></script>`) in your HTML `<head>` or before your application script, ensuring `callback=initMap` points to your map initialization function that subsequently imports this utility.
No dependency data recorded yet.