Harvester


I've been playing with a custom tile set generated via map cruncher. The tiles are generated from an image with an alpha channel of about 170 on coloured regions, and full transparency everywhere else. When the tiles are generated and loaded in firefox they look great... exactly as intended.

IE6 used to be hideous (last month) and now seems to have the transparency handled, but no alpha. I was using Lewis Harvey's fix, but it no longer seems to be required

IE7 also has no alpha on the coloured regions, either, which suprises me. I thought IE7 was supposed to support PNG alpha now.

Anyone have any insight or hacks that might make IE7 work as nicely as firefox

Thanks,
Greg



Re: Does VE mess up PNG alpha for IE7?

Derek Chan


Can you could post a link that duplicates this alpha problem





Re: Does VE mess up PNG alpha for IE7?

Harvester

Unfortunately I don't have a public link at the moment... I have been developing offline.
I'll try to put something helpful up on a free service at some point shortly. If no one knows offhand, then it can't be a common problem. I'll play with the mapcruncher and VE JS files and see if maybe they are doing something...





Re: Does VE mess up PNG alpha for IE7?

SoulSolutions

IE7 supports alpha channel for PNGs, must be something in VE.

Brian would be the man to know. Just need to get his attention

http://www.spatialdatalogic.com/cs/blogs/brian_flood/

I havn't played with PNG as yet for tiles (only jpg) due to the issues in IE6, interesting they may have resolved them only to break IE7.

John.






Re: Does VE mess up PNG alpha for IE7?

Harvester

Thanks John. I'll try to get ahold of Brian if I can't figure it out. I've played some more (it's not what I'm supposed to be focused on this week ) and proved to myself that IE7 does handle the alphas just fine by z-indexing a hard coded instance of one of the tiles over top of the map, it looks fine. However, that beautifully rendered tile is sitting right beside the layer that mapcruncher is helping to render (same tileset!) in non-alpha'd mode. sigh.

I fired a question off to microsoft research's mapcruncher team at the same time as this thread started, but no response yet. In the end I'm sure I'll be pouring over the obfusated JS of VE and/or mapcruncher to figure this out. It is probably one or the other doing a transform on the PNG.




Re: Does VE mess up PNG alpha for IE7?

SoulSolutions

Good luck! If it comes to pouring over js send me an email and i may have something that can help you with that.

John.






Re: Does VE mess up PNG alpha for IE7?

Harvester

I've got a work-around for my problem now.

I had to tweak the VEAPI javascript so that when it's checking for filters it doesn't apply the alpha filter for IE7. That way IE7 falls through to the same method as other browsers (like firefox). If anyone else is interested, here's the location and hack I did (function G under Tile, the ['d] are supposed to be bracket d bracket but the thing changed them to Drinks):

if(b&&typeof b.filter!="undefined"&&navigator.userAgent.toLowerCase().indexOf("msie7")>-1){
r=document.createElement("div");b=r.style;b.left=j['d];b.top=l['d];b.width=q['d];b.height=o['d];b.position="absolute";b.zIndex=h;
b.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+a.src+"',sizingMethod='scale'), alpha(opacity="+m*100+")";
map.appendChild(r)
}
else{
b.zIndex=h;
b.opacity=m;
map.appendChild(a)
}

I sure hope the VE team fixes this soon! I tried using the link that grabs the latest JS (http://live.local.com/veapi.asjx) but it still has the problem. For now I'm using my hacked version and the boss is happy he can demo it (absolutely could NOT convince him to demo with firefox ), maybe it'll be fixed by the time we need to go live with it.

Cheers,

Greg





Re: Does VE mess up PNG alpha for IE7?

SoulSolutions

Great work Greg!

Thanks for sharing that bug fix with us. Yes I also hope that this will be fixed with the next release of VE, I mean you've done all the hard work for them!

I wouldn't be supprised though if it was implimented more generically to identify any IE versiongreater then or equal to 7. Hate for it to stop working in IE8 ;)

John.






Re: Does VE mess up PNG alpha for IE7?

Harvester

Glad to share. This is a great community. I started this project with almost no JS and no VE at all and I can muddle along quite well thanks to the VE forums, ViaVirtualEarth, the SDK, etc. It's great!

Too right about the fix, though. My original hack was msie6 != -1 :) because I only care about ie6 and 7 -- figured when I posted it I would at least handle it such that anything other than ie7 fell into the trap... didn't consider newer!