请问如何基于web edition 实现以下功能:
(1)首先可以根据道路名称查询(支持模糊查询)点击 定位系统会追到当前查询出的位置并且闪烁表示。
(2) 位置查询 (比如某个建筑物名称,支持模糊查询)点击定位系统追到当前查询位置闪烁表示
(3) 缓冲区查询
设定半径为多少米,查询出来的属性以列表形式显示并且点击某一属性闪烁定位。
能否给我们提供以上功能示例代码,功能界面见附件,谢谢、
gong_neng_xu_qiu.doc (176 KB)
请问如何基于web edition 实现以下功能:
(1)首先可以根据道路名称查询(支持模糊查询)点击 定位系统会追到当前查询出的位置并且闪烁表示。
(2) 位置查询 (比如某个建筑物名称,支持模糊查询)点击定位系统追到当前查询位置闪烁表示
(3) 缓冲区查询
设定半径为多少米,查询出来的属性以列表形式显示并且点击某一属性闪烁定位。
能否给我们提供以上功能示例代码,功能界面见附件,谢谢、
gong_neng_xu_qiu.doc (176 KB)
Hi Wang,
从你的需求来看,可以分为两个步骤:
这里贴上了一些第一步的参考代码:
InMemoryMarkerOverlay markerOverlay =newInMemoryMarkerOverlay("MarkerOverlay");markerOverlay.ZoomLevelSet.ZoomLevel01.DefaultMarkerStyle.WebImage =newWebImage("../../theme/default/img/marker_blue.gif", 21, 25);markerOverlay.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
Collection<feature> markers =newCollection<feature>();// Option 1, searching from shape file.ShapeFileFeatureSource featureSource =newShapeFileFeatureSource(Server.MapPath("~/data/road.shp"));featureSource.Open();DataTable dt = featureSource.ExecuteQuery(string.Format("SELECT FID FROM Road where ST_Name like '%{0}%'"));if(dt.Rows.Count > 0){foreach(DataRow itemindt.Rows){Feature location = (featureSource.GetFeaturesByColumnValue("FID", item[0].ToString()).First());markers.Add(newFeature(location.GetShape().GetCenterPoint()));}}
// Option 2, using online geocoding service API. like Baidu Geocoding API: <a href="developer.baidu.com/map/index.php?title=webapi/guide/webservice-geocoding" tabindex="0">developer.baidu.com/map/inde...-geocoding</a>PointShape lnglat = GetLocationFromWebSerivce("260 Cahaba Valley Rd,Pelham,AL,35124");markers.Add(newFeature(lnglat));
对于第二步,我猜你们肯定有自己的数据作为查询数据源,比如自来水管的数据,我们以数据格式是shp为例,搜索指定半径内水表井数据:
ShapeFileFeatureSource wellFeatureSource =newShapeFileFeatureSource(Server.MapPath("~/data/well.shp"));wellFeatureSource.Open();Collection<feature> result = wellFeatureSource.GetFeaturesWithinDistanceOf(currentLocation, GeographyUnit.DecimalDegree, DistanceUnit.Meter, 200, ReturningColumnsType.AllColumns);
Thanks,
Kevin