stamen / modestmaps-js

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

IE6 and IE7 #2

Closed wnoronha closed 14 years ago

wnoronha commented 14 years ago

Don't know if this should be considered as an issue.

But ModestMaps does not work with IE6 and IE7.

RandomEtc commented 14 years ago

It should work, and did previously, but I confess it hasn't been tested for some time. Can you identify specific errors? I'd be glad to help debug and happily receive patches/pull requests.

wnoronha commented 14 years ago

Sweet. Let me start work on this.

I use modestmaps-py and modestmaps-js. I would say mm-py is sweet but mm-js is just fucking awesome! It makes OpenLayers look like a Model-T

RandomEtc commented 14 years ago

Heh. OpenLayers has everything. Modest Maps JS is more like a Vespa to OpenLayers' Fire Engine ;)

wnoronha commented 14 years ago

Sample HTML: http://gist.github.com/597015

Line: 10
Char: 5
Error: 'com' is undefined
Code: 0
URL: http://example.com
RandomEtc commented 14 years ago

Thanks for the test case. I'll try to fire up IE6 someplace and see what I can see.

It might be that there's an error initializing things in modestmaps.js or perhaps in IE the inline script runs before modestmaps.js has loaded? Does it work if you initialize the map inside a window.onload function?

Also note you'll want a "new com.modestmaps.Point(x,y)" for a fixed size map. The constructor functions don't return anything so if you omit new it will think the size is undefined.

wnoronha commented 14 years ago

I have attached some sample code. I am also trying to get to the bottom of this. Are you available on irc?

wnoronha commented 14 years ago

The 'com' error seems to go away if I include the entire js in the html.

I think theManager.processQueue(); seems to be causing some problems.

Char: 12705 "Expected identifier, string or number"

RandomEtc commented 14 years ago

Aha! I got it to work...

There's a trailing comma after the closing brace of getLoadComplete that causes the error you're seeing. Internet Explorer is picky about those.

You also need to say "var map = ..." (I think it's because there's a div named map as well, and they compete if you assign to map globally).

Here's a gist that I've tested successfully in IE6: http://gist.github.com/597021 ... you can see it working at http://bl.ocks.org/597021

I'll close this issue once I get a chance to push a fix to github.

wnoronha commented 14 years ago

Verifying the changes with some of the examples listed.

wnoronha commented 14 years ago

Tested out a few examples. They work fine. I think this issue is fixed.

RandomEtc commented 14 years ago

I pushed a new version of modestmaps.js and modestmaps.min.js that seem to work OK in IE6 (I'm testing with Wine on Mac OS so it's not conclusive)