Click here to Skip to main content
15,793,535 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i was trying to make control layer for my geojson layer. i use leaflet feature group to group it into one control, but there is an error that says Uncaught TypeError: Cannot read property 'minZoom' of undefined.

What I have tried:

var IncomeGroup = L.featureGroup().addTo(map);
    var overlays = {
    "Income" : IncomeGroup
    //Menampilkan data kecamatan choropleth Income
        foreach ($getKecamatan as $row) {

            name: "'.$row->nama_kecamatan.'",
            layer: new L.GeoJSON.AJAX(["assets/unggah_kecamatan/geojson/'.$row->geojson_kecamatan.'"],{
                style: styleIncome
                "Kecamatan : '.$row->nama_kecamatan.'<br>Pendapatan Rerata (Rp) : '.$dataIncome[$row->kode_kecamatan].'")

    var array = [
            <?=implode(',', $arrayKecIncome);?>
    //Menampilkan data kecamatan choropleth-end
    L.control.layers(baseLayers, overlays).addTo(map);
gggustafson 1-May-21 14:25pm    
why are you closing and reopening php?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900