OpenLayers map CSS - crop height The Next CEO of Stack OverflowSet cellpadding and cellspacing in CSS?How do I give text or an image a transparent background using CSS?Is there a CSS parent selector?How to make a div 100% height of the browser window?When to use margin vs padding in CSSChange an HTML5 input's placeholder color with CSSHow can I transition height: 0; to height: auto; using CSS?How do CSS triangles work?How do I vertically center text with CSS?Is it possible to apply CSS to half of a character?

Fastest way to shutdown Ubuntu Mate 18.10

Can the Reverse Gravity spell affect the Meteor Swarm spell?

Describing a person. What needs to be mentioned?

Would this house-rule that treats advantage as a +1 to the roll instead (and disadvantage as -1) and allows them to stack be balanced?

What does this shorthand mean?

Why does GHC infer a monomorphic type here, even with MonomorphismRestriction disabled?

Is it a good idea to use COLUMN AS (left([Another_Column],(4)) instead of LEFT in the select?

Example of a Mathematician/Physicist whose Other Publications during their PhD eclipsed their PhD Thesis

Increase performance creating Mandelbrot set in python

Why doesn't a table tennis ball float on the surface? How do we calculate buoyancy here?

How to be diplomatic in refusing to write code that breaches the privacy of our users

Only print output after finding pattern

How to safely derail a train during transit?

How to start emacs in "nothing" mode (`fundamental-mode`)

How to make a variable always equal to the result of some calculations?

How can I quit an app using Terminal?

Customer Requests (Sometimes) Drive Me Bonkers!

Is a stroke of luck acceptable after a series of unfavorable events?

WOW air has ceased operation, can I get my tickets refunded?

How long to clear the 'suck zone' of a turbofan after start is initiated?

What does "Its cash flow is deeply negative" mean?

Does it take more energy to get to Venus or to Mars?

Too much space between section and text in a twocolumn document

Is HostGator storing my password in plaintext?



OpenLayers map CSS - crop height



The Next CEO of Stack OverflowSet cellpadding and cellspacing in CSS?How do I give text or an image a transparent background using CSS?Is there a CSS parent selector?How to make a div 100% height of the browser window?When to use margin vs padding in CSSChange an HTML5 input's placeholder color with CSSHow can I transition height: 0; to height: auto; using CSS?How do CSS triangles work?How do I vertically center text with CSS?Is it possible to apply CSS to half of a character?










0















I have to work on code someone developped and remake all the interface. Here is the original HTML



<div class="ui-panelgrid-cell ui-g-12 ui-md-6 ui-l-6 ui-lg-8">
<div id="geoForm:j_idt55"
class="ui-dialog ui-widget ui-widget-content ui-corner-all ui-shadow ui-hidden-container ui-resizable"
role="dialog"
aria-labelledby="geoForm:j_idt55_title"
aria-hidden="true"
style="width: auto;
height: auto;"
>
...
</div>

<div id="map" class="map">
<div class="ol-viewport" data-view="32" style="position: relative; overflow: hidden; width: 100%; height: 100%; touch-action: none;">
<canvas class="ol-unselectable" width="1198" height="828" style="width: 100%; height: 100%; display: block;"></canvas>
<div class="ol-overlaycontainer"></div>
<div class="ol-overlaycontainer-stopevent">
<div class="ol-zoom ol-unselectable ol-control">
<button class="ol-zoom-in" type="button" title="Zoom in">+</button>
<button class="ol-zoom-out" type="button" title="Zoom out">−</button>
</div>
</div>
<div class="ol-scale-line ol-unselectable">
<div class="ol-scale-line-inner" style="width: 72px;">2 km</div>
</div>
<div class="ol-zoomslider ol-unselectable ol-control">
<button type="button" class="ol-zoomslider-thumb ol-unselectable" style="top: 188px;"></button>
</div>
<div id="geoForm:layerswitcher" class="ui-panel ui-widget ui-widget-content ui-corner-all" data-widget="layerSwitcher">
<div id="geoForm:layerswitcher_content" class="ui-panel-content ui-widget-content">
<img src="../../images/plan_on.png" onclick="setVisibilityPlan()" title="Plan" class="layerswitcher-icone layer-plan">
<img src="../../images/sat.png" onclick="setVisibilitySatellite()" title="Photo" class="layerswitcher-icone layer-sat">
</div>
</div>
</div>
</div>
</div>


My issue is the following. I want to use bootstrap as CSS framework and I also want to use vh for height management. The map has a specific width and should take the 2/3 of the width. My issue is concerning the height : I want to display 100% width and i want the height to fit the parent div height and to be cropped by the bottom (just because i have to display the map scale in it).



Actually the HTML should be like this : the container's height is 76vh for example.



<div class="row" style="padding-top: 15px;">
<div class="col-xs-12 col-md-6 col-lg-3 col-xl-3" style="background-color: #FFF;">column 1</div>
<div class="col-xs-12 col-md-6 col-lg-9 col-xl-9" style="background-color: #FFF;">
<div id="map">
HERE GOES THE MAP ...
</div>
</div>
</div>









share|improve this question




























    0















    I have to work on code someone developped and remake all the interface. Here is the original HTML



    <div class="ui-panelgrid-cell ui-g-12 ui-md-6 ui-l-6 ui-lg-8">
    <div id="geoForm:j_idt55"
    class="ui-dialog ui-widget ui-widget-content ui-corner-all ui-shadow ui-hidden-container ui-resizable"
    role="dialog"
    aria-labelledby="geoForm:j_idt55_title"
    aria-hidden="true"
    style="width: auto;
    height: auto;"
    >
    ...
    </div>

    <div id="map" class="map">
    <div class="ol-viewport" data-view="32" style="position: relative; overflow: hidden; width: 100%; height: 100%; touch-action: none;">
    <canvas class="ol-unselectable" width="1198" height="828" style="width: 100%; height: 100%; display: block;"></canvas>
    <div class="ol-overlaycontainer"></div>
    <div class="ol-overlaycontainer-stopevent">
    <div class="ol-zoom ol-unselectable ol-control">
    <button class="ol-zoom-in" type="button" title="Zoom in">+</button>
    <button class="ol-zoom-out" type="button" title="Zoom out">−</button>
    </div>
    </div>
    <div class="ol-scale-line ol-unselectable">
    <div class="ol-scale-line-inner" style="width: 72px;">2 km</div>
    </div>
    <div class="ol-zoomslider ol-unselectable ol-control">
    <button type="button" class="ol-zoomslider-thumb ol-unselectable" style="top: 188px;"></button>
    </div>
    <div id="geoForm:layerswitcher" class="ui-panel ui-widget ui-widget-content ui-corner-all" data-widget="layerSwitcher">
    <div id="geoForm:layerswitcher_content" class="ui-panel-content ui-widget-content">
    <img src="../../images/plan_on.png" onclick="setVisibilityPlan()" title="Plan" class="layerswitcher-icone layer-plan">
    <img src="../../images/sat.png" onclick="setVisibilitySatellite()" title="Photo" class="layerswitcher-icone layer-sat">
    </div>
    </div>
    </div>
    </div>
    </div>


    My issue is the following. I want to use bootstrap as CSS framework and I also want to use vh for height management. The map has a specific width and should take the 2/3 of the width. My issue is concerning the height : I want to display 100% width and i want the height to fit the parent div height and to be cropped by the bottom (just because i have to display the map scale in it).



    Actually the HTML should be like this : the container's height is 76vh for example.



    <div class="row" style="padding-top: 15px;">
    <div class="col-xs-12 col-md-6 col-lg-3 col-xl-3" style="background-color: #FFF;">column 1</div>
    <div class="col-xs-12 col-md-6 col-lg-9 col-xl-9" style="background-color: #FFF;">
    <div id="map">
    HERE GOES THE MAP ...
    </div>
    </div>
    </div>









    share|improve this question


























      0












      0








      0








      I have to work on code someone developped and remake all the interface. Here is the original HTML



      <div class="ui-panelgrid-cell ui-g-12 ui-md-6 ui-l-6 ui-lg-8">
      <div id="geoForm:j_idt55"
      class="ui-dialog ui-widget ui-widget-content ui-corner-all ui-shadow ui-hidden-container ui-resizable"
      role="dialog"
      aria-labelledby="geoForm:j_idt55_title"
      aria-hidden="true"
      style="width: auto;
      height: auto;"
      >
      ...
      </div>

      <div id="map" class="map">
      <div class="ol-viewport" data-view="32" style="position: relative; overflow: hidden; width: 100%; height: 100%; touch-action: none;">
      <canvas class="ol-unselectable" width="1198" height="828" style="width: 100%; height: 100%; display: block;"></canvas>
      <div class="ol-overlaycontainer"></div>
      <div class="ol-overlaycontainer-stopevent">
      <div class="ol-zoom ol-unselectable ol-control">
      <button class="ol-zoom-in" type="button" title="Zoom in">+</button>
      <button class="ol-zoom-out" type="button" title="Zoom out">−</button>
      </div>
      </div>
      <div class="ol-scale-line ol-unselectable">
      <div class="ol-scale-line-inner" style="width: 72px;">2 km</div>
      </div>
      <div class="ol-zoomslider ol-unselectable ol-control">
      <button type="button" class="ol-zoomslider-thumb ol-unselectable" style="top: 188px;"></button>
      </div>
      <div id="geoForm:layerswitcher" class="ui-panel ui-widget ui-widget-content ui-corner-all" data-widget="layerSwitcher">
      <div id="geoForm:layerswitcher_content" class="ui-panel-content ui-widget-content">
      <img src="../../images/plan_on.png" onclick="setVisibilityPlan()" title="Plan" class="layerswitcher-icone layer-plan">
      <img src="../../images/sat.png" onclick="setVisibilitySatellite()" title="Photo" class="layerswitcher-icone layer-sat">
      </div>
      </div>
      </div>
      </div>
      </div>


      My issue is the following. I want to use bootstrap as CSS framework and I also want to use vh for height management. The map has a specific width and should take the 2/3 of the width. My issue is concerning the height : I want to display 100% width and i want the height to fit the parent div height and to be cropped by the bottom (just because i have to display the map scale in it).



      Actually the HTML should be like this : the container's height is 76vh for example.



      <div class="row" style="padding-top: 15px;">
      <div class="col-xs-12 col-md-6 col-lg-3 col-xl-3" style="background-color: #FFF;">column 1</div>
      <div class="col-xs-12 col-md-6 col-lg-9 col-xl-9" style="background-color: #FFF;">
      <div id="map">
      HERE GOES THE MAP ...
      </div>
      </div>
      </div>









      share|improve this question
















      I have to work on code someone developped and remake all the interface. Here is the original HTML



      <div class="ui-panelgrid-cell ui-g-12 ui-md-6 ui-l-6 ui-lg-8">
      <div id="geoForm:j_idt55"
      class="ui-dialog ui-widget ui-widget-content ui-corner-all ui-shadow ui-hidden-container ui-resizable"
      role="dialog"
      aria-labelledby="geoForm:j_idt55_title"
      aria-hidden="true"
      style="width: auto;
      height: auto;"
      >
      ...
      </div>

      <div id="map" class="map">
      <div class="ol-viewport" data-view="32" style="position: relative; overflow: hidden; width: 100%; height: 100%; touch-action: none;">
      <canvas class="ol-unselectable" width="1198" height="828" style="width: 100%; height: 100%; display: block;"></canvas>
      <div class="ol-overlaycontainer"></div>
      <div class="ol-overlaycontainer-stopevent">
      <div class="ol-zoom ol-unselectable ol-control">
      <button class="ol-zoom-in" type="button" title="Zoom in">+</button>
      <button class="ol-zoom-out" type="button" title="Zoom out">−</button>
      </div>
      </div>
      <div class="ol-scale-line ol-unselectable">
      <div class="ol-scale-line-inner" style="width: 72px;">2 km</div>
      </div>
      <div class="ol-zoomslider ol-unselectable ol-control">
      <button type="button" class="ol-zoomslider-thumb ol-unselectable" style="top: 188px;"></button>
      </div>
      <div id="geoForm:layerswitcher" class="ui-panel ui-widget ui-widget-content ui-corner-all" data-widget="layerSwitcher">
      <div id="geoForm:layerswitcher_content" class="ui-panel-content ui-widget-content">
      <img src="../../images/plan_on.png" onclick="setVisibilityPlan()" title="Plan" class="layerswitcher-icone layer-plan">
      <img src="../../images/sat.png" onclick="setVisibilitySatellite()" title="Photo" class="layerswitcher-icone layer-sat">
      </div>
      </div>
      </div>
      </div>
      </div>


      My issue is the following. I want to use bootstrap as CSS framework and I also want to use vh for height management. The map has a specific width and should take the 2/3 of the width. My issue is concerning the height : I want to display 100% width and i want the height to fit the parent div height and to be cropped by the bottom (just because i have to display the map scale in it).



      Actually the HTML should be like this : the container's height is 76vh for example.



      <div class="row" style="padding-top: 15px;">
      <div class="col-xs-12 col-md-6 col-lg-3 col-xl-3" style="background-color: #FFF;">column 1</div>
      <div class="col-xs-12 col-md-6 col-lg-9 col-xl-9" style="background-color: #FFF;">
      <div id="map">
      HERE GOES THE MAP ...
      </div>
      </div>
      </div>






      css openlayers






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Mar 8 at 13:27









      JGH

      3,72941226




      3,72941226










      asked Mar 8 at 12:40









      davidveradavidvera

      73116




      73116






















          0






          active

          oldest

          votes












          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55063455%2fopenlayers-map-css-crop-height%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55063455%2fopenlayers-map-css-crop-height%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          How to get text form Clipboard with JavaScript in Firefox 56?How to validate an email address in JavaScript?How do JavaScript closures work?How do I remove a property from a JavaScript object?How do you get a timestamp in JavaScript?How do I copy to the clipboard in JavaScript?How do I include a JavaScript file in another JavaScript file?Get the current URL with JavaScript?How to replace all occurrences of a string in JavaScriptHow to check whether a string contains a substring in JavaScript?How do I remove a particular element from an array in JavaScript?

          Can't initialize raids on a new ASUS Prime B360M-A motherboard2019 Community Moderator ElectionSimilar to RAID config yet more like mirroring solution?Can't get motherboard serial numberWhy does the BIOS entry point start with a WBINVD instruction?UEFI performance Asus Maximus V Extreme

          List of MPs elected to the English parliament in 1640 (April) Contents List of constituencies and members See also Notes References Navigation menueNational Archives – The Glynde Place ArchivesCobbett's Parliamentary history of England, from the Norman Conquest in 1066 to the year 1803'Aldermen in Parliament', The Aldermen of the City of London: Temp. Henry III – 1912onepage&q&f&#61, false 229