                      div.innerHTML = labels.join('<br>');
                                return div;
                            };

                            legend.addTo(map);
                        } else if (document.getElementById('map_type-select').value === 'heatmap') {
                            var geo = geojson_data[document.getElementById('geo_field-select').value];
                            points = [];
                            for (var key in geo['features']) {
                      