#map_breakdown { } #map_breakdown .counciler-picture { float: left; width: 70px; padding: 10px; } #map_breakdown .counciler-information { float: left; padding: 10px; } .clear { clear: both; } jQuery(document).ready(function() { var osMap, boundaryLayer; init(); var postcodeCentre; var postcodeService = new OpenSpace.Postcode(); postcodeService.getLonLat('', onResult); //osMap.setCenter(new OpenSpace.MapPoint(164624.9,41310), 6); osMap.setCenter(postcodeCentre, 6); }); function councilerInfo(wardname) { if (wardname == "Camborne Treslothan ED") { var wardjsonfeedurl = "https://www.camborne-tc.gov.uk/json/treslothan"; } if (wardname == "Camborne Pendarves ED") { var wardjsonfeedurl = "https://www.camborne-tc.gov.uk/json/pendarves"; } if (wardname == "Camborne Trelowarren ED") { var wardjsonfeedurl = "https://www.camborne-tc.gov.uk/json/trelowarren"; } if (wardname == "Camborne Treswithian ED") { var wardjsonfeedurl = "https://www.camborne-tc.gov.uk/json/treswithian"; } if (wardname == "Camborne Roskear ED") { var wardjsonfeedurl = "https://www.camborne-tc.gov.uk/json/roskear"; } // run the feed $.getJSON(wardjsonfeedurl, function(data){ // style the start of the table $(".ward-info").empty().append('

'+ wardname + '
'); $(".ward-info").append(''); // load the data $.each( data.users, function( i, item ) { $(".ward-info").append('

' + item.user.firstname + ' ' + item.user.lastname + '
Political Party: ' + item.user.political_party + '

'); }); // close the table $(".ward-info").append('

'); }); } function init() { var postcodeCentre; osMap = new OpenSpace.Map('map'); boundaryLayer = createBoundaryLayer(); var hoverControl = new OpenLayers.Control.SelectFeature(boundaryLayer, {clickout: true, onSelect: onFeatureHover}); osMap.addControl(hoverControl); hoverControl.activate(); osMap.addLayer(boundaryLayer); osMap.setCenter(new OpenSpace.MapPoint(164624.9,41310), 6); } function onFeatureHover(feature) { // The feature (i.e. the boundary) is passed from the control that was defined above selectedFeature = feature; // The name attribute of the feature is read into a variable and the text box is updated with this value var bndyName = feature.attributes.NAME; councilerInfo(bndyName); } function createBoundaryLayer() { var symbolizer = OpenLayers.Util.applyDefaults({ }, OpenLayers.Feature.Vector.style["default"]); var styleMap = new OpenLayers.StyleMap(symbolizer); var lookup = { "UTE": { fillColor: "Orange", fillOpacity: 0.2, strokeColor: "black", strokeWidth: 3, strokeOpacity: 0.8 } }; styleMap.addUniqueValueRules("default", "AREA_CODE", lookup); var boundaryLayer = new OpenSpace.Layer.Boundary("Boundaries", { strategies: [new OpenSpace.Strategy.BBOX()], area_code: ["UTE"], admin_unit_ids: [ "43776", "43799", "44135", "44110", "44447", ], styleMap: styleMap }); return boundaryLayer; } function postcode_search() { if($("#postcode").val() == null) { alert("You must enter a postcode"); } else { console.log($("#postcode").val()); var postcodeCentre; var postcodeService = new OpenSpace.Postcode(); postcodeService.getLonLat($("#postcode").val(), onResult); //osMap.setCenter(new OpenSpace.MapPoint(164624.9,41310), 6); osMap.setCenter(postcodeCentre, 6); } }

Search Postcode Search

-->

Click on the map to show councillors

Wards & Polling Districts Map

To browse Councillor contact details please navigate to the ‘about’ menu and click on ‘Camborne Town Councillors’