File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed
examples/live-examples-nextjs/src
app/tasks/object-detection Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -225,7 +225,12 @@ export default function ObjectDetection() {
225225 // Handle results from the worker
226226 useEffect ( ( ) => {
227227 if ( lastResult ?. detections && map . current ) {
228- MapUtils . displayDetections ( map . current , lastResult . detections ) ;
228+ MapUtils . displayDetections ( map . current , lastResult . detections , {
229+ "line-color" : "#FFD400" , // Yellow - visible and high contrast
230+ "line-width" : 3 ,
231+ "line-dasharray" : [ 1 , 1 ] , // dotted/dashed appearance
232+ "line-opacity" : 1.0 ,
233+ } , "line" ) ;
229234 setDetections ( lastResult . detections ) ;
230235 }
231236 if ( lastResult ?. geoRawImage ?. bounds && map . current ) {
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ export class MapUtils {
1111 map : maplibregl . Map ,
1212 detections : GeoJSON . FeatureCollection ,
1313 paint = MapUtils . defaultDetectionsPaint ,
14+ type : "symbol" | "fill" | "line" | "raster" | "circle" | "heatmap" | "fill-extrusion" | "hillshade" | "color-relief" | "background" = "fill" ,
1415 ) {
1516 if ( ! map ) return ;
1617
@@ -29,7 +30,7 @@ export class MapUtils {
2930 // Add a layer to display the detections
3031 map . addLayer ( {
3132 id : "detections-layer" ,
32- type : "fill" ,
33+ type : type ,
3334 source : "detections" ,
3435 paint : paint ,
3536 } ) ;
You can’t perform that action at this time.
0 commit comments