I am trying to get address(City, Post code,Street address) with longitude and latitude but i don`t know how. I am using Open layers and when i click on part of map a get longitude and latitude of that position. Does anybody have solution for this?
<!DOCTYPE html>
<html>
<head>
<title>Mouse Position</title>
<link rel="stylesheet" href="https://openlayers.org/en/v4.1.0/css/ol.css" type="text/css">
<script src="https://openlayers.org/en/v4.1.0/build/ol.js"></script>
</head>
<body>
<div id="map" class="map"></div>
<script>
var map = new ol.Map({
layers: [
new ol.layer.Tile({
source: new ol.source.OSM()
})
],
target: 'map',
view: new ol.View({
center: [2918616.660738325,4873187.634331534],
zoom: 19
})
});
map.on('click', function (evt) {
var coord = ol.proj.toLonLat(evt.coordinate);
alert(coord);
});
</script>
</body>
</html>