dawarich/app/javascript/maps_v2/layers/points_layer.js

38 lines
737 B
JavaScript
Raw Normal View History

2025-11-16 06:45:26 -05:00
import { BaseLayer } from './base_layer'
/**
2025-11-26 13:40:12 -05:00
* Points layer for displaying individual location points
2025-11-16 06:45:26 -05:00
*/
export class PointsLayer extends BaseLayer {
constructor(map, options = {}) {
super(map, { id: 'points', ...options })
}
getSourceConfig() {
return {
type: 'geojson',
data: this.data || {
type: 'FeatureCollection',
features: []
2025-11-26 13:40:12 -05:00
}
2025-11-16 06:45:26 -05:00
}
}
getLayerConfigs() {
return [
// Individual points
{
id: this.id,
type: 'circle',
source: this.sourceId,
paint: {
'circle-color': '#3b82f6',
'circle-radius': 6,
'circle-stroke-width': 2,
'circle-stroke-color': '#ffffff'
}
}
]
}
}