Picking a map location within a flow

Post your questions and help other users.

Moderator: Martin

skiptannen
Posts: 82
Joined: 13 Jan 2014 21:39

Picking a map location within a flow

Post by skiptannen » 10 Jun 2014 14:30

I'm trying to figure out how to write a flow that allows me to choose a destination from a map and use that location to fire an alarm when arriving at or leaving the location. I know that I can go into the Location trigger and select a location by tapping on the Pick Location button, but I want to do this as part of a flow. Is that possible or do I need to open Automagic and pick the location before running the flow? I've looked at the Location trigger, the Init Variable Location action, and the various location conditions so far I haven't been able to bring up the map from within a running flow. I'm hoping I'm missing something simple and I just haven't figured it out yet.

Thanks in advance.

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: Picking a map location within a flow

Post by Martin » 10 Jun 2014 16:59

Hi,

There's currently no easy solution to do this. I have it on the todo-list to add an option to select a location in an action Input Dialog at some point. It would also require a new feature to use variables in the location trigger which is also a feature on my todo-list.
I think that the plugin AutoLocation supports a way to add goefences dynamically (but I might be wrong).

Regards,
Martin

skiptannen
Posts: 82
Joined: 13 Jan 2014 21:39

Re: Picking a map location within a flow

Post by skiptannen » 10 Jun 2014 19:03

Thank you Martin - I've never played around with Tasker plugins, and I may take a look at that, but having location as an input dialog type would be a great option to have. I would think that it would open up a bunch of possibilities.

Thanks again.


skip

manuel
Posts: 27
Joined: 05 Jul 2013 20:54

Re: Picking a map location within a flow

Post by manuel » 24 Jun 2014 08:24

+1

BoBo
Posts: 129
Joined: 05 May 2014 12:45

Re: Picking a map location within a flow

Post by BoBo » 15 Jul 2014 08:42

[Brainfart]

What about to ...
a) set a pin at a Google map (manually)
b) extract the data from that map (flow)*
c) take the pin coordinates from that data (flow)
d) write a flow which contains that extracted pin coordinates (flow)
e) execute that created flow
*
Simply click the link shortcut on the map to retreive a URL for the map with pins in.
Next add &output=kml to the end of this url and use the link to retrieve a kml file containing all the pin data.

This kml file is actually in xml format so parsing it should be easy, you just need to look for <coordinates> elements which contain the latitude and longitude data you need. The kml format is documented here: http://code.google.com/apis/kml/documen ... rence.html


Source (click)
[/Brainfart]

8-)

skiptannen
Posts: 82
Joined: 13 Jan 2014 21:39

Re: Picking a map location within a flow

Post by skiptannen » 16 Jul 2014 13:48

Thanks BoBo - this looks like a good idea. I am also thinking of playing with an app named Map Coordinates (https://play.google.com/store/apps/deta ... es.android) - you find your location on the map and then pick the menu option to copy the coordinates to the clipboard.

BoBo
Posts: 129
Joined: 05 May 2014 12:45

Re: Picking a map location within a flow

Post by BoBo » 16 Jul 2014 18:55

Promising app. So you can create a flow which is checking the clipboard for a valid content (the coordinates) and use those values directly within the flow. Makes sense.

skiptannen
Posts: 82
Joined: 13 Jan 2014 21:39

Re: Picking a map location within a flow

Post by skiptannen » 16 Jul 2014 22:22

Yup, that's exactly what I would like to do, but since my test flow is using the condition Location, I'm kind of stuck unless Martin is able to create the ability to add a location using an action Input Dialog (see his previous comment).

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: Picking a map location within a flow

Post by Martin » 17 Jul 2014 19:29

You could also use the function distance in an action Script or a condition Expression to calculate the distance in meters between two locations and execute some actions when the distance is below a certain threshold. You can create location objects in a script with function newLocation so a very basic script could look like this:

-action Script:

Code: Select all

loc1 = newLocation(48.858097, 2.294467);
loc2 = newLocation(48.860327, 2.291206);
-condition Expression:

Code: Select all

distance(loc1, loc2)<1000
It's a bit of a hassle to remember the last inside/outside state in boolean variables so that you can detect enter/exit events but other than that it should work.

Sorry, I did not think about this possibility in my earlier post.

skiptannen
Posts: 82
Joined: 13 Jan 2014 21:39

Re: Picking a map location within a flow

Post by skiptannen » 18 Jul 2014 16:05

No worries Martin - this works and has some interesting possibilities. I wasn't sure what you meant by remembering the inside/outside state in boolean variables, but what I'm playing around with now is having a global list that contains variables with location coordinates and comparing that to the current location with the expression distance(loc1, loc2)<1000. That seems to work. What I'm wondering is if I can use any other data elements from the location coordinates to test for entering/exiting. When I export the location value in the variable, I see "[Location[Script 42.188312,-71.581127 acc=??? t=?!? et=?!?]]". I figure acc= is accuracy and et= is speed, but what it t=? Time? And does it make sense to be going this route or is there a better way?

I wanted to attach the test flow I'm working with, but I'm getting the error "The upload was rejected because the uploaded file was identified as a possible attack vector". Not sure what that's about - I thought I could upload XML files...

Thanks.

Post Reply