Skip to content
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

map layers: remove all references to aggregatedOd layer #1266

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -28,7 +28,7 @@
/** Hexadecimal strings of the various colors that should be available */
colors: string[];
};
[key: string]: any;

Check warning on line 31 in packages/chaire-lib-common/src/config/defaultPreferences.config.ts

View workflow job for this annotation

GitHub Actions / code-lint

Unexpected any. Specify a different type
}

// TODO: Type more fields
Expand Down Expand Up @@ -89,7 +89,6 @@
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
Loading