public static void Main(string[] args) { Console.WriteLine(""); if (args.Length < 3 || args.Length > 4) { usage(); } bool ZoomToResults = (args.Length == 4 && args[3] == "-zoom"); mapObj map = new mapObj(args[0]); Console.WriteLine("# Map layers " + map.numlayers + "; Map name = " + map.name); QueryByAttribute(args[1], map, ZoomToResults); map.querymap.status = mapscript.MS_ON; map.querymap.color.setRGB(0, 0, 255, 255); map.querymap.style = (int)MS_QUERYMAP_STYLES.MS_HILITE; try { imageObj image = map.drawQuery(); image.save(args[2], map); } catch (Exception ex) { Console.WriteLine("QueryMap: ", ex.Message); } }
public static void Main(string[] args) { Console.WriteLine(""); if (args.Length < 3 || args.Length > 4) usage(); bool ZoomToResults = (args.Length == 4 && args[3] == "-zoom"); mapObj map = new mapObj(args[0]); Console.WriteLine ("# Map layers " + map.numlayers + "; Map name = " + map.name); QueryByAttribute(args[1], map, ZoomToResults); map.querymap.status = mapscript.MS_ON; map.querymap.color.setRGB(0,0,255,255); map.querymap.style = (int)MS_QUERYMAP_STYLES.MS_HILITE; try { imageObj image = map.drawQuery(); image.save(args[2],map); } catch (Exception ex) { Console.WriteLine( "QueryMap: ", ex.Message ); } }