zhenyanghua/MeasureTool-GoogleMaps-V3

Right click not working on datalayer

ahmadzt opened this issue · 1 comments

after loading datalayer onto the map, right click is no longer working on area covered by datalayer. it works perfectly outside datalayer area

this is how I load the datalayer

let state = new google.maps.Data();
state.addGeoJson(Selangor);
state.setMap(this.map);

state.setStyle(feature => {
       return {
             fillColor: '#ffffff',
             fillOpacity: 0.01,
             strokeWeight: 1,
       }
})

and this is how it looks like

Screenshot 2019-04-21 at 10 47 31 PM

I have resolved this. Need to set datalayer clickable attribute to false so that it will take any right click event available on the map

state.setStyle(feature => {
       return {
             fillColor: '#ffffff',
             fillOpacity: 0.01,
             strokeWeight: 1,
             clickable: false
       }
})