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);

Is this possible?

I'm not a mapping/GIS/OpenLayers expert.

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.

Setting Zoom Level based on Overlays in Ordnance Survey Map seems to be similar to this question, but the recommended actions don't seem to be compatible with my situation.

0

2 Answers 2

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>
0
0

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 and acknowledge you have read our privacy policy.

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