Skip to content
Snippets Groups Projects
Commit 15e49968 authored by Miłosz Grocholewski's avatar Miłosz Grocholewski
Browse files

feat(vector-map): add stateAbbreviation field for modifications

parent b18ef55e
No related branches found
No related tags found
3 merge requests!271Resolve MIN-39 "Feat/ glyphs",!259Resolve MIN-35 "hypothetical option",!258feat(vector-map): add modifications for map elements
Pipeline #96497 passed
......@@ -127,10 +127,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',
......
......@@ -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(),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment