FAQs
This topic includes some of the problems ArcGIS API for Windows Phone developers hit in their developement, and solutions for those issues. They include the following problems:
- I cannot load data from my server.
- I cannot load data from an external data source outside my application's domain.
- Tasks return a limited number of features.
- Cached or dynamic map images generated by an ArcGIS Server map service do not display transparent areas as transparent.
Problem: I cannot load data from my server
If you're unable to load data from your server, try the following:
- If accessing ArcGIS Server services, make sure that the ArcGIS Services Directory is setup and functioning. Navigate to http://<host>/arcgis/rest/services in a browser. See the Discovering services main page for more information.
- Make sure the REST endpoint for the service is available. Copy and paste the Url defined in your Silverlight/WPF application into a browser. For example: http://<host>/arcgis/rest/services/USA/MapServer
- If your application is not hosted on the same server or domain as the data (services) you are accessing, you need a clientaccesspolicy.xml file on the remote server. See the next FAQ for more information.
- Use the InitializationFailure event on the layer to determine if an error is occurring and interrogate the error message.
- View the HTTP request and response using a standard tool for interrogating HTTP communication. For example Fiddler, Silverlight Spy, FireBug (FireFox add-on), and so on, to determine if a failure has occurred.
Problem: I cannot load data from an external data source outside the application's domain
To access data from a remote server (a different server from the one where your application is hosted), the remote server needs to have a clientaccesspolicy.xml file in the web servers root directory. For security reasons, a Web browser is not allowed to access data that resides outside the exact Web domain where the Silverlight XAP file originated. However, a Silverlight application can load data across domains if permission is granted from the server. This is accomplished by having a small clientaccesspolicy.xml file on the remote server that permits Silverlight to connect to services on that server. For additional information, read the topic Making a service available across domain boundaries. For more information on the structure and function of a clientaccesspolicy.xml file, read the topic Network security access restrictions in Silverlight.
As an example, you can also view the policy file used by ArcGIS Online: http://services.arcgisonline.com/clientaccesspolicy.xml.
Problem: Tasks return a limited number of features
By default, queries against ArcGIS Server services are limited to returning 500 features and MapIt services are limited to 1000 features at a time. Both limits can be modified on the server, if you have access. If not, you will need to iterate through consecutive blocks of results on the client by using the field that contains a unique key (for example, primary key) to track progress.
Problem: Cached or dynamic map images generated by an ArcGIS Server map service do not display transparent areas as transparent
The Silverlight 2 and 3 platform provide little if any support for transparency in PNG 8-bit images. To define a transparent color in a map image generated by an ArcGIS Server map service (e.g. for the background) you need to generate a 24 or 32-bit PNG. By default, the ArcGIS API for Windows Phone will request a 24-bit PNG with a transparent background from ArcGIS Server dynamic map services. To render transparent areas correctly in cached map tiles, generate tiles in 24 or 32-bit PNG format. This issue has been resolved in Silverlight 4 which will render transparency in PNG 8-bit images correctly.