Use QgsMapSettings::layerToMapUnits instead of deprecated QgsMapRenderer::layerToMapUnits