Update app.py
Browse files
app.py
CHANGED
|
@@ -64,7 +64,7 @@ def generate_heatmap_for_site(site_name, df):
|
|
| 64 |
layer = pdk.Layer(
|
| 65 |
"ScatterplotLayer",
|
| 66 |
data=site_df,
|
| 67 |
-
get_position='[
|
| 68 |
get_color="color",
|
| 69 |
get_radius=80, # You can adjust the radius if needed
|
| 70 |
pickable=True,
|
|
@@ -72,8 +72,8 @@ def generate_heatmap_for_site(site_name, df):
|
|
| 72 |
)
|
| 73 |
|
| 74 |
# Handle potential missing coordinates for map center
|
| 75 |
-
latitude = site_df["
|
| 76 |
-
longitude = site_df["
|
| 77 |
|
| 78 |
# View state for the map
|
| 79 |
view_state = pdk.ViewState(
|
|
|
|
| 64 |
layer = pdk.Layer(
|
| 65 |
"ScatterplotLayer",
|
| 66 |
data=site_df,
|
| 67 |
+
get_position='[Location_Longitude__c, Location_Latitude__c]', # Ensure the column names are correct
|
| 68 |
get_color="color",
|
| 69 |
get_radius=80, # You can adjust the radius if needed
|
| 70 |
pickable=True,
|
|
|
|
| 72 |
)
|
| 73 |
|
| 74 |
# Handle potential missing coordinates for map center
|
| 75 |
+
latitude = site_df["Location_Latitude__c"].mean() if not site_df["Location_Latitude__c"].isnull().all() else 0
|
| 76 |
+
longitude = site_df["Location_Longitude__c"].mean() if not site_df["Location_Longitude__c"].isnull().all() else 0
|
| 77 |
|
| 78 |
# View state for the map
|
| 79 |
view_state = pdk.ViewState(
|