Skip to content

Commit

Permalink
Use "name" instead of "uniqueName" or "displayName". This is because …
Browse files Browse the repository at this point in the history
…1) leaflet simply handles the name when the layer is changed and 2) the layer name needs to be unique anyway from the user standpoint (i.e. having layers with the same name is confusing to users).
  • Loading branch information
TomoyukiAota committed Dec 26, 2024
1 parent efee0e4 commit 13ff719
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/app/map/leaflet-map/leaflet-map.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ export class LeafletMapComponent implements OnDestroy, AfterViewInit {
attribution: tileProvider.attribution,
...this.commonLayerOptions,
});
layers[tileProvider.displayName] = tileLayer;
layers[tileProvider.name] = tileLayer;
});
return layers;
}
Expand Down
6 changes: 2 additions & 4 deletions src/app/map/leaflet-map/tile-server-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ const configFileUrl
= 'https://cdn.jsdelivr.net/gh/TomoyukiAota/photo-location-map-resources@main/map-config/osm-tile-server-config-version-1.jsonc';

interface RasterTileProvider {
uniqueName: string;
displayName: string;
name: string;
url: string;
attribution: string;
}
Expand All @@ -22,8 +21,7 @@ export const tileServerConfigFallback: TileServerConfig = {
version: '1',
rasterTileProviders: [
{
uniqueName: 'StandardTileLayer',
displayName: 'OpenStreetMap',
name: 'OpenStreetMap',
url: 'https://tile.openstreetmap.org/{z}/{x}/{y}.png',
attribution: '© OpenStreetMap contributors'
}
Expand Down

0 comments on commit 13ff719

Please sign in to comment.