[mapguide-users] Dynamically specify colour and font of labels
Andy Morsell
amorsell at spatialgis.com
Mon Sep 15 13:07:43 EDT 2008
I did a little playing around with this. I modified the layer XML and then
uploading that modified XML for that layer resource via the mapagent. I
created a field in a table called Font and populated that with the various
fonts I wanted. Then I saved the layer XML from Autodesk MapGuide Studio,
modified it in Notepad++ and then uploaded via the mapagent. The result was
that the label font for all labels was some odd symbol font, not one of the
names I had in the table.
<Label>
<Unit>Inches</Unit>
<SizeContext>DeviceUnits</SizeContext>
<SizeX>0.3</SizeX>
<SizeY>ToInt32 (Height)</SizeY>
<Text>Camera_ID</Text>
<FontName>"Font"</FontName>
<ForegroundColor>ff000000</ForegroundColor>
<BackgroundColor>ffffffff</BackgroundColor>
<BackgroundStyle>Ghosted</BackgroundStyle>
<AdvancedPlacement>
<ScaleLimit>0.5</ScaleLimit>
</AdvancedPlacement>
</Label>
So, based on this, it looks like the font cannot be dynamically driven on a
label by label basis. A good question is, at the core of MGOS, is it using
one font and color value for an entire layer or theme category or is it on
an object by object basis? If the latter, then it seems like it might not
be too large of a task to modify the core code with this change. This would
be a good item for an enhancement request.
Andy Morsell, P.E.
Spatial Integrators, Inc.
www.SpatialGIS.com
From: mapguide-users-bounces at lists.osgeo.org
[mailto:mapguide-users-bounces at lists.osgeo.org] On Behalf Of Gary Morin
Sent: Monday, September 15, 2008 2:59 AM
To: 'MapGuide Users Mail List'
Subject: RE: [mapguide-users] Dynamically specify colour and font of labels
Hi
As I have had no response, do I take it the answer is no, it can't be done?
Thanks
Gary
_____
From: mapguide-users-bounces at lists.osgeo.org
[mailto:mapguide-users-bounces at lists.osgeo.org] On Behalf Of Gary Morin
Sent: 12 September 2008 15:54
To: mapguide-users at lists.osgeo.org
Subject: [mapguide-users] Dynamically spicfiy colour and font of labels
Hi
I know it possible to specify the height, rotation and justification of
feature labels dynamically, using attribute data. But is there a way to do
if for font and colour, i.e. have the font and colour of a label stored as
an attribute?
Thanks
Gary
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapguide-users/attachments/20080915/d7d20f66/attachment.html
More information about the mapguide-users
mailing list