首页 文章

本地ArcGIS Server REST服务未在Silverlight中加载

提问于
浏览
0

我正在使用“ArcGIS API for Silverlight 3.2”进行开发,并将我的 Map 发布到本地主机上的ArcServer 10.2中,并且可以完美地使用javascript加载我自己的REST服务 .

但是,当我尝试从ArcGIS Server Map 服务加载自己的REST服务时,Silverlight控件将运行,在底部显示ESRI图像但不显示 Map .

我的xaml代码是:

<UserControl x:Class="CreatingAMap.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:esri="http://schemas.esri.com/arcgis/client/2009"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="400">
<Grid x:Name="LayoutRoot" Background="White">
    <esri:Map x:Name="MyMap">
        <esri:Map.Layers>
            <esri:ArcGISDynamicMapServiceLayer ID="test2" Url="http://localhost:6080/arcgis/rest/services/Electricity_WMS/MapServer" />              
        </esri:Map.Layers>
    </esri:Map>

</Grid>

当我把我自己的REST地址作为URL属性时,我可以在设计模式下看到我的 Map 但我会运行它,在底部显示ESRI图像但没有 Map .

当我在ArcGIS Sever中使用样本服务时,例如“SampleWorldCities”,默认情况下它在ArcServer 10.2中,或者在ArcGIS Online中使用样本,我的应用程序运行得很完美但是当我使用我在ArcServer中发布的服务时,不工作并显示ESRI图像在底部但没有 Map .

有线索吗?

2 回答

  • 0

    我不确定,但我不认为该元素是必需的 . 不用那样试试,例如:

    <esri:Map x:Name="MyMap">
        <esri:ArcGISDynamicMapServiceLayer ID="test2" Url="http://localhost:6080/arcgis/rest/services/Electricity_WMS/MapServer" />
    </esri:Map>
    
  • 0

    您是否尝试过像fiddler这样的嗅探工具来查看http请求发生了什么?听起来它可能是跨域策略设置 . 同样,silverlight使用可能是原因的客户端访问策略xml文件 . 首先,首先,使用像fiddler这样的工具来查看服务调用的内容 . 希望这可以帮助 .

相关问题