0.2.2 • Published 5 months ago

dhwani-leaflet-country-map v0.2.2

Weekly downloads
-
License
-
Repository
-
Last release
5 months ago

DhwaniLeafletCountryMap

This library was generated with Angular CLI version 9.0.7.

Code scaffolding

Run ng generate component component-name --project dhwani-leaflet-country-map to generate a new component. You can also use ng generate directive|pipe|service|class|guard|interface|enum|module --project dhwani-leaflet-country-map.

Note: Don't forget to add --project dhwani-leaflet-country-map or else it will be added to the default project in your angular.json file.

Build

Run ng build dhwani-leaflet-country-map to build the project. The build artifacts will be stored in the dist/ directory.

Publishing

After building your library with ng build dhwani-leaflet-country-map, go to the dist folder cd dist/dhwani-leaflet-country-map and run npm publish.

Running unit tests

Run ng test dhwani-leaflet-country-map to execute the unit tests via Karma.

Further help

To get more help on the Angular CLI use ng help or go check out the Angular CLI README.

How to pass data and use selector

wrap selector with class mapheight and property overflow hidden .mapheight { height: 500px; }

    <lib-dhwani-leaflet-country-map [sideStateTooltip]="sideStateTooltip" [sideDistrictTooltip]="sideDistrictTooltip"
    [sideBlockTooltip]="sideBlockTooltip" [districtTooltipData]="districtTooltipData" 
    [blockTooltipData]="blockTooltipData" [stateTooltipData]="stateTooltipData" 
    [fillColors]="fillColors" [stateFlag]="stateFlag" [districtFlag]="districtFlag" 
    [hoverOnBoundary]="hoverOnBoundary" [statesData]="statesData" 
    [districtsData]="districtData" [blockApiResponseData]="blockApiResponseData"
    (districtApiTrigger)="getDistrictData($event)" (blockApiTrigger)="getBlockData($event)">
    </lib-dhwani-leaflet-country-map>
sideStateTooltip = true;
sideDistrictTooltip = true;
sideBlockTooltip = true;
districtFlag = true;
stateFlag = true;
hoverOnBoundary = `green`;
statesData: any[] = [];
districtData: any[] = [];
blockApiResponseData: any[] = [];
fillColors = ['#337AB7', '#5b94c4', '#83add2', '#a9c6de', '#d1dfec'];
stateTooltipData = [
    {
        "stateCode": "S03",
        "count": 500,
        "description": 'about punjab',
        "name": 'Punjab'
    },
    {
        "stateCode": "S09",
        "count": 50000,
        "description": 'about up',
        "name": 'Uttar Pradesh'
    },
    {
        "stateCode": "S19",
        "count": 343400,
        "description": 'about west bengal',
        "name": 'West Bengal'
    }
]
districtTooltipData = [
    {
        "districtCode": "S09168",
        "count": 500,
        "description": 'about Hamirpur...',
        "name": 'Hamirpur'
    },
    {
        "districtCode": "S09201",
        "count": 50000,
        "description": 'about Eta...',
        "name": 'Eta'
    },
    {
        "districtCode": "S09182",
        "count": 343400,
        "description": 'about Balrampur...',
        "name": 'Balrampur'
    }
]
blockTooltipData = [
    {
        "blockCensusCode": "00926",
        "count": 500,
        "description": 'about upasas',
        "name": 'Agra'
    },
    {
        "blockCensusCode": "00925",
        "count": 50000,
        "description": 'about usap',
        "name": 'Mathura'
    },
    {
        "blockCensusCode": "00927",
        "count": 343400,
        "description": 'about west bengal',
        "name": 'Agra'
    }
]

ngOnInit(): void {
    this.getStateMapData();
}

getStateMapData() {
    this.statesData = [
        {
            "state_id": 1,
            "state": "Punjab",
            "stateCode": "S03",
            "village": 0,
            "count": 50000,
            "district_id": 1,
            "district": "Ludhiana",
            "districtCode": "S03041",
            "block": 7,
            "farmerAdopted": 2199
        },
        {
            "state_id": 1,
            "state": "Punjab",
            "stateCode": "S03",
            "village": 0,
            "count": 30000,
            "district_id": 2,
            "district": "Moga",
            "districtCode": "S03042",
            "block": 5,
            "farmerAdopted": 1415
        },
        {
            "state_id": 1,
            "state": "Punjab",
            "stateCode": "S03",
            "village": 0,
            "count": 3337,
            "district_id": 3,
            "district": "Amritsar",
            "districtCode": "S03049",
            "block": 6,
            "farmerAdopted": 712
        },
        {
            "state_id": 1,
            "state": "Punjab",
            "stateCode": "S03",
            "village": 0,
            "count": 70000,
            "district_id": 4,
            "district": "Sangrur",
            "districtCode": "S03053",
            "block": 5,
            "farmerAdopted": 1548
        },
        {
            "state_id": 2,
            "state": "Uttar Pradesh",
            "stateCode": "S09",
            "village": 0,
            "count": 25000,
            "district_id": 6,
            "district": "Hamirpur",
            "districtCode": "S09168",
            "block": 1,
            "farmerAdopted": 829
        },
        {
            "state_id": 2,
            "state": "Uttar Pradesh",
            "stateCode": "S09",
            "village": 0,
            "count": 1142,
            "district_id": 7,
            "district": "Mahoba",
            "districtCode": "S09169",
            "block": 1,
            "farmerAdopted": 457
        },
        {
            "state_id": 2,
            "state": "Uttar Pradesh",
            "stateCode": "S09",
            "village": 0,
            "count": 3100,
            "district_id": 8,
            "district": "Chitarkoot",
            "districtCode": "S09171",
            "block": 1,
            "farmerAdopted": 241
        },
        {
            "state_id": 2,
            "state": "Uttar Pradesh",
            "stateCode": "S09",
            "village": 0,
            "count": 72569,
            "district_id": 9,
            "district": "Balrampur",
            "districtCode": "S09182",
            "block": 6,
            "farmerAdopted": 931
        },
        {
            "state_id": 2,
            "state": "Uttar Pradesh",
            "stateCode": "S09",
            "village": 0,
            "count": 1935,
            "district_id": 10,
            "district": "Etah",
            "districtCode": "S09201",
            "block": 3,
            "farmerAdopted": 91
        },
        {
            "state_id": 3,
            "state": "West Bengal",
            "stateCode": "S19",
            "village": 0,
            "count": 13114,
            "district_id": 14,
            "district": "Bankura",
            "districtCode": "S19339",
            "block": 2,
            "farmerAdopted": 2247
        },
        {
            "state_id": 5,
            "state": "Madhya Pradesh",
            "stateCode": "S23",
            "village": 0,
            "count": 5633,
            "district_id": 22,
            "district": "Tikamgarh",
            "districtCode": "S23424",
            "block": 6,
            "farmerAdopted": 1031
        },
        {
            "state_id": 5,
            "state": "Madhya Pradesh",
            "stateCode": "S23",
            "village": 0,
            "count": 2545,
            "district_id": 23,
            "district": "Chhatarpur",
            "districtCode": "S23425",
            "block": 1,
            "farmerAdopted": 241
        },
        {
            "state_id": 5,
            "state": "Madhya Pradesh",
            "stateCode": "S23",
            "village": 0,
            "count": 1505,
            "district_id": 24,
            "district": "Chhindwada",
            "districtCode": "S23455",
            "block": 1,
            "farmerAdopted": 86
        },
        {
            "state_id": 6,
            "state": "Gujarat",
            "stateCode": "S24",
            "village": 0,
            "count": 210,
            "district_id": 27,
            "district": "Kutchh",
            "districtCode": "S24468",
            "block": 2,
            "farmerAdopted": 0
        },
        {
            "state_id": 6,
            "state": "Gujarat",
            "stateCode": "S24",
            "village": 0,
            "count": 3304,
            "district_id": 28,
            "district": "Banas Kantha",
            "districtCode": "S24469",
            "block": 1,
            "farmerAdopted": 81
        },
        {
            "state_id": 6,
            "state": "Gujarat",
            "stateCode": "S24",
            "village": 0,
            "count": 6861,
            "district_id": 29,
            "district": "Sabar Kantha",
            "districtCode": "S24472",
            "block": 2,
            "farmerAdopted": 894
        },
        {
            "state_id": 6,
            "state": "Gujarat",
            "stateCode": "S24",
            "village": 0,
            "count": 936,
            "district_id": 30,
            "district": "Valsad",
            "districtCode": "S24491",
            "block": 2,
            "farmerAdopted": 0
        },
        {
            "state_id": 8,
            "state": "Maharashtra",
            "stateCode": "S27",
            "village": 0,
            "count": 163,
            "district_id": 33,
            "district": "Buldhana",
            "districtCode": "S27500",
            "block": 1,
            "farmerAdopted": 0
        },
        {
            "state_id": 8,
            "state": "Maharashtra",
            "stateCode": "S27",
            "village": 0,
            "count": 39106,
            "district_id": 34,
            "district": "Osmanabad",
            "districtCode": "S27525",
            "block": 6,
            "farmerAdopted": 9977
        },
        {
            "state_id": 11,
            "state": "PUDUCHERRY",
            "stateCode": "S34",
            "village": 0,
            "count": 160,
            "district_id": 38,
            "district": "Villupuram",
            "districtCode": "S33607",
            "block": 1,
            "farmerAdopted": 0
        },
        {
            "state_id": 10,
            "state": "TAMIL NADU",
            "stateCode": "S33",
            "village": 0,
            "count": 15000,
            "district_id": 39,
            "district": "Krishnagiri",
            "districtCode": "S33631",
            "block": 3,
            "farmerAdopted": 122
        },
        {
            "state_id": 11,
            "state": "PUDUCHERRY",
            "stateCode": "S34",
            "village": 0,
            "count": 784,
            "district_id": 41,
            "district": "Puducherry",
            "districtCode": "S34635",
            "block": 2,
            "farmerAdopted": 0
        }
    ];
}

