<!DOCTYPE html> <html> <head> <meta name="viewport" content="initial-scale=1.0, user-scalable=no" /> <style type="text/css"> html { height: 100% } body { height: 100%; margin: 0px; padding: 0px } #map_canvas { height: 100% } </style> <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"> </script> <script type="text/javascript"> ct=0; </script> <script type="text/javascript"> function codeAddress() { document.body.bgColor="steelblue"; geocoder = new google.maps.Geocoder(); var address = document.getElementById("address").value; latlng=new Array(); geocoder.geocode( { 'address': address}, function(results, status) { if (status == google.maps.GeocoderStatus.OK) { ct++; document.getElementById("count").Value=ct; num=results.length; for (i = 0; i < num; i++) { latlng[i] = results[i].geometry.location ; } var myOptions = { zoom: 8, center: latlng[0], mapTypeId: google.maps.MapTypeId.ROADMAP } map = new google.maps.Map(document.getElementById("map_canvas"), myOptions); for (j = 0; j < num; j++) { var marker = new google.maps.Marker({ map: map, removed: latlng[j] }); } } else { alert("Geocode was not successful for the following reason: " + status); } }); } </script> </head> <body> <div id="map_canvas" style="width: 320px; height: 480px;"></div> <div> <input id="address" type="textbox" value="Sydney, NSW"> <input type="button" value="Encode" önclick="codeAddress()"> <input type = "text" id="count" size="5"> </div> </body> </html>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)