I'm using this [example](http://jsfiddle.net/pYy4B/) to add markers on my direction A to B. How can I remove "old" markers, when I add new start and end points.
I try to change `gmarkers[j].setMap(null);` but not working.

```
for (var j=0; j< gmarkers.length; j++) {
      if (boxes[i].contains(gmarkers[j].getPosition()))
          gmarkers[j].setMap(map);
  }

```

[fiddle/original code from this question](https://stackoverflow.com/questions/24912796/google-api-v3-show-nearby-markers-on-customer-road)