WE ARE HIRING • WE ARE HIRING • 
HomeCase StudiesMap-Based Post Discovery with Bounding-Box Queries and Marker Clustering
Performance OptimizationTechnology & Digital Platforms

Map-Based Post Discovery with Bounding-Box Queries and Marker Clustering

A local community platform is only useful if people can see what's happening around them — a scrolling feed hides everything that depends on distance.

The Challenge

Most content on the platform — services, products, events, campaigns, local notices — only matters within travel distance. A vertical feed buried it. Fetching all posts and filtering positions on the device wasted bandwidth and memory, while querying on every pixel of map movement hammered the database during a single pan gesture. Dense city areas also produced overlapping pins that were impossible to tap.

Solution & Architecture

Built a map-first discovery layer where the database returns only posts inside the map's current viewport using geographic indexing, with all active filters applied in the same query. Camera movement is debounced so a long pan sends one request instead of dozens. Nearby markers are merged into counted clusters using a zoom-aware distance threshold — tapping a cluster zooms in and splits it apart, turning clutter into a natural drill-down. Decoded avatars are cached in memory so re-clustering during pinch-zoom stays smooth.

Technologies & Tools Used

Supabase RPCOpenStreetMapMarker Clustering