TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
ahmed elbarbary
NA
1.6k
278.4k
How to pass result of foreach loop to functinon LatLng?
Dec 30 2019 5:02 PM
How to pass result of foreach loop to functinon LatLng using angular 7 ?
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);
});
I have foreach loop get GPS1 latitude and longitude from service return latitude and longitude based on array of locationsId then store it separated by comma , on variable locationsLatLng (lat,lng) as following :
52,70
30,40
20,60
50,100
I need to pass locationsLatLng to function latlng
const
coordinates =
new
google.maps.LatLng(lat value, lng value);
Reply
Answers (
3
)
how to get values of latitude and longtude on two variables
cannot push markers on map although have latitude and longtu