function createPie(data, year) { console.debug(data); var charts = L.featureGroup(); for (var i = 0; i < data.features.length; i++) {   var d = data.features[i].properties; var latlng = data.features[i].geometry.coordinates;   if (d.YR == year) {     var pieData = {values: [       d.TrawlPerc,       d.PursesPerc,       d.BoatsePerc, d.otherPerc     ], labels: ['trawl', 'purses', 'boatse', 'other']};     let chart = new PieChartMarker([latlng[1], latlng[0]], pieData, { icon: L.divIcon({className: 'leaflet-pie-chart-marker'}), width: 60, height: 60, colors: ['#ff0000', '#00ff00', '#0000ff', '#ff00ff'] }); charts.addLayer(chart);   } } return charts; }