Contents
Overview
Key Features
- CMS-Driven Marker Data: Location data was sourced directly from the Webflow CMS collection list rendered on the page. The map script read latitude, longitude, title, image, and description from hidden DOM elements that Webflow populated from its CMS, avoiding any direct API calls and keeping the data flow within Webflow's standard publishing model.
- Info Window on Click: Each marker opened a custom-styled info window on click, displaying the listing image, title, and description inside a compact card. The info window was shared across all markers and reused rather than instantiated per marker, keeping memory usage low.
- Marker Clustering: The @googlemaps/markerclusterer library grouped nearby markers into a single cluster element at lower zoom levels. Without clustering, a dense map with many pins is difficult to read and interact with — clustering resolved this by replacing overlapping markers with a count badge that expands as the user zooms in.
- Custom SVG Cluster Renderer: The default cluster appearance was replaced with a custom renderer that generated an inline SVG directly in JavaScript. The SVG used two concentric circles — a semi-transparent outer ring and a solid inner disc in the client's brand red — with the cluster count rendered in matching red text over a white inner circle. The SVG was base64-encoded and passed as a data URI to a google.maps.Marker, giving full visual control without external image assets.
- Custom Pin Icon: Individual markers used a custom location pin image hosted in Webflow's asset library rather than the default Google Maps teardrop, keeping the map visually consistent with the client's branding.
- Clustering Algorithm Tuning: The @googlemaps/markerclusterer library supports pluggable clustering algorithms. After testing the default, GridAlgorithm was introduced with a configurable gridDistance parameter. Increasing the grid distance caused the algorithm to group pins that were further apart, resulting in fewer, larger clusters at the same zoom level. This was noticeable in practice — with the default algorithm the user had to zoom out four steps before pins clustered; with a tuned GridAlgorithm at gridDistance: 60, clustering kicked in a step earlier at equivalent zoom levels.
- Side Panel Toggle: A button on the page toggled the visibility of a listing panel alongside the map, allowing users to switch between the map view and a list view of the same CMS data. The toggle was wired through a DOMContentLoaded listener.
Screenshots
CMS List View
Webflow Integration
Technologies Used
Implementation
Css
Html