In this example we create two layer groups Bikes, and Cars. We insert markers in both layers (note that on is initially visible and one not). Also we add markers to the main map.
overlays: { hillshade: { name: 'Hillshade Europa', type: 'wms', url: 'http://129.206.228.72/cached/hillshade', visible: true, layerOptions: { layers: 'europe_wms:hs_srtm_europa', format: 'image/png', opacity: 0.25, attribution: 'Hillshade layer by GIScience http://www.osm-wms.de', crs: L.CRS.EPSG900913 } }, fire: { name: 'OpenFireMap', type: 'xyz', url: 'http://openfiremap.org/hytiles/{z}/{x}/{y}.png', layerOptions: { attribution: '© OpenFireMap contributors - © OpenStreetMap contributors', continuousWorld: true } }, cars: { name: 'Cars', type: 'group', visible: true }, bikes: { name: 'Bicycles', type: 'group', visible: false } }
markers: { m1: { lat: 42.20133, lng: 2.19110, layer: 'cars', message: "I'm a car" }, m2: { lat: 42.21133, lng: 2.18110, layer: 'cars', message: "I'm a car" }, m3: { lat: 42.19133, lng: 2.18110, layer: 'bikes', message: 'A bike!!' }, m4: { lat: 42.3, lng: 2.16110, layer: 'bikes' }, m5: { lat: 42.1, lng: 2.16910 }, m6: { lat: 42.15, lng: 2.17110 } }