Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Try this using jQuery. Give Lat, Lng in text box and click GO.</p> <p><strong>UPDATED</strong></p> <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt; &lt;head&gt; &lt;title&gt;Testing&lt;/title&gt; &lt;script src="scripts/jquery-1.9.1.min.js" type="text/javascript"&gt;&lt;/script&gt; &lt;script src="http://maps.googleapis.com/maps/api/js?key=AIzaSyA7IZt-36CgqSGDFK8pChUdQXFyKIhpMBY&amp;sensor=true" type="text/javascript"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; var map; var geocoder; var marker; var latlng; var infowindow; $(document).ready(function() { }); function initialize() { var mapOptions = { //center: new google.maps.LatLng(40.4230, 98.7372), // Coimbatore = (11.0168445, 76.9558321) zoom: 3, mapTypeId: google.maps.MapTypeId.ROADMAP }; map = new google.maps.Map(document.getElementById("map-canvas"), mapOptions); geocoder = new google.maps.Geocoder(); infowindow = new google.maps.InfoWindow(); var latlngStr = $('#address').val().split(","); var lat = parseFloat(latlngStr[0]); var lng = parseFloat(latlngStr[1]); $('#latitude').val(lat); $('#longitude').val(lng); latlng = new google.maps.LatLng(lat, lng); marker = new google.maps.Marker({ position: latlng, map: map, draggable: true }); map.setCenter(latlng); geocoder.geocode({ 'latLng': latlng }, function(results, status) { infowindow.setContent(results[0].formatted_address); $('#txtAddress').val(results[0].formatted_address); }); } &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;label&gt; Lat, Lng: &lt;/label&gt; &lt;input id="address" type="text" placeholder="10.9435131, 76.9383790" /&gt; &lt;input type="button" value="Go" onclick="initialize()" /&gt; &lt;br /&gt; &lt;br /&gt; &lt;div id="map-canvas" style="width: 10px; height: 10px; display: none;"&gt; &lt;/div&gt; &lt;label&gt; Latitude: &lt;/label&gt; &lt;input id="latitude" type="text" /&gt; &lt;br /&gt; &lt;label&gt; Longitude: &lt;/label&gt; &lt;input id="longitude" type="text" /&gt; &lt;label&gt; Address: &lt;/label&gt; &lt;textarea rows="3" cols="30" id="txtAddress"&gt; &lt;/textarea&gt; &lt;/body&gt; &lt;/html&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload