Hi!
I have added a latlong graticulate to my map and would like to have the ability to turn it on/off.
I think it is a very simple but can't find what I'm doing wrong.
I have added the graticulate in the custom file and then created a function to remove it.
' var graticulate = L.latlngGraticule({
showLabel: true,
fontcolor:"#FFFFFF",
color: "#222",
zoomInterval: [
{start: 2, end: 3, interval: 30},
{start: 4, end: 4, interval: 10},
{start: 5, end: 7, interval: 5},
{start: 8, end: 10, interval: 1}
] }).addTo(bootleaf.map);
function latlon(){
bootleaf.map.removeLayer(graticulate);
}
'
Then I added a checkbox in the Tools list with the event onchange calling the function latlon().
<input type="checkbox" name="graticulate" value="1" onchange="latlon()"></li>
I'm always receiving the message that the function is not defined but I don't know where or how I should call the function.
Thank you very much!
Hi!
I have added a latlong graticulate to my map and would like to have the ability to turn it on/off.
I think it is a very simple but can't find what I'm doing wrong.
I have added the graticulate in the custom file and then created a function to remove it.
' var graticulate = L.latlngGraticule({
showLabel: true,
fontcolor:"#FFFFFF",
color: "#222",
zoomInterval: [
{start: 2, end: 3, interval: 30},
{start: 4, end: 4, interval: 10},
{start: 5, end: 7, interval: 5},
{start: 8, end: 10, interval: 1}
function latlon(){
bootleaf.map.removeLayer(graticulate);
}
'
Then I added a checkbox in the Tools list with the event onchange calling the function latlon().
<input type="checkbox" name="graticulate" value="1" onchange="latlon()"></li>I'm always receiving the message that the function is not defined but I don't know where or how I should call the function.
Thank you very much!