On Jun 4, 9:52 pm, andrewljohnson <[email protected]> wrote:
> I tried to do that, but I still see a ton of requests for the sprite
> in IE6 on my log tail:http://www.trailbehind.com/node/1148091/
>
> You can see I include the sprite at the bottom of the page, within the
> Body and Html tags.
It has to be in the cache before the map starts requesting it (IE6 is
really bad about that). So you might want to move it to the top of
the page so it loads as early as possible and make sure it is in the
cache before the map starts loading.
-- Larry
>
> Andrew
>
> On Jun 4, 9:26 pm, warwound <[email protected]> wrote:
>
> > Can you add an IMG element to your map page:
>
> > <img src="/site_media/images/sprite.png" style="display:none" />
>
> > Try to force IE to fetch and cache the image before it is used by the
> > map javascript.
> > Once the image is cached it shouldn't be requested each time that it
> > is subsequently used.
>
> > Martin.
>
> > On 5 June, 04:40, andrewljohnson <[email protected]> wrote:
>
> > > I noticed that when using a GIcon sprite under IE6, the browser
> > > fetches the sprite each time I add a marker to the map. Here's the
> > > code (a bit reduced) that I use to create the GIcon and then render it
> > > to the map. Is there something I can change to avoid multiple sprite
> > > fetches in Internet Explorer 6?
>
> > > //returns an image-like GIcon based on a sprite
> > > function spriteIcon(attr) {
> > > var myicon = new GIcon(G_DEFAULT_ICON);
> > > myicon.sprite = {image:"/site_media/images/sprite.png", left:
> > > (attr.offset*16), top:0};
> > > myicon.iconSize = new GSize(16,16);
> > > myicon.iconAnchor = new GPoint(8,8);
> > > myicon.shadow = null;
> > > return myicon;
>
> > > }
>
> > > //render a set of nodes to the map
> > > GMap2.prototype.renderNodes = function(nodes) {
> > > ...
> > > for (var i = 0; i < nodes.length; ++i) {
> > > var node = nodes[i];
> > > this.waypoints[node.i] = makeWaypoint(node);
> > > attr = getNodeType(node.a)
> > > var myicon = spriteIcon(attr);
> > > var marker = new GMarker(waypoint.point, myicon);
> > > ...
> > > }
>
> > > }
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Maps API" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/Google-Maps-API?hl=en
-~----------~----~----~----~------~----~------~--~---