<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Power BI - Cannot set height in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Power-BI-Cannot-set-height/m-p/140854#M4852</link>
    <description>&lt;P&gt;I am trying to develop custom visual for Power BI. I have div element with leaflet map. When I do not set a height, visual is emplty. I can set a height with&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;this.mapDiv.style.height="300px";&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But this is fixed.&lt;/P&gt;&lt;P&gt;How can I set height dynamically by viewport?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is my code&lt;/P&gt;&lt;PRE&gt;private mapDiv: HTMLElement;

    constructor(options: VisualConstructorOptions) {

        this.mapDiv = document.createElement("div");
        this.mapDiv.id = "mapid";   
        options.element.appendChild(this.mapDiv);

        var map = L.map('mapid');
            map.setView([48.14, 17.12], 13);

        L.tileLayer('https:....', {
                minZoom: 4,
                maxZoom: 18,
         }).addTo(map);

    }

    public update(options: VisualUpdateOptions) {
        // this.mapDiv.style.height = "300px"; WORKS
        this.mapDiv.style.height = options.viewport.height.toString(); // DOESNT WORKS !!!
    }&lt;/PRE&gt;</description>
    <pubDate>Sat, 11 Mar 2017 19:24:53 GMT</pubDate>
    <dc:creator>tomascvm</dc:creator>
    <dc:date>2017-03-11T19:24:53Z</dc:date>
    <item>
      <title>Power BI - Cannot set height</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Power-BI-Cannot-set-height/m-p/140854#M4852</link>
      <description>&lt;P&gt;I am trying to develop custom visual for Power BI. I have div element with leaflet map. When I do not set a height, visual is emplty. I can set a height with&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;this.mapDiv.style.height="300px";&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But this is fixed.&lt;/P&gt;&lt;P&gt;How can I set height dynamically by viewport?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is my code&lt;/P&gt;&lt;PRE&gt;private mapDiv: HTMLElement;

    constructor(options: VisualConstructorOptions) {

        this.mapDiv = document.createElement("div");
        this.mapDiv.id = "mapid";   
        options.element.appendChild(this.mapDiv);

        var map = L.map('mapid');
            map.setView([48.14, 17.12], 13);

        L.tileLayer('https:....', {
                minZoom: 4,
                maxZoom: 18,
         }).addTo(map);

    }

    public update(options: VisualUpdateOptions) {
        // this.mapDiv.style.height = "300px"; WORKS
        this.mapDiv.style.height = options.viewport.height.toString(); // DOESNT WORKS !!!
    }&lt;/PRE&gt;</description>
      <pubDate>Sat, 11 Mar 2017 19:24:53 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Power-BI-Cannot-set-height/m-p/140854#M4852</guid>
      <dc:creator>tomascvm</dc:creator>
      <dc:date>2017-03-11T19:24:53Z</dc:date>
    </item>
    <item>
      <title>Power BI - Cannot set height</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Power-BI-Cannot-set-height/m-p/140855#M4863</link>
      <description>&lt;P&gt;I am trying to develop custom visual for Power BI. I have div element with leaflet map. When I do not set a height, visual is emplty. I can set a height with&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;this.mapDiv.style.height="300px";&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But this is fixed.&lt;/P&gt;&lt;P&gt;How can I set height dynamically by viewport?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is my code&lt;/P&gt;&lt;PRE&gt;private mapDiv: HTMLElement;

    constructor(options: VisualConstructorOptions) {

        this.mapDiv = document.createElement("div");
        this.mapDiv.id = "mapid";   
        options.element.appendChild(this.mapDiv);

        var map = L.map('mapid');
            map.setView([48.14, 17.12], 13);

        L.tileLayer('https:....', {
                minZoom: 4,
                maxZoom: 18,
         }).addTo(map);

    }

    public update(options: VisualUpdateOptions) {
        // this.mapDiv.style.height = "300px"; WORKS
        this.mapDiv.style.height = options.viewport.height.toString(); // DOESNT WORKS !!!
    }&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 11 Mar 2017 19:28:41 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Power-BI-Cannot-set-height/m-p/140855#M4863</guid>
      <dc:creator>tomascvm</dc:creator>
      <dc:date>2017-03-11T19:28:41Z</dc:date>
    </item>
    <item>
      <title>Re: Power BI - Cannot set height</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Power-BI-Cannot-set-height/m-p/141381#M4875</link>
      <description>&lt;P&gt;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/23567"&gt;@tomascvm&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You need to add the&amp;nbsp;length unit.&lt;/P&gt;
&lt;PRE&gt;this.mapDiv.style.height = options.viewport.height.toString() + "px";&lt;/PRE&gt;</description>
      <pubDate>Mon, 13 Mar 2017 11:05:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Power-BI-Cannot-set-height/m-p/141381#M4875</guid>
      <dc:creator>v-chuncz-msft</dc:creator>
      <dc:date>2017-03-13T11:05:10Z</dc:date>
    </item>
  </channel>
</rss>

