如何访问 Datamap 对象属性?我试图打印 map.scope 但我没有定义。谁能告诉我如何访问地图对象属性?
<!DOCTYPE html>
<html>
<head>
<title>
</title>
</head>
<body>
<script src="http://d3js.org/d3.v3.min.js"></script>
<script src="http://d3js.org/topojson.v1.min.js"></script>
<script src="http://datamaps.github.io/scripts/datamaps.world.min.js?v=1"></script>
<div id="container" style="width: 400px; height: 400px;"></div>
<script>
var map = new Datamap({
scope: 'world',
element: document.getElementById("container"),
projection: 'mercator',
fills: {
defaultFill: '#f0af0a',
lt50: 'rgba(0,244,244,0.9)',
gt50: 'red'
},
data: {
USA: {fillKey: 'lt50' },
}
});
console.log(map.scope);
</script>
</body>
</html>