在一个项目中有个 切片图层做底图,一个动态图层做专题图。2个图层叠加显示。
在动态图层的显示条件种和切片的比例有个对应显示的设置。即 切片图层显示到 小于某个比例的情况下,专题图层会隐藏和显示某些 在这个比例下才能显示的内容。
这个功能在rest服务 通过浏览器访问,完全正常。但是在 iphone界面上会无法正确显示。
查询arcgis的论坛,发现原因是由于 iphone的dpi 是 163 .而服务器做切片的dpi 是 96.
会引起比例尺不对应的问题。
解决办法:
设置
AGSDynamicMapServiceLayer.dpi = 96 即可。
相关的解释如下:
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.