Map Engine Implementation

The default map engine for the Store Locator feature is Google Maps.

The following JavaScript facade pattern is used to implement Google Maps. This facade can also be used as a guideline to integrate a different map engine.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

The facade features the following modules and files:

Google Maps Platform Terms of Service

To use the Google Maps API, you must agree to Google’s license terms, obtain a Google Maps API key, and provide this key to NetSuite.

Note:

A standard Store Locator configuration means that your website complies with Google’s licensing terms. However, you must ensure that your website policies and any customizations you make to the Store Locator feature do not break the Google Maps Platform terms.

Key points in the Google Maps Platform Terms of Service include:

Refer to the Google Maps Platform Terms of Service for the complete list of the Google Maps Platform terms.

Important:

The Google Maps Platform is free for a wide variety of use cases. However, if you have a high-traffic website, be aware of Google Maps Platform usage limits. You can purchase a premium license from Google or you can enable Google billing for high-traffic websites. See Google Maps Platform pricing for current Google Maps pricing and plan details. To monitor daily maps usage, use the Google API Dashboard.

Implementing Different Map Engines

Suite Commerce Advanced (SCA) provides a way to implement different map engines.

Note:

The following procedure uses XyzMap as an example. You can use the existing GoogleMap.js and Google.Configuration.js files as a template to create a new map engine implementation.

To integrate a different map engine:

  1. Create a new module to replace the StoreLocatorGoogleMapsImplementation module. This new module must define the specific map engine implementation. The new module could be called StoreLocatorXyzMapImplementation.

  2. Within this new module, create a new implementation file called XyzMap.js, where Xyz is the name of the map engine you are implementing. This file will contain all the implementation logic required to make the specific map engine function with SCA. This file must define ReferenceMap as a dependency and implement all the functions defined as required for the map engine.

  3. Create a new Xyz.Configuration.js file. This file will serve as the facade for the map engine configuration options. This file must define ReferenceMap.Configuration as a dependency and implement all the functions defined that are required for the map engine.

  4. Edit the distro.json file to reference your new module. Store Locator supports only one map engine, so you must delete code that references StoreLocatorGoogleMapsImplementation or disable it behind comment tags. For example, your edited distro.json code might look like this:

                    "suitecommerce/StoreLocatorXyzMapImplementation": "1.0.1",
    //"suitecommerce/StoreLocatorGoogleMapsImplementation": "1.0.1", 
    
                  

    See The distro.json and ns.package.json Files for information about the distribution file and its location.

  5. Save and redeploy the distro.json file to NetSuite. For more information, see Deploy SCA Customizations to NetSuite.

Related Topics

Store Locator
Set up Store Locator in NetSuite
Configure Store Locator Properties

General Notices