intellipharm-pty-ltd / dc-addons

dc.js chart addons
http://intellipharm.github.io/dc-addons/
MIT License
67 stars 27 forks source link

icon(d,map) function from dc.leafletMarkerChart not usable #8

Closed PBrockmann closed 8 years ago

PBrockmann commented 8 years ago

d and map are undefined

.icon(function(d,map) { console.log(d); }

How can I change the color of the icon then ?

gordonwoodhull commented 8 years ago

Looks like _marker() a few lines up just needs to pass this stuff through - _icon() should be _icon(d,map).

dc.leaflet.js has inherited the same mistake, will file an issue there too.

Tim-Intellipharm commented 8 years ago

Fixed in commit 5d793530ef880c2567b93a7a6241502da1f2976b and released in v0.13.0.

@gordonwoodhull You were right. A few lines up I needed to add the arguments to the function call. However the map variable in the _marker function was undefined. So what I ended up doing was calling it like so _icon(d, _chart.map())

PBrockmann commented 8 years ago

Thanks for the quick correction. It works nicelly. dc leaflet_icon