如何根据json结果中的经纬度填充标记?使用角度7? 我有一个foreach循环,根据locationId数组从服务返回的纬度和经度中获取GPS1纬度和经度,然后将其存储为逗号,
在可变locationLatLng(lat,lng)上,如下所示: locationsLatLng中如何通过纬度和经度归档标记this.partDetailsService.getLocationData(locationArr).subscribe(res => {
console.log(res);
res.forEach((item, index) => {
var dataLocation = res[index]['_source']['GPS1'];
console.log(dataLocation);
var locationsLatLng = dataLocation.split(',');
console.log(locationsLatLng);
});
52,70
30,40
20,60
50,100
markers: marker[] = [
{
lat: ?,
lng: ?
}
0 个答案:
没有答案