How do I use cordova-googlemaps-plugin to fill the screen with maps?

Asked 1 months ago, Updated 1 months ago, 4 views

I am currently practicing app development at cordova-googlemaps-plugin.

For the time being, I was able to display the map on the screen.
As for the map, how can I make it full on the screen?

The width is displayed properly regardless of whether you specify "px", "%", or "auto", but
The height does not respond with %% 」 or 」auto では, only with ppx 」 designation.

<!DOCTYPE html>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta http-equiv="Content-Security-Policy"/>
    <script type="text/javascript" src="cordova.js"></script>
    <script type="text/javascript">
   document.addEventListener("device ready", function(){
  vardiv = document.getElementById("map_canvas");;
}, false);

  <div style="width:auto;height:500px;"id="map_canvas"></div>

Thank you for your cooperation.

What's the problem?Or can it only be displayed with "px"?

Please let me know m(__)m

html cordova

2022-09-30 14:28

1 Answers

Basically, when using percentage for height, the height of the parent element must be determined.
html allows you to specify the percentage of the display area, so
How about html and body with height100%?

    height —100%;

    width: 100%;
    height —100%;
<div class="wrapper">
    <div class="target">
        Parent designated
<hr of >
    <div class="target">
        No parent is designated.

2022-09-30 14:28

If you have any answers or tips

© 2022 OneMinuteCode. All rights reserved.