Options
All
  • Public
  • Public/Protected
  • All
Menu

Module Thematic

JMap.Layer.Thematic

Methods used to manage thematics for a layer.

Index

Functions

existsById

  • existsById(layerId: JId, thematicId: JId): boolean
  • JMap.Layer.Thematic.existsById

    Returns true if the thematic exists for the given layer and thematic ids, false otherwise.

    example
    
    // test for thematic existence
    JMap.Layer.Thematic.existsById(4, 3)
    // false

    Parameters

    • layerId: JId

      The JMap layer id

    • thematicId: JId

      The thematic id

    Returns boolean

getAllByLayerId

  • JMap.Layer.Thematic.getAllByLayerId

    Returns all thematics for the specified layer.

    throws

    Error if no layer found for the id, or if the layer is a layer group.

    example
    
    // returns all thematics of layer id=4
    JMap.Layer.Thematic.getAllByLayerId(4)

    Parameters

    • layerId: JId

      The JMap layer id

    Returns JLayerThematic[]

getAllVisibleByLayerId

  • JMap.Layer.Thematic.getAllVisibleByLayerId

    Returns layer thematics that are currently displayed on the map.

    throws

    Error if no layer found for the id, or if the layer is a layer group.

    example
    
    // returns the thematic(s) that are displayed on he map for layer id=4
    JMap.Layer.Thematic.getAllVisibleByLayerId(4)

    Parameters

    • layerId: JId

      The JMap layer id

    Returns JLayerThematic[]

getById

  • JMap.Layer.Thematic.getById

    Returns a specific layer thematic.

    throws

    Error if no layer found for the id, if the layer is a layer group, or if the thematic doesn't exist.

    example
    
    // returns thematic id=3 of layer id=4
    JMap.Layer.Thematic.getById(4, 3)

    Parameters

    • layerId: JId

      The JMap layer id

    • thematicId: JId

      The thematic id

    Returns JLayerThematic

getFamilyTypeById

  • JMap.Layer.Thematic.getFamilyTypeById

    Returns the family of the specified layer thematic

    throws

    Error if layer or thematic is not found, or if an invalid param is provided

    example
    
    // returns the family of thematic id=3 of layer id=7
    let family = JMap.Layer.Thematic.getFamilyTypeById(
       layerId: 7,
       thematicId: 3
     )
    console.log(family)
    // "Classification"

    Parameters

    • layerId: JId

      The JMap layer id

    • thematicId: JId

      The thematic id

    Returns JLAYER_THEMATIC_FAMILY_TYPES

hasAnyVisibleByLayerId

  • hasAnyVisibleByLayerId(layerId: JId): boolean
  • JMap.Layer.Thematic.hasAnyVisibleByLayerId

    Returns true if the layer has at least one thematic displayed on the map.

    throws

    Error if no layer found for the id, or if the layer is a layer group.

    example
    
    // returns false if no thematic is displayed for layer id=4
    JMap.Layer.Thematic.hasAnyVisibleByLayerId(4)

    Parameters

    • layerId: JId

      The JMap layer id

    Returns boolean

setAllCategoriesVisibility

  • setAllCategoriesVisibility(layerId: JId, thematicId: JId, visibility: boolean): void
  • JMap.Layer.Thematic.setAllCategoriesVisibility

    Shows or hides all thematic categories of a layer on the map

    throws

    Error if layer or thematic is not found, or if an invalid param is provided

    example
    
    // Hide all categories of thematic id=3 of layer id=7
    JMap.Layer.Thematic.setAllCategoriesVisibility(
       layerId: 7,
       thematicId: 3,
       visibility: false
     )

    Parameters

    • layerId: JId

      The JMap layer id

    • thematicId: JId

      The thematic id

    • visibility: boolean

      true to show, false to hide

    Returns void

setAllConditionsVisibility

  • setAllConditionsVisibility(layerId: JId, thematicId: JId, visibility: boolean): void
  • JMap.Layer.Thematic.setAllConditionsVisibility

    Shows or hides all thematic conditions of a layer thematic on the map

    Works only for JMap Cloud server, on style rule based thematics.

    throws

    Error if layer or thematic is not found, or thematic is not a style rule thematic, or if an invalid param is provided

    example
    
    // Hide all conditions of thematic id="ac7b197c-ca14-4295-b349-8cba6a4dc631" of layer id="53ff7632-0d5e-497a-a1b0-25ce3f941023"
    JMap.Layer.Thematic.setAllConditionsVisibility(
       layerId: "53ff7632-0d5e-497a-a1b0-25ce3f941023",
       thematicId: "ac7b197c-ca14-4295-b349-8cba6a4dc631",
       visibility: false
     )

    Parameters

    • layerId: JId

      The JMap layer id

    • thematicId: JId

      The thematic id

    • visibility: boolean

      true to show, false to hide

    Returns void

setCategoryVisibility

  • JMap.Layer.Thematic.setCategoryVisibility

    Shows or hides a specific layer thematic category on the map.

    throws

    Error if layer or thematic is not found, or if an invalid param is provided

    example
    
    // Hide the first category of thematic id=3 of layer id=7
    JMap.Layer.Thematic.setCategoryVisibility({
       layerId: 7,
       thematicId: 3,
       categoryIndex: 0,
       visibility: false
     })

    Parameters

    Returns void

setConditionVisibility

  • JMap.Layer.Thematic.setConditionVisibility

    Shows or hides a specific layer thematic condition on the map.

    Works only for JMap Cloud server.

    throws

    Error if layer or thematic is not found, or thematic is not a style rule thematic, or if an invalid param is provided

    example
    
    // Hide condition of thematic id="ac7b197c-ca14-4295-b349-8cba6a4dc631" of layer id="53ff7632-0d5e-497a-a1b0-25ce3f941023"
    JMap.Layer.Thematic.setConditionVisibility({
       layerId: "53ff7632-0d5e-497a-a1b0-25ce3f941023",
       thematicId: "ac7b197c-ca14-4295-b349-8cba6a4dc631",
       conditionId: "ac7b197c-ca14-4295-b349-8cba6a4dc631",
       visibility: false // false to hide, true to show
     })

    Parameters

    Returns void

setThematicsVisibility

  • JMap.Layer.Thematic.setThematicsVisibility

    Shows or hides multiple layer thematics on the map

    throws

    Error if any layer or thematic are not found

    example
    
    // Display the thematic id=3 of layer id=7, and hide the thematic id=1 of layer id=14
    JMap.Layer.Thematic.setThematicsVisibility([
       {layerId: 7, thematicId: 3, visibility: true},
       {layerId: 14, thematicId: 1, visibility: false}
    ])

    Parameters

    Returns void

setVisibilityById

  • setVisibilityById(layerId: JId, thematicId: JId, visibility: boolean): void
  • JMap.Layer.Thematic.setVisibilityById

    Shows or hides a layer thematic on the map

    throws

    Error if layer or thematic is not found

    example
    
    // Display the thematic id=3 of layer id=7
    JMap.Layer.Thematic.setVisibilityById(7, 3, true)
    
    // Hide the thematic id=3 of layer id=7
    JMap.Layer.Thematic.setVisibilityById(7, 3, false)

    Parameters

    • layerId: JId

      The JMap layer id

    • thematicId: JId

      The thematic id

    • visibility: boolean

      true to show, false to hide

    Returns void