Home > DeveloperSection > Forums > Enter the location in text box show address in map or point the current location.
Milin Narkhede
Milin Narkhede

Total Post:5

Points:35
Posted on    February-28-2015 8:19 AM

 JavaScript JQuery  JavaScript  Google API 
Ratings:


 4 Reply(s)
 908  View(s)
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..




John Smith

Total Post:102

Points:720
Posted on    February-28-2015 11:17 AM

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

Milin Narkhede
Milin Narkhede

Total Post:5

Points:35
Posted on    March-01-2015 8:28 AM

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..

Jack C
Jack C

Total Post:13

Points:91
Posted on    March-02-2015 6:36 AM

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.');
    }
  });
}


Milin Narkhede
Milin Narkhede

Total Post:5

Points:35
Posted on    March-07-2015 10:06 AM

Thanks

jack c and john smith code is running successfully.

Milin.



Don't want to miss updates? Please click the below button!

Follow MindStick