Hi,
I have the following scenario...
Map loads in an iFrame on another page.
The iFrame URL included the variables "address=" and "latlng="
followed by their values.
The problem I have is with my latlng code.
When I use the following code it tries to grab the 'latlng' value from
the parent URL, not the iFrame URL. I know it has something to do with
document.URL and changing it to something else? :)
[code from iFrame]
<script>
var platlng = document.URL.indexOf('&latlng=');
if (platlng != -1)
{
var latlng = document.URL.substring(platlng+8, document.URL.length);
var llmatches = location.search.match(/(\?|&)latlng=([^&]*)/);
if(llmatches && llmatches[2])
latlng = llmatches[2].replace(/%20/g," ");
alert(latlng);
// write out the latlng with the information after the &
document.write("<script>\npoint = new GLatLng("+latlng+");\nvar
marker = new GMarker(new GLatLng("+latlng+"));\n<\/script>");
}
else {
document.write("");
};
</script>
Thanks.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Maps API" group.
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-API?hl=en
-~----------~----~----~----~------~----~------~--~---