private void CarBeginRun() { var c = GetCarByName("car", MyMap.Layers["MyGraphicsLayer"] as GraphicsLayer); if (c != null) { //MessageBox.Show(dt1.ToString()); GetBeginPoint((c.Geometry as CustomMapPoint).Y, (c.Geometry as CustomMapPoint).X, 100); } Dtimer.Begin(); Ltimer.Begin(); }
private void Ltimer_Completed(object sender, EventArgs e) { isrealroadupdated = false; UpdateLength(); Ltimer.Begin(); }
private void ctlMap_MouseClick(object sender, MapMouseEventArgs e) { if (isbegin == true) { BaseGeometry bg = GetItemByID("routing", "begin"); if (bg != null) { LayerReset(); } var data = new ObservableCollection <VectorLayerData>(); var point = new Point(ctlMap.ViewportPointToLocation(e.ViewportPoint).Longitude, ctlMap.ViewportPointToLocation(e.ViewportPoint).Latitude); data.Add(new VectorLayerData { Geo = point.AsBinary(), ID = "begin", Label = "起点", }); layer.Add(data); isbegin = false; } if (islast == true) { var data = new ObservableCollection <VectorLayerData>(); var point = new Point(ctlMap.ViewportPointToLocation(e.ViewportPoint).Longitude, ctlMap.ViewportPointToLocation(e.ViewportPoint).Latitude); data.Add(new VectorLayerData { Geo = point.AsBinary(), ID = "last", Label = "终点", }); layer.Add(data); DraggablePushpin dp = GetDCarByMSID("drapcar", carml); if (dp != null) { GetBegionRoad(dp.Location.Latitude, dp.Location.Longitude, 100); } Dtimer.Begin(); Ltimer.Begin(); islast = false; } if (isbarrier == true) { //初始化一个图标 var data = new ObservableCollection <VectorLayerData>(); var point = new Point(ctlMap.ViewportPointToLocation(e.ViewportPoint).Longitude, ctlMap.ViewportPointToLocation(e.ViewportPoint).Latitude); GetBarrier(point.X, point.Y, 30); data.Add(new VectorLayerData { Geo = point.AsBinary(), ID = "barrier", Label = "障碍" + bn.ToString(), }); layer.Add(data); isbarrier = false; bn++; } }
private void LtimerCompleted(object sender, EventArgs e) { UpdateLength(); Ltimer.Begin(); }