Click here to Skip to main content
15,844,498 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hello all...
i want to show latitude and longitude of particular place on google map...
mean when i click on place A ,latitude and longitude will be shown in infoWindow...
and when i click on place B ,latitude and longitude will be shown in infoWindow...
plz help i can do this...

Thnks for help !!!!


 <script src="" type="text/javascript"></script>
<script type="text/javascript" src=""></script>
 <script language="JavaScript" src=""></script>
<script type="text/javascript">

  var  geocoder = new google.maps.Geocoder();
 var infowindow = new google.maps.InfoWindow();
var latlang=new google.maps.LatLng(geoip_latitude(), geoip_longitude());
  function initialize()
      var myOptions = {
      center: latlang,
      zoom: 5,
      mapTypeId: google.maps.MapTypeId.ROADMAP

    var map = new google.maps.Map(document.getElementById("map"), myOptions);
 geocoder.geocode({ 'latLng': latlang }, function (items, status) {

                    if (status == google.maps.GeocoderStatus.OK) {


                       var marker = new google.maps.Marker({
                            position: latlang ,
                            map: map

                         google.maps.event.addListener(marker, 'click', function () {

      , this);

google.maps.event.addListener(map, 'click', function (event) {

                geocoder.geocode({ 'latLng': event.latLng }, function (items, status) {

                    if (status == google.maps.GeocoderStatus.OK) {
                        $('#latitude').val(items[0], 12));
                        $('#longitude').val(items[0].geometry.location.lng().toString().substr(0, 12));
                       marker = new google.maps.Marker({
                            position: event.latLng,
                            map: map

                        var ll=event.latLng;
              , marker);




<div id="map" align="center" style="height: 420px;  width:500px; top:0px; border: 1px solid black;"></div>
Share this answer
Member 9332883 20-Oct-12 22:44pm    
but how to show direction among that points ????

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900