• JMap.MapContext.updateMetaData

    Updates a map context meta-data (= data that describe the context), without changing the map data.

    The map context map's data will not be changed, for that use JMap.MapContext.update function.

    The map-context meta-data is persisted server-side.

    You can provide partial meta-data, if a meta-data is not provided it will not be changed.

    Parameters

    • contextId: JId

      the JMap map context id

    • data: JMapContextMetaData

      partial map context meta-data, only data provided will be updated

    Returns Promise<void>

    the updated map context

    Throws

    if context not found, or empty or invalid meta-data, or server request error

    Example

    // update the map-context id=3 meta-data
    JMap.MapContext
    .updateMetaData(3, { // only "title" and "description" meta-data will be changed, "shareLink" keep the same
    title: "My new title",
    descritpion: "My new description"
    })
    .then(mapContext => console.info(`Map context id=3 "title" and "description" updated.`, mapContext))
    .catch(error => console.error(error))