L.Control.Login = L.Control.extend({ options: { position: 'bottomleft' }, onAdd: function (map) { var name = 'control-login', container = L.DomUtil.create('div', name + ' leaflet-bar'); this._map = map; this._div = container; if (userdata.loggedin == true) { container.innerHTML = "Logged in as: " + userdata.username + "
\ Sign out"; } else { container.innerHTML = "Not logged in
\ \ "; } return container; }, onRemove: function (map) { }, _onMouseMove: function (e) { this._div.innerHTML = FormatCoord(e.latlng); } });