没有合适的资源?快使用搜索试试~ 我知道了~
WebGIS中的网络分析最近设施分析,这里的代码为源代码,且为后台代码。
资源推荐
资源详情
资源评论
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows;
using System.Windows.Controls;
using ESRI.ArcGIS.Client;
using ESRI.ArcGIS.Client.Geometry;
using ESRI.ArcGIS.Client.Tasks;
namespace ArcGISSilverlightSDK
{
public partial class ClosestFacility : UserControl
{
private RouteTask myRouteTask;
private GraphicsLayer facilitiesGraphicsLayer;
private GraphicsLayer IncidentsGraphicsLayer;
private GraphicsLayer barriersGraphicsLayer;
private GraphicsLayer routeGraphicsLayer;
List<Graphic> pointBarriers;
List<Graphic> polylineBarriers;
List<Graphic> polygonBarriers;
Random random;
public ClosestFacility()
{
InitializeComponent();
facilitiesGraphicsLayer = MyMap.Layers["MyFacilitiesGraphicsLayer"] as GraphicsLayer;
IncidentsGraphicsLayer = MyMap.Layers["MyIncidentsGraphicsLayer"] as GraphicsLayer;
barriersGraphicsLayer = MyMap.Layers["MyBarriersGraphicsLayer"] as GraphicsLayer;
using System.Collections.Generic;
using System.Linq;
using System.Windows;
using System.Windows.Controls;
using ESRI.ArcGIS.Client;
using ESRI.ArcGIS.Client.Geometry;
using ESRI.ArcGIS.Client.Tasks;
namespace ArcGISSilverlightSDK
{
public partial class ClosestFacility : UserControl
{
private RouteTask myRouteTask;
private GraphicsLayer facilitiesGraphicsLayer;
private GraphicsLayer IncidentsGraphicsLayer;
private GraphicsLayer barriersGraphicsLayer;
private GraphicsLayer routeGraphicsLayer;
List<Graphic> pointBarriers;
List<Graphic> polylineBarriers;
List<Graphic> polygonBarriers;
Random random;
public ClosestFacility()
{
InitializeComponent();
facilitiesGraphicsLayer = MyMap.Layers["MyFacilitiesGraphicsLayer"] as GraphicsLayer;
IncidentsGraphicsLayer = MyMap.Layers["MyIncidentsGraphicsLayer"] as GraphicsLayer;
barriersGraphicsLayer = MyMap.Layers["MyBarriersGraphicsLayer"] as GraphicsLayer;
routeGraphicsLayer = MyMap.Layers["MyRoutesGraphicsLayer"] as GraphicsLayer;
myRouteTask = new RouteTask("http://sampleserver6.arcgisonline.com/arcgis/rest/services/NetworkAnalysis/SanDiego/NAServer/ClosestFacility");
myRouteTask.SolveClosestFacilityCompleted += SolveClosestFacility_Completed;
myRouteTask.Failed += SolveClosestFacility_Failed;
pointBarriers = new List<Graphic>();
polylineBarriers = new List<Graphic>();
polygonBarriers = new List<Graphic>();
random = new Random();
}
private void SolveButton_Click(object sender, RoutedEventArgs e)
{
List<AttributeParameter> aps = new List<AttributeParameter>();
AttributeParameter ap = GetAttributeParameterValue (AttributeParameter2.SelectionBoxItem.ToString().Trim());
if (ap != null)
aps.Add( ap );
GenerateBarriers();
RouteClosestFacilityParameters routeParams = new RouteClosestFacilityParameters()
{
Incidents = IncidentsGraphicsLayer.Graphics,
Barriers = pointBarriers.Count > 0 ? pointBarriers : null,
PolylineBarriers = polylineBarriers.Count > 0 ? polylineBarriers : null,
PolygonBarriers = polygonBarriers.Count > 0 ? polygonBarriers : null,
Facilities = facilitiesGraphicsLayer.Graphics,
myRouteTask = new RouteTask("http://sampleserver6.arcgisonline.com/arcgis/rest/services/NetworkAnalysis/SanDiego/NAServer/ClosestFacility");
myRouteTask.SolveClosestFacilityCompleted += SolveClosestFacility_Completed;
myRouteTask.Failed += SolveClosestFacility_Failed;
pointBarriers = new List<Graphic>();
polylineBarriers = new List<Graphic>();
polygonBarriers = new List<Graphic>();
random = new Random();
}
private void SolveButton_Click(object sender, RoutedEventArgs e)
{
List<AttributeParameter> aps = new List<AttributeParameter>();
AttributeParameter ap = GetAttributeParameterValue (AttributeParameter2.SelectionBoxItem.ToString().Trim());
if (ap != null)
aps.Add( ap );
GenerateBarriers();
RouteClosestFacilityParameters routeParams = new RouteClosestFacilityParameters()
{
Incidents = IncidentsGraphicsLayer.Graphics,
Barriers = pointBarriers.Count > 0 ? pointBarriers : null,
PolylineBarriers = polylineBarriers.Count > 0 ? polylineBarriers : null,
PolygonBarriers = polygonBarriers.Count > 0 ? polygonBarriers : null,
Facilities = facilitiesGraphicsLayer.Graphics,
剩余10页未读,继续阅读
资源评论
AdvancedCoder
- 粉丝: 0
- 资源: 2
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- LLVM MachineScheduler UML 图
- 《算法设计与分析报告》
- Discuz插件 微信购买会员用户组V2.180418商业版
- CSP-JS2024第二轮官方测试数据
- 适用于typora编辑器的主题.zip
- chromedriver-win64-132.0.6824.0.zip
- chromedriver-win64-132.0.6823.0.zip
- chromedriver-win64-132.0.6821.2.zip
- petr按照j6中对transformer的处理进行优化,代码及结果
- PandaX是Go语言开源的企业级物联网平台低代码开发基座,支持设备管控,规则链,云组态,可视化大屏,报表设计器,表单设计器等功
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功