Spaces:
Sleeping
Sleeping
Update pages/market_rent_estimation.py
Browse files- pages/market_rent_estimation.py +21 -16
pages/market_rent_estimation.py
CHANGED
|
@@ -180,24 +180,29 @@ def main():
|
|
| 180 |
gdf_Atlanta = gdf[gdf.full_submarket.str.contains("Atlanta")]
|
| 181 |
folium.GeoJson(data=gdf_Atlanta.geometry.to_json(), name='geojson').add_to(m)
|
| 182 |
for _, row in gdf_Atlanta.iterrows():
|
| 183 |
-
#
|
| 184 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 185 |
|
| 186 |
-
#
|
| 187 |
-
|
| 188 |
-
|
| 189 |
-
# # Add the GeoJson and Popup to the map
|
| 190 |
-
# geojson.add_child(popup).add_to(m)
|
| 191 |
|
| 192 |
-
folium.GeoJson(
|
| 193 |
-
|
| 194 |
-
|
| 195 |
-
|
| 196 |
-
|
| 197 |
-
|
| 198 |
-
|
| 199 |
-
|
| 200 |
-
).add_to(m)
|
| 201 |
|
| 202 |
# Add layer control to toggle marker visibility
|
| 203 |
folium.LayerControl().add_to(m)
|
|
|
|
| 180 |
gdf_Atlanta = gdf[gdf.full_submarket.str.contains("Atlanta")]
|
| 181 |
folium.GeoJson(data=gdf_Atlanta.geometry.to_json(), name='geojson').add_to(m)
|
| 182 |
for _, row in gdf_Atlanta.iterrows():
|
| 183 |
+
# Convert the row's geometry to GeoJSON
|
| 184 |
+
geojson = folium.GeoJson(data=row['geometry'].__geo_interface__,
|
| 185 |
+
style_function=lambda feature: {
|
| 186 |
+
'fillColor': '#00000000', # Make the fill color transparent
|
| 187 |
+
'color': '#00000000', # Set the border color
|
| 188 |
+
'weight': 2 # Set the border width
|
| 189 |
+
},
|
| 190 |
+
)
|
| 191 |
+
# Add a popup with the name
|
| 192 |
+
popup = folium.Popup(row['full_submarket'], parse_html=True)
|
| 193 |
|
| 194 |
+
# Add the GeoJson and Popup to the map
|
| 195 |
+
geojson.add_child(popup).add_to(m)
|
|
|
|
|
|
|
|
|
|
| 196 |
|
| 197 |
+
# folium.GeoJson(
|
| 198 |
+
# data=row['geometry'].__geo_interface__,
|
| 199 |
+
# style_function=lambda feature: {
|
| 200 |
+
# 'fillColor': '#00000000', # Make the fill color transparent
|
| 201 |
+
# 'color': 'blue', # Set the border color
|
| 202 |
+
# 'weight': 2 # Set the border width
|
| 203 |
+
# },
|
| 204 |
+
# tooltip=folium.Tooltip(row['full_submarket']) # Add a tooltip with the name
|
| 205 |
+
# ).add_to(m)
|
| 206 |
|
| 207 |
# Add layer control to toggle marker visibility
|
| 208 |
folium.LayerControl().add_to(m)
|