[Sugar-devel] [Karma] Basic example of Conozco working
Bryan Berry
bryan at olenepal.org
Thu Oct 22 00:15:03 EDT 2009
On Thu, 2009-10-22 at 03:24 +0100, Gary C Martin wrote:
> You probably have it already, but if needed, scaling and translation
> of existing svg content can be done by nesting the map drawing
> commands with the transform attribute:
>
> http://www.w3.org/TR/SVG/coords.html#TransformAttribute
>
> Regards,
> --Gary
tks Gary. I know of the transform attribute but I have used it yet.
I will need to understand transform better in order to implement pan and
zoom functionality.
Right now I am using i just assign the ratio of the browser viewport's
x/y dimensions to the actual svg to the svg DOM element's currentScale
attribute
var xRatio = browserInnerWidth/MAX_SCREEN_X;
var yRatio = browserInnerHeight/MAX_SCREEN_Y;
//get the smallest ratio
newRatio = xRatio > yRatio ? yRatio : xRatio;
if (newRatio < 1) {
svgElem.currentScale = newRatio - 0.05;
}
Would u be interested to do a "Conozco a UK" activity? ;) I could help
u with the javascript if you help me w/ the SVG ;)
--
Bryan W. Berry
Senior Engineer
OLE Nepal, http://www.olenepal.org
More information about the Sugar-devel
mailing list