| 43 | } |
| 44 | |
| 45 | public static void Main(string[] args) |
| 46 | { |
| 47 | Console.WriteLine(""); |
| 48 | if (args.Length < 2) usage(); |
| 49 | |
| 50 | mapObj m_obj = new mapObj(args[0]); |
| 51 | |
| 52 | if (args.Length >= 3) |
| 53 | { |
| 54 | Console.WriteLine("Setting the imagetype to " + args[2]); |
| 55 | m_obj.setImageType(args[2]); |
| 56 | } |
| 57 | |
| 58 | Console.WriteLine ("# Map layers " + m_obj.numlayers + "; Map name = " + m_obj.name); |
| 59 | for (int i=0; i<m_obj.numlayers; i++) |
| 60 | { |
| 61 | Console.WriteLine("Layer [" + i + "] name: " + m_obj.getLayer(i).name); |
| 62 | } |
| 63 | |
| 64 | imageObj i_obj = m_obj.draw(); |
| 65 | Console.WriteLine("Image URL = " + i_obj.imageurl + "; Image path = " + i_obj.imagepath); |
| 66 | Console.WriteLine("Image height = " + i_obj.height + "; width = " + i_obj.width); |
| 67 | try |
| 68 | { |
| 69 | i_obj.save(args[1],m_obj); |
| 70 | } |
| 71 | catch (Exception ex) |
| 72 | { |
| 73 | Console.WriteLine( "\nMessage ---\n{0}", ex.Message ); |
| 74 | Console.WriteLine( |
| 75 | "\nHelpLink ---\n{0}", ex.HelpLink ); |
| 76 | Console.WriteLine( "\nSource ---\n{0}", ex.Source ); |
| 77 | Console.WriteLine( |
| 78 | "\nStackTrace ---\n{0}", ex.StackTrace ); |
| 79 | Console.WriteLine( |
| 80 | "\nTargetSite ---\n{0}", ex.TargetSite ); } |
| 81 | } |
| 82 | } |
| 83 | |