I have a google map which I am getting json data from. I want to automatically build a string that I can pass to the marker object. I get an error "invalid object initializer" in firebug when I do this. Does this make sense or is their a better way to handle this.
function buildMarkers(json) {
$.each(json, function(z) {
var asdf;
$.each(this, function(key,valueObj){
//console.log(key + '---' + valueObj);
asdf += key + ': ' + valueObj + ', ';
});
markers[z] = new google.maps.Marker({
map: map,
position: new google.maps.LatLng(this.school_lat,this.school_long),
asdf
});
etc....
MarkerOptionsand pass them toMarker()at the same time.