I think in this block of code :
var marker = new google.maps.Marker({
position: location,
map: map,
title: this.LocationName
});
the "map" var you declared back in the initiation is may not be
available in this scope. You can either declare "map" as a global or
put it into an object literal.
I wrote some example code
http://www.joelee.me.uk/sampleCode/2010/googleMapsV3markersClearExample.html
Two things to note :
- "var mapStuff =" near the top is the code declaring the mapStuff as
an object literal
- "function addPubToMap" sees the code passing the mapStuff.theMap
into the parameter map parameter of the marker object
Hope that helps