Exemple #1
0
 public Program(string mapFileName)
 {
     m_rm = new ReadMap(mapFileName);
     m_rm.loadRegion();
     Box box;
     box.xmin = 121.47070008731318;
     box.xmax = 121.49708348652267;
     box.ymin = 31.229476036434761;
     box.ymax = 31.243319909952547;
     MapRegion region = m_rm.getSmallRegion(box);
     Console.WriteLine(GeneralTool.distanceInMeter(box.xmin, box.ymin, box.xmin, box.ymax));
     Console.WriteLine(GeneralTool.distanceInMeter(box.xmin, box.ymin, box.xmax, box.ymin));
     m_genRoute = new GenRandRoute(region);
     m_estRoute = new EstimateRoute(region);
 }
Exemple #2
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="mapPt">经纬度基准点坐标</param>
 /// <param name="screenSize">屏幕大小</param>
 /// <param name="scale">缩放大小,1为放大1e4</param>
 public MapTransfer(MapPoint mapPt,PointF screenSize,double scale)
 {
     m_mapPt = mapPt;
     m_screenSize = screenSize;
     m_scale = scale;
     m_rm = new ReadMap(Properties.Resources.MapFileName);
     m_rm.loadRegion();
     Box box;
     box.xmin = m_mapPt.x;
     box.ymin = m_mapPt.y;
     box.xmax = m_mapPt.x + ((double)m_screenSize.X) / (m_scale * Properties.Settings.Default.ScaleFactor);
     box.ymax = m_mapPt.y + ((double)m_screenSize.Y) / (m_scale * Properties.Settings.Default.ScaleFactor);
     m_currentRegion = m_rm.getSmallRegion(box);
     m_bRebuildRegion = true;
     m_estOutRoute = new EstimateRoute(m_rm.region);
 }