User Manual

Set Map Provider

15/10/26
Set Map Provider

The Set Map Provider action determines which map provider the end user will use in the application. It is used on screens that allow the user to change their map preference to save the selected provider.

Technical Specifications

  • Save User Preference: Sets the end user’s map provider preference to Google Maps or Amap.
  • Dynamic Usage: The provider value can be entered as a constant or retrieved dynamically from an element (e.g., SelectBox).
  • Web & Mobile Support: Can be used in both web and mobile applications.
To use this action, the Let end users choose the map provider option must be enabled in the Maps setting in Config Manager, and both Google Maps and Amap configurations must be defined.

Steps to Implement the “Set Map Provider” Action

1. Defining the Action in UI Design

  1. Log in to the Kuika platform.
  2. Open the project you’ll be working on from the Apps screen.
  3. Switch to the UI Design module.
  4. Select the screen or element (e.g., a SelectBox or button) where you want to add the action.
  5. In the Properties panel on the right, click the + button next to the Actions heading.
  6. In the window that opens, type “set map” in the search field or select the Geolocation category from the Category list.
  7. Select the Set Map Provider action and add it.

2. Configuring Action Parameters

  • Provider (String): The map provider to be set for the end user. It must be one of the following values:
    • GoogleMaps
    • Amap

You can enter the value directly as a Fixed Value or click the magic wand icon to retrieve it dynamically from an element (e.g., the selected value of a SelectBox).

Use Case: User Changing Map Preference

On a settings screen, the end user is prompted to select a map provider via a SelectBox, and this preference must be saved.

Application Flow:

  1. Switch to the UI Design module.
  2. Drag and drop a SelectBox element onto the screen from the Elements panel (e.g., selectMapProvider).
  3. Define the SelectBox options with values set to GoogleMaps and Amap.

Action Flow and Configuration:

  1. To display the current preference, add the Get Map Provider and then the Set Value actions to the screen’s pageInit actions (see Get Map Provider Action).
  2. Add the Set Map Provider action to the actions that run when the SelectBox value changes.
  3. Pass the selected value of the selectMapProvider element to the Provider parameter.

When the user selects a new map provider from the SelectBox, the preference is saved, and maps in the app are displayed using the selected provider.

Set Map Provider Action: Advanced Customizations

  • Saving with a Button: If you want the preference to be saved when the user confirms it rather than immediately, you can add the action to the OnClick event of a “Save” button instead of the SelectBox.
  • Information Message: You can add a “Notify” action after the “Set Map Provider” action to inform the user that their preference has been saved.

Technical Risks and Controls

  • Invalid Value: If a value other than “GoogleMaps” or “Amap” is provided for the “Provider” parameter, the preference may not be saved. Use the exact same spelling for the values, including uppercase and lowercase letters.
  • Configuration Missing: If the configuration for the selected provider is not defined in Config Manager, the map may not display.

The “Set Map Provider” action gives end users the flexibility to choose a map provider and allows you to personalize the app experience for users working in different regions or with different preferences.

No items found.

Other Related Content

No items found.

Glossary

No items found.

Alt Başlıklar