arcgis ios 10.0.1 sdk 中比例尺 scale 和伺服器不一致的問題。

來源:互聯網
上載者:User

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

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.