ENTER THE LOCATION IN TEXT BOX SHOW ADDRESS IN MAP OR POINT THE CURRENT LOCATION.

Milin Narkhede

Total Post:5

Points:35
Posted by  Milin Narkhede
 1238  View(s)
Ratings:
Rate this:
if page my current location show ..this code is work but i enter a location box any other address javascript not work please help me..


  1. John Smith

    Post:102

    Points:720
    Re: Enter the location in text box show address in map or point the current location.

    check following code

    var txtValue= new google.maps.LatLng(22.258652//textbox1.value                                                           ,71.192381//textbox2.value    );
      var mapOptions = {
        zoom:6,
        mapTypeId: google.maps.MapTypeId.ROADMAP,
        center: txtValue
      }
      map = new google.maps.Map(document.getElementById('map'), mapOptions);
      directionsDisplay.setMap(map);



      Modified On Feb-28-2015 11:19:11 AM
  1. Milin Narkhede

    Post:5

    Points:35
    Re: Enter the location in text box show address in map or point the current location.

    Hello Sir,

    please  check this link...
    http://nvsoft.in/GetMap/CurrentLocation.htm

    current location is show but in textbox i type enter a location this functionality not working...
    i have used javascript but not proper work please help me..

    Milind..

  1. Jack C

    Post:13

    Points:91
    Re: Enter the location in text box show address in map or point the current location.

    you can try following lines of code:

    function geocodePosition(pos) {
      geocoder.geocode({
        latLng: pos
      }, function(responses) {
        if (responses && responses.length > 0) {
          updateMarkerAddress(responses[0].formatted_address);
        } else {
          updateMarkerAddress('Cannot determine address at this location.');
        }
      });
    }

  1. Milin Narkhede

    Post:5

    Points:35
    Re: Enter the location in text box show address in map or point the current location.

    Thanks

    jack c and john smith code is running successfully.

    Milin.


Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!