the summary didn't describe what i want all too well as i couldn't sum it up that easy. I have a script that pulls the latitude and longitude from google maps depending on an address I type into a field. and that works great. but it puts the latitude and longitude in the map InfoWindow(). I want it to put the latitude in it's own field and the longitude in it's own field. here's the code:
JAVA SCRIPT AT TOP OF INDEX.HTML JavaScript Code: <script src="http://maps.google.com/maps?file=api&v=1&key=ABQIAAAAwck- cJHtWqhCPpb7YdIbxxQgaP07k1bpen6xl4LECJ4kKs9BPhQhmqV4fNac6juPxd- kSsu_21NJ7Q" type="text/javascript"></script> <script src="gaddress.js" type="text/javascript"></script> </head> <body onload="address();" style="text-align:center;font- family:Arial;font-size:11px;"> <div id="map" style="width: 500px; height: 300px; margin: 10px auto;"></div> <script type="text/javascript"> //<![CDATA[ if (GBrowserIsCompatible()) { var map = new GMap(document.getElementById("map")); map.addControl(new GSmallMapControl()); } function move( p, a ) { if ( p == null ) { alert( "Address Not Found\nPlease Try Again." ); } else { map.centerAndZoom( p, 4 ); var marker = new GMarker(p); map.addOverlay(marker); map.openInfoWindow(p, "<strong>" + a + "</strong><br/>" + p.x + "<br/>" + p.y); } } function address() { GAddress( document.getElementById("a").value, move ); return false; } //]]> </script> JAVASCRIPT IN gaddress.js: JavaScript Code: function GAddress( a, c ) { var xmlhttp = false; try { xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } catch (E) { xmlhttp = false; } } if (!xmlhttp && typeof XMLHttpRequest!='undefined') { xmlhttp = new XMLHttpRequest(); } var l = new Array(); xmlhttp.open("GET", "gaddress.cgi?a=" + escape(a), true); xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4) { l = xmlhttp.responseText.split(','); if ( l[0] == '' ) c( null, a ); else c( new GPoint( l[0] - 0, l[1] - 0 ), a ); } } xmlhttp.send(null) } AND LAST BUT NOT LIEST... at all. gaddress.cgi: CGI Code: use CGI; use LWP::Simple; my $cgi = new CGI(); my $a = $cgi->param('a'); my $d = get( "http://rpc.geocoder.us/service/rest?address=$a" ); $d =~ /geo:long>([^<]*).*?geo:lat>([^<]*)/is; print "Content-type: text/plain\n\n"; print "$1,$2"; I hope I'm not asking too much of anybody. I was hoping this would be as simple as document.getElementById().value = latitude; but that proved unworthing. thanx much yall FYI I found this code at " http://ejohn.org/projects/gaddress/ " it does what's it's supposed to do great. but i'm trying to improve on it. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
