sadhana belge

sadhana belge

  • NA
  • 85
  • 18.7k

How to Search a Place and pincode in Map using Google Map A

Jan 24 2014 7:56 AM
Hello sir,
i have two textbox
1)one seracharea names ex:London
2)second textbox is pincode example:AB,AL
i have to find area with that pincode surrodings areas
how to do i find out but i can not find right solution
how can i concatenate pincode with country
My code:

<script src="js/jquery-1.9.1.js" type="text/javascript"></script>

<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?sensor=false"></script>



<script type="text/javascript">
$(document).ready(
function () {
$(
"#btn").click(function () {

var geocoder = new google.maps.Geocoder();

var con = document.getElementById('txtPincode').value;

var city = document.getElementById('txtSearchArea').value;

var com = con + "," + "+" + city + "+";
geocoder.geocode({
'address': com }, function (results, status) {

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

var x = results[0].geometry.location.lat();

var y = results[0].geometry.location.lng();

var latlng = new google.maps.LatLng(x, y);

var myOptions = {
zoom: 8,
center: latlng,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
map =
new google.maps.Map(document.getElementById("map-canvas"), myOptions);

var marker = new google.maps.Marker({
position:
new google.maps.LatLng(x, y),
map: map,
title: com
});

var infowindow = new google.maps.InfoWindow({
content: com
});
infowindow.open(map, marker);
google.maps.event.addDomListener(window,
'load');
}
else {
res.innerHTML =
"Enter correct Details: " + status;
}
});
});
});

</script>
 
AL near London ,UK
AL is the Pincode of London
how to do gernerated the url to get this:
https://maps.google.co.in/maps?q=London,+United+Kingdom,AL&hl=en&sll=51.511214,-0.119824&sspn=0.633315,1.454315&hq=,AL&hnear=London,+United+Kingdom&t=m&z=13

i dont use this maps.google.co.in


i have to used the this url:

https://maps.googleapis.com/maps/api/js?sensor=false

and passing the pinocde and location parameter how to do






Attachment: search.zip