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)
});


-- 
You received this message because you are subscribed to the Google Groups 
"Google Maps JavaScript API v3" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-maps-js-api-v3/-/bK9tO-ixLr4J.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-maps-js-api-v3?hl=en.

Reply via email to