Skip to content

Commit 240c3a6

Browse files
committed
linting
1 parent 1e98c3e commit 240c3a6

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

app/src/MapViewComponent.tsx

+12-2
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,20 @@ const GIT_SHA = (import.meta.env.VITE_GIT_SHA || "main").substr(0, 8);
3232
const ATTRIBUTION =
3333
'<a href="https://github.com/protomaps/basemaps">Protomaps</a> © <a href="https://openstreetmap.org">OpenStreetMap</a>';
3434

35+
function getSourceLayer(l: LayerSpecification): string {
36+
if ("source-layer" in l && l["source-layer"]) {
37+
return l["source-layer"];
38+
}
39+
return "";
40+
}
41+
3542
const FeaturesProperties = (props: { features: MapGeoJSONFeature[] }) => {
3643
return (
3744
<div className="features-properties">
3845
{props.features.map((f) => (
3946
<div key={f.id}>
4047
<span>
41-
<strong>{(f.layer as unknown)["source-layer"]}</strong>
48+
<strong>{getSourceLayer(f.layer)}</strong>
4249
<span> ({f.geometry.type})</span>
4350
</span>
4451
<table>
@@ -68,7 +75,10 @@ function getMaplibreStyle(
6875
maxZoom?: number,
6976
): StyleSpecification {
7077
let tilesWithProtocol = tiles;
71-
if (tilesWithProtocol && new URL(tiles).pathname.endsWith(".pmtiles")) {
78+
if (
79+
tilesWithProtocol &&
80+
new URL(tilesWithProtocol).pathname.endsWith(".pmtiles")
81+
) {
7282
tilesWithProtocol = `pmtiles://${tiles}`;
7383
}
7484
const style = {

app/src/VisualTestsComponent.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ export default function VisualTestsComponent() {
255255
const tag = QUERY_PARAMS.get("tag");
256256

257257
// get all JSONs first - we don't want to initialize the map without a starting position
258-
let examples: Example[] = rawExamples as unknown;
258+
let examples: Example[] = rawExamples as Example[];
259259
if (name !== null) {
260260
examples = examples.filter((e) => e.name === name);
261261
} else if (tag !== null) {

0 commit comments

Comments
 (0)