【问题标题】:Local ArcGIS Server REST services not loading in Silverlight本地 ArcGIS Server REST 服务未在 Silverlight 中加载
【发布时间】:2014-06-30 11:49:18
【问题描述】:

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

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

我的 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 属性时,我可以在设计模式下看到我的地图,但我会运行它,在底部显示 ESRI 图像但没有地图。!!!

此外,当我在 ArcGIS Sever 中使用示例服务(例如默认情况下位于 ArcServer 10.2 中的“SampleWorldCities”)或在 ArcGIS Online 中使用示例时,我的应用程序运行良好,但是当我使用我在 ArcServer 中发布的服务时,无法正常工作并且在底部显示 ESRI 图像,但没有地图。

有什么线索吗?

【问题讨论】:

    标签: silverlight arcgis esri arcgis-server


    【解决方案1】:

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

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

    【讨论】:

    • 请注意。我试了一下,但它不起作用。
    【解决方案2】:

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

    【讨论】:

      猜你喜欢
      • 2016-03-01
      • 2018-05-16
      • 1970-01-01
      • 2013-12-31
      • 2017-10-22
      • 2020-11-29
      • 2023-03-05
      • 2019-04-24
      • 2021-01-31
      相关资源
      最近更新 更多