I have been inspired by this code to create a geohash map for my Neo4j geohash graph on Leaflet:
Unlike the (lat/lon) markers, the geohash string is represented as a rectangle in the map.
For a static search, I return all the geohash nodes with an Ajax query in my Leaflet Map.
For a dynamic search I added a search form, as you can see above the map, to query the Neo4j database by time (timehash here for me).
The request to the database is working fine, and the new geohash rectangles are plotted in the map, however the previous geohash rectangles remains.
How do I delete the previous geohash rectangle from the map?