[Mapbender-commits] r6019 - trunk/mapbender/http/javascripts
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Fri Apr 23 06:43:10 EDT 2010
Author: astrid_emde
Date: 2010-04-23 06:43:10 -0400 (Fri, 23 Apr 2010)
New Revision: 6019
Modified:
trunk/mapbender/http/javascripts/geometry.js
Log:
display icon with RaphaelJS
Modified: trunk/mapbender/http/javascripts/geometry.js
===================================================================
--- trunk/mapbender/http/javascripts/geometry.js 2010-04-23 10:29:39 UTC (rev 6018)
+++ trunk/mapbender/http/javascripts/geometry.js 2010-04-23 10:43:10 UTC (rev 6019)
@@ -1929,36 +1929,24 @@
if (typeof offsetY !== "number" || isNaN(offsetY)) {
offsetY = -40;
}
-// if(ie){
-// var newImg = document.createElement("img");
- var newImgTop = y + offsetY;
- var newImgLeft = x + offsetX;
- $(that.canvasDivTag.getTag()).html("<img name='mapSymbol' id='mapSymbol' src='" +
- url + "' style='position:absolute;top:" + newImgTop + ";left:" + newImgLeft +
- ";" + (width !== undefined ? "width:" + width + "px;" : "") +
- (height !== undefined ? "height:" + height + "px;" : "") +
- ";z-index:100;display:none'/>").children("img").show();
-// }
-// else{
-/*
- var newImg = document.createElement("img");
- newImg.src = url;
- newImg.className = "mapsymbol";
- newImg.name = "mapSymbol";
- newImg.id = "mapSymbol";
- that.canvasDivTag.getTag().appendChild(newImg);
- newImg.style.position = "absolute";
-
- // center the image at x, y
- newImg.style.top = y + offsetY;
- newImg.style.left = x + offsetX;
+ var newImgTop = y + offsetY;
+ var newImgLeft = x + offsetX;
+
+ if (typeof Raphael !== "undefined") {
if (width !== undefined && height !== undefined) {
- newImg.style.width = width;
- newImg.style.height = height;
+ canvas.image(url, newImgLeft, newImgTop, width, height);
}
- newImg.style.zIndex = 100;
-*/
-// }
+ else {
+ canvas.image(url, newImgLeft, newImgTop);
+ }
+ }
+ else {
+ $(that.canvasDivTag.getTag()).html("<img name='mapSymbol' id='mapSymbol' src='" +
+ url + "' style='position:absolute;top:" + newImgTop + ";left:" + newImgLeft +
+ ";" + (width !== undefined ? "width:" + width + "px;" : "") +
+ (height !== undefined ? "height:" + height + "px;" : "") +
+ ";z-index:100;display:none'/>").children("img").show();
+ }
};
/**
More information about the Mapbender_commits
mailing list