Control method

36 views
Skip to first unread message

sophie BARNOUIN

unread,
Aug 23, 2013, 2:45:22 AM8/23/13
to leaflet-ve...@googlegroups.com
Hello,
Thank you for this great add in.
Is it possible to use the control method (L.control.Layers) with the AGS layers? I couldn't manage to do it...
If not, how can we build a control to switch between diferent layers on the map?
Thank you, Sophie

Bryan McBride

unread,
Aug 26, 2013, 5:36:25 PM8/26/13
to leaflet-ve...@googlegroups.com
The easiest way to control LVL layers is to wire up a little HTML form somewhere on your page. Something like this:

<form>
<input type="checkbox" id="layerOne" onClick="if(this.checked {layerOne.setMap(map)} else {layerOne.setMap(null)}">Layer One
<input type="checkbox" id="layerTwo" onClick="if(this.checked){layerTwo.setMap(map)} else {layerTwo.setMap(null)}">Layer Two
</form>


--
You received this message because you are subscribed to the Google Groups "Leaflet Vector Layers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to leaflet-vector-l...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.



--
Bryan R. McBride, GISP
bryanmcbride.com

sophie BARNOUIN

unread,
Aug 29, 2013, 11:20:39 AM8/29/13
to leaflet-ve...@googlegroups.com
Hello,
Thanks a lot for your help, I'm gone try that soon,
Sophie

2013/8/26 Bryan McBride <mcbrid...@gmail.com>

--
You received this message because you are subscribed to a topic in the Google Groups "Leaflet Vector Layers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/leaflet-vector-layers/_kmPJTYloJA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to leaflet-vector-l...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages