-1

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?

  • why not geolocate the place? – Daan Apr 03 '15 at 07:06
  • 1
    The site doesn't work this way (providing code on demand). You must do your research, and create some code yourself. If at this time you still have problems, then other users here can help you. See [ask]. – mins Apr 03 '15 at 07:06
  • You need a service for that. Google offers such a service. You could also google for the google service (okay not so funny joke maybe :) ). – hakre Apr 03 '15 at 07:07
  • when i searched all codes are based on latitude and longitude – Sandeep Vellaparambil Apr 03 '15 at 07:09
  • `` – Sandeep Vellaparambil Apr 03 '15 at 07:10
  • Use the [google maps geocoding service](http://www.geocodezip.com/v3_example_geo2.asp?addr1=AH%20Wadia%20Marg,%20Friends%20Colony,%20Hallow%20Pul,%20Kurla,%20Mumbai,%20Maharashtra%20400070&geocode=1) – geocodezip Apr 03 '15 at 07:15

2 Answers2

0

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

0

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