Skip to content

Commit

Permalink
When parcel is selected add the layer from the current theme
Browse files Browse the repository at this point in the history
  • Loading branch information
rmichaelis committed Jul 25, 2024
1 parent 6ab881f commit 28ac35b
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ const exports = function($scope, $window, $compile,
this.layerLookup_ = {
'Adresse': ['addresses'],
'Parcelle': ['parcels', 'parcels_labels'],
'Parcelle_go': ['parcels_go', 'parcels_labels_go'],
'Parcelle_prof': ['parcels_prof', 'parcels_labels'],
'lieu_dit': ['toponymes'],
'FLIK': ['asta_flik_parcels'],
'FLIK_Provisoire': ['asta_flik_parcels_provisoire'],
Expand Down Expand Up @@ -927,8 +929,13 @@ exports.selected_ =
if (arrayIncludes(this.showGeom_, feature.get('layer_name'))) {
features.push(feature);
}
var cur_suggestion_layer = suggestion.get('layer_name');
if (cur_suggestion_layer === 'Parcelle' &&
arrayIncludes(['go', 'prof'], this.appTheme_.getCurrentTheme())) {
cur_suggestion_layer = cur_suggestion_layer + '_' + this.appTheme_.getCurrentTheme();
}
var layers = /** @type {Array<string>} */
(this.layerLookup_[suggestion.get('layer_name')] || []);
(this.layerLookup_[cur_suggestion_layer] || []);
layers.forEach(function(layer) {
this.addLayerToMap_(/** @type {string} */ (layer));
}.bind(this));
Expand Down

0 comments on commit 28ac35b

Please sign in to comment.