Using Bing Maps to Calculate Worker Distance from Alarms

 

When using alarms with location information, it's possible to calculate the worker distance from the alarm using Bing Maps. This obtains the distance and time required to travel via the best route. In the previous version of CFSWorX, the distance was a simple straight-line calculation between the alarm and each worker. As with the previous version, you must still collect the worker location data using the MobileHMI CFSWorX feature.

 

To use Bing Maps, you must follow these steps:

  1. You must get a Bing MAPS key. Follow these instructions:

https://github.com/Microsoft/BingMapsRESTToolkit/blob/master/Docs/Getting%20Started.md#CreatingABingMapsKey

  1. Enter the Bing Maps Key into the environment variable “Ico_Cfs_BingMapsKey”. Follow these detailed instructions.
    Note: The next steps require the Windows Environment Variables to be changed for the user running the CFSWorX Services. To do this, we must sign into Windows as that account.

    1. Log into Windows as the user configured to run the ICONICS Connected Field Worker Point Manager service (FwxWorkerAccessService).

    2. Open Windows Settings.

    3. Search for “Environment Variables”.

    4. Select “Edit environment Variables for your account”.

    5. Add the following variable and its value:

Ico_Cfs_BingMapsKey - the value should be the Bing Maps API Key that you generated previously.

 

Note: It is very important that the environment variables and the services are under the same user, if not they will not be read by the service correctly.

  1. Now restart the Worker Access Point Manger.

  2. Now any Worker Lookup activity in a workflow that includes the location information will retrieve the workers sorted by the distance that is acquired from Bing Maps. This distance represents the shortest driving route.

  3. If you wish to discontinue using Bing Maps, simply delete the environment variable and restart Worker Access Point Manager.

See Also:

Setting Up Mobile Device Health