diff --git a/src/components/Map/MapViewer/MapViewerVector/utils/shapes/MapElement.ts b/src/components/Map/MapViewer/MapViewerVector/utils/shapes/MapElement.ts index 337e6f0f7f6914891970894a902fc64db61a6300..e0943fb44bf4a3cb655f262e80cef366ef24b1a4 100644 --- a/src/components/Map/MapViewer/MapViewerVector/utils/shapes/MapElement.ts +++ b/src/components/Map/MapViewer/MapViewerVector/utils/shapes/MapElement.ts @@ -131,10 +131,13 @@ export default class MapElement { fill: getFill({ color: rgbToHex(modification.fillColor) }), zIndex: modification.z, }); - if (modification.name) { + const modificationText = modification.stateAbbreviation + ? modification.stateAbbreviation + : modification.name; + if (modificationText) { modificationStyle.setText( new Text({ - text: modification.name, + text: modificationText, font: `${modification.fontSize}px Arial`, textAlign: 'center', textBaseline: 'middle', diff --git a/src/models/modelElementModificationSchema.ts b/src/models/modelElementModificationSchema.ts index c5c19b3207db2e1a08ce4448b88a42a586b86b61..0d604ceaa065a955f37be81e44f86f79320c624b 100644 --- a/src/models/modelElementModificationSchema.ts +++ b/src/models/modelElementModificationSchema.ts @@ -15,6 +15,7 @@ export const modelElementModificationSchema = z.object({ fillColor: colorSchema, fontSize: z.number(), state: z.string().nullable().optional(), + stateAbbreviation: z.string().nullable().optional(), direction: z.enum(['RIGHT', 'LEFT']).optional(), active: z.boolean().optional(), sboTerm: z.string(),