在我的项目中,我使用传单来显示点.
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?
如果你想为此使用 OpenStreetmaps,你可以简单地发出请求(使用 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);
});
您将获得包含(不仅)纬度和经度的 JSON 对象.
You'll get JSON objects containing (not only) lat and lon.
这篇关于获取纬度 &经度根据传单给出的地址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!
检查一个多边形点是否在传单中的另一个内部Check if a polygon point is inside another in leaflet(检查一个多边形点是否在传单中的另一个内部)
更改传单标记群集图标颜色,继承其余默认 CSSChanging leaflet markercluster icon color, inheriting the rest of the default CSS properties(更改传单标记群集图标颜色,继承其余默认
触发点击传单标记Trigger click on leaflet marker(触发点击传单标记)
如何更改 LeafletJS 中的默认加载磁贴颜色?How can I change the default loading tile color in LeafletJS?(如何更改 LeafletJS 中的默认加载磁贴颜色?)
将外部geojson添加到传单层Add external geojson to leaflet layer(将外部geojson添加到传单层)
将 Leaflet 图层控件添加到侧边栏Adding Leaflet layer control to sidebar(将 Leaflet 图层控件添加到侧边栏)