• JMap.User.getPreference

    Get a user preference value from user storage. The returned Promise resolves to the value, else null if no preference has been set. Rejects on error, or if name parameter is not string or empty string, or if no user is logged in

    Parameters

    • name: string

      the name of the preference

    Returns Promise<string | null>

    a Promise that resolves with the value from the user storage (or null if the preference is not set).

    Example

    let prefName = "jmapserver-ng-core-basemap"
    JMap.User
    .getPreference(prefName)
    .then(preferenceValue => console.log(`Preference item "${prefName}" value is "${preferenceValue}"`))
    .catch(reason => console.log(`Cannot get the preference value of param "${prefName}". Reason: ${reason}`))