On Wed, Feb 9, 2011 at 2:50 AM, bratliff <bratl...@umich.edu> wrote: > On Feb 7, 10:24 pm, Ben Appleton <apple...@google.com> wrote: > > Hi Berry, > > > > We have a user agent parser that extracts the rendering engine and > version > > from the browser useragent. I only apply the workaround > (width=height=255px) > > to IE version 8. Watch out for non-IE browsers which claim to be IE, as > > historically some webservers only supported IE. > > > > We set coordsize to 1 1 and coordorigin to 0 0 if I recall correctly. > > Apparently this works around some VML coordinate bugs. VML is happy to > > overflow. > > > > We now implement all hit detection in javascript. This allows layers to > > "play nice", so we can click through an SVG or canvas element's bounding > > box. I haven't yet converted to use Canvas by default, but as > you.indicate > > this may be mucb faster than SVG. > > > > Cheers > > Ben > > Thanks Ben, > > I use: > > if (document.all) if (window.XMLHttpRequest) > > to isolate IE7+. Do you know of similar capabilities tests for IE8 & > IE9 ? IE9 supports CANVAS. IE8 does not. >
When testing vector graphics capabilities I test first for SVG, then canvas, then VML. So I only need to distinguish IE6/7 vs IE8 in the VML code (not IE9). Since we have a general browser detection library, I haven't gone looking for short tests to distinguish IE6/7 vs IE8. I'm sure there must be some though. I am using coordsize 1 1 & coordorigin 0 0 also because every other > attempt failed. Without a useable VML installation on my PC, I am > flying blind. > > The only drawback to CANVAS I have encountered is the inability to > recolor polys on the fly. Painting over the poly does not preserve > its zIndex. It also blends differently with other overlapped polys. > Repainting whole tiles is too slow for rollovers. > In the past we preferred SVG over Canvas, but we may revisit that decision now that we use JS hit detection. Specifically once we paint Canvas tiles, panning seems to be much faster than with SVG tiles which seem to repaint on each frame. So I'm interested to hear about Canvas repainting speed. I was hoping that when a poly changed visual style we could repaint the affected tiles, or "dirty" rectangles inside each tile. I haven't measured anything yet though. Do you use "point-in-poly" analysis for hit detection ? I let CANVAS > do it for me in an off-screen CANVAS element. It involves just one > tile. It is actually quite fast. I use point-in-polygon and point-near-polyline hit tests. I first detect which tile the event applies to, then I run the hit tests over all polys in that tile. I use the simplified, cropped tile vectors for hit detection, so that even a pathological poly (a test fractal) only has 1000 vertices per tile. Benchmarking shows that IE7 on my laptop can hit test about 1M vertices per seconds, so JS hit detection seems to be fast enough even for mousemove. I haven't tried rendering an off-screen canvas element. Does that slow down rendering by 2x? Have you had any trouble with canvas anti-aliasing in your offscreen element? I recommend JS hit detection - if it's fast enough, it can save a lot of work upfront. By the way, if you don't already you might want to throttle mousemove events. I've seen hundreds of mousemove events per second in some browsers, particularly with a high DPI mouse. We start dropping mousemove events when they exceed 50fps, which helps slow browsers a lot. Cheers Ben Berry > > -- > You received this message because you are subscribed to the Google Groups > "Google Maps JavaScript API v3" group. > To post to this group, send email to > google-maps-js-api-v3@googlegroups.com. > To unsubscribe from this group, send email to > google-maps-js-api-v3+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/google-maps-js-api-v3?hl=en. > > -- You received this message because you are subscribed to the Google Groups "Google Maps JavaScript API v3" group. To post to this group, send email to google-maps-js-api-v3@googlegroups.com. To unsubscribe from this group, send email to google-maps-js-api-v3+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-maps-js-api-v3?hl=en.