/*
 *    GeoTools - The Open Source Java GIS Toolkit
 *    http://geotools.org
 *
 *    (C) 2017, Open Source Geospatial Foundation (OSGeo)
 *
 *    This library is free software; you can redistribute it and/or
 *    modify it under the terms of the GNU Lesser General Public
 *    License as published by the Free Software Foundation;
 *    version 2.1 of the License.
 *
 *    This library is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 *    Lesser General Public License for more details.
 */
package org.geotools.mapbox;

public abstract class MBLayer {

    private String id;

    private String source;

    private String sourceLayer;

    private Boolean visibility;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getSource() {
        return source;
    }

    public void setSource(String source) {
        this.source = source;
    }

    public String getSourceLayer() {
        return sourceLayer;
    }

    public void setSourceLayer(String sourceLayer) {
        this.sourceLayer = sourceLayer;
    }

    public abstract String getType();

    public Boolean getVisibility() {
        return visibility;
    }

    public void setVisibility(Boolean visibility) {
        this.visibility = visibility;
    }

}

@@ -635,12 +635,19 @@
 ls.%0A
+ *    %0A
  */%0A
-
 pack
@@ -672,16 +672,52 @@
 apbox;%0A%0A
+import org.json.simple.JSONObject;%0A%0A
 public a
@@ -741,16 +741,46 @@
 ayer %7B%0A%0A
+    private JSONObject json;%0A%0A
     priv
@@ -886,17 +886,656 @@
 sibility
-;
+ = true;%0A%0A    public MBLayer(JSONObject json) %7B        %0A        super();%0A        this.json = json;%0A%0A        this.id = (String) json.get(%22id%22);%0A%0A        if (json.containsKey(%22source%22)) %7B%0A            this.source = (String) json.get(%22source%22);%0A        %7D%0A%0A        if (json.containsKey(%22source-layer%22)) %7B%0A            this.sourceLayer = (String) json.get(%22source-layer%22);%0A        %7D%0A%0A        if (json.containsKey(%22visibility%22)) %7B%0A            this.visibility = (Boolean) json.get(%22visibility%22);%0A        %7D%0A    %7D%0A%0A    public JSONObject getJson() %7B%0A        return json;%0A    %7D%0A%0A    public void setJson(JSONObject json) %7B%0A        this.json = json;%0A    %7D
 %0A%0A    pu

Update MBLayer for json