Example #1
0
        public frmMain()
        {
            InitializeComponent();
            MapLayer.SetAbstractGraphicsFactory(NETGraphicsFactory.getInstance());
            localMapTileFileReader = new MapTileVectorDataSource(@"D:\nanjing\Nanjing.pst");
            GeoSet getSet = localMapTileFileReader.GetGeoSet();

            graphics   = Graphics.FromImage(mapImage);
            drawFont   = new Font("Arial", 16, FontStyle.Bold);
            drawBrush  = new SolidBrush(Color.Red);
            pen        = new Pen(Color.Red);
            greenColor = Color.FromArgb(120, Color.Blue);
            fillBrush  = new SolidBrush(greenColor);
            getSet.GetMapMapFeatureLayer("POI.lyr").FontColor          = 0x0000FF;
            getSet.GetMapMapFeatureLayer("POI.lyr").FontName           = "楷体";
            getSet.GetMapMapFeatureLayer("LandMark.lyr").FontColor     = 0;
            getSet.GetMapMapFeatureLayer("LandMark.lyr").FontName      = "Arial";
            getSet.GetMapMapFeatureLayer("Adm_LandMark.lyr").FontColor = 0;
            getSet.GetMapMapFeatureLayer("Adm_LandMark.lyr").FontName  = "Arial";
            getSet.GetMapMapFeatureLayer("Road.lyr").FontColor         = 16711680;
            getSet.GetMapMapFeatureLayer("Road.lyr").FontName          = "楷体";
            getSet.GetMapMapFeatureLayer("RailWay.lyr").FontColor      = 0;
            getSet.GetMapMapFeatureLayer("RailWay.lyr").FontName       = "Arial";
            getSet.GetMapMapFeatureLayer("Landuse.lyr").FontColor      = 0;
            getSet.GetMapMapFeatureLayer("Landuse.lyr").FontName       = "Arial";
            getSet.GetMapMapFeatureLayer("Block.lyr").FontColor        = 0;
            getSet.GetMapMapFeatureLayer("Landuse.lyr").FontName       = "Arial";
            getSet.GetMapMapFeatureLayer("Adm_Area.lyr").FontColor     = 16711680;
            getSet.GetMapMapFeatureLayer("Adm_Area.lyr").FontName      = "宋体";
            mapTileDownloadManager = new MapTileDownloadManager(this);
            mapFileIndex           = new FileStream("world.ind", FileMode.Open);
            mapFileData            = new FileStream("world.dat", FileMode.Open);
            MapIndexReader         = new BinaryReader(mapFileIndex);
            MapDataReader          = new BinaryReader(mapFileData);
            for (int i = 0; i < 3; i++)
            {
                for (int j = 0; j < 3; j++)
                {
                    SelectedMapIndex[i, j] = false;
                }
            }
            SelectedMapIndex[0, 0] = true;
            DrawMapImages();
            cboMapType.SelectedIndex = 12;
            managerThread            = new Thread(new ThreadStart(mapTileDownloadManager.ProcessTaskList));
            managerThread.Start();
        }
Example #2
0
 public frmMain()
 {
     InitializeComponent();
     MapLayer.SetAbstractGraphicsFactory(NETGraphicsFactory.getInstance());
     localMapTileFileReader = new MapTileVectorDataSource(@"D:\nanjing\Nanjing.pst");
     GeoSet getSet = localMapTileFileReader.GetGeoSet();
     graphics = Graphics.FromImage(mapImage);
     drawFont = new Font("Arial", 16, FontStyle.Bold);
     drawBrush = new SolidBrush(Color.Red);
     pen = new Pen(Color.Red);
     greenColor = Color.FromArgb(120, Color.Blue);
     fillBrush = new SolidBrush(greenColor);
     getSet.GetMapMapFeatureLayer("POI.lyr").FontColor = 0x0000FF;
     getSet.GetMapMapFeatureLayer("POI.lyr").FontName = "楷体";
     getSet.GetMapMapFeatureLayer("LandMark.lyr").FontColor = 0;
     getSet.GetMapMapFeatureLayer("LandMark.lyr").FontName = "Arial";
     getSet.GetMapMapFeatureLayer("Adm_LandMark.lyr").FontColor = 0;
     getSet.GetMapMapFeatureLayer("Adm_LandMark.lyr").FontName = "Arial";
     getSet.GetMapMapFeatureLayer("Road.lyr").FontColor = 16711680;
     getSet.GetMapMapFeatureLayer("Road.lyr").FontName = "楷体";
     getSet.GetMapMapFeatureLayer("RailWay.lyr").FontColor = 0;
     getSet.GetMapMapFeatureLayer("RailWay.lyr").FontName = "Arial";
     getSet.GetMapMapFeatureLayer("Landuse.lyr").FontColor = 0;
     getSet.GetMapMapFeatureLayer("Landuse.lyr").FontName = "Arial";
     getSet.GetMapMapFeatureLayer("Block.lyr").FontColor = 0;
     getSet.GetMapMapFeatureLayer("Landuse.lyr").FontName = "Arial";
     getSet.GetMapMapFeatureLayer("Adm_Area.lyr").FontColor = 16711680;
     getSet.GetMapMapFeatureLayer("Adm_Area.lyr").FontName = "宋体";
     mapTileDownloadManager = new MapTileDownloadManager(this);
     mapFileIndex = new FileStream("world.ind", FileMode.Open);
     mapFileData = new FileStream("world.dat", FileMode.Open);
     MapIndexReader = new BinaryReader(mapFileIndex);
     MapDataReader = new BinaryReader(mapFileData);
     for(int i=0;i<3;i++)
     {
         for(int j=0;j<3;j++)
         {
             SelectedMapIndex[i, j] = false;
         }
     }
     SelectedMapIndex[0, 0] = true;
     DrawMapImages();
     cboMapType.SelectedIndex = 12;
     managerThread = new Thread(new ThreadStart(mapTileDownloadManager.ProcessTaskList));
     managerThread.Start();
 }
        public MapTileWriter(int startX, int startY, int endX, int endY, int level, int type, MapTileDownloadManager manager)
        {
            startIndexX = startX;
            startIndexY = startY;
            endIndexX = endX;
            endIndexY = endY;
            zoomLevel = level;
            mapType = type;
            mapTileDownloadManager = manager;
            try
            {
                FileStream notAvaiable = new FileStream("tile-na.png",FileMode.Open);
                notavaiablePng = new byte[notAvaiable.Length];
                notAvaiable.Read(notavaiablePng, 0, notavaiablePng.Length);
                notAvaiable.Close();

            }catch(Exception ex)
            {

            }
        }
 public MapTileDownloadWorker(MapTileDownloadManager mapTileDownloadManager, MapTileIndex mapTileIndex)
 {
     this.mapTileIndex = mapTileIndex;
     this.mapTileDownloadManager = mapTileDownloadManager;
     localMapTileFileReader = frmMain.localMapTileFileReader;
 }
 public MapTileDownloadWorker(MapTileDownloadManager mapTileDownloadManager, MapTileIndex mapTileIndex)
 {
     this.mapTileIndex           = mapTileIndex;
     this.mapTileDownloadManager = mapTileDownloadManager;
     localMapTileFileReader      = frmMain.localMapTileFileReader;
 }