kartograph / kartograph.js

UNMAINTAINED Open source JavaScript renderer for Kartograph SVG maps
http://kartograph.org
GNU Lesser General Public License v3.0
1.51k stars 227 forks source link

addLayer method returns too soon when chunks > 1 #51

Open glesica opened 11 years ago

glesica commented 11 years ago

The addLayer method has no callback, and it seems to return only after it finishes when you don't set the chunks option to a value > 1. This is good, because if you have a layer that takes awhile to load, and you then want to add some symbols, you really want addLayer to be finished before the symbols are added so you don't have to mess with the z-index (which I don't even know how to change in kartograph at this point...).

However, if chunks is set to a value > 1, addLayer appears to return after the first chunk is drawn, which then allows addSymbols to do its thing and you can end up with subsequent chunks drawn on top of your symbols.

I don't think this would be hard to fix, but I want to make sure it is considered a problem and that I'm not just experiencing this because of ignorance before I do that... thoughts?

Note: I posted this under kartograph.org the first time because I didn't notice there were separate repos (got there from some example source). Please disregard the other one.