0
我正在尝试使用jVectorMap中的地图在移动网站上工作我发现在横向模式下在iphone上查看页面时,我需要将scale命令更改为.4。但是,在纵向模式下,它需要更小,例如.2。JQM Orientation SVG Scale
我使用此代码来调整从jVectorMap下载的js库中找到的比例值。注释掉的代码是我修改,企图以适应iPhone的屏幕
applyTransformParams: function(scale, transX, transY) {
if (this.mode == 'svg') {
this.rootGroup.setAttribute('transform', 'scale(.4) translate(30, '+transY+')');
//this.rootGroup.setAttribute('transform', 'scale('+scale+') translate('+transX+', '+transY+')');
} else {
this.rootGroup.coordorigin = (this.width-transX)+','+(this.height-transY);
this.rootGroup.coordsize = this.width/scale+','+this.height/scale;
}
}
原代码
我的问题是,有没有办法我能确定通过JS屏幕方向,并将它更新比例的数字?或者也许有一个最适合移动的命令?
感谢所有帮助