Google map change



  • A Google card is produced in a standard way <div> c heigth = 40%♪ Then, by pressuring her, she's stretching all over the screen.heigth = 100%but the data for her are released to the same 40 percent of her height. ♪ ♪

    How do you get them to load at all altitudes?

    Code:

    <div id="map1" class="mapstep2" style="height:40%; margin: 0 auto; padding-bottom: 10px;"></div>
    

    <script async defer
    src="https://maps.googleapis.com/maps/api/js?key=mykey&callback=initMap">
    </script>

    var y = 0;
    function initMap() {
    var mapOptions1 = {
    zoom: 17,
    center: coords,
    mapTypeId: google.maps.MapTypeId.ROADMAP,
    draggable: false,
    }
    var map1 = new google.maps.Map(document.getElementById("map1"), mapOptions1, optnavigateonline);
    google.maps.event.addListener(map1, "click", function (event) {
    if (y == 0) {
    map1.setOptions({ draggable: true });
    $("#map1").css({ "height": "100%" });
    scroll_to_elem("map1", 10);
    y = 1;
    } else
    {
    if (y==1)
    {
    map1.setOptions({ draggable: false });
    $("#map1").css({ "height": "40%" });
    y = 0;
    }
    }



  • Call me in the right place:

     google.maps.event.trigger(map, "resize");
    

Log in to reply
 


Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2