diff --git a/app/src/composables/use-layout.ts b/app/src/composables/use-layout.ts index c25d6696ee..160a502c63 100644 --- a/app/src/composables/use-layout.ts +++ b/app/src/composables/use-layout.ts @@ -59,6 +59,10 @@ function createLayoutWrapper(layout: LayoutConfig): Component { type: Function as PropType<() => Promise>, default: null, }, + clearFilters: { + type: Function as PropType<() => void>, + default: null, + }, }, emits: WRITABLE_PROPS.map((prop) => `update:${prop}` as const), setup(props, { emit }) { diff --git a/app/src/interfaces/map/map.vue b/app/src/interfaces/map/map.vue index 8f989811b4..eadad53879 100644 --- a/app/src/interfaces/map/map.vue +++ b/app/src/interfaces/map/map.vue @@ -145,16 +145,15 @@ export default defineComponent({ const controls = { draw: new MapboxDraw(getDrawOptions(geometryType)), fitData: new ButtonControl('mapboxgl-ctrl-fitdata', fitDataBounds), - navigation: new NavigationControl(), + navigation: new NavigationControl({ + showCompass: false, + }), geolocate: new GeolocateControl(), }; onMounted(() => { - setupMap(); - }); - - onUnmounted(() => { - map.remove(); + const cleanup = setupMap(); + onUnmounted(cleanup); }); return { @@ -168,11 +167,12 @@ export default defineComponent({ basemap, }; - function setupMap() { + function setupMap(): () => void { map = new Map({ container: container.value!, style: style.value, attributionControl: false, + dragRotate: false, logoPosition: 'bottom-right', ...props.defaultView, ...(mapboxKey ? { accessToken: mapboxKey } : {}), @@ -200,6 +200,7 @@ export default defineComponent({ map.on('draw.delete', handleDrawUpdate); map.on('draw.update', handleDrawUpdate); map.on('draw.modechange', handleDrawModeChange); + window.addEventListener('keydown', handleKeyDown); }); watch( @@ -247,6 +248,11 @@ export default defineComponent({ loadValueFromProps(); } ); + + return () => { + window.removeEventListener('keydown', handleKeyDown); + map.remove(); + }; } function resetValue(hard: boolean) { @@ -383,6 +389,12 @@ export default defineComponent({ emit('input', serialize(currentGeometry)); } } + + function handleKeyDown(event) { + if ([8, 46].includes(event.keyCode)) { + controls.draw.trash(); + } + } }, }); diff --git a/app/src/lang/translations/en-US.yaml b/app/src/lang/translations/en-US.yaml index 26b44496a6..c03e6ab740 100644 --- a/app/src/lang/translations/en-US.yaml +++ b/app/src/lang/translations/en-US.yaml @@ -1529,8 +1529,9 @@ layouts: invalid_geometry: Invalid geometry auto_location_filter: Always filter data to view bounds search_this_area: Search this area - clear_data_filter: Clear Data Filter - clear_location_filter: Clear Location Filter + clear_data_filter: Clear data filter + clear_location_filter: Clear location filter + no_results_here: No results in this area panels: metric: diff --git a/app/src/lang/translations/fr-FR.yaml b/app/src/lang/translations/fr-FR.yaml index 8fe58f6162..201bd16f7a 100644 --- a/app/src/lang/translations/fr-FR.yaml +++ b/app/src/lang/translations/fr-FR.yaml @@ -904,10 +904,11 @@ fields: png: PNG webP: WebP tiff: Tiff + basemaps: Fond de cartes basemaps_raster: Raster basemaps_tile: Raster TileJSON basemaps_style: Style de Mapbox - mapbox_key: Jeton d'accès Mapbox + mapbox_key: Clé d'accès Mapbox mapbox_placeholder: pk.eyJ1Ijo..... transforms_note: Le nom de la méthode Sharp et ses arguments. Voir https://sharp.pixelplumbing.com/api-constructor pour plus d'informations. additional_transforms: Transformations supplémentaires @@ -1500,20 +1501,21 @@ layouts: end_date_field: Champ Date de fin map: map: Carte - basemap: Carte de base - layers: Afficher... + basemap: Fond de carte + layers: Couches edit_custom_layers: Modifier la couche cluster_options: Options de regroupement - cluster: Activer le clustering - cluster_radius: Rayon de grappe - cluster_minpoints: Taille minimale du cluster - cluster_maxzoom: Zoom maximum pour la grappe + cluster: Regrouper les données + cluster_radius: Rayon de regroupement + cluster_minpoints: Taille minimale des clusters + cluster_maxzoom: Zoom maximum pour le regroupement field: Géométrie invalid_geometry: Géométrie invalide - auto_location_filter: Toujours filtrer les données pour afficher les limites search_this_area: Chercher dans cette zone - clear_data_filter: Réinitialiser le filtre - clear_location_filter: Éliminer le filtre de coupon + auto_location_filter: Toujours filter les données selon l'emprise + clear_data_filter: Enlever les filtres avancés + clear_location_filter: Enlever le filtre géographique + no_results_here: Aucun résultat dans cette zone panels: metric: name: Indicateurs diff --git a/app/src/layouts/map/components/map.vue b/app/src/layouts/map/components/map.vue index 98131c58a6..af21de4943 100644 --- a/app/src/layouts/map/components/map.vue +++ b/app/src/layouts/map/components/map.vue @@ -88,7 +88,9 @@ export default defineComponent({ }); const attributionControl = new AttributionControl({ compact: true }); - const navigationControl = new NavigationControl(); + const navigationControl = new NavigationControl({ + showCompass: false, + }); const geolocateControl = new GeolocateControl(); const fitDataControl = new ButtonControl('mapboxgl-ctrl-fitdata', () => { emit('fitdata'); @@ -115,6 +117,7 @@ export default defineComponent({ container: 'map-container', style: style.value, attributionControl: false, + dragRotate: false, ...props.camera, ...(mapboxKey ? { accessToken: mapboxKey } : {}), }); @@ -245,6 +248,7 @@ export default defineComponent({ newSelection?.forEach((id) => { map.setFeatureState({ id, source: '__directus' }, { selected: true }); }); + boxSelectControl.showUnselect(newSelection?.length); } function onFeatureClick(event: MapLayerMouseEvent) { @@ -470,6 +474,8 @@ export default defineComponent({ } .mapboxgl-point-popup { + box-shadow: 10px 10px 10px solid red; + &.mapboxgl-popup-anchor-left .mapboxgl-popup-tip { border-right-color: var(--background-normal); } @@ -493,12 +499,11 @@ export default defineComponent({ font-family: var(--family-sans-serif); background-color: var(--background-normal); border-radius: var(--border-radius); + box-shadow: var(--card-shadow); pointer-events: none; } } - -