logo separator

[mkgmap-dev] Question reg. StyleImpl

From GerdP gpetermann_muenchen at hotmail.com on Thu Apr 11 07:51:38 BST 2013

Hi programmers,

I found quite a lot of places in mkgmap source with a block like below.
I'd prefer to put this into a static method like 
  public static Style readStyle(Properties props)
in the StyleImpl class.
Any reasons why that wasn't done until now?

		String loc = props.getProperty("style-file");
		if (loc == null)
			loc = props.getProperty("map-features");
		String name = props.getProperty("style");

		if (loc == null && name == null)
			name = "default";

		try {
			this.style = new StyleImpl(loc, name);
			this.style.applyOptionOverride(props);

		} catch (SyntaxException e) {
			System.err.println("Error in style: " + e.getMessage());
			throw new ExitException("Could not open style " + name);
		} catch (FileNotFoundException e) {
			String name1 = (name != null)? name: loc;
			throw new ExitException("Could not open style " + name1);
		}


Gerd



--
View this message in context: http://gis.19327.n5.nabble.com/Question-reg-StyleImpl-tp5756589.html
Sent from the Mkgmap Development mailing list archive at Nabble.com.


More information about the mkgmap-dev mailing list