-
Notifications
You must be signed in to change notification settings - Fork 19
Add min waypoint zoom #1933
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Add min waypoint zoom #1933
Changes from all commits
24971f2
879b546
2e2e220
3ad6688
9e1f5a4
d12c973
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -397,6 +397,9 @@ | |||||
| "CustomLayover": "Battement personnalisé (minutes)", | ||||||
| "ShowPaths": "Montrer les lignes et parcours", | ||||||
| "HidePaths": "Cacher les lignes et parcours", | ||||||
| "WaypointMinZoom": "Zoom minimal de la carte pour les points de repère de parcours", | ||||||
| "WaypointMinZoomHelp": "Les points de repère s'affichent et peuvent être ajoutés ou retirés à partir de ce niveau de zoom (plage permise : 1 à 15, où 1 correspond à la vue mondiale et 15 à la rue). Une valeur plus basse permet d'éditer à une vue plus large.", | ||||||
| "WaypointMinZoomRefreshHint": "Il faut actualiser la page pour que ce réglage s'applique sur la carte.", | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Refresh hint contradicts runtime sync behavior. The text states users must refresh the page ( 📝 Suggested correction-"WaypointMinZoomRefreshHint": "Il faut actualiser la page pour que ce réglage s'applique sur la carte."
+"WaypointMinZoomRefreshHint": "Les changements s'appliquent immédiatement sur la carte."📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||
| "true": "Oui", | ||||||
| "false": "Non", | ||||||
| "Generate": "Générer le parcours", | ||||||
|
|
@@ -519,7 +522,8 @@ | |||||
| "DefaultDecelerationIsRequired": "La décélération st requise.", | ||||||
| "DefaultDecelerationIsInvalid": "La décélération est invalide.", | ||||||
| "DefaultDecelerationIsTooLow": "La décélération est trop faible.", | ||||||
| "DefaultDecelerationIsTooHigh": "La décélération est trop élevée (inconfortable)." | ||||||
| "DefaultDecelerationIsTooHigh": "La décélération est trop élevée (inconfortable).", | ||||||
| "WaypointMinZoomOutOfRange": "Le zoom minimal pour les points de repère doit être un entier entre 1 et 15." | ||||||
| } | ||||||
| }, | ||||||
| "transitRouting": { | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -28,6 +28,10 @@ import { MapUpdateLayerEventType } from 'chaire-lib-frontend/lib/services/map/ev | |
|
|
||
| // Local workspace imports | ||
| import layersConfig, { sectionLayers, overlaySource } from '../../config/layers.config'; | ||
| import pathWaypointZoomSync, { | ||
| MAP_UPDATE_LAYERS_MIN_ZOOM_EVENT, | ||
| MapUpdateLayersMinZoomPayload | ||
| } from '../../services/map/PathWaypointZoomSync'; | ||
| import { polygonSelectionService } from '../../services/map/PolygonSelectionService'; | ||
| import transitionMapEvents from '../../services/map/events'; | ||
| import mapCustomEvents from '../../services/map/events/MapRelatedCustomEvents'; | ||
|
|
@@ -207,11 +211,20 @@ class MainMap extends React.Component<MainMapProps & WithTranslation & PropsWith | |
| this.layerManager.setMap(map); | ||
| this.popupManager.setMap(map); | ||
| this.layerManager.updateEnabledLayers(this.state.layers); | ||
| // The waypoint layers bake their minzoom at module-load time (layers.config), | ||
| // before user preferences are loaded asynchronously. Reapply it now that the | ||
| // map exists so the user's saved preference takes effect on first load. | ||
| pathWaypointZoomSync.applyNow(serviceLocator.eventManager); | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Le commentaire dit "Trigger and initial generic min-zoom update", mais le nom de la variable n'a rien de générique. Renommer?
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Aussi, as-tu vraiment besoin d,appeler le applyNow? Il semble que le layer.config va déjà chercher le min zoom depuis les préférences, donc ça devrait être ok? Tu n'as peut-être pas besoin du tout de cette fonction. |
||
|
|
||
| this.setState({ mapLoaded: true }); | ||
| serviceLocator.eventManager.emit('map.loaded'); | ||
| }; | ||
|
|
||
| /** Generic handler: update the minzoom of the given map layers. */ | ||
| updateLayersMinZoom = (payload: MapUpdateLayersMinZoomPayload) => { | ||
| this.layerManager.updateLayersMinZoom(payload.layerNames, payload.minZoom); | ||
| }; | ||
|
|
||
| showPathsByAttribute = (attribute: string, value: any) => { | ||
| // attribute must be agency_id or line_id | ||
| if (attribute === 'agency_id') { | ||
|
|
@@ -273,6 +286,8 @@ class MainMap extends React.Component<MainMapProps & WithTranslation & PropsWith | |
| serviceLocator.eventManager.on('map.deleteSelectedNodes', this.deleteSelectedNodes); | ||
| serviceLocator.eventManager.on('map.deleteSelectedPolygon', this.onDeleteSelectedPolygon); | ||
| serviceLocator.eventManager.on('collection.update.nodes', this.onNodesUpdatedHandler); | ||
| serviceLocator.eventManager.on(MAP_UPDATE_LAYERS_MIN_ZOOM_EVENT, this.updateLayersMinZoom); | ||
| pathWaypointZoomSync.start(serviceLocator.eventManager); | ||
| }; | ||
|
|
||
| onDeleteSelectedPolygon = () => { | ||
|
|
@@ -318,6 +333,8 @@ class MainMap extends React.Component<MainMapProps & WithTranslation & PropsWith | |
| serviceLocator.eventManager.off('map.deleteSelectedNodes', this.deleteSelectedNodes); | ||
| serviceLocator.eventManager.off('map.deleteSelectedPolygon', this.onDeleteSelectedPolygon); | ||
| serviceLocator.eventManager.off('collection.update.nodes', this.onNodesUpdatedHandler); | ||
| serviceLocator.eventManager.off(MAP_UPDATE_LAYERS_MIN_ZOOM_EVENT, this.updateLayersMinZoom); | ||
| pathWaypointZoomSync.stop(); | ||
|
|
||
| // Remove map event listeners BEFORE react-map-gl cleans up | ||
| // We need to do this early because react-map-gl will call map.remove() automatically | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.