OpenSpace. SupportService

Queries the API support service for items such as tile usage counts.

Example

The following example shows how to add the large map control to the map:

var osMap, screenOverlay, supportService;

function init()
{
osMap = new OpenSpace.Map('map');

// Add a screen Overlay
screenOverlay = new OpenSpace.Layer.ScreenOverlay("tilecount");
screenOverlay.setPosition(new OpenLayers.Pixel(10, 480));
osMap.addLayer(screenOverlay);

osMap.setCenter(new OpenSpace.MapPoint(438760,114760), 8);

// Create a new service
supportService = new OpenSpace.SupportService();

// Register to query service when map is moved
osMap.events.register("moveend", osMap, function(e) {
supportService.getTileCount(results);
});
}

function results(tilesUsed, maxTiles)
{
// Draw results on screen in overlay
screenOverlay.setHTML("<DIV style=\"width: 250px; height=75px; color: white; background-color: gray; font-size: 20px\">" +
"Tiles Used: " + tilesUsed + " of " + maxTiles + " </DIV>");
}
Summary
Queries the API support service for items such as tile usage counts.
Create a new OpenSpace.SupportService instance
Sends a query to the support server to find out the current map tile usage and the maximum number of available tiles.

Constructor

OpenSpace. SupportService

Create a new OpenSpace.SupportService instance

Parameters

Returns

An instance of OpenSpace.SupportService

Functions

getTileCount

getTileCount: function(callback)

Sends a query to the support server to find out the current map tile usage and the maximum number of available tiles.

Parameters

callback{Function} A function to call with the result.

Returns

{tileCount, maxTiles} Calls the callback function with the number of tiles used by this API key and the maximum number available.

getTileCount: function(callback)
Sends a query to the support server to find out the current map tile usage and the maximum number of available tiles.