File tree Expand file tree Collapse file tree 2 files changed +16
-3
lines changed
Expand file tree Collapse file tree 2 files changed +16
-3
lines changed Original file line number Diff line number Diff 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' ,
Original file line number Diff line number Diff 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 ) ;
You can’t perform that action at this time.
0 commit comments