Shiny: How to filter data based on location of user input data

I have a shiny app running here. It plots around 12 thousand apartments and rooms for rent on a leaflet interactive map and adds a marker on the map based on the address that the user inputs. Here's the code. Sorry for the if it is not well documented.

There are two different data frame objects: one is for apartments (

df.apt

) and the other is for rooms(

df.quartos

).

However, because of the amount of data the app loads, it is a bit slow. I want to add a resource that will plot the data only after the user inserts the address and also choose a proximity range (like, show only the apartments within 10km from the inputed address). How should I go about it?