• JMap.User.hasPreference

    Check for a user preference existence. The returned Promise resolves with true if a value has been set for the user preference, else false. 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<boolean>

    a Promise that resolves with true if a value has been set for the user preference, else false

    Example

    let prefName = "jmapserver-ng-core-basemap"
    JMap.User
    .hasPreference(prefName)
    .then(hasPreferenceValue => console.log(`Preference item "${prefName}" exists: ${hasPreferenceValue.toString()}`))