@trailstash/ultra
Version:
A web based tool for making MapLibre GL maps with data from sources such as Overpass, GeoJSON, GPX, KML, TCX, etc
44 lines (43 loc) • 886 B
JavaScript
export const geoJsonLayers = (source) => [
{
id: `${source}-geojson-fill`,
type: "fill",
source,
filter: ["==", ["geometry-type"], "Polygon"],
paint: {
"fill-color": "#555",
"fill-opacity": 0.3,
},
},
{
id: `${source}-geojson-fill-outline`,
type: "line",
source,
filter: ["==", ["geometry-type"], "Polygon"],
paint: {
"line-color": "#555",
"line-width": 2,
},
},
{
id: `${source}-geojson-line`,
type: "line",
source,
filter: ["==", ["geometry-type"], "LineString"],
paint: {
"line-color": "#555",
"line-width": 2,
},
},
{
id: `${source}-geojson-point`,
type: "circle",
source,
filter: ["==", ["geometry-type"], "Point"],
paint: {
"circle-color": "#555",
"circle-stroke-color": "#fff",
"circle-stroke-width": 1,
},
},
];