本文介紹了獲取緯度 &經(jīng)度根據(jù)傳單給出的地址的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!
問題描述
在我的項(xiàng)目中,我使用傳單來顯示點(diǎn).
In my project I am using leaflet to display points.
我正在從我的數(shù)據(jù)庫中獲取地址 &想要顯示該特定地址的點(diǎn).
I am getting address from my database & want to show point for that particular address.
我還沒有找到任何可以給我自由度的東西經(jīng)度根據(jù)提供的地址.
I haven't found anything which will give me latitude & longitude as per address provided.
誰能幫我解決這個問題?
Can anyone help me on this?
推薦答案
如果你想為此使用 OpenStreetmaps,你可以簡單地發(fā)出請求(使用 jquery):
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);
});
您將獲得包含(不僅)緯度和經(jīng)度的 JSON 對象.
You'll get JSON objects containing (not only) lat and lon.
這篇關(guān)于獲取緯度 &經(jīng)度根據(jù)傳單給出的地址的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!
【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請聯(lián)系我們刪除處理,感謝您的支持!