mirror of
https://github.com/Freika/dawarich.git
synced 2026-01-10 17:21:38 -05:00
38 lines
737 B
JavaScript
38 lines
737 B
JavaScript
|
|
import { BaseLayer } from './base_layer'
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Points layer for displaying individual location points
|
||
|
|
*/
|
||
|
|
export class PointsLayer extends BaseLayer {
|
||
|
|
constructor(map, options = {}) {
|
||
|
|
super(map, { id: 'points', ...options })
|
||
|
|
}
|
||
|
|
|
||
|
|
getSourceConfig() {
|
||
|
|
return {
|
||
|
|
type: 'geojson',
|
||
|
|
data: this.data || {
|
||
|
|
type: 'FeatureCollection',
|
||
|
|
features: []
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
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'
|
||
|
|
}
|
||
|
|
}
|
||
|
|
]
|
||
|
|
}
|
||
|
|
}
|