RFgen 5.1 Insider Preview

Google Maps Integration and Route Planning

In our previous Spotlight, we introduced the Google Geo-Location and Tagging Support functionality that’s available with the new Map control in the RFgen 5.1, Mobile Development Studio. This Spotlight continues to share how to use the Map control to create a mapping and routing application. If your operations include transporting goods to or from multiple locations, the Google Maps Integration and Route Planning feature could be a time-saver for you. For example, if you have workflows that require users to manually enter addresses for routine routes, you can use this Map control to create an application that:

  • Calculates the most efficient route from a set of addresses or GPS coordinates.
  • Maps the route while the user is connected to the Internet.
  • Generates driving directions for each stop.

Google Maps Route Planning App on an iPad

Route Planning

Google Maps Delivery Directions App on an iPad

Delivery Directions

 

Key Benefits

  • Reduces the manual effort required to plan routes.
  • Integrates Google maps where needed in your applications.
 

Route Plan Implementation Example

The following is a sample script used to generate a routine delivery route plan for a fictitious auto service and parts delivery company.

vector-google-maps-route-planning-ipad.png Google Maps Route Plan Code Sample

All geo-location/mapping APIs are implemented on the Map prompt.

To plan a delivery route, you call the PlanRoute method on the Map interface of the Map prompt. The API will take the addresses passed into the Points variable, calculate the best route, and then return the addresses in the proper sequence in the string array that was passed into the PlanRoute method. The PlanRoute method also needs the address where the delivery starts and finishes.

The last Boolean variable on the PlanRoute API tells the mapping engine to generate a map. If True is passed into the method called, the engine will display an interactive map in the image view of the prompt. The user can then zoom in or out, or reposition the map by using the appropriate icon.

 

Delivery Directions Implementation Example

The Delivery Directions Implementation Example works very similar to the Route Plan Implementation Example. To get the delivery directions, you pass the origin and destination addresses into the Map prompt map object via the GetDirections method.

Google Maps Dirving Directions App on an iPad Google Maps Delivery Directions Code Sample

In the Delivery Directions Implementation Example, the origin address “Services, 200 Plaza Dr. Folsom, CA 95630, USA “ is passed in the first parameter, txtOrig.Text, and the destination is passed in the second parameter, txtDest.Text. The third parameter, sDirs, is the line-by-line driving instructions. The last Boolean parameter just like the route plan is used to determine if a map should be displayed. 

 

Google Mapping Key

The Google Maps Integration requires the user to sign up for a Google Maps APIs account and obtain a Google Maps API Key. Once the key has been obtained, in your RFgen Mobile Development Studio, add it to: Configuration > Environmental Properties – Google Integration.

To learn more about obtaining an activation license key, go to Google Maps APIs Pricing and Plans and click on “Paid”.

Google Integration Map Keys

 

Clean & Elegant
Fully Responsive
Clean & Elegant
Fully Responsive
Clean & Elegant
Fully Responsive