Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
okvittem opened this issue Jan 4, 2014 · 1 comment
Assignees
Milestone

Comments

@okvittem
Copy link

okvittem commented Jan 4, 2014

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.

@ghost ghost assigned elesdoar Jan 13, 2014
@therealtakeshi
Copy link

Receiving the same: Uncaught TypeError: Cannot read property 'zIndex' of undefined on both L.tileLayer.betterWms and L.esri.tiledMapLayer objects.

Any workarounds recommended?

@elesdoar elesdoar added this to the 0.3.0 milestone Nov 19, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants