Configuring Siebel Open UI > Siebel Open UI Application Programming Interface > Methods for Pop-Up Objects, Google Maps, and Property Sets >

Method That Integrates Google Maps


This topic describes the method that Siebel Open UI uses to integrate with Google Maps. It includes the following topics:

The Integration with Maps and Location service allows the user to view CRM data on a map and get driving directions and other information. If the user taps the postal code of the contact or account address, then Siebel Open UI displays a Google map that includes the address and step-by-step information that describes how to navigate from the current location to the location that the postal code identifies.

This service can get a list of accounts, contacts, or opportunity addresses from the record set that the list applet contains, and then display these addresses in a map. The list view displays distance information from the current location. The map view includes pins on the map that indicate the current location and location of all objects that fall within a radius from the geographic location where the user is currently situated. If the user clicks a pin, then Siebel Open UI does something depending on the following type of information that the pin represents:

  • Opportunity or account. Navigates the user to details of the record.
  • Contact. Allows the user to make a telephone call, send an email, or view contact details.

Siebel Open UI uses the google-ui-map plug-in. It includes the following methods in the JQMMapCtrl class:

  • GetInlineRoute
  • ShowMapLocations
  • Integration with Maps and Location

GetInlineRoute Method

The GetInlineRoute method does the following work:

  • Dynamically loads the Google map method.
  • Gets the current location of the device or browser.
  • Draws the route. It uses the current location as the starting point and the account location as the destination.

It includes the DestValue argument. This argument identifies the postal code or address of an account, contact, or opportunity.

Siebel Open UI calls the predefined GetInlineRoute method from a form applet, but you can customize it to use a list applet. The Integration with Maps and Location service creates a link that includes an image and a bind click event that references the control link that calls the GetInlineRoute method. It gets the postal code value from the record that the user chooses in the form applet, and then sends the value when it calls the GetInlineRoute method in the JQMMapCtrl class. Siebel Open UI must load the Google method before it calls the GetInlineRoute method. It includes the URL for the Google method when it loads the JQMMapCtrl class.

Flow That the GetInlineRoute Method Uses

The GetInlineRoute method uses the following flow:

  1. Makes sure the Web template file includes a map div element.
  2. Calls the LoadAPI method.
  3. Dynamically loads the Google map method. The Google map method is not downloadable so it dynamically loads the map method when it initializes the JQMMapCtrl class.
  4. Calls the LoadMap method.
  5. Removes all markers, overlays, and services from the map div element.
  6. Creates a Google map in the div element. It uses the div element that it created in the web template. It uses the google-ui-map plug-in to create this element in Step 4.
  7. It sends the name of the jqmMapCtrl div element to the plug-in to draw the map.
  8. Uses the getCurrentPosition method to get the current geocode of the client device. This method is available through the navigator.geolocation object. A geocode is an object that stores the geographic coordinates of a location expressed as latitude and longitude.
  9. Displays the GPS geocode of the current position. It does this only if the browser supports GPS (Global Positioning System). If the browser does not support GPS, or if GPS is not available, then Siebel Open UI sets the current location to Oracle headquarters at 500 Oracle Parkway, Redwood Shores, CA 94065. The following browsers support GPS:
    • Internet Explorer version 9.0
    • Firefox version 3.5
    • Chrome version 5.0
    • Safari version 5.0
    • Opera version 10.60
  10. Calls the GetAcctDirections method. It uses the following arguments of the GetAcctDirections method during this call:
    • mapCanvas. Identifies the div element where Siebel Open UI draws the map.
    • currentLocation. Identifies the device GPS location. If the browser does not support GPS or if GPS is not available, then it uses the Oracle headquarters address.
    • acctDestination. Identifies the postal code or address from the account, contact or opportunity record.
  11. Draws the route from the currentLocation to acctDestination. For example:

ShowMapLocations Method

The ShowMapLocations method loads the Google map method, initializes the geocoder service to get the geocode of the address, and creates a marker for each location that the array contains.

It uses the AcctArray method. This method gets the address or postal code of all account, contact, or opportunity addresses from the record set that the list applet displays.

Siebel Open UI can call the ShowMapLocations method from a list applet. You can create a button or link control, and then bind a click event with the control so that this event calls the method. The ShowMapLocations method uses jqmListRenderert to do the following work:

  • Loop through the record set that the list applet contains
  • Determine the columns that are available
  • Add the nonnull value of each address field in the record to create the full address.
  • Add the address to the array.

You can bind the ShowMap button control in the web template with the click event in jqmListRenderer, and then configure Siebel Open UI to use the account array to call the ShowMapLocations method in the JQMMapCtrl class.

Flow That the ShowMapLocations Method Uses

The ShowMapLocations method uses the following flow:

  1. Calls the LoadAPI method that loads the Google map method. The Google map method is not downloadable, so Siebel Open UI loads it when it initializes the JQMMapCtrl class and provides the LoadMap as a callback method. For more information, see Coding Callback Methods.
  2. Calls the LoadAcctsMap method, which does the following work:
    1. Gets the current geocode of the client device.
    2. Gets the address of the location so that it can display this address in the Info Window.
    3. Creates the Google map in the div element. It uses the div element that it created in the web template. It used the google-ui-map plug-in to create this element.
    4. Starts an instance of the Geocoder service.
    5. Does the following work for each address that the AcctArray method includes:
      • Gets the geocode of the address.
      • Sets the marker Position according to the geocode.
      • Calls the addMarker method to map all markers that the map div element contains.

Calling Methods That the Integration with Maps and Location Method Uses

You can call methods that the Integration with Maps and Location method uses from a form applet or list applet in the following way:

  1. Initialize the JQMMapCtrl class.
  2. Configure Siebel Open UI so that it sends a single account address or postal code and then binds it to an event that calls the GetInlineRoute method.

    Siebel Open UI comes predefined to bind the anchor control for the postal code field to a click event. Siebel Open UI displays the postal code field as an icon next to the control. It uses this configuration only for form applets.

    To configure a list applet, you must also do the following work:

    1. Prepare the account array that stores the addresses or postal codes and bind it to an event that Siebel Open UI can call from a ShowMapLocations method. Siebel Open UI comes predefined to concatenate the values of Street Address, City and State fields, and then set the nonnull values that the array contains. It does this so that it can send the array to the method.
    2. Create a link or button that calls the method.

Siebel Open UI uses the Google-ui-map plug-in to render the Google map. This plug-in requires a div id to display the map. This div element can reside in any container. The CCViewDetailMap_Mobile.swt file supports list and map rendering. It contains the following code. It uses the jqmMapCtrl div id to render the Google map:

<swe:if condition="Web Engine State Properties, IsMobileApplicationMode">
  <div id="SiebelMapContainer" name="SiebelMapContainer"
  style="display:none;">
  <div id="jqmMapCtrl" name="jqmMapCtrl"></div>
  </div>
</swe:if>

Configuring Siebel Open UI Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Legal Notices.