You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

121 lines
4.2 KiB

1 year ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
  2. <html>
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  5. <title>amMap examples</title>
  6. <link rel="stylesheet" href="../ammap/ammap.css" type="text/css">
  7. <script src="../ammap/ammap.js" type="text/javascript"></script>
  8. <!-- map file should be included after ammap.js -->
  9. <script src="../ammap/maps/js/worldLow.js" type="text/javascript"></script>
  10. <script>
  11. var map;
  12. // svg path for target icon
  13. var targetSVG = "M9,0C4.029,0,0,4.029,0,9s4.029,9,9,9s9-4.029,9-9S13.971,0,9,0z M9,15.93 c-3.83,0-6.93-3.1-6.93-6.93S5.17,2.07,9,2.07s6.93,3.1,6.93,6.93S12.83,15.93,9,15.93 M12.5,9c0,1.933-1.567,3.5-3.5,3.5S5.5,10.933,5.5,9S7.067,5.5,9,5.5 S12.5,7.067,12.5,9z";
  14. // svg path for plane icon
  15. var planeSVG = "m2,106h28l24,30h72l-44,-133h35l80,132h98c21,0 21,34 0,34l-98,0 -80,134h-35l43,-133h-71l-24,30h-28l15,-47";
  16. AmCharts.ready(function() {
  17. map = new AmCharts.AmMap();
  18. var dataProvider = {
  19. mapVar: AmCharts.maps.worldLow
  20. };
  21. map.areasSettings = {
  22. unlistedAreasColor: "#8dd9ef"
  23. };
  24. map.imagesSettings = {
  25. color: "#585869",
  26. rollOverColor: "#585869",
  27. selectedColor: "#585869",
  28. pauseDuration: 0.2,
  29. animationDuration:2.5,
  30. adjustAnimationSpeed:true
  31. };
  32. map.linesSettings = {
  33. color: "#585869",
  34. alpha: 0.4
  35. };
  36. // LONDON
  37. var lines = [{
  38. id: "line1",
  39. arc: -0.85,
  40. alpha: 0.3,
  41. latitudes: [48.8567, 43.8163, 34.3, 23],
  42. longitudes: [2.3510, -79.4287, -118.15, -82]
  43. }, {
  44. id: "line2",
  45. alpha: 0,
  46. color: "#000000",
  47. latitudes: [48.8567, 43.8163, 34.3, 23],
  48. longitudes: [2.3510, -79.4287, -118.15, -82]
  49. }];
  50. // cities
  51. var cities = [{
  52. svgPath: targetSVG,
  53. title: "Paris",
  54. latitude: 48.8567,
  55. longitude: 2.3510
  56. }, {
  57. svgPath: targetSVG,
  58. title: "Toronto",
  59. latitude: 43.8163,
  60. longitude: -79.4287
  61. }, {
  62. svgPath: targetSVG,
  63. title: "Los Angeles",
  64. latitude: 34.3,
  65. longitude: -118.15
  66. }, {
  67. svgPath: targetSVG,
  68. title: "Havana",
  69. latitude: 23,
  70. longitude: -82
  71. }, {
  72. svgPath: planeSVG,
  73. positionOnLine: 0,
  74. color: "#000000",
  75. alpha: 0.1,
  76. animateAlongLine: true,
  77. lineId: "line2",
  78. flipDirection: true,
  79. loop: true,
  80. scale: 0.03,
  81. positionScale: 1.3
  82. }, {
  83. svgPath: planeSVG,
  84. positionOnLine: 0,
  85. color: "#585869",
  86. animateAlongLine: true,
  87. lineId: "line1",
  88. flipDirection: true,
  89. loop: true,
  90. scale: 0.03,
  91. positionScale: 1.8
  92. }];
  93. dataProvider.images = cities;
  94. dataProvider.lines = lines;
  95. dataProvider.zoomLevel = 3.5;
  96. dataProvider.zoomLongitude = -55;
  97. dataProvider.zoomLatitude = 42;
  98. map.dataProvider = dataProvider;
  99. map.write("mapdiv");
  100. });
  101. </script>
  102. </head>
  103. <body>
  104. <div id="mapdiv" style="width: 100%; background-color:#d5eff7; height: 500px;"></div>
  105. </body>
  106. </html>