Support Forum

Ask questions and get help from MobileTogether experts.
MobileTogether Product Information
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
View
Go to last post Go to first unread
jwatt222  
#1 Posted : Monday, September 26, 2016 4:21:07 PM(UTC)
jwatt222

Rank: Advanced Member

Groups: Registered
Joined: 5/23/2016(UTC)
Posts: 129
United States
Location: Virginia

Thanks: 20 times
Is it possible to integrate Google maps for business with MobileTogether Apps? If so where can I find help on this in the User Manual?

Thanks,
bbv  
#2 Posted : Tuesday, September 27, 2016 10:59:06 AM(UTC)
bbv

Rank: Administration

Groups: Registered, Administrators
Joined: 7/21/2014(UTC)
Posts: 498

Was thanked: 88 time(s) in 88 post(s)
I'm not sure what you mean with Google maps for business, but you can easily show a location or route between two locations on currently installed mapping application (which is in most cases Google Maps on Android) using Show Geolocation command

http://manual.altova.com...oloc_showgeolocation.htm
jwatt222  
#3 Posted : Tuesday, September 27, 2016 5:03:28 PM(UTC)
jwatt222

Rank: Advanced Member

Groups: Registered
Joined: 5/23/2016(UTC)
Posts: 129
United States
Location: Virginia

Thanks: 20 times
BBV, Thanks,

This response is helpful and I will use it as an alternative. However,

I am looking to use truck specific routes that take in consideration restricted routes and low clearances. Google Maps for Business will allow me to build a separate app using Android Studio to do this.

My question is whether or not I can integrate this into my app using MTD or is it something that will only be possible in Android Studio by adding a new map activity.
bbv  
#4 Posted : Wednesday, September 28, 2016 10:35:42 AM(UTC)
bbv

Rank: Administration

Groups: Registered, Administrators
Joined: 7/21/2014(UTC)
Posts: 498

Was thanked: 88 time(s) in 88 post(s)
This will have to be an independent app.
bbv  
#5 Posted : Thursday, September 29, 2016 9:50:25 AM(UTC)
bbv

Rank: Administration

Groups: Registered, Administrators
Joined: 7/21/2014(UTC)
Posts: 498

Was thanked: 88 time(s) in 88 post(s)
As a follow up to my answer: you can call your app which integrates your license of Google Maps for Business by registering your own URL scheme, like
Code:

	myurl::/my/app?
thìs allows you to call your app from MobileTogether with parameters.

Starting with the upcoming v3.0 there will be 2nd means for this: you can define your own file extension, like
Code:

	file.myappext
and save such file on client device in MobileTogether and then execute action Open File. This again will call your app with Business Maps and file will be used to transfer any parameters you wish
jwatt222  
#6 Posted : Wednesday, August 23, 2017 7:27:20 AM(UTC)
jwatt222

Rank: Advanced Member

Groups: Registered
Joined: 5/23/2016(UTC)
Posts: 129
United States
Location: Virginia

Thanks: 20 times
I hope I can explain this well enough for you to help me; I can do this easily with google maps using show geolocation but I need truck routes.

I am trying to connect to an external app from my MTD App which requires connecting with a url. With this the user is taken to the app and gets truck routes based on the parameters of the url. If I put in the url and type in the LAt Long coordunates the url works exactly like it should. However I cannot assume what coordinates the user will be needing until he puts in his dispatch. Nor can I assume what type of veh configuration the user would have.

Therefore, I need the app to be able to accept the parameters from the xml file. I need to be able to construct this url from the data provided by the user and have set the following tree to pull from:

=geolat "41.12345"
=geolong "-72.12345"
=units "us"
=height"162"
=length "636"
=width "102"
=weight "80000"
=hazmatclass "0"
=axles "5"
=trailers "1"
=drawbar or 5th wheel "1"

THIS URL: "http://smarttruckroute.com/route/truck?daddr=Warehouse@41.12345,-72.12345&vehConfig=us,162,636,102,80000,0,5,1,1"

If I type this in the open url field and click on the control it goes to the app and gives me the appropriate route for the truck to take. However when I try to build this url and press the control, it only goes to the map and stops there waiting for me to put in the coordinates or address before it will give me the route.

