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
// This sample uses 3rd party proj4 component
4
// that makes it possible to set coordinates
5
// for the points and labels on the map and
6
// required for custom projections and grid labels formatting.
7
// See https://docs.anychart.com/Maps/Map_Projections
8
9
// create data set
10
var data = [
11
{points: [50.8, -3.6, 50.8, -1.6]},
12
{points: [50.8, -1.6, 51.5, -0.16], to: "New Forest National Park"},
13
{points: [51.5,-0.16, 51.7, -1.29]},
14
{points: [51.7, -1.29, 52.2, 0.27]},
15
{points: [52.2, 0.27, 53.3, -1.5], to: "Cambridge"},
16
{points: [53.3, -1.5, 54.5,-3.4], to: "Edinburgh"},
17
{points: [54.5, -3.4, 57.1, -2.19], to: "Aberdeen"}
18
];
19
20
// create map
21
var map = anychart.map();
22
23
//create connector series
24
var series = map.connector(data);
25
26
// set geodata
27
map.geoData(anychart.maps['united_kingdom']);
28
29
// name of the chart
30
map.title("The touristic interest route through the UK \n");
31
32
// set container id for the chart
33
map.container('container');
34
35
// initiate chart drawing
36
map.draw();
37
});