stamen / modestmaps-js

Modest Maps javascript port
http://modestmaps.com
566 stars 152 forks source link

Several examples is no longer working #100

Closed pixelfreak closed 12 years ago

pixelfreak commented 12 years ago

The hurricane example along with some other examples don't work anymore :(

psaia commented 12 years ago

It actually seems to be working in Firefox. However, in Safari and Chrome it is not. I'm getting this error:

Uncaught Error: NOT_FOUND_ERR: DOM Exception 8

The first example in the Wiki (A Map requires a DOM element, layer...) is also failing for me for the same reason.

The problem seems to be starting on line 2639. When the child div is being appending the the parent.

// put the given layer on top of all the others
addLayer: function(layer) {
    this.layers.push(layer);
    this.parent.appendChild(layer.parent);
    layer.map = this; // TODO: remove map property from MM.Layer?
    return this;
},

Wrapping TemplatedMapProvider in the Layer method fixes this issue. This should probably be a separate ticket.

tmcw commented 12 years ago

Hey @pixelfreak - just fixed the hurricanes example. What other examples are you seeing break?

pixelfreak commented 12 years ago

@tmcw Looks like they are all fixed now. I'll let you know if I see anything else. Thanks!