加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

AnyMap在地图上添加自定义区域

发布时间:2020-12-15 17:54:09 所属栏目:百科 来源:网络整理
导读:Flash地图控件AnyMap 允许用户添加任意数量的自定义区域到地图中,使用它们可以在地图上显示森林、自定义区或任何其他自定义多边形。 下面的示例中我们将展示一幅拥有两个自定义区域的世界地图――一个用于东半球,一个用于西半球。工具提示将显示相关信息。

Flash地图控件AnyMap允许用户添加任意数量的自定义区域到地图中,使用它们可以在地图上显示森林、自定义区或任何其他自定义多边形。


下面的示例中我们将展示一幅拥有两个自定义区域的世界地图――一个用于东半球,一个用于西半球。工具提示将显示相关信息。

我们需要添加两个"Area"类型系列,例如北半球系列应该如下所示:

<series name="Norther Hemisphere">
  <point y="0" x="-180" />
  <point y="0" x="180" />
  <point y="90" x="180" />
  <point y="90" x="-180" />
</series>

我们还将添加相关的描述,并启用提示工具来显示这些信息。添加数据我们将使用如下属性:注意,如果多边形第一点和最后一点是不一样的,他们会自动连接。

<series name="Northern Hemisphere" type="Area" color="Blue" style="Hemi">
  <attributes>
    <attribute name="info">The Northern Hemisphere or northern hemisphere
is the half of a planet that is north of the
equator―the word hemisphere literally means
'half ball'. It is also that half of the celestial
sphere north of the celestial equator. Earth's
northern hemisphere contains most of the land
and about 90% of the human population.</attribute>
  </attributes>
  <point y="0" x="-180" />
  <point y="0" x="180" />
  <point y="90" x="180" />
  <point y="90" x="-180" />
</series>

在自定义区域内启用提示工具,只需将它设置在 <data_plot_settings>的<area_series>节点:

<area_series>
  <tooltip_settings enabled="true">
    <font render_as_html="true" />
    <format><![CDATA[%cbegin<font face="Verdan" size="10"><b>{%SeriesName}</b><br>{%info} %cend]]></format>
  </tooltip_settings>
</area_series>

132836885.jpg

参考资料:AnyMap使用教程

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读