MapContent mapContent = new MapContent();
MapViewport viewport = mapContent.getViewport();
viewport.setBounds(new ReferencedEnvelope(mapArea, DefaultGeographicCRS.WGS84));
viewport.setScreenArea(new Rectangle(width, height));
mapContent.addLayer(new FeatureLayer(featureSource, style));
StreamingRenderer renderer = new StreamingRenderer();
renderer.setRendererHints(renderingHints);
renderer.setMapContent(mapContent);
renderer.paint(g, viewport.getScreenArea(), viewport.getBounds());