Skip to content

TypeError: obj.layer.options is undefined leaflet.control.orderlayers.js:100 #1

@okvittem

Description

@okvittem

This plugin fails with when overlayers miss .options.zindex. This happens for L.GPX and vector overlay. L.imageOverlay has zindex, but if you have more than one with same zindex, only the last one shows in the control. base layers shows.Code snippets failing:

var blay  = {'Statkart': topo2, 'Statkart2': topor2, 'Google':googleLayer, 'Satelitt':gsat, 'Openstreetmap':osm };
var olay = {};
mapControl = L.control.orderlayers(
blay, olay, 
{ collapsed: false,
  title: 'Order Layers', autoZIndex: true
}
);

rings.push( L.circle(to, 20, {color: 'red', fill:false}) );
var clayer = L.layerGroup(rings, {zIndex: 20});
clayer.setZIndex(20);
clayer.addTo(map);
mapControl.addOverlay(clayer, 'my rings');

Leaflet is 0.7.1 and oderLayers is straight from git.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions