You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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!
The text was updated successfully, but these errors were encountered:
Thanks for your answer.
Yes, that's the plgin that I'm using.
And I manage to add the graticulate without problems.
My problems are with the button I want to add to let the user remove the graticulate when they want.
I have this code in the custom.js inside the aftermaploads function
' 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 have added a checkbox in the list of tools in the menu: <input type="checkbox" name="graticulate" value="1" onchange="latlon()"></li>
There is where I got the message that the function is not defined.
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!
The text was updated successfully, but these errors were encountered: