• JMap.MapContext.update

    Updates a map context, saves the current map context data.

    The map-context update is persisted server-side.

    You can provide partial meta-data (= data that describes the context), if a meta-data is not provided, it will not be changed.

    Parameters

    • contextId: JId

      the JMap map context id

    • Optional params: JMapContextMetaData

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

    Returns Promise<JMapContext>

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