This example assumes you have successfully embedded the component and validated the license.
This example shows you how to retrieve panorama coverages. A panorama coverage is extracted from the actual trajectory taken by the mobile vehicle while the module mapping data was recorded. This trajectory is then simplified and provided as “Coverage”.
Steps to take :
The example below shows how to wait for a publication to load successfully.
client.addEventListener(orbit.webclient.LoadPublicationEvent.SUCCESS, function(e) { console.log("Publication is loaded."); });
Searching for panorama coverages requires 2 parameters :
A boundingbox is defined by these parameters :
A list of publication labels can be provided, but can also be ommitted. When null is provided, coverages are returned for every label.
Keep in mind that a user can enable or disable project labels using a HUD window. Use these functions and event to keep track of the labels in use :
Panorama.getProjectLabels() - Get the list of labels defined by the loaded publication.Panorama.getProjectLabelUse() - Get the 'use' state of a label. PanoramaEvent.ProjectLabelUseChange event - Listen to track when the user enables or disables a label.
Coverages are returned in the Publication CRS or in a custom CRS if one was set using the setCRS() function.
client.addEventListener(orbit.webclient.LoadPublicationEvent.SUCCESS, function(e) { client.getPanorama().searchCoverages(null/*all-labels*/,133810,206161,133860,206211,"31370", function (result) { console.log("Found coverages : ", result); }, function(fault) { console.log("Error loading coverages : ", fault); }); });
The color for a coverage can be retrieved using the Panorama.getProjectLabelColor() function.
Scale limits should be applied to coverages. We recommend to render them between 1/1500 and 1/50000 on a metric scale.
<html title="My Publication"> <head> <script type="text/javascript" src="<server>/api/<version>/webclient_api.js"></script> <script type="text/javascript"> var client; function addClient() { client.addEventListener(orbit.webclient.ClientEvent.GRANTED, function(e) { client.setServer("http://developer.orbitgis.com/service"); client.setCredentials("dev","dev"); client.loadPublication("Sint-Niklaas_31370"); }); client.addEventListener(orbit.webclient.LoadPublicationEvent.SUCCESS, function(e) { client.getPanorama().searchCoverages(null/*all-labels*/,133810,206161,133860,206211,"31370", function (result) { console.log("Found coverages : ", result); }, function(fault) { console.log("Error loading coverages : fault); }); }); }); } </script> </head> <body onload="addClient()"> <div id="clientElement"/> </body> </html>
Please open the JavaScript Console of your browser to see debug messages.