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->setArguments($args); $view->setDisplay('block'); $view->preExecute(); $view->execute(); $content = $this->renderer->render($view->render()); $response->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.