Reputation: 594
Sorry this might seem like a stupid question, but has been frustrating me for a second day now ;///
I can get the map to show up no matter what.
Created new test project this is Application.html.erb
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<style type="text/css">
html { height: 100% }
body { height: 100%; margin: 0; padding: 0 }
#gmap { height: 100% }
</style>
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false&libraries=geometry&v=3.7">
</script>
<script src="http://code.jquery.com/jquery-1.9.0.min.js"></script>
<%= stylesheet_link_tag "application", :media => "all" %>
<%= javascript_include_tag "maplace.min" %>
<script type="text/javascript">
$(function() {
new Maplace({
locations: [-34.397, 150.644],
controls_on_map: false
}).Load();
});
</script>
<title>Maptest</title>
</head>
<body>
<div id="gmap"></div>
</body>
</html>
And it seems like all of the javascripts are loaded without any problems. Please Help
Upvotes: 1
Views: 881
Reputation: 1588
I think this should work, try:
new Maplace({
locations: [{
lat: -34.397,
lon: 150.644
}],
controls_on_map: false
}).Load();
Upvotes: 1
Reputation: 18099
I think you need to give proper dimensions to the map container. As seen from the post, you mentioned:
#gmap { height: 100% }
But, I guess it's missing the width. You should try adding the width to the container. Something like:
#gmap { height: 100%;width:400px;} //Just a random dimension.
Upvotes: 1