display a minimal map

4 posts / 0 new
Last post
bertmaker
display a minimal map

Hi Y'all, first post from a mapquest noob here,

I want to display a minimal map in a browser, just to start somewhere. I collated this html from the website which gets parsed in Safari, IE and Chrome but nothing displays, What am I doing wrong?

thanks in advance for your time.

 

Bert

<html>
<head>
<script src="https://api.mqcdn.com/sdk/mapquest-js/v1.3.2/mapquest.js"></script>
<link type="text/css" rel="stylesheet" href="https://api.mqcdn.com/sdk/mapquest-js/v1.3.2/mapquest.css"/>
</head>
<body>
<div id="map" class="js-map"></div>
<script>
L.mapquest.key = 'I have my own key here';

// 'map' refers to a <div> element with the ID map
L.mapquest.map('map', {
center: [37.7749, -122.4194],
layers: L.mapquest.tileLayer('map'),
zoom: 12
});
</script>
</body>
</html>

 

 


MQBrianCoakley
Give your map div some

Give your map div some dimensions and you should be good to go.

 

<style>
#map {
width: 800px;
height: 600px;
}
</style>

 


bertmaker
That did the trick! Thanks!

That did the trick! Thanks!


MQBrianCoakley
Cool. Glad to help.
Cool. Glad to help.