Drupal Leaflet View loading view block through Ajax I created a view block for displaying geocodeed nodes on a View Leaflet map.
Everything working, the map displays the markers as I want.
Now, I would like to load this map throught drupal ajax

I attached the leaflet libraries to the page.
Then I load the view with:

$view = Views::getView('map');

$view-&gt;setArguments($args);
$view-&gt;setDisplay('block');
$view-&gt;preExecute();
$view-&gt;execute();
$content = $this-&gt;renderer-&gt;render($view-&gt;render());

$response-&gt;addCommand(
    new HtmlCommand('.result__map', $content)
 ));


The $content contain only an empty div generatated from the view and when the response is instered in the Dom nothing happen.
I suspesct that the map is missing some JS trigger to instanciante the map and maybe some JS settings. 

Could someone send me an example or point me in the right direction.
You must use the ViewExecutable::buildRenderable function.

Instead of:

$content = $this-&gt;renderer-&gt;render($view-&gt;render()); 


You must do like this:

$content = $view-&gt;buildRenderable('block', $args);