Skip to content

Commit e07efa0

Browse files
types added
1 parent 9d46330 commit e07efa0

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

src/components/MapStyleSwitcher.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,14 @@ const MapStyleSwitcher: React.FC<MapStyleSwitcherProps> = ({
1414
useEffect(() => {
1515
console.log('MapStyleSwitcher rendered', handleStyleChange);
1616
});
17-
const baseMaps = {
17+
type BaseMap = {
18+
name: string;
19+
img: string;
20+
};
21+
22+
type BaseMaps = Record<string, BaseMap>;
23+
24+
const baseMaps: BaseMaps = {
1825
STREETS: {
1926
name: 'Street',
2027
img: 'https://cloud.maptiler.com/static/img/maps/streets.png',

src/components/PropertyMap.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,13 @@ const layerStylePoints: CircleLayerSpecification = {
107107
},
108108
};
109109

110-
const mapStyles = {
110+
type MapStyle = {
111+
url: string;
112+
};
113+
114+
type MapStyles = Record<string, MapStyle>;
115+
116+
const mapStyles: MapStyles = {
111117
DataVisualization: {
112118
url: `https://api.maptiler.com/maps/dataviz/style.json?key=${maptilerApiKey}`,
113119
},
@@ -510,7 +516,7 @@ const PropertyMap: FC<PropertyMapProps> = ({
510516
onError={(e) => {
511517
console.log(e);
512518
if (
513-
e.message ===
519+
e.error.cause ===
514520
"The layer 'vacant_properties_tiles_polygons' does not exist in the map's style and cannot be queried for features."
515521
)
516522
setHasLoadingError(true);

0 commit comments

Comments
 (0)