In MapGuide, how do I change the color of a selected object?

Source: Internet
Author: User

In MapGuide OpenSource/Enterprise, the selected objects are displayed in blue by default. However, if I already have blue features on the map, it's easy to mix them up. Can I define the color of the selected feature?

Well, no problem. You can!

In MapGuide Enterprise 2009 Update1, the corresponding open-source version is later than 2.0.

Corresponding to the Ajax simple answer webpage layout:

.. \ Www \ viewerfiles \ ajaxmappane. templ
Line 334
Var selectionColor = '0x0000ffff'; // Blue
Just change the color you want.

The value is 0 xRRGGBBaa where each is a hex value from 0-255 representing your RGB and transparency (alpha) values. currently I'm not seeing the alpha value have any impact as either FF or 00 so I don't think it's being used.

Don't mistakenly try to use HTML hex color codes as this is an RGB color code.

Here's a site with sample color values.



For Flexible web page layout (not in MapGuide Enterprise 2010, 2009 ):

In ApplicationDefinition. xml, <SelectionColor> can be used to set the color of the selected object.

Where is this file? C: \ Program Files \ Autodesk \ MapGuideEnterprise2010 \ WebServerExtensions \ www \ fusion \ templates \ mapguide \ slate

Slate is the Template Name in MapGuide Studio. If you want to use another template, change ApplicationDefinition. xml in the corresponding directory.


<MapGroupType id = "Sheboygan">


<Type> MapGuide </Type>

<SingleTile> true </SingleTile>


<ResourceId> Library: // Samples/Sheboygan/Maps/Sheboygan. MapDefinition </ResourceId>

<SelectionAsOverlay> true </SelectionAsOverlay>

<SelectionColor> 0x0000FFA0 </SelectionColor>







Note: This method is used to change the template file. It takes effect only when you create a new Flexible web page layout. It does not work for the existing Flexible weblayout !!! If you want to use this color for all new flexible web pages in the future, you can use this method. If you only want to change the selected color of the current flexible web page layout and do not want to change the color of other pages, go down and look down.

To change the selected color of the current flexible web page layout, the simplest way is to select the Map tab in MapGuide Studio, and click the "Edit Map Groups" button to see xml similar to the above, after changing the value of SelectionColor, save the flexible webpage layout.


For Flexible Web Layouts in MGE 2010 there is a setting exposed in the Flexible Web Layout definition seen through Studio. the user shocould click the Edit Map Groups button on the Map component panel of the Flexible Layout and contained within each map group section there is a <SelectionColor> setting which allows the Author to specify the selection color for each map. again the same values as above apply. in MGE 2009 no setting is exposed.



Okay. First come here. If you have any questions, ask the Forum:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.