I'm trying to use the GMaps.js in github but for some reason it is not working, I'm pretty sure I have typed it out right, if anybody could point me in the right direction thanks. (http://i.imgur.com/3LkL6xS.png actual photo in case it isn't big enough on here.)
Here is the new source code:
<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script src="http://maps.google.com/maps/api/js?key=AIzaSyBi7e8AiTyqWiFt9vlbGqsAzGyRhVWqCsk&sensor=true"></script>
<script src="js/gmaps.js"></script>
<script>
/**
* Basic Map
*/
$(document).ready(function(){
var map = new GMaps({
div: '#basic_map',
lat: 51.5073346,
lng: -0.1276831,
zoom: 12,
zoomControl : true,
zoomControlOpt: {
style : 'SMALL',
position: 'TOP_LEFT'
},
panControl : false,
});
});
</script>
</head>
<body>
<div id="basic_map"></div>
</body>
</html>
As I said in the comment, you are probably missing the width and height of the div, you try show map in.
Here is working jsfiddle: jsFiddle to play with
$(document).ready(function () {
var map = new GMaps({
div: '#basic_map',
lat: 51.5073346,
lng: -0.1276831,
width: '500px',
height: '500px',
zoom: 12,
zoomControl: true,
zoomControlOpt: {
style: 'SMALL',
position: 'TOP_LEFT'
},
panControl: false
});
});
Added width and height to the code.
Or Here you have the same result, with width and height in css. Not much difference.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With