11 "Identifies highlightListing is missing scrollIntoView — the selected listing should scroll into view in the sidebar"
12 ]
13 },
14 {
15 "id": 2,
16 "prompt": "I'm building a coffee shop finder. I have 150 locations in a GeoJSON file. I started with `new mapboxgl.Marker()` for each one but the page feels sluggish. My colleague says I should add clustering. What's the right marker strategy for 150 locations?",
17 "expectations": [
18 "Recommends symbol layer (not clustering) for 150 locations",
19 "States HTML markers are appropriate only for fewer than 100 locations",
20 "States clustering is appropriate for more than 1000 locations — 150 does not require it",
21 "Explains symbol layers render on the GPU via WebGL instead of creating 150 DOM elements"
22 ]
23 },
24 {
25 "id": 3,
26 "prompt": "I want to add a location-aware feature to my store locator: when the user clicks 'Find Stores Near Me', I want to (a) show their location on the map as a blue dot and (b) sort the sidebar listing by distance from their location. What APIs and approach should I use?",
27 "expectations": [
28 "Recommends adding mapboxgl.GeolocateControl to the map for the blue dot / on-map location indicator",
29 "Recommends using navigator.geolocation.getCurrentPosition() separately to get coordinates for distance calculation",
30 "Recommends using Turf.js (turf.distance) for distance calculation rather than a custom Haversine formula",
31 "Shows sorting the stores array by the calculated distance before rebuilding the sidebar list"