Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script src='http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js' type='text/javascript'></script>
<script type="text/javascript"></script>
</head>
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
<script type="text/javascript">
var map;
var geocoder;
function initialize()
{
    var latlng = new google.maps.LatLng(47.6059399181561, 14.747812500000007);
    map = new google.maps.Map(document.getElementById('map'), {
      zoom:6,
      center:latlng,
      mapTypeId:google.maps.MapTypeId.HYBRID
    });
    google.maps.event.addListener(map, 'center_changed', placeMarker);
    google.maps.event.addListener(map, 'dragend', reverseLookup);
    geocoder = new google.maps.Geocoder();
}
function placeMarker()
{
    var center = map.getCenter();
    marker = new google.maps.Marker({
      map:map,
      position: center
    });
}
function reverseLookup()
{
    geocoder.geocode({'latLng': map.getCenter()}, function(results, status)
    {
      if (status == google.maps.GeocoderStatus.OK)
      {
        document.getElementById('area').value = 
        results[results.length-1].formatted_address + " " +
        map.getCenter() + "\r\n" + document.getElementById('area').value;
      }
    });
}
</script>
<body onLoad="initialize()">
<div id="map" style="width: 800px; height: 350px;"></div>
<textarea id='area' cols='80' rows='5'></textarea>
</body>
</html>
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
anonymouspro
0viewers