Gavin’s Odd Bits of Code

2008-03-29 (Sat)

Daily Tile Usage Count for Ordance Survey GE Overlay

Filed under: Google Earth — Gavin Brock @ 7:41 pm
Tags: ,

One problem with the Ordnance Survey’s OpenSpace API is the relatively low number of map “tiles” that you can use (currently 30000 per site per day). However they now have an API call to let you see your current tile usage.

I have added a little embedded widget to my Google Earth page so that you can check if the count has been exceeded, and if that might be the cause of problems when using the overlay.

If you are interested the tiny piece of code is:

<body>
<div id="tilecount" style="position: absolute; left:0px; top:0px; width: 100%; height: 100%; text-align: center;">Checking tile count...</div>
<script type="text/javascript">
	var supportService = new OpenSpace.SupportService();
	supportService.getTileCount( function (tilesUsed, maxTiles) {
  		var s = "Tiles Used: " + tilesUsed + " of " + maxTiles;
		var div = document.getElementById("tilecount");
		div.innerHTML=s;
	});
</script>
</body>
About these ads

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

The Rubric Theme. Blog at WordPress.com.

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: