1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
|
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Parse SVG</title>
<script src="../dist/zrender.js"></script>
</head>
<body>
<style>
html, body, #main {
width: 100%;
height: 100%;
margin: 0;
}
</style>
<div id="main"></div>
<script type="text/javascript">
var zr = zrender.init(document.getElementById('main'));
fetch('./asset/Tehran_topo.svg')
.then(response => response.text())
.then(zrender.parseSVG)
.then(result => {
result.root.scale = [0.4, 0.4];
zr.add(result.root);
});
</script>
</body>
</html>
|