get latitude & longitude as per address given for leaflet

javascript, leaflet

Solution

If you want to use OpenStreetmaps for this, you can simply make a request (using jquery):

    $.get(location.protocol + '//nominatim.openstreetmap.org/search?format=json&q='+address, function(data){
       console.log(data);
    });

You'll get JSON objects containing (not only) lat and lon.

Problem

In my project I am using leaflet to display points. I am getting address from my database & want to show point for that particular address. I haven't found anything which will give me latitude & longitude as per address provided. Can anyone help me on this?

Original source