Rank: Advanced Member
Groups: Registered
Joined: 5/23/2016(UTC) Posts: 129 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,
|
|
|
|
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
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 5/23/2016(UTC) Posts: 129 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.
|
|
|
|
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.
|
|
|
|
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 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 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
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 5/23/2016(UTC) Posts: 129 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.
|
|
|
|
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?
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 5/23/2016(UTC) Posts: 129 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.
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 5/23/2016(UTC) Posts: 129 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.
|
|
|
|
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.
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 5/23/2016(UTC) Posts: 129 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
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 5/23/2016(UTC) Posts: 129 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 ","
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 5/23/2016(UTC) Posts: 129 Location: Virginia Thanks: 20 times
|
string-join($MT_GEOLOCATION/Root/Location/@Latitude), ($MT_GEOLOCATION/Root/Location/@Longitude)
is also returning 37.3598504 -77.9551039
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 5/23/2016(UTC) Posts: 129 Location: Virginia Thanks: 20 times
|
string($MT_GEOLOCATION/Root/Location/@Latitude), ($MT_GEOLOCATION/Root/Location/@Longitude)
also returns 37.3598504 -77.9551039
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 5/23/2016(UTC) Posts: 129 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()
|
|
|
|
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
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 5/23/2016(UTC) Posts: 129 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.
|
|
|
|
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.
|
1 user thanked bbv for this useful post.
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 5/23/2016(UTC) Posts: 129 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.
|
|
|
|
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.