得到纬度&根据传单给出的经度 [英] get latitude & longitude as per address given for leaflet

查看:86
本文介绍了得到纬度&根据传单给出的经度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的项目中,我使用传单来显示点。

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.

任何人都可以帮我吗?

推荐答案

有一个已经为Leaflet开发的伟大地理编码器。

There is a great geocoder already developed for Leaflet.

https:/ /github.com/smeijer/L.GeoSearch

您可以轻松使用结果

map.on('geosearch_showlocation', function (result) {
    L.marker([result.x, result.y]).addTo(map)
});

这篇关于得到纬度&根据传单给出的经度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