
Product
Rust Support Now in Beta
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.
route-replay-googlemaps-react
Advanced tools
React hook and components for route-replay-googlemaps.
See the main project documentation for more details.
npm install route-replay-googlemaps-react route-replay-googlemaps-core react react-dom @types/google.maps
# or
yarn add route-replay-googlemaps-react route-replay-googlemaps-core react react-dom @types/google.maps
# or
pnpm add route-replay-googlemaps-react route-replay-googlemaps-core react react-dom @types/google.maps
import { RouteReplay, RouteReplayHandle } from 'route-replay-googlemaps-react';
import { useRef, useState, useEffect } from 'react';
import { Loader } from '@googlemaps/js-api-loader';
import type { RouteInput } from 'route-replay-googlemaps-core';
function MyMapComponent() {
const [mapInstance, setMapInstance] = useState<google.maps.Map | null>(null);
const replayHandleRef = useRef<RouteReplayHandle>(null);
const apiKey = 'YOUR_GOOGLE_MAPS_API_KEY';
useEffect(() => {
const loader = new Loader({ apiKey, version: 'weekly', libraries: ['maps'] });
loader.importLibrary("maps").then((google) => {
const map = new google.Map(document.getElementById("map")!, {
center: { lat: 35.68, lng: 139.76 },
zoom: 15,
});
setMapInstance(map);
});
}, [apiKey]);
const routeData: RouteInput = [/* your route points */];
return (
<div>
<div id="map" style={{ height: '500px', width: '100%' }} />
{mapInstance && (
<RouteReplay
ref={replayHandleRef}
map={mapInstance}
route={routeData}
/>
)}
<button onClick={() => replayHandleRef.current?.play()} disabled={!mapInstance}>Play</button>
<button onClick={() => replayHandleRef.current?.pause()} disabled={!mapInstance}>Pause</button>
</div>
);
}
ISC
FAQs
React hook and components for route-replay-googlemaps
We found that route-replay-googlemaps-react demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.
Product
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
Security News
Socket CEO Feross Aboukhadijeh joins Risky Business Weekly to unpack recent npm phishing attacks, their limited impact, and the risks if attackers get smarter.