Skip to content
This repository was archived by the owner on Nov 30, 2018. It is now read-only.
This repository was archived by the owner on Nov 30, 2018. It is now read-only.

how to make map appear full screen width/height #429

Closed
@abbood

Description

@abbood

I included google maps sdk into my project and was able to make it appear 100% screen width/height by doing the following:

first i made sure the html tag was 100% height

html { height: 100% }

in the html file holding the google map, I just made the holding div 100% height/width as well:

#map {
  height: 100%
  width: 100%
}

and I basically load the map using javascript:

$(document).ready(function() {
    var handler;
    handler = Gmaps.build("Google");
    return handler.buildMap({
      internal: {
        id: "map"
      }
    }, function() {
      handler.fitMapToBounds();
    });
  });

with angular-google-maps, i simply followed the instructions.. which specifically asks to set a height for the map like so:

.angular-google-map-container { height: 400px; }

trying to set that to 100% results in nothing showing up in the page. I spent all morning messing with css, with no clear win. The closest I got was doing this

.angular-google-map-container { 
  height: 100%;
  position: absolute;
}

but then that made the map non-draggable..

any ideas?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions