@@ -104,9 +104,10 @@ function onRender(event: Event): void {
104104  // Get the RenderData from the event 
105105  const  data  =  ( event  as  CustomEvent < RenderData > ) . detail 
106106
107-   const  fig : string  =  data . args [ "fig " ] 
107+   const  script : string  =  data . args [ "script " ] 
108108  const  height : number  =  data . args [ "height" ] 
109109  const  width : number  =  data . args [ "width" ] 
110+   const  html : string  =  data . args [ "html" ] 
110111
111112  if  ( ! window . map )  { 
112113    // Only run this if the map hasn't already been created (and thus the global 
@@ -121,7 +122,7 @@ function onRender(event: Event): void {
121122      div1 . style . height  =  `${ height }  px` 
122123      div1 . style . width  =  `${ width }  px` 
123124
124-       if  ( fig . indexOf ( "document.getElementById('export')" )  !==  - 1 )  { 
125+       if  ( script . indexOf ( "document.getElementById('export')" )  !==  - 1 )  { 
125126        let  a  =  document . createElement ( "a" ) 
126127        a . href  =  "#" 
127128        a . id  =  "export" 
@@ -146,8 +147,11 @@ function onRender(event: Event): void {
146147      // The folium-generated script creates a variable called "map_div", which 
147148      // is the actual Leaflet map. 
148149      render_script . innerHTML  = 
149-         fig  +  `window.map = map_div; window.initComponent(map_div);` 
150+         script  +  `window.map = map_div; window.initComponent(map_div);` 
150151      document . body . appendChild ( render_script ) 
152+       const  html_div  =  document . createElement ( "div" ) 
153+       html_div . innerHTML  =  html 
154+       document . body . appendChild ( html_div ) 
151155    } 
152156  } 
153157} 
0 commit comments