}
// create server vector data source before the map
if (layer.getSource() != null && layer.getSource() instanceof ServerVector) {
ServerVector vectorSource = (ServerVector) layer.getSource();
builder.append(renderServerVectorJs(vectorSource, layer));
}
// create vector data sources for clusters before the map
if (layer.getSource() != null && layer.getSource() instanceof Cluster) {
Cluster source = (Cluster) layer.getSource();
// for the GeoJSON loader, render the data loading function
if(source.getSource() instanceof ServerVector) {
ServerVector vectorSource = (ServerVector) source.getSource();
builder.append(renderServerVectorJs(vectorSource, layer));
}
}
builder.append(layer.getJsId() + " = new " + layer.getJsType() + "(" + layer.renderJs() + ");\n");