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
- Implement the GPSSupport.jspf file into the JSP file that you want to implement the GPS support.
- Detect if GPS support is enabled for the current device.
- Display a button that uses the current location to perform the store location search.
- Before invoking the mStoreLocatorResultView:
- Set the
geoCodeLatitude
parameter to the current location's latitude value. - Set the
geoCodeLongitude
parameter to the current location's longitude value.
- Set the
Integrating with the geocoder API
- Implement the SearchZipCode.jspf file into the JSP file that you want to implement the geocoder API.
- Obtain the user input from the
zipOrCity
JSTL variable and invoke the geocode API using this input. - Parse or obtain the latitude and longitude values returned by the API provider.
- Set the
geoCodeLatitude
JSTL variable to contain the resulting latitude value. - Set the
geoCodeLongitude
JSTL variable to contain the resulting longitude value.
Integrating with a static map
- Implement the ShowMap.jspf file into the JSP file that you want to implement the static map.
- 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>
- 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
- Update the ViewMap.jspf file to contain the required logic to invoke the default iPhone maps application.
- Detect the devices as an iPhone.
- 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. - Construct the Google Maps URL.
- BlackBerry
- Update the ViewMap.jspf file to contain the required logic to invoke the default BlackBerry maps application.
- See the manufacturer's documentation to add device-specific support for Blackberry devices.