I can easily get the coordinates to show on my form but it appears that I am not able to write them into the url.

I WOULD GREATLY APPRECIATE ANY SUGGESTIONS ON THE BEST APPROACH TO SOLVE THIS.

THANKS IN ADVANCE.
bbv  
#7 Posted : Wednesday, August 23, 2017 9:12:08 AM(UTC)
bbv

Rank: Administration

Groups: Registered, Administrators
Joined: 7/21/2014(UTC)
Posts: 498

Was thanked: 88 time(s) in 88 post(s)
Did I get your right, you fail with building URL with XPath statements, whereas when directly typed it is fine? If yes, what XPath statement did you use so far?
jwatt222  
#8 Posted : Wednesday, August 23, 2017 2:15:51 PM(UTC)
jwatt222

Rank: Advanced Member

Groups: Registered
Joined: 5/23/2016(UTC)
Posts: 129
United States
Location: Virginia

Thanks: 20 times
Using a button with the control action for "on button clicked" and "open url/file" I select open url and place this in directly:
"http://smarttruckroute.com/route/truck?daddr=Warehouse@41.12345,-72.12345&vehConfig=us,162,636,102,80000,0,5,1,1"

It goes to Smart truck route and retrieve the route. Perfect!

However, I will not be able to put these parameters in for each client.

I need to construct a way to build the url from their inputs and using that in the control action;

I tried localizing these two parts: "http://smarttruckroute.com/route/truck?daddr=Warehouse@" "&vehConfig=us" and using a sequence of strings to pull "41.12345,-72.12345" and "us,162,636,102,80000,0,5,1,1" from the persistent tree since this is what the client parameters would be. However no matter how I try to put it back together in the open url control action the best I can get is to land on the world map but it does not retrieve the route.

jwatt222  
#9 Posted : Wednesday, August 23, 2017 3:23:44 PM(UTC)
jwatt222

Rank: Advanced Member

Groups: Registered
Joined: 5/23/2016(UTC)
Posts: 129
United States
Location: Virginia

Thanks: 20 times
This works:

string('http://smarttruckroute.com/via/truck?daddr=Stop@ || 37.3598504,-77.9551039 || &vehConfig || Vehconfig()')

This does not work:

string('http://smarttruckroute.com/via/truck?daddr=Stop@ || Shipperurl() || &vehConfig || Vehconfig()')

The Shipperurl function is a string of the lat and long from the persistent tree.
bbv  
#10 Posted : Wednesday, August 23, 2017 10:29:25 PM(UTC)
bbv

Rank: Administration

Groups: Registered, Administrators
Joined: 7/21/2014(UTC)
Posts: 498

Was thanked: 88 time(s) in 88 post(s)
I'm actually surprised that the first works, because it is also wrong.

Assuming your functions Shippeurl() and Vehconfig() are properly implemented, this is the statement you need:

'http://smarttruckroute.com/via/truck?daddr=Stop@' || Shipperurl() || '&vehConfig=' || Vehconfig()

No string is necessary, but you have to put quotes around every directly typed text.

If this doesn't help then attach your actual file, then we can easily help.
jwatt222  
#11 Posted : Thursday, August 24, 2017 8:49:55 PM(UTC)
jwatt222

Rank: Advanced Member

Groups: Registered
Joined: 5/23/2016(UTC)
Posts: 129
United States
Location: Virginia

Thanks: 20 times
Thanks. I'm still learning. I'm using your online Xpath 3.0 training but am not an expert by any means.

One last question:

string($MT_GEOLOCATION/Root/Location/@Latitude),string($MT_GEOLOCATION/Root/Location/@Longitude)
evaluates to 37.3598504 -77.9551039

How do I get the ',' to show and evaluate to 37.3598504,-77.9551039
jwatt222  
#12 Posted : Thursday, August 24, 2017 9:23:01 PM(UTC)
jwatt222

Rank: Advanced Member

Groups: Registered
Joined: 5/23/2016(UTC)
Posts: 129
United States
Location: Virginia

Thanks: 20 times
($MT_GEOLOCATION/Root/Location/@Latitude) || ($MT_GEOLOCATION/Root/Location/@Longitude)

returns 37.3598504-77.9551039

