[ka-Map-users] Ka Icon

The Bun rosario.carbone at ipl.com
Wed Oct 31 13:10:22 EDT 2007


Hi 
I had a similar problem although maybe a bit different. I added a graphic
element ( in my case a .png ) to the XmlOverlay, in the
kaXmlOverlay.prototype.loadXml method during the startup of my page, for
Firefox it was OK while for IE it wasn't. I discovered that when data are
cached IE doesn't raise the onload event for the image ... I changed the
following code in kaXmlIcon.prototype.draw_canvas (kaXmlOverlay.js):

this.img.onload = function() {
   	ctx.drawImage(timg, dx, dy, tw, th);
             ctx.restore();
}

With:

if (_BrowserIdent_checkIt('msie'))
{
	ctx.drawImage(timg, dx, dy, tw, th);
             ctx.restore();
}
else 
{
    this.img.onload = function() {
   	    ctx.drawImage(timg, dx, dy, tw, th);
                 ctx.restore();
    }
}

And now it works, maybe this has nothing to do with your problem but this is
definitely a bug in kaXmlOverlay, or better say in IE?

Best Regards
Rosario


GISGuru wrote:
> 
> Hi,
> 
> I am adding a graphic to a map as the user clicks on the map with a tool.
> In FF this works fine. However in IE 7 the graphic is shown at startup but
> when the user clicks around the same code does not draw the icon. 
> 
> The page is an iframe inside a php page. 
> 
> The map page is a html page with the following doctype
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
> "http://www.w3.org/TR/html4/loose.dtd">
> 
> Any Ideas?
> 
> Thanks in advance
> J
> Code to Add Icon
> 
> my_point = myXmlOverlay.addNewPoint('Property', longuitude, latitude);
> 	
> 		
> var my_symbol = new kaXmlIcon();
> 	my_symbol.icon_src = 'pin_red.gif';
> 	my_symbol.icon_w = 32;
> 	my_symbol.icon_h = 32;
> 	my_symbol.xoff = -16;
> 	my_symbol.yoff = -14;	
> 	my_point.addGraphic(my_symbol);
> 
> 

-- 
View this message in context: http://www.nabble.com/Ka-Icon-tf4725136.html#a13514102
Sent from the ka-map-users mailing list archive at Nabble.com.



More information about the ka-Map-users mailing list