Closed sttawm closed 9 years ago
If interaction is added to the map by default, we need a way to disable it. One approach involves storing a reference to the interact object and providing a getter/setter
interact
ms.map = function() { var map = {}, ... interact = ms.interact(); add(interact); map.interact = function(x) { if (!arguments.length) return interact; interact.add(x? map : null); } ... }; // disable interact map.interact(false);
Could also just have a plain getter and do:
ms.map = function() { var map = {}, ... interact = ms.interact(); add(interact); map.interact = function() { return interact; } ... }; // disable interact map.remove(map.interact());
These don't seem so bad, and are simple enough. map.add(ms.interact()) is probably common enough that automating it is worth it.
map.add(ms.interact())
Thoughts?
.
Done.
If interaction is added to the map by default, we need a way to disable it. One approach involves storing a reference to the
interact
object and providing a getter/setterCould also just have a plain getter and do:
These don't seem so bad, and are simple enough.
map.add(ms.interact())
is probably common enough that automating it is worth it.Thoughts?
.