void mapControl1_MapMouseClick(MapControlEventArgs e) { if (_router != null) { var routerPoint = _router.Resolve(Vehicle.Car, e.Position); if (routerPoint != null) { _points.Add(routerPoint); _layerPrimitives.AddPoint(routerPoint.Location, 15, SimpleColor.FromKnownColor(KnownColor.Black).Value); _layerPrimitives.AddPoint(routerPoint.Location, 7, SimpleColor.FromKnownColor(KnownColor.White).Value); } if (_points.Count > 1) { var tspRouter = new RouterTSPWrapper <RouterTSPAEXGenetic>( new RouterTSPAEXGenetic(), _router); var route = tspRouter.CalculateTSP(Vehicle.Car, _points.ToArray()); if (route != null) { _layerRoute.Clear(); _layerRoute.AddRoute(route); } } } }
void mapControl1_MapMouseClick(MapControlEventArgs e) { if (_router != null) { if (_point1 == null) { _point1 = _router.Resolve(Vehicle.Car, e.Position); } else if (_point2 == null) { _point2 = _router.Resolve(Vehicle.Car, e.Position); } else { _point1 = _point2; _point2 = _router.Resolve(Vehicle.Car, e.Position); } if (_point1 != null && _point2 != null) { Route route = _router.Calculate(Vehicle.Car, _point1, _point2); if (route != null) { _routeLayer.Clear(); _routeLayer.AddRoute(route); } } } }
void mapControl1_MapMouseMove(MapControlEventArgs e) { OsmSharp.Logging.Log.TraceEvent("MapControlForm", OsmSharp.Logging.TraceEventType.Information, "Map mouse move"); }
void mapControl1_MapMouseClick(MapControlEventArgs e) { if(_router != null) { var routerPoint = _router.Resolve(Vehicle.Car, e.Position); if(routerPoint != null) { _points.Add(routerPoint); _layerPrimitives.AddPoint(routerPoint.Location, 15, SimpleColor.FromKnownColor(KnownColor.Black).Value); _layerPrimitives.AddPoint(routerPoint.Location, 7, SimpleColor.FromKnownColor(KnownColor.White).Value); } if(_points.Count > 1) { var tspRouter = new RouterTSPWrapper<RouterTSPAEXGenetic>( new RouterTSPAEXGenetic(), _router); var route = tspRouter.CalculateTSP(Vehicle.Car, _points.ToArray()); if(route != null) { _layerRoute.Clear(); _layerRoute.AddRoute(route); } } } }
private void Route(MapControlEventArgs e) { //Route(e.Position); }