From 8c84b8a00c72f5994f8d4e365966bde33306a13a Mon Sep 17 00:00:00 2001 From: danzel Date: Wed, 1 Aug 2012 15:57:17 +1200 Subject: [PATCH] Radio buttons properly dynamically created in IE7 don't work, so the layers dialog doesn't work, do it this hacky way instead. --- src/control/Control.Layers.js | 30 ++++++++++++++++++++++++------ 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/src/control/Control.Layers.js b/src/control/Control.Layers.js index d5cd2002..0d0a9ca3 100644 --- a/src/control/Control.Layers.js +++ b/src/control/Control.Layers.js @@ -133,16 +133,34 @@ L.Control.Layers = L.Control.extend({ this._separator.style.display = (overlaysPresent && baseLayersPresent ? '' : 'none'); }, - _addItem: function (obj, onclick) { + //IE7 bugs out if you create a radio dynamically, so you have to do it this hacky way + //Ref: http://stackoverflow.com/questions/118693/how-do-you-dynamically-create-a-radio-button-in-javascript-that-works-in-all-bro/119079#119079 + _createRadioElement: function (name, checked) { + + var radioHtml = '