Skip to content

Commit

Permalink
front: map: use the sprites for signals served by editoast
Browse files Browse the repository at this point in the history
This reduces a dependency to an external server

The sprites are also smaller
0.41Mb instead of 1.2Mb for the default sprite @2x

Signed-off-by: Tristram Gräbener <[email protected]>
  • Loading branch information
Tristramg committed Feb 4, 2025
1 parent 92a75ff commit f60ec38
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion editoast/src/views/sprites.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ async fn sprites(
}

let sprite_configs = SpriteConfig::load();
if !sprite_configs.contains_key(&signaling_system) {
if signaling_system != "default" && !sprite_configs.contains_key(&signaling_system) {
return Err(SpriteErrors::UnknownSignalingSystem { signaling_system }.into());
}
let path =
Expand Down
2 changes: 1 addition & 1 deletion front/src/common/Map/Layers/blankStyle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export const useMapBlankStyle = (): MapProps['mapStyle'] => {
if (!signalingSystems) return [];

const ponctualObjectsSprites: Sprite = {
url: 'https://static.osm.osrd.fr/sprites/sprites',
url: `${window.location.origin}${baseURL}/sprites/default/sprites`,
id: 'default',
};
const isDefaultSpriteValid = await isValidUrl(ponctualObjectsSprites.url);
Expand Down

0 comments on commit f60ec38

Please sign in to comment.