Test a Layer
In this section, we will introduce how to test your layer.
API test page
On the publishing site, we provide the API test page which helps test the request/response from your web service and see the Layar server's logs to track down any issues.
To open the API test page, click on the "Test" button for a layer in the publishing site environment (see screenshot below).
The settings provided on the API test page are used to define request parameters in GetPOIs request, please see table below:
|API test page settings||Parameter in GetPOIs request||Example|
|Phone location||lat & lon||52.36569, 4.89297|
Please NOTE that Layar server is validating the JSON response based on the Api version selected on the API test page. Please make sure that you select the right version. If the layer should work on various layar clients (check the Minimum API version setting on the publishing site), for instance both layar v7.1 and v8.3, please make sure you check it against these API versions.
Once these settings are defined, click on "Load POIs" button to see the GetPOIs-JSON Response (see screenshot below).
In Console view, we can see the GetPOIs request that was sent. If the GetPOIs response is valid and Spots are returned within the search range, spots information under "POI list".
The API test page has the same validation rules implemented as Layar client running on the phone. All the error messages are highlighted in red.
In general, the following issues can be detected:
1. Serious issues (no POIs are returned)
- Layer not available
Quite often in the console view, it says "error validating provider response + many error messages sent back from the server". This means that the GetPOIs JSON response is not valid, therefore, it could not be accepted by the layar server. To valid JSON response, please copy GetPOIs request into a JSON validator (for instance, http://www.jsonlint.com/. don't forget to use the 'View source' option, you may not see the entire response in your browser window). Please NOTE that sometimes it might be a valid JSON according to those json validation tools but might not be validated according to Layar API. In this case, please double check whether you have returned the correct JSON response according to the API specification.
- Unable to reach POI provider (no content available)
Please check whether your web service is still reachable. There is a 10 sec time out threshold on Layar server, please make sure that your web service returns a GetPOIs response within 10 secs.
2. Normal issues (issues that should be fixed for better performance and user experience on the phone)
- layer name mismatch between GetPOIs request and GetPOIs response.
- spots "id" values should not be null or have the same values.
- ImageURL is broken or redirected.
- Some returned Spots are not within the red search circle.
2. Test on the phone
Of course, to make sure that your layer works as you expected. The best way is to test it on the phone. To test your layer on the phone, please take the following steps:
- Download the market version of Layar client from Android market or IPhone Appstore.
- Launch Layar client and see the "Layers" view. Make sure you use the client in a location where you have good internet connection (via your cellular network or WiFi).
- Click on "Settings" option in the navigation bar and click "Account".
- Login with your layar account (with developer role enabled). After logging in, you should see that you are given development mode.
- A "Testing" tab should be shown under "Layers" view.
- All your geo- layers can be found under "Test" tab.
- In order to launch Vision enabled lyer you need to scan the uploaded Pages
The developer settings (fixed location settings, etc) can be found by following the steps below:
- Clicking on the "Settings" option in the navigation bar
- Click on the "Options" button
- A few more options are shown below "developers settings"
Please NOTE that for test layers, the changes in layer editing section should take place in layar client immediately, except that the image/icon might be cached and they will be changed within 5 to 10 mins.
This is the end of this section, if you think your layer is functioning good and you want to request for publication approval, please test your layer against Layer testing instructions .