diff --git a/js/util/actor.js b/js/util/actor.js index 0c0fd9da40c..9aefb0298de 100644 --- a/js/util/actor.js +++ b/js/util/actor.js @@ -56,8 +56,8 @@ Actor.prototype.receive = function(message) { }; Actor.prototype.send = function(type, data, callback, buffers) { - var id = null; - if (callback) this.callbacks[id = this.callbackID++] = callback; + var id = callback ? this.mapId + ':' + this.callbackID++ : null; + if (callback) this.callbacks[id] = callback; this.postMessage({ mapId: this.mapId, type: type, id: String(id), data: data }, buffers); };