Feature Pack 4

Integrating with map service providers

Smart phone and tablet starter stores can be customized to integrate with map service providers, providing enhanced searching and displaying capabilities on the store locator and e-flyer pages.

Integrating with map service providers provides the following enhancements:
  • Store locations can be found by entering a ZIP/Postal code into the search fields. This advanced level of location searching enables the customer to find stores relative to any location of their choice.
  • A map of the area can be displayed on the store locator page, where the store locations are labelled on the map. Multiple store locations labelled on the map enable the customer to quickly locate the most convenient store location.
  • Mobile phones equipped with Global Positioning System (GPS) functionality can use the store locator to find store locations based on their current geographic location.
Note: A strong understanding of your map service provider's API is important in successfully integrating its enhancements into the store locator.

Before integrating using one of the following approaches, ensure that you have completed the map service provider's sign-up process to obtain a key, application ID, or other service-specific identifier.

Enabling GPS support

  1. Implement the GPSSupport.jspf file into the JSP file that you want to implement the GPS support.
  2. Detect if GPS support is enabled for the current device.
  3. Display a button that uses the current location to perform the store location search.
  4. Before invoking the mStoreLocatorResultView:
    1. Set the geoCodeLatitude parameter to the current location's latitude value.
    2. Set the geoCodeLongitude parameter to the current location's longitude value.

Integrating with the geocoder API

  1. Implement the SearchZipCode.jspf file into the JSP file that you want to implement the geocoder API.
  2. Obtain the user input from the zipOrCity JSTL variable and invoke the geocode API using this input.
  3. Parse or obtain the latitude and longitude values returned by the API provider.
  4. Set the geoCodeLatitude JSTL variable to contain the resulting latitude value.
  5. Set the geoCodeLongitude JSTL variable to contain the resulting longitude value.

Integrating with a static map

  1. Implement the ShowMap.jspf file into the JSP file that you want to implement the static map.
  2. Locate the store_map_image div where the image file is displayed.

    For example:

    
    <div id="store_map_image">
    <img src="" width="238" height="184" alt="${physicalStores[i].physicalStoreIdentifier.externalIdentifier} Map" />
    </div>
  3. Set the value of the image src attribute to contain the static map URL. In the preceding code sample, the image src attribute contains a null value "" by default.

Integrating with specific mobile devices

iPhone
  1. Update the ViewMap.jspf file to contain the required logic to invoke the default iPhone maps application.
  2. Detect the devices as an iPhone.
  3. Obtain the store location information from the store location variable. For example, physicalStores[i].locationInfo.address.addressLine[0] returns address line 1 of the store location.
  4. Construct the Google Maps URL.
BlackBerry
  1. Update the ViewMap.jspf file to contain the required logic to invoke the default BlackBerry maps application.
  2. See the manufacturer's documentation to add device-specific support for Blackberry devices.