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 get values of latitude and longtude on two variables
Dec 30 2019 3:08 PM
How to store values of loc[0] and loc[1] on two variables latitude and longtude
and what type of two variables ?
let lati:string;
let
long
:string;
this
.partDetailsService.getLocationData(locationArr).subscribe(res => {
console.log(res);
res.forEach((item, index) => {
let dataLocation = res[index][
'_source'
][
'GPS1'
];
console.log(dataLocation);
let loc = dataLocation.split(
','
);
console.log(
"After"
);
console.log(loc); success
console.log(loc[0].trim()); success
console.log(loc[1].trim()); success
lati=loc[0].trim();
long
=loc[1].trim();
});
latitude= result of loc[0].trim after loop finish
longtude= result of loc[1].trim after loop finish
and what datatype assigned to two variables ?
suppose I have on dataLocation that store GPS1 as following
52,70
30,40
20,60
50,100
then
latitude variable will have 52,30,20,50
longtude variable will have 70,40,60,100
Ho to create two variables that can give me values above ?
Reply
Answers (
1
)
How to display more than locaions gps on googlemap?
How to pass result of foreach loop to functinon LatLng?