Add owner name to listings map popup
Some checks failed
Deploy stAndrews / deploy (push) Failing after 5s
Some checks failed
Deploy stAndrews / deploy (push) Failing after 5s
Join owner_1 from owners.rds to listings via address match key. Display in marker popup above price on the Listings tab map.
This commit is contained in:
@@ -234,6 +234,7 @@ create_server <- function(input, output, session) {
|
||||
lng = ~longitude,
|
||||
popup = ~paste0(
|
||||
"<b>", address, "</b><br>",
|
||||
"Owner: ", owner_1, "<br>",
|
||||
"Price: ", price_fmt, "<br>",
|
||||
"Sq Ft: ", sqft, "<br>",
|
||||
"$/Sq Ft: ", ppsf_fmt
|
||||
|
||||
@@ -64,7 +64,7 @@ owners_coords <- owners_sf |>
|
||||
street_raw = trimws(sub("^\\d+\\s+(.*),.*$", "\\1", location)),
|
||||
match_key = paste(house_num, toupper(street_raw))
|
||||
) |>
|
||||
select(match_key, geom) |>
|
||||
select(match_key, owner_1, geom) |>
|
||||
distinct(match_key, .keep_all = TRUE)
|
||||
|
||||
# Extract house number + street from RentCast address
|
||||
@@ -94,6 +94,7 @@ listings <- listings |>
|
||||
transmute(
|
||||
listed_date = as.Date(listedDate),
|
||||
address = formattedAddress,
|
||||
owner_1,
|
||||
sqft = as.numeric(squareFootage),
|
||||
price = as.numeric(price),
|
||||
price_per_sqft = round(price / sqft, 0),
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user