data_merged_loc_allbrands = points_wifi.features.map(function(d){
let res = map_site.get(d.properties.idpw);
if(res){
let apple = res.filter(d=>d.device_constructor_name=="Apple").length>0?res.filter(d=>d.device_constructor_name=="Apple")[0].nb:0;
let other = res.filter(d=>d.device_constructor_name!="Apple").map(cv=>cv.nb).reduce((val,cval)=>cval+val)
return {code:d.properties.idpw,apple:apple,other:other}
}
return {code:d.properties.idpw,apple:0,other:0}
})