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
-~----------~----~----~----~------~----~------~--~---

Reply via email to