getDistrictData(stateId: any) {
    this.districtData = [
        {
            "state_id": 2,
            "state": "Uttar Pradesh",
            "stateCode": "S09",
            "village": 0,
            "farmerReached": 17000,
            "district_id": 6,
            "district": "Hamirpur",
            "districtCode": "S09168",
            "block": 1,
            "farmerAdopted": 829
        },
        {
            "state_id": 2,
            "state": "Uttar Pradesh",
            "stateCode": "S09",
            "village": 0,
            "farmerReached": 1142,
            "district_id": 7,
            "district": "Mahoba",
            "districtCode": "S09169",
            "block": 1,
            "farmerAdopted": 457
        },
        {
            "state_id": 2,
            "state": "Uttar Pradesh",
            "stateCode": "S09",
            "village": 0,
            "farmerReached": 3100,
            "district_id": 8,
            "district": "Chitarkoot",
            "districtCode": "S09171",
            "block": 1,
            "farmerAdopted": 241
        },
        {
            "state_id": 2,
            "state": "Uttar Pradesh",
            "stateCode": "S09",
            "village": 0,
            "farmerReached": 72569,
            "district_id": 9,
            "district": "Balrampur",
            "districtCode": "S09182",
            "block": 6,
            "farmerAdopted": 931
        },
        {
            "state_id": 2,
            "state": "Uttar Pradesh",
            "stateCode": "S09",
            "village": 0,
            "farmerReached": 19350,
            "district_id": 10,
            "district": "Etah",
            "districtCode": "S09201",
            "block": 3,
            "farmerAdopted": 910
        }
    ];
}

getBlockData(districtId: any) {
    this.blockApiResponseData = [
        {
            count: 100000,
            district_name: "Agra",
            blockCensusCode: "S09189"
        },
        {
            count: 500000,
            district_name: "Mathura",
            blockCensusCode: "S09182"
        },
        {
            count: 100000,
            district_name: "Mainpuri",
            blockCensusCode: "S09182"
        },
        {
            count: 50000000,
            district_name: "Firozabad",
            blockCensusCode: "S09182"
        },
        {
            count: 5000000000,
            district_name: "Aligarh",
            blockCensusCode: "S09182"
        },
        {
            count: 25000,
            district_name: "Etah",
            blockCensusCode: "S09182"
        },
        {
            count: 100000001,
            district_name: "Hathras",
            blockCensusCode: "S09182"
        },
        {
            count: 100000,
            district_name: "Amethi",
            blockCensusCode: "S09182"
        },
        {
            count: 99000009,
            district_name: "Sultanpur",
            blockCensusCode: "S09182"
        },
        {
            count: 50000000,
            district_name: "Ayodhya",
            blockCensusCode: "S09182"
        },
        {
            count: 70000000,
            district_name: "Ballia",
            blockCensusCode: "S09182"
        },
        {
            count: 90000000,
            district_name: "Amethi",
            blockCensusCode: "S09182"
        },
        {
            count: 100000000,
            district_name: "Mahoba",
            blockCensusCode: "S09182"
        },
        {
            count: 10000000,
            district_name: "Gonda",
            blockCensusCode: "S09182"
        },
        {
            count: 88000008,
            district_name: "Jhansi",
            blockCensusCode: "S09182"
        },
        {
            count: 50000000,
            district_name: "Amethi",
            blockCensusCode: "S09182"
        },
        {
            count: 70000009,
            district_name: "Amethi",
            blockCensusCode: "S09182"
        },
        {
            count: 90000000,
            district_name: "Amethi",
            blockCensusCode: "S09182"
        },
    ]
}
0.2.1

5 months ago

0.2.0

5 months ago

0.1.8

5 months ago

0.1.9

5 months ago

0.2.2

5 months ago

0.1.7

5 months ago

0.1.0

7 months ago

0.1.2

6 months ago

0.1.1

6 months ago

0.1.4

5 months ago

0.1.6

5 months ago

0.1.5

5 months ago

0.0.9

11 months ago

0.0.8

11 months ago

0.0.7

1 year ago

0.0.6

1 year ago

0.0.5

1 year ago

0.0.4

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago