Map trial

<!–
var osMap, screenOverlay, mapOV, postcodeService;
var pos;
// Variables for markers
var size,offset,infoWindowAnchor,icon,content,popUpSize;

// Variables for routes
var linesLayer;
var points;
var lineFeature;
var lineString;
var style_blue = {strokeColor: “#0000CD”, strokeOpacity: 0.5, strokeWidth: 4.5};

// Variables for route start and end markers
var routeMarkersLayer, routepos, routesize,routeoffset,routeicon;

function initmapbuilder()
{
// Creating the Openspace map and the postcode service
osMap = new OpenSpace.Map(‘map’);
postcodeService = new OpenSpace.Postcode();

// Adding the map overview
mapOV = new OpenSpace.Control.OverviewMap();
osMap.addControl(mapOV);
//fix to put copyright on top of overview map: Needs api fix for later version
var ccControl = osMap.getControlsByClass(“OpenSpace.Control.CopyrightCollection”)
osMap.removeControl(ccControl[0]);
ccControl = new OpenSpace.Control.CopyrightCollection();
osMap.addControl(ccControl);
ccControl.activate();
//end of fix
// Turning the overview map on
mapOV.maximizeControl();

// Defining the center of the map and the zoom level
osMap.setCenter(new OpenSpace.MapPoint(418000,585975),2);
// Defining a marker
pos = new OpenSpace.MapPoint(419900,585900);
size = new OpenLayers.Size(30,39);
offset = new OpenLayers.Pixel(-15,-36);
infoWindowAnchor = new OpenLayers.Pixel(16,16);
icon = new OpenSpace.Icon(‘https://openspace.ordnancesurvey.co.uk/osmapapi/img_versions/img_1.0.1/OS/images/markers/marker-cross-med-red.png’, size, offset, null, infoWindowAnchor);
content = ‘

Northwoods

‘;
popUpSize = new OpenLayers.Size(250,150);
osMap.createMarker(pos, icon, content, popUpSize);
linesLayer = osMap.getVectorLayer();
// Defining a route
points = new Array();
points.push(new OpenLayers.Geometry.Point(419890,585920));
points.push(new OpenLayers.Geometry.Point(418300,587460));
points.push(new OpenLayers.Geometry.Point(418210,587540));
points.push(new OpenLayers.Geometry.Point(418190,588530));
points.push(new OpenLayers.Geometry.Point(418160,588490));
points.push(new OpenLayers.Geometry.Point(417420,589720));
points.push(new OpenLayers.Geometry.Point(416040,590240));
points.push(new OpenLayers.Geometry.Point(415190,590550));
points.push(new OpenLayers.Geometry.Point(414640,590350));
points.push(new OpenLayers.Geometry.Point(414740,590140));
// create a polyline feature from the array of points
lineString = new OpenLayers.Geometry.LineString(points);
lineFeature = new OpenLayers.Feature.Vector(lineString, null, style_blue);
linesLayer.addFeatures([lineFeature]);
// Set up layer for route markers
routeMarkersLayer = new OpenLayers.Layer.Markers(“Route Markers”);
// Defining a route start or end marker
routepos = new OpenSpace.MapPoint(419890,585920);
routesize = new OpenLayers.Size(33,45);
routeoffset = new OpenLayers.Pixel(-5,-37);
routeicon = new OpenSpace.Icon(‘https://openspace.ordnancesurvey.co.uk/osmapapi/img_versions/img_1.0.1/mapbuilder/routemarker-start.png’, routesize, routeoffset, null, null);
routeMarkersLayer.addMarker(new OpenLayers.Marker(routepos, routeicon));
// Defining a route start or end marker
routepos = new OpenSpace.MapPoint(414740,590140);
routesize = new OpenLayers.Size(33,45);
routeoffset = new OpenLayers.Pixel(-5,-37);
routeicon = new OpenSpace.Icon(‘https://openspace.ordnancesurvey.co.uk/osmapapi/img_versions/img_1.0.1/mapbuilder/routemarker-end.png’, routesize, routeoffset, null, null);
routeMarkersLayer.addMarker(new OpenLayers.Marker(routepos, routeicon));
osMap.addLayer(routeMarkersLayer);

clusterControl = new OpenSpace.Control.ClusterManager();
osMap.addControl(clusterControl);
clusterControl.activate();}
// –>