Skip to content

Commit b42ea3a

Browse files
bdjulbicCopilot
andauthored
feat: add tooltip toggle (#3371)
* add tooltip toggle Signed-off-by: bdjulbic <bdjulbic@foursquare.com> * change back the name Signed-off-by: bdjulbic <bdjulbic@foursquare.com> * remove translations Signed-off-by: bdjulbic <bdjulbic@foursquare.com> * Update src/layers/src/geojson-layer/geojson-layer.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: bdjulbic <bdjulbic@foursquare.com> * update Signed-off-by: bdjulbic <bdjulbic@foursquare.com> * remove duplicate toggle Signed-off-by: bdjulbic <bdjulbic@foursquare.com> * fix tests Signed-off-by: bdjulbic <bdjulbic@foursquare.com> * fix tests Signed-off-by: bdjulbic <bdjulbic@foursquare.com> --------- Signed-off-by: bdjulbic <bdjulbic@foursquare.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent b87714f commit b42ea3a

15 files changed

Lines changed: 55 additions & 22 deletions

File tree

src/components/src/side-panel/layer-panel/layer-configurator.tsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -871,6 +871,16 @@ export default function LayerConfiguratorFactory(
871871
</ConfigGroupCollapsibleContent>
872872
</LayerConfigGroup>
873873
) : null}
874+
875+
{/* Interaction */}
876+
{'allowHover' in layer.visConfigSettings ? (
877+
<LayerConfigGroup label={'layer.interaction'} collapsible>
878+
<VisConfigSwitch
879+
{...layer.visConfigSettings.allowHover}
880+
{...visConfiguratorProps}
881+
/>
882+
</LayerConfigGroup>
883+
) : null}
874884
</StyledLayerVisualConfigurator>
875885
);
876886
}

src/layers/src/geojson-layer/geojson-layer.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ export const geojsonVisConfigs: {
8282
enable3d: 'enable3d';
8383
wireframe: 'wireframe';
8484
fixedHeight: 'fixedHeight';
85+
allowHover: 'allowHover';
8586
} = {
8687
opacity: 'opacity',
8788
strokeOpacity: {
@@ -105,7 +106,8 @@ export const geojsonVisConfigs: {
105106
filled: 'filled',
106107
enable3d: 'enable3d',
107108
wireframe: 'wireframe',
108-
fixedHeight: 'fixedHeight'
109+
fixedHeight: 'fixedHeight',
110+
allowHover: 'allowHover'
109111
};
110112

111113
export type GeoJsonVisConfigSettings = {
@@ -126,6 +128,7 @@ export type GeoJsonVisConfigSettings = {
126128
filled: VisConfigBoolean;
127129
enable3d: VisConfigBoolean;
128130
wireframe: VisConfigBoolean;
131+
allowHover: VisConfigBoolean;
129132
};
130133

131134
export type GeoJsonLayerColumnsConfig = {
@@ -150,6 +153,7 @@ export type GeoJsonLayerVisConfig = {
150153
enable3d: boolean;
151154
wireframe: boolean;
152155
fixedHeight: boolean;
156+
allowHover: boolean;
153157
};
154158

155159
type GeoJsonLayerVisualChannelConfig = LayerColorConfig &
@@ -699,7 +703,7 @@ export default class GeoJsonLayer extends Layer {
699703
opacity: visConfig.strokeOpacity
700704
};
701705

702-
const pickable = interactionConfig.tooltip.enabled;
706+
const pickable = interactionConfig.tooltip.enabled && visConfig.allowHover;
703707
const hoveredObject = this.hasHoveredObject(objectHovered);
704708

705709
const {data, ...props} = dataProps;

src/localization/src/translations/ca.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,8 @@ export default {
152152
heightRange: 'Rang alçada',
153153
heightMultiplier: "Multiplicador d'alçada",
154154
fixedHeight: 'Alçada fixa',
155-
fixedHeightDescription: "Utilitzeu l'alçada sense modificacions"
155+
fixedHeightDescription: "Utilitzeu l'alçada sense modificacions",
156+
allowHover: "Mostra informació d'eina"
156157
},
157158
layerManager: {
158159
addData: 'Afegeix Dades',

src/localization/src/translations/cn.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,8 @@ export default {
141141
showWireframe: '显示线框',
142142
weightIntensity: '加权强度',
143143
zoomScale: '缩放比例',
144-
heightRange: '高度范围'
144+
heightRange: '高度范围',
145+
allowHover: '显示工具提示'
145146
},
146147
layerManager: {
147148
addData: '添加数据',

src/localization/src/translations/en.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ export default {
174174
heightMultiplier: 'Height Multiplier',
175175
fixedHeight: 'Fixed height',
176176
fixedHeightDescription: 'Use height without modifications',
177-
allowHover: 'Allow Hover',
177+
allowHover: 'Allow hover',
178178
showNeighborOnHover: 'Highlight Neighbors On Hover',
179179
showHighlightColor: 'Show highlight Color',
180180
darkModeEnabled: 'Dark base map',

src/localization/src/translations/es.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,8 @@ export default {
153153
heightRange: 'Rango de alturas',
154154
heightMultiplier: 'Multiplicador de altura',
155155
fixedHeight: 'Altura fija',
156-
fixedHeightDescription: 'Usar altura sin modificaciones'
156+
fixedHeightDescription: 'Usar altura sin modificaciones',
157+
allowHover: 'Mostrar descripción emergente'
157158
},
158159
layerManager: {
159160
addData: 'Añadir datos',

src/localization/src/translations/fi.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,8 @@ export default {
150150
heightRange: 'Korkeuden rajat',
151151
heightMultiplier: 'Korkeuskerroin',
152152
fixedHeight: 'Kiinteä korkeus',
153-
fixedHeightDescription: 'Käytä korkeutta ilman muutoksia'
153+
fixedHeightDescription: 'Käytä korkeutta ilman muutoksia',
154+
allowHover: 'Näytä työkaluvihje'
154155
},
155156
layerManager: {
156157
addData: 'Lisää aineisto',

src/localization/src/translations/ja.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,8 @@ export default {
149149
heightRange: '高さの範囲',
150150
heightMultiplier: '高さ乗数',
151151
fixedHeight: '固定高さ',
152-
fixedHeightDescription: '高さを変更せずに使用する'
152+
fixedHeightDescription: '高さを変更せずに使用する',
153+
allowHover: 'ツールチップを表示'
153154
},
154155
layerManager: {
155156
addData: 'データ追加',

src/localization/src/translations/pt.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,8 @@ export default {
151151
heightRange: 'Alcance da Altura',
152152
heightMultiplier: 'Multiplicador de altura',
153153
fixedHeight: 'Altura fixa',
154-
fixedHeightDescription: 'Use a altura sem modificações'
154+
fixedHeightDescription: 'Use a altura sem modificações',
155+
allowHover: 'Mostrar dica de ferramenta'
155156
},
156157
layerManager: {
157158
addData: 'Adicionar Dados',

src/localization/src/translations/ru.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,8 @@ export default {
145145
weightIntensity: 'Вес Интенсивность',
146146
zoomScale: 'Масштаб увеличения',
147147
heightRange: 'Диапазон высоты',
148-
heightMultiplier: 'Множитель высоты'
148+
heightMultiplier: 'Множитель высоты',
149+
allowHover: 'Показать подсказку'
149150
},
150151
layerManager: {
151152
addData: 'Добавить данные',

0 commit comments

Comments
 (0)