diff --git a/loko/assets/static/assets/asset_symbology.js b/loko/assets/static/assets/asset_symbology.js index 062d392..949baa3 100644 --- a/loko/assets/static/assets/asset_symbology.js +++ b/loko/assets/static/assets/asset_symbology.js @@ -427,6 +427,33 @@ glyphCodepoint: 'f82b', mapImage: 'icon-sign', }, + + // ITS + itsgeoasset: { + thematic: 'its', + color: '#0288d1', + iconUrl: null, + iconClass: 'bi-broadcast-pin', + glyphCodepoint: 'f1d5', + mapImage: 'icon-its', + }, + itsbollardsystem: { + thematic: 'its', + color: '#0288d1', + iconUrl: null, + iconClass: 'bi-border-width', + glyphCodepoint: 'f1ca', + mapImage: 'icon-itsbollardsystem', + }, + itsbollardplot: { + thematic: 'its', + color: '#0288d1', + iconUrl: '/static/assets/its_bollard_plot_icon.svg?v=20261008', + iconSize: 42, + iconClass: 'bi-cone-striped', + glyphCodepoint: 'f2aa', + mapImage: 'icon-itsbollardplot', + }, }; // ─── 3. Specific Parking Spot Overrides by spot_type ───────────────────────── @@ -633,6 +660,7 @@ natureplanter: injected.natureplanter || (ASSET_TYPE_OVERRIDES.natureplanter && ASSET_TYPE_OVERRIDES.natureplanter.iconUrl), artworkfountain: injected.artworkfountain || ASSET_TYPE_OVERRIDES.artworkfountain.iconUrl, artworkmonument: injected.artworkmonument || ASSET_TYPE_OVERRIDES.artworkmonument.iconUrl, + itsbollardplot: injected.itsbollardplot || (ASSET_TYPE_OVERRIDES.itsbollardplot && ASSET_TYPE_OVERRIDES.itsbollardplot.iconUrl), }; return urls; } @@ -656,6 +684,9 @@ { name: 'icon-roaddrain', codepoint: 'f617', color: '#1e88e5' }, { name: 'icon-structures', codepoint: 'f876', color: '#6d4c41' }, { name: 'icon-its', codepoint: 'f1d5', color: '#0288d1' }, + { name: 'icon-itsgeoasset', codepoint: 'f1d5', color: '#0288d1' }, + { name: 'icon-itsbollardsystem', codepoint: 'f1ca', color: '#0288d1' }, + { name: 'icon-itsbollardplot', codepoint: 'f2aa', color: '#0288d1' }, { name: 'icon-clean', codepoint: 'f78a', color: '#5e5e5e' }, { name: 'icon-cleanglasscontainer', codepoint: 'f78a', color: '#16a34a' }, { name: 'icon-artworks', codepoint: 'f4b0', color: '#f24141' }, @@ -749,6 +780,9 @@ ['==', ['get', 'asset_type'], 'roadfurniture'], 'icon-speedbump', ['==', ['get', 'asset_type'], 'roadconcreteblockset'], 'icon-roadconcreteblockset', ['==', ['get', 'asset_type'], 'naturerwiasset'], 'icon-naturerwiasset', + ['==', ['get', 'asset_type'], 'itsbollardplot'], 'icon-itsbollardplot', + ['==', ['get', 'asset_type'], 'itsbollardsystem'], 'icon-itsbollardsystem', + ['==', ['get', 'asset_type'], 'itsgeoasset'], 'icon-its', ['==', ['get', 'spot_type'], 'scooter_drop_zone'], 'icon-parkingspot-scooter_drop_zone', ['==', ['get', 'spot_type'], 'pmr'], 'icon-parkingspot-pmr', ['==', ['get', 'spot_type'], 'ev_charging'], 'icon-parkingspot-ev_charging', @@ -924,14 +958,20 @@ '#0288d1' ], ['==', ['get', 'thematic'], 'nature'], '#2e7d32', + ['==', ['get', 'asset_type'], 'itsbollardsystem'], '#0288d1', ['match', ['get', 'asset_type'], 'roadway', '#334155', 'sidewalk', '#64748b', getThematicColorExpr()] ], 'line-width': [ 'case', ['any', ['boolean', ['feature-state', 'highlighted'], false], ['boolean', ['feature-state', 'selected'], false]], 6, + ['==', ['get', 'asset_type'], 'itsbollardsystem'], 5, 3.5 ], - 'line-opacity': 0.88, + 'line-opacity': [ + 'case', + ['==', ['get', 'asset_type'], 'itsbollardsystem'], 0.95, + 0.88 + ], }, minzoom: 8, }; diff --git a/loko/assets/static/assets/its_bollard_plot_icon.svg b/loko/assets/static/assets/its_bollard_plot_icon.svg new file mode 100644 index 0000000..0881e09 --- /dev/null +++ b/loko/assets/static/assets/its_bollard_plot_icon.svg @@ -0,0 +1,36 @@ + diff --git a/loko/assets/static/assets/unified_index.js b/loko/assets/static/assets/unified_index.js index 9280376..4331729 100644 --- a/loko/assets/static/assets/unified_index.js +++ b/loko/assets/static/assets/unified_index.js @@ -535,7 +535,7 @@ function buildColumns() { } }, { - field: 'element_type', title: gettext('Type'), sortable: true, width: 130, widthUnit: 'px', valign: 'middle', + field: 'element_type', title: gettext('Type'), sortable: true, width: 145, widthUnit: 'px', valign: 'middle', formatter: function (v, row) { const table = $('#unified-table'); let isCatVisible = false; @@ -543,10 +543,21 @@ function buildColumns() { isCatVisible = table.length && typeof table.bootstrapTable === 'function' && table.bootstrapTable('getVisibleColumns').some(c => c.field === 'category'); } catch (e) {} - if (!isCatVisible && row && row.is_location && row.category) { - return `${escapeHtml(v || '-')} ${escapeHtml(row.category)}`; + + let iconPrefix = ''; + if (typeof AssetSymbology !== 'undefined' && row && !row.is_location && !row.is_management_zone) { + const symb = AssetSymbology.getAssetSymbology(row); + const colorStyle = symb.color ? `color:${symb.color};` : ''; + iconPrefix = AssetSymbology.renderIconHtml(symb, { + style: `${colorStyle} font-size: 0.95rem; vertical-align: -1px; margin-right: 5px;`, + imgClass: 'me-1' + }); } - return escapeHtml(v || '-'); + + if (!isCatVisible && row && row.is_location && row.category) { + return `${iconPrefix}${escapeHtml(v || '-')} ${escapeHtml(row.category)}`; + } + return `${iconPrefix}${escapeHtml(v || '-')}`; } }, { field: 'thematic_name', title: gettext('Thématique'), sortable: true, width: 140, widthUnit: 'px', valign: 'middle' }, @@ -2016,6 +2027,7 @@ function collectClickedAssets(clickEvent) { element_type: p.element_type || '', detail_url: p.detail_url || null, feature_id: id, + extra_info: p.plots_count != null ? `${p.plots_count} plot(s)` : (p.bollard_type || ''), }); }); @@ -2149,15 +2161,26 @@ function showAssetClickPopup(clickEvent) { const type = escapeHtml(a.element_type || a.asset_type || ''); const thematic = escapeHtml(a.thematic_name || a.thematic || ''); const name = escapeHtml(a.name || ''); + const extra = a.extra_info ? ` • ${escapeHtml(a.extra_info)}` : ''; const detailAnchor = a.detail_url ? `${code}` : `${code}`; + let iconPrefix = ''; + if (typeof AssetSymbology !== 'undefined') { + const symb = AssetSymbology.getAssetSymbology(a); + const colorStyle = symb.color ? `color:${symb.color};` : ''; + iconPrefix = AssetSymbology.renderIconHtml(symb, { + style: `${colorStyle} font-size: 1rem; vertical-align: -1px; margin-right: 5px;`, + imgClass: 'me-1' + }); + } + return `
-
${detailAnchor}
-
${type}${thematic ? ' - ' + thematic : ''}
+
${iconPrefix}${detailAnchor}
+
${type}${thematic ? ' - ' + thematic : ''}${extra}
${name ? `
${name}
` : ''}