2

I'm trialling Ordnance Survey OpenSpace Pro WMS, and I have a basic map showing all the layers I'm going to be licensed for (free ones plus vector map local). This works fine, but I'd like to make the most zoomed level of mapping (VML) bigger on the screen if that's possible? i.e. so I can see it more clearly and the location of pins plotted on the screen more clearly. Obviously I'm not expecting any more data features/detail to become visible (as I'm not paying for any more detailed layers of mapping) - I just want to zoom in on the same map tiles more closely.

I'm initialising my map as follows:

var options = {products: ["OV0", "OV1", "OV2", "MSR", "MS", "250KR", "250K", "VMDR", "VMD", "VMLR", "VML"]};

osMap = new OpenSpace.Map('map', options);

Would be grateful to know if this is possible. I'm not a mapping/GIS/OpenLayers expert, so hopefully there's a simple way to do it.

Here's a OS map with max zoom level (showing vector map local). OS Map VML layer - default magnification

Here's the same map but magnified using browser zoom to achieve the affect I want - i.e. the same map layer, but bigger. Magnified OS Map VML layer

I've achieved this using browser zoom which is a fudge and I can't expect my users to do this. I will be plotting points on the map too, so using browser zoom will just make all the point markers massive too. Ideally I want to make the map bigger, and leave the markers, copyright statement, zoom control etc all the same original size.

p.s. This question seems to be similar, but the recommended actions don't seem to be compatible with my situation.

  • Think you need another option to set resolution var options = {resolutions: [10, 5] webarchive.nationalarchives.gov.uk/20100402191611/http://… – Mapperz Jan 6 '15 at 18:49
  • Thanks @Mapperz. Using resolutions in the option seems to mean that the product bit gets ignored. With resolutions: [10,5] - I get just 2 resolution levels not the ability to make the most detailed layer bigger. [link]ordnancesurvey.co.uk/business-and-government/help-and-support/… has a table of products and resolutions, but I can't see how to do what I want to do. – Chris S Jan 6 '15 at 19:03
  • An update: This example is what I'm trying to do. I've simplified my example to only use VML as a product, and I am creating a WMTS layer and setting resolutions to [1,0.5], and serverResolutions to [1]. This should mean that the map will stretch the tile. Unfortunately the tiles aren't rendering at all on this layer, so I don't think my OS OpenSpace Pro trial key is enabled for the wmts service, so I'm waiting for OS to get back to me to say they have enabled it. Will update when I know more. – Chris S Jan 13 '15 at 17:15
  • Openlayers 3 (not 2) supports fractional zoom example jsfiddle.net/tschaub/orr6qfkc set zoom: 10.75 then 10.25 is OpenSpace Pro on openlayers 3 yet? – Mapperz Jan 13 '15 at 18:01
  • Hi Mapperz - don't think it is on openlayers version 3. The documentation shows 2.12. p.s. can't upvote your answer as don't have enough reputation points. :-( – Chris S Jan 13 '15 at 18:17
1

This fixes the zoom level and extent of the map

Add your pro api key and it should work

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Open Space Tutorial - Example 10</title>
<script type= "text/javascript"src="http://webarchive.nationalarchives.gov.uk/20100402191611/http://openspace.ordnancesurvey.co.uk/osmapapi/openspace.js?key=insert_your_api_key_here"></script>
</head>
<body onload="init()">
<script type="text/javascript">
    var osMap;
    function init()
    {
        // Change default map[ options to just have two zoom levels
        // and a limited map extent
        var options = {resolutions: [10, 5],
                       maxExtent: new OpenSpace.MapBounds(400000, 100000, 450000, 150000) };
        osMap = new OpenSpace.Map('map', options);
        osMap.setCenter(new OpenSpace.MapPoint(438760, 114760), 1);
    }
</script>
<h1>Using different map options</h1>
<div id="map" style="width: 500px; height: 300px; border: 1px solid black;"></div>
</body>
</html>
  • Thanks again @Mapperz. I tried your code and it doesn't quite do what I'm trying to do. I've elaborated my question above to include some screen grabs to try to explain better. Your example limits the zoom control to allow me to see 1 of 2 layers. I have been using the 'products' construct to define which layers are available, one of which is Vector Map Local. I want to have all the layers available, but to magnify VML too. If I use 'resolutions' construct it just seems to be a different way of specifying the 'products'. I'm beginning to wonder if this isn't supported in OS OpenSpace. – Chris S Jan 6 '15 at 22:12
0

Although it's now an old question this may be useful for anyone who doesn't use the WMTS service. Here's a basic OpenSpace map with client zoom implemented by reproducing the normal WMS layer as a TMS layer (which works with the free service): http://mikenunn.16mb.com/map/os-map-client-zoom.htm

Another clarity related issue for some is the "washout" backdrop style of some of the products. My example uses mix-blend-mode to enhance colours for VMD where the browser supports it (Chrome and Firefox, but not IE or Edge).

The screenshot shows the result of similar code run in the API playground where VML is available.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.