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 void InitVectorMap() { MapTileVectorDataSource localMapTileFileReader = new MapTileVectorDataSource(@"c:\nanjing\Nanjing.pst"); GeoSet getSet = localMapTileFileReader.GetGeoSet(); //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 = "宋体"; //getSet.GetMapMapFeatureLayer("1.lyr").FontColor = 0x0000FF; //getSet.GetMapMapFeatureLayer("1.lyr").FontName = "楷体"; //getSet.GetMapMapFeatureLayer("2.lyr").FontColor = 0; //getSet.GetMapMapFeatureLayer("2.lyr").FontName = "Arial"; //getSet.GetMapMapFeatureLayer("3.lyr").FontColor = 0; //getSet.GetMapMapFeatureLayer("3.lyr").FontName = "Arial"; //getSet.GetMapMapFeatureLayer("4.lyr").FontColor = 16711680; //getSet.GetMapMapFeatureLayer("4.lyr").FontName = "楷体"; //getSet.GetMapMapFeatureLayer("5.lyr").FontColor = 0; //getSet.GetMapMapFeatureLayer("5.lyr").FontName = "Arial"; // VectorMapRenderer vectorMapRenderer = new VectorMapRenderer(getSet); _mapTileDownloadManager = new MapTileDownloadManager(this, localMapTileFileReader); // getSet.Open(); }
public MapTileDownloadWorker(MapTileDownloadManager mapTileDownloadManager, MapTileIndex mapTileIndex) { this.mapTileIndex = mapTileIndex; this.mapTileDownloadManager = mapTileDownloadManager; localMapTileFileReader = frmMain.localMapTileFileReader; }