javascript map in leaflet how to refresh

后端 未结 3 1834

i have a basic geoJson program in javascript by using leaflet API.






        
3条回答
  •  天命终不由人
    2021-02-05 15:39

    Last time I've used

    map._onResize(); 
    

    and that help me refresh map. Maybe a little hack, but, it work.

    In your code will be area._onResize()

    P.S: Maybe you should try change the way to set new opacity value - try change

    function clicked(){
        this.options.style.fillOpacity = 0.8;
     }
    

    to that

    function clicked(){
        this.setStyle({fillOpacity: 0.2});
     }
    

提交回复
热议问题