JSFiddle - React, Tailwind, and code Playground

by abenrob

JavaScript

var geojson = {
    "type": "FeatureCollection",
    "features": [
        {
            "type": "Feature",
            "properties": {},
            "geometry": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [
                            35.5078125,
                            -4.23685605976896
                        ],
                        [
                            36.73828124999999,
                            -5.659718554577286
                        ],
                        [
                            34.12353515625,
                            -5.681583683421118
                        ],
                        [
                            35.5078125,
                            -4.23685605976896
                        ]
                    ]
                ]
            }
        }
    ]
};
$.ajax({
    "type": "POST",
    "data": {
        "format": "geojson",
        "returnGeometry": "no",
        "returnGeometryEnvelopes": "no",
        "groupby": "featuretype",
        "statsdef": "count:gid",
        "intersects": geojson,
        "limit": '-1'
    },
    'dataType': "json",
    'url': 'http://chubbs.spatialdev.com/services/tables/tanzania_cicos/query',
    'success': function(data){	
        console.log(data);
    }
})