我在用leaflet-geosearch
用来搜索我在谷歌地图页面中显示的地址的经度和纬度,我正在使用角度
在我的组件中
private openAddressInMap() {
this.provider.search({query: address}).then(result => { // search coordinates for each city
if (!isNullOrUndefined(result) && result.length > 0 && !isNullOrUndefined(result[0])) {
const lng = result[0].x;
const lat = result[0].y;
window.open('https://maps.google.com/?q=' + lat + ',' + lng, '_blank');
}
});
}
然后我通过传递 lat 和 lng 打开谷歌地图链接,问题是标记没有很好定位,它指向错误的地址