This is a JavaScript problem of how to manipulate the LatLng object. I have a two V3 maps running. I want to take the LatLng object from the geocoder.geocode, make it into a string variable and concatenate it into a static map's src="http:// etc. " to create a 3rd map - a static map. Currently, I get a solid blue staticmap with a Google logo, which suggests the map is trying to work, but the markerLatLng variable is incorrect. (Hard coded with Lat and Lng numbers, it works) To remove the outside parenthses of the LatLng object, I have tried toString followed by a pair of replace method calls, and several other things like stringify, all without success. How should this be done? - or do I need to split the object into a Lat string and a Lng string and concatenate them separately? Here's the relevant code with comments showing the content of alerts at several lines. What needs to change?
geocoder.geocode( geoCoderRequest, function(results, status) { // results[0].geometry.location = (43.098337,-77.441738)
var markerLatLng = toString(results[0].geometry.location); //[objectWindow]
markerLatLng = markerLatLng.replace("(", "").replace(")", ""); //[objectWindow]
$("#map_canvas").html( '<img src="
http://maps.googleapis.com/maps/api/staticmap? etc.'+ 'markerLatLng' + 'etc. ');
$("#streetAddressGeocode").val( results[0].geometry.location ); // (43.098337,-77.441738)
});