javascript - can't remove google map markers
问题 I'm having some trouble with google map markers. I have an array that contains 7 locations. When the page loads, a "for" loop runs through the array and places the first four locations as markers on the map. What I then want to happen is to be able to click the "Remove and add markers" button, which would run a function (called addMarker2) to remove the original 4 location markers and add the last 3 location markers to the map. I've tested the function to only add the last 3 markers, and it