Class: layertreeComponent component:gmfLayertreeComponent

gmf.layertreeComponent

new layertreeComponent()

This component creates a layertree based on the c2cgeoportal JSON themes source and a ngeo.layertreeComponent. The controller used by this component defines some functions for each node that are created by a default template. This default template can be overrided by setting the value 'gmf.layertreeTemplateUrl' but you will have to adapt the ngeoLayertreeTemplateUrl value too (to define the children's nodes template path).

Example:

 <gmf-layertree
   gmf-layertree-dimensions="ctrl.dimensions"
   gmf-layertree-map="ctrl.map">
 </gmf-layertree>

You can add an attribute 'gmf-layertree-openlinksinnewwindow="::true"' to open metadata URLs in a new window. By default, and in the default template, links will be opened in a popup.

Used UI metadata:

  • isChecked: if 'false' the layer visibility will be set to false.
  • iconUrl: layer icon full URL.
  • legendRule: WMS rule used to get a layer icon.
  • isLegendExpanded: if 'true' the legend is expanded by default.
  • metadataUrl: Display a popup with the content of the given URL if possible also open a new window.
HTML attributes:
Name Type Description
gmf-layertree-map ol.Map The map.
gmf-layertree-dimensions Object:.<string:, string:> | undefined Global dimensions object.
gmf-layertree-openlinksinnewwindow boolean | undefined if true, open metadataURLs in a new window. Otherwise open them in a popup.