| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174 |
- import React, { Component } from 'react';
- import ContentWrapper from '@/components/Layout/ContentWrapper';
- import VectorMap from '@/components/Maps/VectorMap';
- import { Container, Row, Col, Card, CardHeader, CardBody } from "reactstrap";
- const defaultColors = {
- markerColor: '#f20226',
- bgColor: 'transparent',
- scaleColors: ['#3E3A8E'],
- regionFill: '#bbbec6'
- };
- const RegionValues = {
- 'ID_su': 1,
- 'ID_su': 2,
- 'ID_ss': 3,
- 'ID_la': 4,
- 'ID_be': 5,
- 'ID_bb': 6,
- 'ID_jk': 2,
- 'ID_jb': 9,
- 'ID_bt': 9,
- 'ID_yo': 8,
- 'ID_jt': 5,
- 'ID_jl': 1,
- 'ID_ba': 2,
- 'ID_nb': 1,
- 'ID_sg': 1,
- 'ID_sn': 1,
- 'ID_sr': 1,
- 'ID_sb': 10,
- 'ID_ri': 10,
- 'ID_kr': 10,
- 'ID_ja': 10,
- 'ID_ks': 11,
- 'ID_kb': 11,
- 'ID_ki': 11,
- 'ID_kt': 11,
- 'ID_ku': 11,
- 'ID_ma': 12,
- 'ID_mu': 12,
- 'ID_ac': 13,
- 'ID_pa': 14,
- 'ID_pb': 14,
- 'ID_nt': 15,
- 'ID_go': 16,
- 'ID_st': 16,
- 'ID_sa': 16,
- }
- const LLDIKTI = {
- 'ID_su': '<h5>LLDIKTI Wilayah I</h5>',
- 'ID_ss': '<h5>LLDIKTI Wilayah II</h5>',
- 'ID_la': '<h5>LLDIKTI Wilayah II</h5>',
- 'ID_be': '<h5>LLDIKTI Wilayah II</h5>',
- 'ID_bb': '<h5>LLDIKTI Wilayah II</h5>',
- 'ID_jk': '<h5>LLDIKTI Wilayah III</h5>',
- 'ID_jb': '<h5>LLDIKTI Wilayah IV</h5>',
- 'ID_bt': '<h5>LLDIKTI Wilayah IV</h5>',
- 'ID_yo': '<h5>LLDIKTI Wilayah V</h5>',
- 'ID_jt': '<h5>LLDIKTI Wilayah VI</h5>',
- 'ID_jl': '<h5>LLDIKTI Wilayah VII</h5>',
- 'ID_ba': '<h5>LLDIKTI Wilayah VIII</h5>',
- 'ID_nb': '<h5>LLDIKTI Wilayah VIII</h5>',
- 'ID_sg': '<h5>LLDIKTI Wilayah IX</h5>',
- 'ID_sn': '<h5>LLDIKTI Wilayah IX</h5>',
- 'ID_sr': '<h5>LLDIKTI Wilayah IX</h5>',
- 'ID_sb': '<h5>LLDIKTI Wilayah X</h5>',
- 'ID_ri': '<h5>LLDIKTI Wilayah X</h5>',
- 'ID_kr': '<h5>LLDIKTI Wilayah X</h5>',
- 'ID_ja': '<h5>LLDIKTI Wilayah X</h5>',
- 'ID_ks': '<h5>LLDIKTI Wilayah XI</h5>',
- 'ID_kb': '<h5>LLDIKTI Wilayah XI</h5>',
- 'ID_ki': '<h5>LLDIKTI Wilayah XI</h5>',
- 'ID_kt': '<h5>LLDIKTI Wilayah XI</h5>',
- 'ID_ku': '<h5>LLDIKTI Wilayah XI</h5>',
- 'ID_ma': '<h5>LLDIKTI Wilayah XII</h5>',
- 'ID_mu': '<h5>LLDIKTI Wilayah XII</h5>',
- 'ID_ac': '<h5>LLDIKTI Wilayah XIII</h5>',
- 'ID_pa': '<h5>LLDIKTI Wilayah XIV</h5>',
- 'ID_pb': '<h5>LLDIKTI Wilayah XIV</h5>',
- 'ID_nt': '<h5>LLDIKTI Wilayah XV</h5>',
- 'ID_go': '<h5>LLDIKTI Wilayah XVI</h5>',
- 'ID_st': '<h5>LLDIKTI Wilayah XVI</h5>',
- 'ID_sa': '<h5>LLDIKTI Wilayah XVI</h5>',
- }
- class Maps extends Component {
- state = {
- series: {
- regions: [{
- values: RegionValues,
- scale: defaultColors.scaleColors,
- normalizeFunction: 'polynomial'
- }]
- },
- markers: [
- // { latLng: [0.293347, 101.706825], name: 'aceh' },
- // { latLng: [4.695135, 96.749397], name: 'ID_ac' },
- // { latLng: [-0.52, 166.93], name: 'Nauru' },
- // { latLng: [-8.51, 179.21], name: 'Tuvalu' },
- // { latLng: [7.11, 171.06], name: 'Marshall Islands' },
- // { latLng: [17.3, -62.73], name: 'Saint Kitts and Nevis' },
- // { latLng: [3.2, 73.22], name: 'Maldives' },
- // { latLng: [35.88, 14.5], name: 'Malta' },
- // { latLng: [41.0, -71.06], name: 'New England' },
- // { latLng: [12.05, -61.75], name: 'Grenada' },
- // { latLng: [13.16, -59.55], name: 'Barbados' },
- // { latLng: [17.11, -61.85], name: 'Antigua and Barbuda' },
- // { latLng: [-4.61, 55.45], name: 'Seychelles' },
- // { latLng: [7.35, 134.46], name: 'Palau' },
- // { latLng: [42.5, 1.51], name: 'Andorra' }
- ],
- options: {
- map: 'id_ID',
- backgroundColor: defaultColors.bgColor,
- zoomMin: 1,
- zoomMax: 8,
- zoomOnScroll: true,
- regionStyle: {
- initial: {
- 'fill': defaultColors.regionFill,
- 'fill-opacity': 1,
- 'stroke': 'none',
- 'stroke-width': 1.5,
- 'stroke-opacity': 1
- },
- hover: {
- 'fill-opacity': 0.5,
- cursor: 'pointer'
- },
- selected: {
- fill: 'yellow'
- },
- selectedHover: {}
- },
- focusOn: {
- x: 0.4,
- y: 0.6,
- scale: 1
- },
- markerStyle: {
- initial: {
- fill: defaultColors.markerColor,
- stroke: defaultColors.markerColor
- }
- },
- onRegionLabelShow: (e, el, code) => {
- if (RegionValues[code])
- el.html(LLDIKTI[code] + el.html() + ' : ' + RegionValues[code] + ' pelaporan');
- }
- }
- }
- render() {
- return (
- <Card className="card-default">
- <CardBody>
- <VectorMap height="370px" options={this.state.options} series={this.state.series} markers={this.state.markers} />
- </CardBody>
- <div align="center">
- <span>Peta Geografis Wilayah LLDikti</span>
- </div>
- </Card>
- );
- }
- }
- export default Maps;
|