MapGuide中如何更改选中地物的颜色?

简介:


MapGuide OpenSource/Enterprise中选中地物时缺省是用蓝色表示的。但如果我的地图上已经有蓝色地物了,很容易弄混,能不能自己定义选中地物的颜色呢?

嗯,没问题,可以的!

MapGuide Enterprise 2009 Update1中,对应的开源版本2.0以后版本

对应Ajax简答网页布局:


..\www\viewerfiles\ajaxmappane.templ
line 334
var selectionColor = '0x0000FFFF'; // Blue
改成你希望的颜色就行了

The value is 0xRRGGBBaa 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.

http://www.blythe.org/webwork/alphacolor.html

 

对于Flexible灵活网页布局(MapGuide Enterprise 2010中,2009中没有):

在ApplicationDefinition.xml中有一个<SelectionColor> 可以对选中地物的颜色进行设置。

这个文件在哪里?C:\Program Files\Autodesk\MapGuideEnterprise2010\WebServerExtensions\www\fusion\templates\mapguide\slate

Slate是MapGuide Studio里面对应的模版名字,你要用别的模版的话就改对应目录下的ApplicationDefinition.xml。

<MapSet>

  <MapGroupType id="Sheboygan">

    <Map>

      <Type>MapGuide</Type>

      <SingleTile>true</SingleTile>

      <Extension>

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

        <SelectionAsOverlay>true</SelectionAsOverlay>

        <SelectionColor>0x0000FFA0</SelectionColor>

      </Extension>

    </Map>

    <Extension />

  </MapGroupType>

</MapSet>

 

注意: 通过这种方式更改的是模版文件,只有新建灵活网页布局时才会生效,对已有的Flexible weblayout不起作用!!!如果你想一劳永逸,以后所有新建的灵活网页布局都用这种选中颜色,那就使用这种方案。如果你只想更改当前这一个灵活网页布局的选中颜色,不想改其他的,那么往下看。

  

要想更改当前的灵活网页布局的选中颜色,最简单的办法就是MapGuide Studio中的Map 选项卡,点“Edit Map Groups”按钮出现xml和上面的类似,更改SelectionColor 的值后,保存灵活网页布局即可。

 

For Flexible Web Layouts in MGE 2010 there is a setting exposed in the Flexible Web Layout definition seen through Studio. The user should 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.

 

好了,先到这里。 有问题的话论坛提问: www.newmgdn.com/bbs

作者: 峻祁连
邮箱:junqilian@163.com 
出处: http://junqilian.cnblogs.com 
转载请保留此信息。



本文转自峻祁连. Moving to Cloud/Mobile博客园博客,原文链接:http://www.cnblogs.com/junqilian/archive/2009/05/27/1491051.html ,如需转载请自行联系原作者
目录
打赏
0
0
0
0
23
分享
相关文章
去掉悬浮框与点击框之间的线条问题
解决方法: .arc-toolbar .block.app.initialized:hover:after { display: block; content: ''; position: absolute; width: 100%; ...
806 0
怎么修改模型的表面颜色?
在3D模型中,材质颜色是物体表面外观的重要组成部分。通过手动设置或从纹理图像中提取颜色值,可以为模型赋予丰富多彩的外观。
172 1
|
10月前
echars 设置文字倾斜 图表根据鼠标滑轮自动改变x轴数据
echars 设置文字倾斜 图表根据鼠标滑轮自动改变x轴数据
127 1
CSDN博客炫丽图标调整字体大小和颜色
CSDN博客炫丽图标调整字体大小和颜色
134 0
灰色3D按钮组合
在线演示 本地下载
635 0
计算机中的颜色X——两颜色的偏转值
  颜色C1到颜色C2的偏转值定义为,颜色C1沿顺时针方向偏转到颜色C2时所转过的角度。   偏转值和两颜色C1与C2的夹角类似,但不完全一样。两颜色的夹角表示为两颜色的色相值的夹角,取值范围为[0,180],C1和C2的夹角与C2和C1的夹角是一样的。
759 0
AI助理

你好,我是AI助理

可以解答问题、推荐解决方案等