How to remove data from a Google Maps Data Layer?

前端 未结 4 1809
深忆病人
深忆病人 2020-12-23 22:51

I see Google Maps support geojson. Looking at the docs here: https://developers.google.com/maps/documentation/javascript/datalayer#load_geojson

Given the last exampl

4条回答
  •  温柔的废话
    2020-12-23 23:37

    This worked for me:

    map.data.forEach(function(feature) {
        // filter...
        map.data.remove(feature);
    });
    

提交回复
热议问题