Spaces:
Sleeping
Sleeping
Update pages/market_rent_estimation.py
Browse files- pages/market_rent_estimation.py +13 -12
pages/market_rent_estimation.py
CHANGED
|
@@ -147,18 +147,19 @@ def main():
|
|
| 147 |
folium.GeoJson(data=gdf_current_market.geometry.to_json(), name='geojson').add_to(m)
|
| 148 |
for _, row in gdf_current_market.iterrows():
|
| 149 |
# Convert the row's geometry to GeoJSON
|
| 150 |
-
|
| 151 |
-
|
| 152 |
-
|
| 153 |
-
|
| 154 |
-
|
| 155 |
-
|
| 156 |
-
|
| 157 |
-
|
| 158 |
-
|
| 159 |
-
|
| 160 |
-
|
| 161 |
-
|
|
|
|
| 162 |
|
| 163 |
# Add layer control to toggle marker visibility
|
| 164 |
folium.LayerControl().add_to(m)
|
|
|
|
| 147 |
folium.GeoJson(data=gdf_current_market.geometry.to_json(), name='geojson').add_to(m)
|
| 148 |
for _, row in gdf_current_market.iterrows():
|
| 149 |
# Convert the row's geometry to GeoJSON
|
| 150 |
+
if row['geometry'] is not None:
|
| 151 |
+
geojson = folium.GeoJson(data=row['geometry'].__geo_interface__,
|
| 152 |
+
style_function=lambda feature: {
|
| 153 |
+
'fillColor': '#00000000', # Make the fill color transparent
|
| 154 |
+
'color': '#00000000', # Set the border color
|
| 155 |
+
'weight': 2 # Set the border width
|
| 156 |
+
},
|
| 157 |
+
)
|
| 158 |
+
# Add a popup with the name
|
| 159 |
+
popup = folium.Popup(row['full_submarket'], parse_html=True)
|
| 160 |
+
|
| 161 |
+
# Add the GeoJson and Popup to the map
|
| 162 |
+
geojson.add_child(popup).add_to(m)
|
| 163 |
|
| 164 |
# Add layer control to toggle marker visibility
|
| 165 |
folium.LayerControl().add_to(m)
|