Through a code in HTML, I try to add a basemap of StamenMaps through Open Layer, but it does not work for me.
<!DOCTYPE html>
<html lang="es">
<head>
<meta charset="UTF-8">
<link rel="stylesheet" href="https://openlayers.org/en/v6.5.0/css/ol.css" type="text/css">
<script src="https://openlayers.org/en/v4.6.5/build/ol.js" type="text/javascript"></script>
<style>
#mapa {
height: 100%;
width: 100%;
}
</style>
<title>Mapa básico</title>
</head>
<body>
<div id="mapa"></div>
<script type="text/javascript">
var vista = new ol.View({
center:[-411000, 4928000],
zoom:6
});
var capa = [
new ol.layer.Tile({
source: new ol.source.Stamen({
layer: 'watercolor'
})
}),
];
var mapa = new ol.Map({
target:"mapa",
layers:[capa],
view:vista
});
</script>
</body>
</html>
When I click on the file, the browser goes blank. Is there something wrong when I call the StamenMaps map source?