Skip to content

Commit 227d049

Browse files
tahinikaligrafy
authored andcommitted
map layers: remove all references to aggregatedOd layer
fixes #1248 This feature is not supported yet in Transition. When we want to support it, we can add it back as specified.
1 parent b857ca3 commit 227d049

File tree

9 files changed

+3
-84
lines changed

9 files changed

+3
-84
lines changed

locales/en/notifications.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
"ScenarioCollectionLoadingFromServer": "Loading scenarios from server",
2727
"GarageCollectionLoadingFromServer": "Loading garages from server",
2828
"UnitCollectionLoadingFromServer": "Loading units from server",
29-
"AggregatedODGeojsonCollectionLoadingFromServer": "Loading OD places from server",
3029

3130
"SimulationCollectionLoadingFromCollection": "Loading simulations",
3231
"NetworkCollectionLoadingFromCollection": "Loading networks",
@@ -44,7 +43,6 @@
4443
"ScenarioCollectionLoadingFromCollection": "Loading scenarios",
4544
"GarageCollectionLoadingFromCollection": "Loading garages",
4645
"UnitCollectionLoadingFromCollection": "Loading units",
47-
"AggregatedODGeojsonCollectionLoadingFromCollection": "Loading OD places",
4846

4947
"SavingAllCache": "Saving cache files",
5048
"RestartTrRouting": "Restart routing engine",

locales/en/od.json

Lines changed: 0 additions & 4 deletions
This file was deleted.

locales/fr/notifications.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
"ScenarioCollectionLoadingFromServer": "Chargement des scénarios (serveur)",
2727
"GarageCollectionLoadingFromServer": "Chargement des garages (serveur)",
2828
"UnitCollectionLoadingFromServer": "Chargement des unités (serveur)",
29-
"AggregatedODGeojsonCollectionLoadingFromServer": "Chargement des lieux OD (serveur)",
3029

3130
"SimulationCollectionLoadingFromCollection": "Chargement des simulations",
3231
"NetworkCollectionLoadingFromCollection": "Chargement des réseaux",
@@ -44,7 +43,6 @@
4443
"ScenarioCollectionLoadingFromCollection": "Chargement des scénarios",
4544
"GarageCollectionLoadingFromCollection": "Chargement des garages",
4645
"UnitCollectionLoadingFromCollection": "Chargement des unités",
47-
"AggregatedODGeojsonCollectionLoadingFromCollection": "Chargement des lieux OD",
4846

4947
"SavingAllCache": "Sauvegarde des fichiers de cache",
5048
"RestartTrRouting": "Redémarrage du calculateur",

locales/fr/od.json

Lines changed: 0 additions & 4 deletions
This file was deleted.

