在一個項目中有個 切片圖層做底圖,一個動態圖層做專題圖。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.