maplibre-google-maps
Version:
MapLibre Google Maps plugin
26 lines (25 loc) • 823 B
HTML
<html lang="en">
<head>
<title>Maplibre Google Maps</title>
<meta charset='utf-8'>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel='stylesheet' href='https://unpkg.com/maplibre-gl@4.3.2/dist/maplibre-gl.css' />
<script src='https://unpkg.com/maplibre-gl@4.3.2/dist/maplibre-gl.js'></script>
<style>
body { margin: 0; padding: 0; }
html, body, #map { height: 100%; }
</style>
</head>
<body>
<div id="map"></div>
<script type="module">
import { googleProtocol, createGoogleStyle } from 'https://unpkg.com/maplibre-google-maps@1.0.4/index.js';
maplibregl.addProtocol('google', googleProtocol);
const map = new maplibregl.Map({
container: 'map',
style: createGoogleStyle('google', 'roadmap', 'YOUR_GOOGLE_KEY'),
});
</script>
</body>
</html>