JMap.Project.activateById
Activate a project on the map, for a given project id.
User session rigths are checked server side and an error is thrown if user doesn't have the access right for the project.
The JMap project id
a promise that is resolved when the project has been loaded successfully
JMap.Project.activateByName
Activate a project on the map, for a given project name.
User session rigths are checked server side and an error is thrown if user doesn't have the access right for the project.
the project
JMap.Project.deactivate
Deactivate the current displayed project. The map is destroyed.
After calling this method :
JMap.Project.existsById
Returns true if project exist for the given project id.
The JMap project id
JMap.Project.existsByName
Returns true if project exist for the given project name.
The JMap project name
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.
JMap.Project.getAllProjects
Returns a promise that returns all JMap projects descriptors when resolved.
If no project is loaded, returns empty array.
JMap.Project.getBackgroundColor
Returns loaded JMap project background color in html hexa format. This color is used as the background of the map.
JMap.Project.getBase64ImageThumbnail
Returns loaded JMap project base64 image thumbnail.
When JMap NG Core lib is started, it doesn't load projects thumbnails, but you can load it by setting the startup option "loadAllProjectThumbnails" as true.
If no thumbnail has been loaded it returns an empty string.
JMap.Project.getByName
Returns the project for the given project name.
The JMap project name
JMap.Project.getDefaultDistanceUnit
Returns the project distance unit, or "meters" if no distance unit is set on the project.
JMap.Project.getDescription
Returns loaded JMap project description.
JMap.Project.getId
Returns loaded JMap project id.
JMap.Project.getInitialExtent
Returns loaded JMap project initial extent. This is the extent that is automatically displayed when the project is opened.
JMap.Project.getInitialRotation
Returns loaded JMap project initial map rotation. This rotation is the one applied when the project is opened.
JMap.Project.getMapUnit
Returns the project map unit.
JMap.Project.getName
Returns loaded JMap project name.
JMap.Project.getProjection
Returns loaded JMap project projection.
In MapBox, projection is always "EPSG:3857", but that function returns the project defined projection (so it can be different than ESPG:3857).
JMap.Project.getSelectionColor
Returns loaded JMap project selection color in html hexa format.
This is the color that is used for selected features of layers that don't have a specific selection style defined.
JMap.Project.hasProjectActivated
Returns true if a JMap project is active, that means a project is selected and displayed on the map.
JMap.Project.isChangeDisabled
Returns true if the project change has been disabled by startup option "disableProjectChange" (see JCoreOptions).
Notice that as long the first project has not been loaded, this method returns false even if the parameter is true.
It becomes true, if option "disableProjectChange" is set to true, and a project has been activated.
JMap.Project.loadAllProjectThumbnails
Load all project thumbnails in the data store.
Default width is 348 and height 190.
Image is a base 64 formatted string.
width (0 < width < 1280) and height (0 < height < 720) for the thumbnails
JMap.Project.setChangeDisabled
Disables project change.
Can be used in a project extention for instance, to override the behaviour of this parameter inherited from startup options for the current user session.
JMap.Project.setChangeEnabled
Enables project change.
Can be used in a project extention for instance, to override the behaviour of this parameter inherited from startup options for the current user session.
JMap.Project
From this section you can manage the project that is in use in the JMap NG Core library.