| 1 |
liveuser |
1 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
|
|
2 |
<html>
|
|
|
3 |
|
|
|
4 |
<head>
|
|
|
5 |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
|
|
6 |
<title>amMap example</title>
|
|
|
7 |
|
|
|
8 |
<link rel="stylesheet" href="../ammap/ammap.css" type="text/css">
|
|
|
9 |
<script src="../ammap/ammap.js" type="text/javascript"></script>
|
|
|
10 |
<!-- map file should be included after ammap.js -->
|
|
|
11 |
<script src="../ammap/maps/js/worldLow.js" type="text/javascript"></script>
|
|
|
12 |
|
|
|
13 |
<script src="../ammap/themes/black.js" type="text/javascript"></script>
|
|
|
14 |
<script>
|
|
|
15 |
|
|
|
16 |
AmCharts.theme = AmCharts.themes.black;
|
|
|
17 |
// add all your code to this method, as this will ensure that page is loaded
|
|
|
18 |
AmCharts.ready(function() {
|
|
|
19 |
// create AmMap object
|
|
|
20 |
var map = new AmCharts.AmMap();
|
|
|
21 |
|
|
|
22 |
// set path to images
|
|
|
23 |
|
|
|
24 |
|
|
|
25 |
/* create data provider object
|
|
|
26 |
mapVar tells the map name of the variable of the map data. You have to
|
|
|
27 |
view source of the map file you included in order to find the name of the
|
|
|
28 |
variable - it's the very first line after commented lines.
|
|
|
29 |
|
|
|
30 |
getAreasFromMap indicates that amMap should read all the areas available
|
|
|
31 |
in the map data and treat them as they are included in your data provider.
|
|
|
32 |
in case you don't set it to true, all the areas except listed in data
|
|
|
33 |
provider will be treated as unlisted.
|
|
|
34 |
*/
|
|
|
35 |
var dataProvider = {
|
|
|
36 |
mapVar: AmCharts.maps.worldLow,
|
|
|
37 |
getAreasFromMap:true
|
|
|
38 |
};
|
|
|
39 |
// pass data provider to the map object
|
|
|
40 |
map.dataProvider = dataProvider;
|
|
|
41 |
|
|
|
42 |
/* create areas settings
|
|
|
43 |
* autoZoom set to true means that the map will zoom-in when clicked on the area
|
|
|
44 |
* selectedColor indicates color of the clicked area.
|
|
|
45 |
*/
|
|
|
46 |
map.areasSettings = {
|
|
|
47 |
autoZoom: true,
|
|
|
48 |
rollOverBrightness:10,
|
|
|
49 |
selectedBrightness:20
|
|
|
50 |
};
|
|
|
51 |
|
|
|
52 |
// let's say we want a small map to be displayed, so let's create and add it to the map
|
|
|
53 |
map.smallMap = new AmCharts.SmallMap();
|
|
|
54 |
|
|
|
55 |
// write the map to container div
|
|
|
56 |
map.write("mapdiv");
|
|
|
57 |
});
|
|
|
58 |
|
|
|
59 |
</script>
|
|
|
60 |
</head>
|
|
|
61 |
|
|
|
62 |
<body>
|
|
|
63 |
<div id="mapdiv" style="width: 100%; background-color:#222222; height: 500px;"></div>
|
|
|
64 |
</body>
|
|
|
65 |
|
|
|
66 |
</html>
|