[mapguide-users] Dynamically specify colour and font of labels

Gary Morin gary.morin at keynetix.com
Mon Sep 15 14:59:37 EDT 2008


Hi Andy

 

Thanks for your reply on this, in light of what you say, for now we will
populate the attribute table with font, weight and colour and then use
themeing of the layer, for the different combinations. Not ideal but it
solves the problem for now.

 

Thanks

 

Gary

 

  _____  

From: mapguide-users-bounces at lists.osgeo.org
[mailto:mapguide-users-bounces at lists.osgeo.org] On Behalf Of Andy Morsell
Sent: 15 September 2008 18:08
To: 'MapGuide Users Mail List'
Subject: RE: [mapguide-users] Dynamically specify colour and font of
labels

 

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/d1b28ca6/attachment.html


More information about the mapguide-users mailing list