Maps.js 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. import React, { Component } from 'react';
  2. import ContentWrapper from '@/components/Layout/ContentWrapper';
  3. import VectorMap from '@/components/Maps/VectorMap';
  4. import { Container, Row, Col, Card, CardHeader, CardBody } from "reactstrap";
  5. const defaultColors = {
  6. markerColor: '#f20226',
  7. bgColor: 'transparent',
  8. scaleColors: ['#3E3A8E'],
  9. regionFill: '#bbbec6'
  10. };
  11. const RegionValues = {
  12. 'ID_su': 11100,
  13. 'ID_su': 111,
  14. 'ID_ss': 13131,
  15. 'ID_la': 3131,
  16. 'ID_be': 313,
  17. 'ID_bb': 3131,
  18. 'ID_jk': 2212,
  19. 'ID_jb': 99,
  20. 'ID_bt': 9,
  21. 'ID_yo': 8,
  22. 'ID_jt': 5,
  23. 'ID_jl': 1,
  24. 'ID_ba': 2,
  25. 'ID_nb': 1,
  26. 'ID_sg': 1,
  27. 'ID_sn': 1,
  28. 'ID_sr': 1,
  29. 'ID_sb': 10,
  30. 'ID_ri': 10,
  31. 'ID_kr': 10,
  32. 'ID_ja': 10,
  33. 'ID_ks': 11,
  34. 'ID_kb': 11,
  35. 'ID_ki': 11,
  36. 'ID_kt': 11,
  37. 'ID_ku': 11,
  38. 'ID_ma': 12,
  39. 'ID_mu': 12,
  40. 'ID_ac': 13,
  41. 'ID_pa': 14,
  42. 'ID_pb': 14,
  43. 'ID_nt': 15,
  44. 'ID_go': 16,
  45. 'ID_st': 16,
  46. 'ID_sa': 16,
  47. }
  48. const LLDIKTI = {
  49. 'ID_su': '<h5>LLDIKTI Wilayah I</h5>',
  50. 'ID_ss': '<h4>LLDIKTI Wilayah II</h4>',
  51. 'ID_la': '<h4>LLDIKTI Wilayah II</h4>',
  52. 'ID_be': '<h4>LLDIKTI Wilayah II</h4>',
  53. 'ID_bb': '<h4>LLDIKTI Wilayah II</h4>',
  54. 'ID_jk': '<h4>LLDIKTI Wilayah III</h4>',
  55. 'ID_jb': '<h4>LLDIKTI Wilayah IV</h4>',
  56. 'ID_bt': '<h4>LLDIKTI Wilayah IV</h4>',
  57. 'ID_yo': '<h4>LLDIKTI Wilayah V</h4>',
  58. 'ID_jt': '<h4>LLDIKTI Wilayah VI</h4>',
  59. 'ID_jl': '<h4>LLDIKTI Wilayah VII</h4>',
  60. 'ID_ba': '<h4>LLDIKTI Wilayah VIII</h4>',
  61. 'ID_nb': '<h4>LLDIKTI Wilayah VIII</h4>',
  62. 'ID_sg': '<h4>LLDIKTI Wilayah IX</h4>',
  63. 'ID_sn': '<h4>LLDIKTI Wilayah IX</h4>',
  64. 'ID_sr': '<h4>LLDIKTI Wilayah IX</h4>',
  65. 'ID_sb': '<h4>LLDIKTI Wilayah X</h4>',
  66. 'ID_ri': '<h4>LLDIKTI Wilayah X</h4>',
  67. 'ID_kr': '<h4>LLDIKTI Wilayah X</h4>',
  68. 'ID_ja': '<h4>LLDIKTI Wilayah X</h4>',
  69. 'ID_ks': '<h4>LLDIKTI Wilayah XI</h4>',
  70. 'ID_kb': '<h4>LLDIKTI Wilayah XI</h4>',
  71. 'ID_ki': '<h4>LLDIKTI Wilayah XI</h4>',
  72. 'ID_kt': '<h4>LLDIKTI Wilayah XI</h4>',
  73. 'ID_ku': '<h4>LLDIKTI Wilayah XI</h4>',
  74. 'ID_ma': '<h4>LLDIKTI Wilayah XII</h4>',
  75. 'ID_mu': '<h4>LLDIKTI Wilayah XII</h4>',
  76. 'ID_ac': '<h4>LLDIKTI Wilayah XIII</h4>',
  77. 'ID_pa': '<h4>LLDIKTI Wilayah XIV</h4>',
  78. 'ID_pb': '<h4>LLDIKTI Wilayah XIV</h4>',
  79. 'ID_nt': '<h4>LLDIKTI Wilayah XV</h4>',
  80. 'ID_go': '<h4>LLDIKTI Wilayah XVI</h4>',
  81. 'ID_st': '<h4>LLDIKTI Wilayah XVI</h4>',
  82. 'ID_sa': '<h4>LLDIKTI Wilayah XVI</h4>',
  83. }
  84. class Maps extends Component {
  85. state = {
  86. series: {
  87. regions: [{
  88. values: RegionValues,
  89. scale: defaultColors.scaleColors,
  90. normalizeFunction: 'polynomial'
  91. }]
  92. },
  93. markers: [
  94. // { latLng: [0.293347, 101.706825], name: 'aceh' },
  95. // { latLng: [4.695135, 96.749397], name: 'ID_ac' },
  96. // { latLng: [-0.52, 166.93], name: 'Nauru' },
  97. // { latLng: [-8.51, 179.21], name: 'Tuvalu' },
  98. // { latLng: [7.11, 171.06], name: 'Marshall Islands' },
  99. // { latLng: [17.3, -62.73], name: 'Saint Kitts and Nevis' },
  100. // { latLng: [3.2, 73.22], name: 'Maldives' },
  101. // { latLng: [35.88, 14.5], name: 'Malta' },
  102. // { latLng: [41.0, -71.06], name: 'New England' },
  103. // { latLng: [12.05, -61.75], name: 'Grenada' },
  104. // { latLng: [13.16, -59.55], name: 'Barbados' },
  105. // { latLng: [17.11, -61.85], name: 'Antigua and Barbuda' },
  106. // { latLng: [-4.61, 55.45], name: 'Seychelles' },
  107. // { latLng: [7.35, 134.46], name: 'Palau' },
  108. // { latLng: [42.5, 1.51], name: 'Andorra' }
  109. ],
  110. options: {
  111. map: 'id_ID',
  112. backgroundColor: defaultColors.bgColor,
  113. zoomMin: 1,
  114. zoomMax: 8,
  115. zoomOnScroll: true,
  116. regionStyle: {
  117. initial: {
  118. 'fill': defaultColors.regionFill,
  119. 'fill-opacity': 1,
  120. 'stroke': 'none',
  121. 'stroke-width': 1.5,
  122. 'stroke-opacity': 1
  123. },
  124. hover: {
  125. 'fill-opacity': 0.8
  126. },
  127. selected: {
  128. fill: 'blue'
  129. },
  130. selectedHover: {}
  131. },
  132. focusOn: {
  133. x: 0.4,
  134. y: 0.6,
  135. scale: 1
  136. },
  137. markerStyle: {
  138. initial: {
  139. fill: defaultColors.markerColor,
  140. stroke: defaultColors.markerColor
  141. }
  142. },
  143. onRegionLabelShow: (e, el, code) => {
  144. if (RegionValues[code])
  145. el.html(LLDIKTI[code] + el.html() + ' : ' + RegionValues[code] + ' pelaporan');
  146. }
  147. }
  148. }
  149. render() {
  150. return (
  151. <Card className="card-default">
  152. <CardBody>
  153. <VectorMap height="370px" options={this.state.options} series={this.state.series} markers={this.state.markers} />
  154. </CardBody>
  155. <div align="center">
  156. <span>Peta Geografis Wilayah LLDikti</span>
  157. </div>
  158. </Card>
  159. );
  160. }
  161. }
  162. export default Maps;