simplegeo / polymaps

Polymaps is a free JavaScript library for making dynamic, interactive maps in modern web browsers.
http://polymaps.org/
Other
1.6k stars 213 forks source link

Load function should be called with layer as context #130

Open natevw opened 12 years ago

natevw commented 12 years ago

It'd be cleaner to write an ad-hoc layer "subclass" without actually subclassing one if the load function were called with the layer as its this context:

map.add(po.layer(function () {
    console.log(this,arguments);
}));

Currently this logs "Window" as the first object, and the layer is not available to the function unless it is captured in the outer scope.