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.

65 lines
2.3 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 example</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 src="../ammap/themes/black.js" type="text/javascript"></script>
  11. <script>
  12. AmCharts.theme = AmCharts.themes.black;
  13. // add all your code to this method, as this will ensure that page is loaded
  14. AmCharts.ready(function() {
  15. // create AmMap object
  16. var map = new AmCharts.AmMap();
  17. // set path to images
  18. /* create data provider object
  19. mapVar tells the map name of the variable of the map data. You have to
  20. view source of the map file you included in order to find the name of the
  21. variable - it's the very first line after commented lines.
  22. getAreasFromMap indicates that amMap should read all the areas available
  23. in the map data and treat them as they are included in your data provider.
  24. in case you don't set it to true, all the areas except listed in data
  25. provider will be treated as unlisted.
  26. */
  27. var dataProvider = {
  28. mapVar: AmCharts.maps.worldLow,
  29. getAreasFromMap:true
  30. };
  31. // pass data provider to the map object
  32. map.dataProvider = dataProvider;
  33. /* create areas settings
  34. * autoZoom set to true means that the map will zoom-in when clicked on the area
  35. * selectedColor indicates color of the clicked area.
  36. */
  37. map.areasSettings = {
  38. autoZoom: true,
  39. rollOverBrightness:10,
  40. selectedBrightness:20
  41. };
  42. // let's say we want a small map to be displayed, so let's create and add it to the map
  43. map.smallMap = new AmCharts.SmallMap();
  44. // write the map to container div
  45. map.write("mapdiv");
  46. });
  47. </script>
  48. </head>
  49. <body>
  50. <div id="mapdiv" style="width: 100%; background-color:#222222; height: 500px;"></div>
  51. </body>
  52. </html>