packages/chaire-lib-common/src/config/defaultPreferences.config.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ const defaultPreferences: PreferencesModel = {
5454
zoom: 10,
5555
baseLayer: 'osm'
5656
},
57-
showAggregatedOdTripsLayer: true,
5857
socketUploadChunkSize: 10240000,
5958
defaultWalkingSpeedMetersPerSeconds: 5 / 3.6,
6059
geoNames: {

packages/transition-frontend/src/components/dashboard/TransitionDashboard.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,8 +222,6 @@ class Dashboard extends React.Component<DashboardProps, DashboardState> {
222222
const scenarioCollection = new ScenarioCollection([], {}, serviceLocator.eventManager);
223223
const placeCollection = new PlaceCollection([], {}, serviceLocator.eventManager);
224224

225-
// const aggregatedODGeojsonCollection = new AggregatedODGeojsonCollection([], {}, serviceLocator.eventManager);
226-
227225
loadLayersAndCollections({
228226
dataSourceCollection,
229227
simulationCollection,

packages/transition-frontend/src/components/dashboard/TransitionToolbar.tsx

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import 'rc-menu/assets/index.css';
1313
import * as Status from 'chaire-lib-common/lib/utils/Status';
1414
import serviceLocator from 'chaire-lib-common/lib/utils/ServiceLocator';
1515
import { roundToDecimals } from 'chaire-lib-common/lib/utils/MathUtils';
16-
import Preferences from 'chaire-lib-common/lib/config/Preferences';
1716
import { loadLayersAndCollections } from '../../services/dashboard/LayersAndCollectionsService';
1817
import { LayoutSectionProps } from 'chaire-lib-frontend/lib/services/dashboard/DashboardContribution';
1918

@@ -134,7 +133,6 @@ class Toolbar extends React.Component<LayoutSectionProps & WithTranslation, Tran
134133
fetchData = () => {
135134
loadLayersAndCollections({
136135
serviceLocator,
137-
//aggregatedODGeojsonCollection: serviceLocator.collectionManager.get('aggregatedOD'),
138136
agencyCollection: serviceLocator.collectionManager.get('agencies'),
139137
scenarioCollection: serviceLocator.collectionManager.get('scenarios'),
140138
serviceCollection: serviceLocator.collectionManager.get('services'),
@@ -318,43 +316,6 @@ class Toolbar extends React.Component<LayoutSectionProps & WithTranslation, Tran
318316
</MenuItem>
319317
)}
320318

321-
{Preferences.get('showAggregatedOdTripsLayer') &&
322-
this.state.layersVisibility.aggregatedOD === true && (
323-
<MenuItem
324-
key="tr__top-menu-button-hide-aggregated-od"
325-
title={this.props.t('od:HideAggregatedOD')}
326-
className="tr__top-menu-button"
327-
onClick={function () {
328-
serviceLocator.eventManager.emit('map.hideLayer', 'aggregatedOD');
329-
}}
330-
>
331-
<img
332-
className="_icon"
333-
src={'/dist/images/icons/od/aggregated_od_visible_white.svg'}
334-
alt={this.props.t('od:HideAggregatedOD')}
335-
title={this.props.t('od:HideAggregatedOD')}
336-
/>
337-
</MenuItem>
338-
)}
339-
{Preferences.get('showAggregatedOdTripsLayer') &&
340-
this.state.layersVisibility.aggregatedOD === false && (
341-
<MenuItem
342-
key="tr__top-menu-button-show-aggregated-od"
343-
title={this.props.t('od:ShowAggregatedOD')}
344-
className="tr__top-menu-button"
345-
onClick={function () {
346-
serviceLocator.eventManager.emit('map.showLayer', 'aggregatedOD');
347-
}}
348-
>
349-
<img
350-
className="_icon"
351-
src={'/dist/images/icons/od/aggregated_od_hidden_white.svg'}
352-
alt={this.props.t('od:ShowAggregatedOD')}
353-
title={this.props.t('od:ShowAggregatedOD')}
354-
/>
355-
</MenuItem>
356-
)}
357-
358319
<MenuItem
359320
key="tr__top-menu-button-save-and-update-nodes"
360321
title={this.props.t('transit:transitNode:SaveAllAndUpdateTransferableNodes')}

packages/transition-frontend/src/config/layers.config.ts

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,8 @@ export const WAYPOINT_MIN_ZOOM = 14;
1010

1111
// Define which layers should be visible for each section
1212
export const sectionLayers = {
13-
simulations: ['aggregatedOD', 'odTripsProfile', 'transitStations', 'transitNodes'],
13+
simulations: ['transitStations', 'transitNodes'],
1414
agencies: [
15-
'aggregatedOD',
1615
'transitNodesRoutingRadius',
1716
'transitStations',
1817
'transitStationsSelected',
@@ -26,7 +25,6 @@ export const sectionLayers = {
2625
'transitPathWaypointsErrors'
2726
],
2827
nodes: [
29-
'aggregatedOD',
3028
'transitNodes250mRadius',
3129
'transitNodes500mRadius',
3230
'transitNodes750mRadius',
@@ -41,30 +39,17 @@ export const sectionLayers = {
4139
],
4240
scenarios: ['transitPathsForServices'],
4341
services: ['transitPathsForServices'],
44-
routing: [
45-
'aggregatedOD' /*'transitPaths', 'transitNodes', 'transitStations', */,
46-
'routingPathsStrokes',
47-
'routingPaths',
48-
'routingPoints'
49-
],
42+
routing: ['routingPathsStrokes', 'routingPaths', 'routingPoints'],
5043
comparison: [
51-
'aggregatedOD' /*'transitPaths', 'transitNodes', 'transitStations', */,
5244
'routingPathsStrokes',
5345
'routingPaths',
5446
'routingPathsStrokesAlternate',
5547
'routingPathsAlternate',
5648
'routingPoints'
5749
],
58-
accessibilityMap: [
59-
'aggregatedOD',
60-
'accessibilityMapPolygons',
61-
'accessibilityMapPolygonStrokes',
62-
'accessibilityMapPoints'
63-
],
50+
accessibilityMap: ['accessibilityMapPolygons', 'accessibilityMapPolygonStrokes', 'accessibilityMapPoints'],
6451
accessibilityComparison: ['accessibilityMapPolygons', 'accessibilityMapPolygonStrokes', 'accessibilityMapPoints'],
65-
odRouting: ['aggregatedOD', 'odTripsProfile'],
6652
gtfsImport: [
67-
'aggregatedOD',
6853
'transitNodesRoutingRadius',
6954
'transitStations',
7055
'transitStationsSelected',
@@ -76,7 +61,6 @@ export const sectionLayers = {
7661
'transitPathWaypointsSelected'
7762
],
7863
gtfsExport: [
79-
'aggregatedOD',
8064
'transitNodesRoutingRadius',
8165
'transitStations',
8266
'transitStationsSelected',

packages/transition-frontend/src/services/dashboard/LayersAndCollectionsService.ts

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ type LoadLayersOptions = {
2929
serviceCollection: ServiceCollection;
3030
scenarioCollection: ScenarioCollection;
3131
placeCollection: PlaceCollection;
32-
// aggregatedODGeojsonCollection: any;
3332
serviceLocator: any;
3433
};
3534

@@ -46,7 +45,6 @@ export const loadLayersAndCollections = async ({
4645
serviceCollection,
4746
scenarioCollection,
4847
placeCollection,
49-
// aggregatedODGeojsonCollection,
5048
serviceLocator
5149
}: LoadLayersOptions) => {
5250
try {
@@ -94,15 +92,6 @@ export const loadLayersAndCollections = async ({
9492
serviceLocator.collectionManager.add('places', placeCollection);
9593

9694
serviceLocator.pathLayerManager.updateFilter();
97-
/* if (Preferences.get('showAggregatedOdTripsLayer')) {
98-
await aggregatedODGeojsonCollection.loadFromServer(
99-
serviceLocator.socketEventManager,
100-
dataSourceCollection.size() > 0 ? dataSourceCollection.getFeatures()[0].get('id') : null
101-
);
102-
}
103-
104-
serviceLocator.collectionManager.add('aggregatedOD', aggregatedODGeojsonCollection);
105-
serviceLocator.eventManager.emit('map.updateLayer', 'aggregatedOD', aggregatedODGeojsonCollection.toGeojson()); */
10695
} catch (error) {
10796
console.error(error); // todo: better error handling
10897
}

0 commit comments

Comments
 (0)