- Home
-
Public Sector
Public Sector
Quick links to popular content
- Business
-
Leisure
Leisure
OS getamap – print your route
Have your map custom made
Visit our shop
Read our magazine
-
Education & Research
Education & Research
Schools
Further & Higher Education
Research
General interest
-
About us
About us
Quick links
- Support
OS OpenSpace Pro technical FAQs
- How do I request a small OpenSpace API Build?
-
OS OpenSpace can be requested in two sizes – the default large size which includes all of the features from OpenLayers and a new small size which excludes the less used features.
The small version can be requested by adding the parameter b=small to your API request:
script src='http://openspace.ordnancesurvey.co.uk/osmapapi/openspace.js?key=INSERT_YOUR_API_KEY_HERE&b=small>
The large size is the default version however this can be specifically requested by adding the parameter b=large
script src='http://openspace.ordnancesurvey.co.uk/osmapapi/openspace.js?key=INSERT_YOUR_API_KEY_HERE&b=large>
To see which features are included or excluded from either build please add the debug parameter debug=true which provides the unminified code including a list of the included and excluded OpenLayers classes.
- Which browsers does OS OpenSpace Pro support?
-
At the moment OS OpenSpace supports IE6+, Firefox 1.5+, Safari 2+ Opera 8+ and Google Chrome 1+.
If you are working in IE8 and have used the web-map builder application, you may come across “display me using modern standards”. To overcome this, you will need to enable and turn on Compatibility View mode for all web pages and websites:
- click on Tools menu,
- select Compatibility View Settings.
- In the “Compatibility View Settings” dialog, tick the check box for Display all websites in Compatibility View option.
- Click on Close button when done.
- I keep getting an 'http referrer' error; why is this?
-
This is usually because the registered URL is not correctly registered. You need to ensure that you have registered two types of URLs for your application, for example:
http://www.mydomain.com
and
http://mydomain.com
If you do need to register an additional url, please send us an email stating your API Key and the URL that you need to get added.
- How do I configure OS OpenSpace Pro mapping layer requests
-
We have provided a method to request products using Product Codes. If you have an OpenSpace Pro licence, your application can request additional datasets including 1:25k. Each mapping product had a unique product code (see below).
In your OpenSpace code you will need to replace or comment out this piece of code that provides the default products:
//osMap = new OpenSpace.Map('map');Replace it with code that requests products by Product Code. Its important to insert a correct sequence of product codes i.e Insert small scale products first (most zoomed out). To use product codes correctly they need to be ordered according to resolution, so the resolution order (as represented by the product codes) must be in high to low order.
In the following example, Vector Map District had been included:
var options = {products: ["OV0", "OV1", "OV2",
"MSR", "MS", "250KR", "250K", "50KR", "50K",
"VMDR", "VMD", "SVR", "SV"]};osMap = new OpenSpace.Map('map',options);In the following example, 50k, Vector Map District and StreetView are shown:
var options = {products: ["50KR", "50K", "VMDR",
"VMD", "SVR", "SV"]};osMap = new OpenSpace.Map('map',options); - How do I add 1:25 000 scale mapping
-
If you have an OpenSpace Pro contract to licence 1:25k mapping, use the following product code.
var options = {products: "25KR", "25K"]};osMap = new OpenSpace.Map('map',options); - What are the OpenSpace Pro Product Codes?
-
In order to achieve a friendly zoomed in/out effect, each product type has a suitable resolution measured in meters per pixel at which it should be viewed in a web application.
Each product type (except Overview maps) has been provided at two zoom levels or resolutions. When a product is Resampled it is twice the original resolution. 'R' denotes a resampled product,.
Mapping layers Resolution Index Local OS StreetView® 1 SV 2 SVR OS VectorMap® Local 1 VML 2 VMLR District 1:25 000 Scale Colour Raster 2.5 25K 4 25KR OS VectorMap® District 2.5 VMD 4 VMDR Regional 1:50 000 Scale Colour Raster 5 50K 10 50KR 1:250 000 Scale Colour Raster 25 250K 50 250KR National overview Miniscale® (1:1M scale) 100 MS 200 MSR Overview two 500 OV2 Overview one 1000 OV1 Overview zero 2500 OV0 Zoom Map Stack
Product Resolution Index Generated from Strategi® 896 CS00 Generated from Strategi 448 CS01 Generated from Strategi and Land-Form Panorama® 224 CS02 Generated from Strategi and Land-Form Panorama 112 CS03 Generated from Strategi and Land-Form Panorama 56 CS04 Generated from Strategi and Land-Form Panorama 28 CS05 Generated from OS VectorMap Disctrict, Strategi and Land-Form Panorama 14 CS06 Generated from OS VectorMap Disctrict, Strategi and Land-Form Panorama 7 CS07 Generated from OS VectorMap Disctrict, Strategi and Land-Form Panorama 3.5 CS08 Generated from OS VectorMap Local 1.75 CS09 Generated from OS VectorMap Local 0.875 CS10 - Does OS OpenSpace Pro have any look-ups?
-
Yes the OS OpenSpace Pro API has three look-ups:
Product Purpose Code-point® Open for postcode look-up Boundary-Line™ Data for boundary information 1:50 000 Scale Gazetteer for place name search - What are the technical details for the service?
-
Access Authority
API Key received upon registration.
Protocol - REST based AJAX APIMinimum client script support
HTML
JavaScriptSupported Output Formats
JSON
TIFFCoordinate Reference Systems
British National Grid System (EPSG:27700)Coordinate Ranges for Coverage
Axis Min Max
---------------------------------
X 0 700000
Y 0 1300000 - How do I report a bug?
-
To report an issue because you think that there might be a bug, announce it first in the forum because other developers will then be able to confirm whether or not there is a problem with your code. If the issue cannot be resolved, then the OS OpenSpace Team will investigate it.
- How do I debug my code?
-
Debugging can be done by using the Firebug Lite JavaScript library, obtained at http://www.getfirebug.com/lite.html
The Firebug Lite script must be included before the OS OpenSpace API script, and, depending on the browser using it, must be included from the same domain as your application.
This will then allow the OpenLayers.Console namespace to be used for debugging and error logging. For instance
OpenLayers.Console.log("This is a test");will display "This is a test" in either the Firebug console (where available) or the Firebug Lite console.
We have also provided a debud a debug facility to inspect un-minified code. To do this add &debug=true to the URL; osopenspacepro.ordnancesurvey.co.uk/osmapapi/openspace.js?key=your_api_key_here&debug=true
- How do I call a tile count?
-
There is also a support service which has a function that can be called to get the current tile count and tile limit. The tile count may be a cached value, but is likely to be accurate to within a few minutes. This function is probably best called when the page is first loaded to check if there are any tiles left and then display some form of error message. The service calls a user-supplied callback function that takes two integer parameters.
To call the service:
...
var supportService = new OpenSpace.SupportService();
supportService.getTileCount(tileCountResults);
...
The callback function
function tileCountResults(tilesUsed, maxTiles)
{var s = "Tiles Used: " + tilesUsed + " of " + maxTiles;
- Can I use localhost to develop?
-
Local host is used for development purposes and OS OpenSpace has been configured to work using local host prior to go live. Once you have completed your development you need to ensure that your registered url is the host url for your website. Once you have checked this you will need to add all your code to your site.
To add your code to your site you can use an ftp client, most hosts/providers supply an ftp service free of charge however some do charge.
Use the ftp client to upload your html file.
Once you have uploaded your html file to a server using an FTP client you will need to add a script to your page. In your web site page, where you want the web-map to appear, insert the following script into the body of the page or blog html editor.
You’ll only need to do this once.
