Bring Common Land Unit (CLU) boundaries into Google Maps without rebuilding your map stack.
clu datasetpmtiles, @mapbox/vector-tile, and pbfdeck.gl for quicker iterationnpm install pmtiles @mapbox/vector-tile pbf
# Optional helpers
npm install deck.gl @deck.gl/google-mapsThe API exposes a MapLibre style document that centralizes colors, labels, and layer IDs. Even though Google Maps cannot ingest the style directly, reusing its values keeps your presentation consistent across platforms.
GET https://api.landmapmagic.com/clu/style.json?key=YOUR_API_KEY
Runtime overrides:
borderColor=#fde047
hoverColor=#ffd700
labelColor=#000000
labels=falseRender CLU geometries directly inside Google Maps using WebGLOverlayView and a PMTiles reader. This approach keeps everything client-side and allows custom styling and interaction.
import { Loader } from '@googlemaps/js-api-loader';
import { PMTiles } from 'pmtiles';
import { VectorTile } from '@mapbox/vector-tile';
import Pbf from 'pbf';
const pmtiles = new PMTiles(
'https://api.landmapmagic.com/clu.pmtiles?key=YOUR_API_KEY'
);
const loader = new Loader({
apiKey: process.env.GMAPS_KEY!,
version: 'weekly'
});
loader.load().then(() => {
const map = new google.maps.Map(document.getElementById('map')!, {
center: { lat: 41.878, lng: -93.097 },
zoom: 12,
mapId: 'YOUR_VECTOR_MAP_ID'
});
const overlay = new google.maps.WebGLOverlayView();
overlay.onAdd = () => { overlay.requestRedraw(); };
overlay.onContextRestored = () => {
// Initialize shaders/buffers here.
overlay.requestRedraw();
};
overlay.onDraw = async ({ gl, transformer }) => {
const visibleTiles = transformer.getVisibleRegion().tiles();
for (const { z, x, y } of visibleTiles) {
const tile = await pmtiles.getZxy(z, x, y);
if (!tile) continue;
const vt = new VectorTile(new Pbf(tile.data));
const layer = vt.layers['clu'];
if (!layer) continue;
for (let i = 0; i < layer.length; i++) {
const feature = layer.feature(i);
const geom = feature.loadGeometry();
// Convert to Web Mercator, populate buffers, draw lines.
}
}
gl.drawArrays(gl.LINES, 0, vertexCount);
};
overlay.setMap(map);
});Deck.gl's MVTLayer understands PMTiles and integrates cleanly with Google Maps via @deck.gl/google-maps.
import { Loader } from '@googlemaps/js-api-loader';
import { GoogleMapsOverlay } from '@deck.gl/google-maps';
import { MVTLayer } from '@deck.gl/geo-layers';
const loader = new Loader({
apiKey: process.env.GMAPS_KEY!,
version: 'weekly'
});
loader.load().then(() => {
const map = new google.maps.Map(document.getElementById('map')!, {
center: { lat: 41.878, lng: -93.097 },
zoom: 12,
mapId: 'YOUR_VECTOR_MAP_ID'
});
const overlay = new GoogleMapsOverlay({
layers: [
new MVTLayer({
id: 'clu-outline',
data: 'https://api.landmapmagic.com/clu.pmtiles?key=YOUR_API_KEY',
minZoom: 6,
maxZoom: 14,
lineWidthMinPixels: 1,
getLineColor: [253, 224, 71, 255], // #fde047
loadOptions: {
pmtiles: { metadata: true }
}
})
]
});
overlay.setMap(map);
});If WebGL overlays are not an option, prerender CLU data to raster PNGs and register them with google.maps.ImageMapType. This removes interactivity but works with older Google Maps map IDs.