Skip to content

Commit

Permalink
Add structure element cssClass
Browse files Browse the repository at this point in the history
  • Loading branch information
coastforge-mei committed Dec 27, 2024
1 parent 188dd3c commit f4d74d2
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 6 deletions.
3 changes: 3 additions & 0 deletions src/Classes/Services/LayerContentService.php
Original file line number Diff line number Diff line change
Expand Up @@ -1042,6 +1042,7 @@ protected function createGeoJsonResult($objLayer, $strPopupTable = '', $lang = '
'loc_linkurl' => Utils::replaceInsertTags($objLayer->loc_linkurl ?: '', $lang),
'hover_location' => $objLayer->hover_location,
'hover_style' => $objLayer->hover_style,
'cssClass' => $objLayer->cssClass,
],
];

Expand Down Expand Up @@ -1102,6 +1103,7 @@ protected function createGeoJsonResult($objLayer, $strPopupTable = '', $lang = '
'tooltip' => Utils::replaceInsertTags($objLayer->tooltip ?: '', $lang),
'tooltip_length' => $objLayer->tooltip_length,
'label' => Utils::replaceInsertTags($objLayer->loc_label ?: '', $lang),
'cssClass' => $objLayer->cssClass,
];
} elseif ($data) {
// OL3 needs a feature or feature-collection
Expand All @@ -1121,6 +1123,7 @@ protected function createGeoJsonResult($objLayer, $strPopupTable = '', $lang = '
'loc_linkurl' => Utils::replaceInsertTags($objLayer->loc_linkurl ?: '', $lang),
'hover_location' => $objLayer->hover_location,
'hover_style' => $objLayer->hover_style,
'cssClass' => $objLayer->cssClass,
],
];
}
Expand Down
4 changes: 2 additions & 2 deletions src/Classes/Services/LayerService.php
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,7 @@ protected function getLayerList($intId, $lang, $blnIsSubLayer = false)
}
}
if ($arrGetLayerData = $this->parseLayer($objLayers, $lang)) {
$arrLayerData = $arrGetLayerData;//$this->parseLayer($objLayers);
$arrLayerData['cssClass'] = $objLayers->cssClass;
$arrLayerData = $arrGetLayerData;

if ($childLayerList = $this->getLayerList($arrLayerData['id'], $lang, true)) {
$arrLayerData['hasChilds'] = true;
Expand Down Expand Up @@ -365,6 +364,7 @@ public function parseLayer($objLayer, $lang)
$arrLayerData['locstyle'] = $objLayer->locstyle;
$arrLayerData['initial_opened'] = $objLayer->initial_opened;
$arrLayerData['zIndex'] = $objLayer->zIndex;
$arrLayerData['cssClass'] = $objLayer->cssClass;

if ($objLayer->cluster_locations) {
$arrLayerData['cluster'] = [
Expand Down
12 changes: 8 additions & 4 deletions src/Resources/public/js/c4g-layer-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -654,7 +654,8 @@ export class BetterLayerController {
collapsed: !parseFloat(layer.initial_opened),
greyed: layer.zoom && !this.compareZoom(layer.zoom),
id: layer.id,
childStates: childStates
childStates: childStates,
cssClass: layer.cssClass,
}
}
getFeaturesFromStruct(structure) {
Expand Down Expand Up @@ -799,7 +800,8 @@ export class BetterLayerController {
"key" : layer.key,
"name" : features[featureId].get(nameField),
"hide" : hide,
"childs" : []
"childs" : [],
"cssClass" : layer.cssClass
})
}
}
Expand Down Expand Up @@ -905,7 +907,8 @@ export class BetterLayerController {
"id" : features[featureId].get("positionId"),
"key" : layer.key,
"name" : features[featureId].get(nameField),
"childs" : []
"childs" : [],
"cssClass" : layer.cssClass,
});
arrLayers[index].ignoreChilds = true;
arrLayerStates[index].childStates.push({
Expand Down Expand Up @@ -1153,7 +1156,8 @@ export class BetterLayerController {
"tags" : layer.tags,
"hide" : hide,
"childs" : childs,
"zoomTo" : layer.zoomTo
"zoomTo" : layer.zoomTo,
"cssClass" : layer.cssClass,
};
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,9 @@ export class C4gStarboardLayerElement extends Component {
if (this.props.layerStates.greyed) {
cssClass += " " + cssConstants.DISABLED;
}
if (this.props.layer.cssClass) {
cssClass += " " + this.props.layer.cssClass;
}
let openClose = this.props.layerStates.collapsed ? cssConstants.CLOSE : cssConstants.OPEN;
let objChilds = this.props.layer.childs;
let linkText;
Expand Down

0 comments on commit f4d74d2

Please sign in to comment.