I am using this page to allow users to search for Points Of Interest within a given radius of an address that they type in.
The problem I’m having is that I can’t clear the map of markers between a successful and then an unsuccessful search.
For example if I type in Swindon at a radius of 25 miles, 2 POI’s are shown within the sidebar and their respective markers are shown on the map.
If I then use County Antrim as my search address again at 25 miles, the sidebar correctly shows ‘No results found’ but the markers from the initial serach are still on the map.
I’ve trawled the internet to try different pieces of code to get this to work but I’m really stuck with this issue. I’ve gone back to the source code on the Google site and I’m sure that I’m using the same code.
Could someone perhaps show me where I’m going wrong with this please?
I use this: