Markers in Layergroup not showing in Layer.control

179 views
Skip to first unread message

Luca Moiana

unread,
Mar 3, 2015, 6:15:35 PM3/3/15
to leafl...@googlegroups.com


Hi, working on my webmap  http://lucamoiana.github.io/mdr2015/boilerplate.html


I created three groups with different polylines and groups of markers; controls work  the first time and I can turn ON/OFF goups, but, if I go back and turn them ON again, markers are not showing up.


why? what can I do?


CODE:

var corto_group = L.layerGroup([corto, ristoro_smaria, ristoro_massina]);
var medio_group = L.layerGroup([medio, ristoro_smaria, ristoro_massina, ristoro_roccolo, ristoro_visconta ]);
var lungo_group = L.layerGroup([lungo, ristoro_smaria, ristoro_massina, ristoro_roccolo, ristoro_visconta ]);
var groupedOverlays = {
   
"7 Km": corto_group,
   
"15 Km": medio_group,
   
"20 Km": lungo_group
 
};
 
var groupedOverlays2 = {
     
"Servizi": servizi
   
};

var options = { exclusiveGroups: ["Percorsi"] };
L
.control.layers(groupedOverlays, groupedOverlays2,{collapsed: false}).addTo(map);



Kevin Lee

unread,
Mar 4, 2015, 9:02:20 AM3/4/15
to leafl...@googlegroups.com
It seems to work for me though. I'm using the latest version of Chrome.

Luca Moiana

unread,
Mar 4, 2015, 9:13:49 AM3/4/15
to leafl...@googlegroups.com
Hi Kevin,

thanks for your reply. I test wtih safari, firefox on OSX and ie 10 and Chrome Versione 40.0.2214.115 m: if you select 7km, 15km, 20km and then back 20km, 15km, 7km I can see markers 

--

---
You received this message because you are subscribed to a topic in the Google Groups "Leaflet" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/leaflet-js/n24FmM1FyxU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to leaflet-js+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
If we helped convince you not to print this email, go to www.printgreener.com/saveatree.php.

Luca Moiana

unread,
Mar 5, 2015, 6:18:10 PM3/5/15
to leafl...@googlegroups.com
I think the problem was with same markers belonging to different gourps;
my workaround was to create the same marker with 3 different var names.

L
To unsubscribe from this group and all its topics, send an email to leaflet-js+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages