Skip to content

Commit

Permalink
map layers: remove all references to aggregatedOd layer
Browse files Browse the repository at this point in the history
fixes #1248

This feature is not supported yet in Transition. When we want to support
it, we can add it back as specified.
  • Loading branch information
tahini committed Feb 28, 2025
1 parent 73143ab commit 66f08da
Show file tree
Hide file tree
Showing 9 changed files with 3 additions and 81 deletions.
2 changes: 0 additions & 2 deletions locales/en/notifications.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
"ScenarioCollectionLoadingFromServer": "Loading scenarios from server",
"GarageCollectionLoadingFromServer": "Loading garages from server",
"UnitCollectionLoadingFromServer": "Loading units from server",
"AggregatedODGeojsonCollectionLoadingFromServer": "Loading OD places from server",

"SimulationCollectionLoadingFromCollection": "Loading simulations",
"NetworkCollectionLoadingFromCollection": "Loading networks",
Expand All @@ -44,7 +43,6 @@
"ScenarioCollectionLoadingFromCollection": "Loading scenarios",
"GarageCollectionLoadingFromCollection": "Loading garages",
"UnitCollectionLoadingFromCollection": "Loading units",
"AggregatedODGeojsonCollectionLoadingFromCollection": "Loading OD places",

"SavingAllCache": "Saving cache files",
"RestartTrRouting": "Restart routing engine",
Expand Down
4 changes: 0 additions & 4 deletions locales/en/od.json

This file was deleted.

2 changes: 0 additions & 2 deletions locales/fr/notifications.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
"ScenarioCollectionLoadingFromServer": "Chargement des scénarios (serveur)",
"GarageCollectionLoadingFromServer": "Chargement des garages (serveur)",
"UnitCollectionLoadingFromServer": "Chargement des unités (serveur)",
"AggregatedODGeojsonCollectionLoadingFromServer": "Chargement des lieux OD (serveur)",

"SimulationCollectionLoadingFromCollection": "Chargement des simulations",
"NetworkCollectionLoadingFromCollection": "Chargement des réseaux",
Expand All @@ -44,7 +43,6 @@
"ScenarioCollectionLoadingFromCollection": "Chargement des scénarios",
"GarageCollectionLoadingFromCollection": "Chargement des garages",
"UnitCollectionLoadingFromCollection": "Chargement des unités",
"AggregatedODGeojsonCollectionLoadingFromCollection": "Chargement des lieux OD",

"SavingAllCache": "Sauvegarde des fichiers de cache",
"RestartTrRouting": "Redémarrage du calculateur",
Expand Down
4 changes: 0 additions & 4 deletions locales/fr/od.json

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ const defaultPreferences: PreferencesModel = {
center: [config.mapDefaultCenter.lon, config.mapDefaultCenter.lat],
zoom: 10
},
showAggregatedOdTripsLayer: true,
socketUploadChunkSize: 10240000,
defaultWalkingSpeedMetersPerSeconds: 5 / 3.6,
geoNames: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,8 +215,6 @@ class Dashboard extends React.Component<DashboardProps, DashboardState> {
const scenarioCollection = new ScenarioCollection([], {}, serviceLocator.eventManager);
const placeCollection = new PlaceCollection([], {}, serviceLocator.eventManager);

// const aggregatedODGeojsonCollection = new AggregatedODGeojsonCollection([], {}, serviceLocator.eventManager);

loadLayersAndCollections({
dataSourceCollection,
simulationCollection,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import 'rc-menu/assets/index.css';
import * as Status from 'chaire-lib-common/lib/utils/Status';
import serviceLocator from 'chaire-lib-common/lib/utils/ServiceLocator';
import { roundToDecimals } from 'chaire-lib-common/lib/utils/MathUtils';
import Preferences from 'chaire-lib-common/lib/config/Preferences';
import { loadLayersAndCollections } from '../../services/dashboard/LayersAndCollectionsService';
import { LayoutSectionProps } from 'chaire-lib-frontend/lib/services/dashboard/DashboardContribution';

Expand Down Expand Up @@ -132,7 +131,6 @@ class Toolbar extends React.Component<LayoutSectionProps & WithTranslation, Tran
fetchData = () => {
loadLayersAndCollections({
serviceLocator,
//aggregatedODGeojsonCollection: serviceLocator.collectionManager.get('aggregatedOD'),
agencyCollection: serviceLocator.collectionManager.get('agencies'),
scenarioCollection: serviceLocator.collectionManager.get('scenarios'),
serviceCollection: serviceLocator.collectionManager.get('services'),
Expand Down Expand Up @@ -311,41 +309,6 @@ class Toolbar extends React.Component<LayoutSectionProps & WithTranslation, Tran
</MenuItem>
)}

{Preferences.get('showAggregatedOdTripsLayer') &&
this.state.layersVisibility.aggregatedOD === true && (
<MenuItem
title={this.props.t('od:HideAggregatedOD')}
className="tr__top-menu-button"
onClick={function () {
serviceLocator.eventManager.emit('map.hideLayer', 'aggregatedOD');
}}
>
<img
className="_icon"
src={'/dist/images/icons/od/aggregated_od_visible_white.svg'}
alt={this.props.t('od:HideAggregatedOD')}
title={this.props.t('od:HideAggregatedOD')}
/>
</MenuItem>
)}
{Preferences.get('showAggregatedOdTripsLayer') &&
this.state.layersVisibility.aggregatedOD === false && (
<MenuItem
title={this.props.t('od:ShowAggregatedOD')}
className="tr__top-menu-button"
onClick={function () {
serviceLocator.eventManager.emit('map.showLayer', 'aggregatedOD');
}}
>
<img
className="_icon"
src={'/dist/images/icons/od/aggregated_od_hidden_white.svg'}
alt={this.props.t('od:ShowAggregatedOD')}
title={this.props.t('od:ShowAggregatedOD')}
/>
</MenuItem>
)}

<MenuItem
title={this.props.t('transit:transitNode:SaveAllAndUpdateTransferableNodes')}
className="tr__top-menu-button"
Expand Down
21 changes: 3 additions & 18 deletions packages/transition-frontend/src/config/layers.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@

// Define which layers should be visible for each section
export const sectionLayers = {
simulations: ['aggregatedOD', 'odTripsProfile', 'transitStations', 'transitNodes'],
simulations: ['odTripsProfile', 'transitStations', 'transitNodes'],
agencies: [
'aggregatedOD',
'transitNodesRoutingRadius',
'transitStations',
'transitStationsSelected',
Expand All @@ -23,7 +22,6 @@ export const sectionLayers = {
'transitPathWaypointsErrors'
],
nodes: [
'aggregatedOD',
'transitNodes250mRadius',
'transitNodes500mRadius',
'transitNodes750mRadius',
Expand All @@ -37,21 +35,9 @@ export const sectionLayers = {
'transitNodesSelected'
],
scenarios: ['transitPathsForServices'],
routing: [
'aggregatedOD' /*'transitPaths', 'transitNodes', 'transitStations', */,
'routingPathsStrokes',
'routingPaths',
'routingPoints'
],
accessibilityMap: [
'aggregatedOD',
'accessibilityMapPolygons',
'accessibilityMapPolygonStrokes',
'accessibilityMapPoints'
],
odRouting: ['aggregatedOD', 'odTripsProfile'],
routing: ['routingPathsStrokes', 'routingPaths', 'routingPoints'],
accessibilityMap: ['accessibilityMapPolygons', 'accessibilityMapPolygonStrokes', 'accessibilityMapPoints'],
gtfsImport: [
'aggregatedOD',
'transitNodesRoutingRadius',
'transitStations',
'transitStationsSelected',
Expand All @@ -63,7 +49,6 @@ export const sectionLayers = {
'transitNodesSelected'
],
gtfsExport: [
'aggregatedOD',
'transitNodesRoutingRadius',
'transitStations',
'transitStationsSelected',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ type LoadLayersOptions = {
serviceCollection: ServiceCollection;
scenarioCollection: ScenarioCollection;
placeCollection: PlaceCollection;
// aggregatedODGeojsonCollection: any;
serviceLocator: any;
};

Expand All @@ -46,7 +45,6 @@ export const loadLayersAndCollections = async ({
serviceCollection,
scenarioCollection,
placeCollection,
// aggregatedODGeojsonCollection,
serviceLocator
}: LoadLayersOptions) => {
try {
Expand Down Expand Up @@ -94,15 +92,6 @@ export const loadLayersAndCollections = async ({
serviceLocator.collectionManager.add('places', placeCollection);

serviceLocator.pathLayerManager.updateFilter();
/* if (Preferences.get('showAggregatedOdTripsLayer')) {
await aggregatedODGeojsonCollection.loadFromServer(
serviceLocator.socketEventManager,
dataSourceCollection.size() > 0 ? dataSourceCollection.getFeatures()[0].get('id') : null
);
}
serviceLocator.collectionManager.add('aggregatedOD', aggregatedODGeojsonCollection);
serviceLocator.eventManager.emit('map.updateLayer', 'aggregatedOD', aggregatedODGeojsonCollection.toGeojson()); */
} catch (error) {
console.error(error); // todo: better error handling
}
Expand Down

0 comments on commit 66f08da

Please sign in to comment.