Get my location and display longtitude and latitude in separate labels

Dear fellow Kodulars,

I am having issues extracting latitude and longtitude information from Google Maps’ Get My Location block.

image

As you can see in the above screenshot, I get the entire location data by using the given Get My Location block, but I am not able to separate the longtitude, latitude and the precision values (which are a result of the Get My Location block).

For example, this is the output of the Get My Location block:
image

I was thinking of using RegEx but I could only find RegEx match which only returns True or False as the output, but is not able to copy the matched text so that I can store/use it somewhere.

So, long story short - from a text like this: (22.2222 11.1111 9.493) I want one label to dispaly 22.2222 and the second label to display 11.1111.

Any suggestions are much appreciated.

Thank you.

1 Like

You should read the block description…

“Get current location using Google Map Service. Return a YailList with first item being the latitude, the second item being the longitude, and last time being the accuracy of the reading.”

3 Likes

Hi @mika,

Yes, that’s why I am asking. It returns 3 values, but I am unable to split those 3 values and use the values one by one.

Am I missing something in your reply?

Thank you

1 Like

Yes the word YailList.
Store the result in a list.

Maybe someone else with time can help you

5 Likes

Ouh, a list. I wondered what that was 'cause I thought it was something from Yandex.
That seems interesting. I will try it.

Thank you for the help

3 Likes

Select item from list… Index1 latitude, index2 longitudes, index3 accuracy

2 Likes

Thank you @pipechela!
This worked out like a charm :slight_smile:

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.