Not sure how to get the ","
jwatt222  
#13 Posted : Friday, August 25, 2017 5:24:09 AM(UTC)
jwatt222

Rank: Advanced Member

Groups: Registered
Joined: 5/23/2016(UTC)
Posts: 129
United States
Location: Virginia

Thanks: 20 times
string-join($MT_GEOLOCATION/Root/Location/@Latitude), ($MT_GEOLOCATION/Root/Location/@Longitude)

is also returning 37.3598504 -77.9551039
jwatt222  
#14 Posted : Friday, August 25, 2017 6:20:50 AM(UTC)
jwatt222

Rank: Advanced Member

Groups: Registered
Joined: 5/23/2016(UTC)
Posts: 129
United States
Location: Virginia

Thanks: 20 times
string($MT_GEOLOCATION/Root/Location/@Latitude), ($MT_GEOLOCATION/Root/Location/@Longitude)

also returns 37.3598504 -77.9551039
jwatt222  
#15 Posted : Friday, August 25, 2017 7:37:55 AM(UTC)
jwatt222

Rank: Advanced Member

Groups: Registered
Joined: 5/23/2016(UTC)
Posts: 129
United States
Location: Virginia

Thanks: 20 times
Got it Working! Thanks Anyway.
I decided to shorten up the url to get the route only without the vehicle config since I can set this in Smart Truck route.
I split the latitude and longitude and then input the comma directly and it gives me the route.
'http://smarttruckroute.com/via/truck?daddr=Stop@' || Latitude() || ',' || Longitude()
bbv  
#16 Posted : Friday, August 25, 2017 9:16:11 AM(UTC)
bbv

Rank: Administration

Groups: Registered, Administrators
Joined: 7/21/2014(UTC)
Posts: 498

Was thanked: 88 time(s) in 88 post(s)
Just for completness, without adding the functions, the syntax would be:

'http://smarttruckroute.com/via/truck?daddr=Stop@' || $MT_GEOLOCATION/Root/Location/@Latitude || ',' || $MT_GEOLOCATION/Root/Location/@Longitude
jwatt222  
#17 Posted : Friday, August 25, 2017 10:44:04 AM(UTC)
jwatt222

Rank: Advanced Member

Groups: Registered
Joined: 5/23/2016(UTC)
Posts: 129
United States
Location: Virginia

Thanks: 20 times
Thanks.

I am working perfectly with this:
'http://smarttruckroute.com/via/truck?daddr=Stop@' || Stop1Latitude() || ',' || Stop1Longitude() || '&vehConfig=' || Units() || ',' || TruckHeight() || ',' || TruckLength() || ',' || TruckWidth() || ',' || TruckWeight() || ',' || HazmatClass() || ',' || NumberofAxles() || ',' || NumberofTrailers() || ',' || Drawbaror5thWheel()

I have to contact Smart Truck Route later today to see where to insert the tolls because without it the route is taking me through tolls. If I go to the app and turn on the button to avoid tolls, then when I go from my app to theirs, it turns it off. Anyway I'll have to sove this with them.

What would be the benefit to changing it to the way you have it? Would it make the app faster or require less data use or battery power etc? Would love to know so that the app is most efficient?

Thanks for your help with this. I am excited about the value this adds to my app.
bbv  
#18 Posted : Friday, August 25, 2017 11:07:52 AM(UTC)
bbv

Rank: Administration

Groups: Registered, Administrators
Joined: 7/21/2014(UTC)
Posts: 498

Was thanked: 88 time(s) in 88 post(s)
I only wanted to show you how it can be written if you wanted to avoid creating functions.

Your way of doing things is absolutely fine, and your code is actually easier to read, because shorter. The execution time of this statement is so minimal, that it has no implications on speed or battery power.
thanks 1 user thanked bbv for this useful post.
jwatt222 on 8/25/2017(UTC)
jwatt222  
#19 Posted : Friday, August 25, 2017 11:15:26 AM(UTC)
jwatt222

Rank: Advanced Member

Groups: Registered
Joined: 5/23/2016(UTC)
Posts: 129
United States
Location: Virginia

Thanks: 20 times
Thanks once again for your help. I hope to learn this language one day but until then expect that I will probably need you again soon when I move on to the next phase. Take care until then.
Users browsing this topic
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.