HTMLcopy
1
<div id="container"></div>
CSScopy
6
1
html, body, #container {
2
width: 100%;
3
height: 100%;
4
margin: 0;
5
padding: 0;
6
}
JavaScriptcopy
x
1
anychart.onDocumentReady(function () {
2
3
// create a data set for connectors
4
var dataSet = [
5
{points: [33.62, 113.34, 36.05, 103.79]},
6
{points: [36.05, 103.79, 40.14, 94.66]},
7
{points: [40.14, 94.66, 38.14, 85.52]},
8
{points: [38.14, 85.52, 37.11, 79.91]},
9
{points: [37.11, 79.91, 39.46, 75.99]},
10
{points: [39.46, 75.99, 37.66, 62.16]},
11
{points: [37.66, 62.16, 35.68, 51.38]},
12
{points: [35.68, 51.38, 33.31, 44.36]},
13
{points: [33.31, 44.36, 36.19, 36.16]},
14
{points: [36.19, 36.16, 37.98, 23.72]},
15
{points: [37.98, 23.72, 45.44, 12.31]}
16
];
17
18
// create a map
19
var map = anychart.map();
20
21
// create a connector series
22
var series = map.connector(dataSet);
23
24
// set geodata
25
map.geoData(anychart.maps['world']);
26
27
// title the map
28
map.title("Silk Road Trade Route from Xian to Venice");
29
30
// set the container id
31
map.container('container');
32
33
// draw the map
34
map.draw();
35
36
});