• JMap.Project.getActiveProject

    Returns the active project (the one displayed on the map).

    If no project is active, the object returned has an id equals to -1.

    Returns JProject

    Example

    // returns the active project
    const activeProject = JMap.Project.getActiveProject()
    if (activeProject.id === -1) {
    console.info("No active project")
    } else {
    console.info(`Active project is "${activeProject.name}"`)
    }