Opened 10 years ago

Closed 10 years ago

#2393 closed enhancement (wontfix)

Make textsymbol more configurable

Reported by: gabrimonfa Owned by:
Priority: low Milestone:
Component: General Version: 2.5.0
Severity: trivial Keywords:
Cc: External ID:

Description

  1. 2.5.2.7949

textsymbol.templ in mapguide/webserverextensions/www/viewerfiles has many options that are not configurable, as

<Unit>Points</Unit>
<SizeContext>DeviceUnits</SizeContext>

<Rotation>0</Rotation>

<BackgroundColor>FF000000</BackgroundColor>
<BackgroundStyle>Transparent</BackgroundStyle>
<HorizontalAlignment>Center</HorizontalAlignment>
<VerticalAlignment>Baseline</VerticalAlignment>

I suggest to transform them in %s and to modify the functions that use the template in order to accept more parameters (with default values equals to those actually written in the template, in order to let older code run without modifications).

F.i. in layerdefinitionfactory.php

static function CreateTextSymbol($text, $fontHeight, $foregroundColor)

should become something like

static function CreateTextSymbol($text, $fontHeight,      $foregroundColor, 
$unit='Points', 
$sizeContext='DeviceUnits', 
$rotation=0, 
$font='Arial', 
$backgroundColor='FF000000', 
$backgroundStyle='Transparent', 
$horizontalAlignment='Center', 
$verticalAlignment='Baseline')

Change History (3)

comment:1 by jng, 10 years ago

Is there something in the existing set of web tier applications that would benefit from this change?

If this is for your own application, then might as well leave such modifications there. We don't want to change stuff like this for the sake of changing it, unless some existing built-in web tier application needs it.

comment:2 by gabrimonfa, 10 years ago

No, I'm not aware of any built-in web tier application (btw which are the built-in web tier applications? Ajax viewer and Fusion viewer?) that would benefit from this change.

I'm doing this change in my custom version of MapGuide (applying it in every new version) since I need to be able to stylize differently some textsymbols. So obviously I would need to apply one fewer patch if this change goes upstream.

I filed this enhancement since I realized that a similar change was made for other templates (that I also use to change in every version, in order to have more style configurations).

AreaRule.templ Mapguide 2.4

    <Stroke>
        <LineStyle>Solid</LineStyle>
        <Thickness>1</Thickness>
        <Color>FF000000</Color>
        <Unit>Points</Unit>
        <SizeContext>DeviceUnits</SizeContext>
    </Stroke>

AreaRule.templ Mapguide 2.5.2

        <Stroke>
            <LineStyle>%s</LineStyle>
            <Thickness>%s</Thickness>
            <Color>%s</Color>
            <Unit>%s</Unit>
            <SizeContext>%s</SizeContext>
        </Stroke>

Feel free to close this enhancement as non acceptable if the change is deemed non appropriate.

comment:3 by jng, 10 years ago

Resolution: wontfix
Status: newclosed

Yeah, I think you should just keep a local copy of these modified templates with your application.

Note: See TracTickets for help on using tickets.