diff --git a/loleaflet/src/map/handler/Map.FileInserter.js b/loleaflet/src/map/handler/Map.FileInserter.js index 0dd6aeef1..4484e4590 100644 --- a/loleaflet/src/map/handler/Map.FileInserter.js +++ b/loleaflet/src/map/handler/Map.FileInserter.js @@ -48,9 +48,10 @@ L.Map.FileInserter = L.Handler.extend({ _sendFile: function (name, file) { var url = this._url; var xmlHttp = new XMLHttpRequest(); + var socket = this._map._socket; xmlHttp.onreadystatechange = function () { if (xmlHttp.readyState === 4 && xmlHttp.status === 200) { - this._map._socket.sendMessage('insertfile name=' + name + ' type=graphic'); + socket.sendMessage('insertfile name=' + name + ' type=graphic'); } }; xmlHttp.open('POST', url, true);