GDI+ exception

Aug 20, 2011 at 12:53 PM
Edited Aug 20, 2011 at 4:44 PM

I stepped through your source code and it looks like all the layers are being created successfully with your new changes. Very nice!

BUT I'm getting a GDI+ exception when it tries to copy over all the marker PNGs.
No problem there, I just copied those over to an Images directory manually from the source, then re-ran the app with the zoom-levels-foreach commented out (so as to not wait 45 minutes) and I commented out all the PNG copy code as well.

But I'm getting a blank map still when I open the HTML, so I'm not sure what's going on there... The HTML file has the world.Size.Width and Height written to it successfully. So then I looked at my JS debugger, and it said it couldn't load MapData.xml because it was being treated as an image. So I exported that, and it's still having some troubles:

Resource interpreted as Image but transferred with MIME type text/html.
XMLHttpRequest cannot load file:///C:/Users/Chris/Desktop/tmap/MapData.xml. Origin null is not allowed by Access-Control-Allow-Origin.
Terraria.js:70Uncaught TypeError: Cannot call method 'lng' of null

I don't know if any of that helps. Let me know if you want files.

Aug 20, 2011 at 9:07 PM

MapData.xml is generated by the tool when it is ran and placed into the output directory.

It sounds like this could be a browser security issue with loading the local xml file.

What browser are you using?

Aug 21, 2011 at 12:15 AM
Aug 21, 2011 at 1:01 AM

The issue appears to be with the security in chrome. It disables local file access which I'm using to open the mapdata.xml file.

One thing that makes it work is to run chrome with the


flag. I'll have to see if there are other ways to do what I'm doing that don't require this. I have tested the page in Internet Explorer and Firefox and both of those browsers work without any additional flags.

Aug 21, 2011 at 12:49 PM

Fantastic. Thank you!

Any clue as to why I was getting a GDI+ exception?

Aug 22, 2011 at 12:10 AM

Those errors I got from the directory not existing that I was trying to write to but I added code to force create the folder. Perhaps a permissions issue with the target folders?