您的位置:首页 > 移动开发 > IOS开发

arcgis ios 10.0.1 sdk 中比例尺 scale 和服务器不一致的问题。

2013-07-09 00:44 155 查看
在一个项目中有个 切片图层做底图,一个动态图层做专题图。2个图层叠加显示。

在动态图层的显示条件种和切片的比例有个对应显示的设置。即 切片图层显示到 小于某个比例的情况下,专题图层会隐藏和显示某些 在这个比例下才能显示的内容。

这个功能在rest服务 通过浏览器访问,完全正常。但是在 iphone界面上会无法正确显示。

查询arcgis的论坛,发现原因是由于 iphone的dpi 是 163 .而服务器做切片的dpi 是 96.

会引起比例尺不对应的问题。

解决办法:

设置

AGSDynamicMapServiceLayer.dpi = 96 即可。

相关的解释如下:
http://forums.arcgis.com/threads/4247-Rendering-Labels-in-AGSDynamicMapServiceLayer?highlight=132%2F96

The labels are bigger because AGSDynamicMapServiceLayer uses the phone's resolution (163 DPI) to export
maps. Other APIs that run on computers (not phones) use a smaller resolution - 96 is standard for most computer screens. Hence the difference.

The difference stems from the fact that labels are defined in point sizes (ex: Arial 10pt, etc). The graphic gurus
of the world have decided that 72 points = 1 inch. But what exactly is 1 inch on a screen? Well, that depends on the screen's DPI (dots-per-inch). At 96 DPI, 1 inch = 96 dots. At 163 DPI, 1 Inch = 163 dots. So if you defined your label as 72 pt Arial, it would
take up 96 dots on a map exported at 96 DPI, but it would take up 163 dots on map of 163 DPI. 163 is bigger than 96 (obviously) and so the labels are bigger.

If you like, you can change the dpi property
of AGSDynamicMapServiceLayer to 96 and then the labels will have the familiar proportion you're expecting.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: