I want to display small map in web page.I have only place name with me.I don't have latitude and longitude of place.
suppose my place is
"AH Wadia Marg, Friends Colony, Hallow Pul, Kurla, Mumbai, Maharashtra 400070
"
is there any way to display?
I want to display small map in web page.I have only place name with me.I don't have latitude and longitude of place.
suppose my place is
"AH Wadia Marg, Friends Colony, Hallow Pul, Kurla, Mumbai, Maharashtra 400070
"
is there any way to display?
I'm not entirely sure what you want, but the Google Maps API allows you to display a location based solely on the name.
If you want a static image: https://developers.google.com/maps/documentation/staticmaps/
If you want an interactive map: https://developers.google.com/maps/documentation/embed/guide
You need to use google geo code, For that first you need to collect whole address and make comma separated string and then need to pass to geo code, Please take a look to below code.
var geocoder = new google.maps.Geocoder();
var address = $("#address").val() + ' ' + $("#city").val() + ' ' + $("#state").val() + ' ' + $("#zipcode").val();
if (geocoder) {
geocoder.geocode({'address': address}, function (results, status) {
if (status == google.maps.GeocoderStatus.OK) {
$('#LoadMap').locationpicker({
location: {latitude: results[0].geometry.location.k, longitude: results[0].geometry.location.D},
radius: 300,
inputBinding: {
locationNameInput: $('#AddressAutoComplete')
},
enableAutocomplete: true,
onchanged: function (currentLocation, radius, isMarkerDropped) {
$('#address_loc0').val(currentLocation.latitude + ',' + currentLocation.longitude);
}
});
}
});
}