SW1A 1NR'); // mark.clickable = true; //map.enableGoogleBar(); } function showInAppControl(appDiv) { var controlUI = document.createElement('div'); controlUI.style.backgroundColor = 'white'; controlUI.style.border = '1px solid #717b87'; controlUI.style.cursor = 'pointer'; controlUI.style.textAlign = 'left'; controlUI.style.margin = '5px'; controlUI.style.padding = '2px'; controlUI.style.boxShadow = '2px 2px 1px #afafaf'; controlUI.title = 'Open this map in your Maps app.'; controlUI.style.verticalalign = 'middle'; appDiv.appendChild(controlUI); // Set CSS for the control interior. var controlText = document.createElement('div'); controlText.style.fontFamily = 'Arial,sans-serif'; controlText.style.fontSize = '12px'; controlText.style.paddingLeft = '4px'; controlText.style.paddingRight = '4px'; controlText.style.verticalalign = 'middle'; controlText.innerHTML = 'Show in Maps App'; controlUI.appendChild(controlText); // Setup the click event listeners: simply set the map to Chicago. google.maps.event.addDomListener(controlUI, 'click', function() { window.location = link; }); } function getDirections(endLatLng) { var lat = position.coords.latitude; var lng = position.coords.longitude; var endLat = endLatLng.lat(); var endLng = endLatLng.lng(); if ($('#dirFrom').val() == 'Current Location') { var start = new google.maps.LatLng(lat, lng); } else { var start = $('#dirFrom').val(); } var end = new google.maps.LatLng('51.505421', '-0.14023'); var request = { origin: start, destination: end, travelMode: google.maps.TravelMode.DRIVING, unitSystem: google.maps.UnitSystem.IMPERIAL, region: 'UK' }; $('#pl_print').show(); //$('#zoneReturn').show(); directionsService.route(request, function(result, status) { if (status == google.maps.DirectionsStatus.OK) { directionsDisplay.setDirections(result); } }); var mapDiv = document.getElementById('www_map'); mapDiv.scrollIntoView(true); } function clearDirFrom() { if ($('#dirFrom').val() == 'Current Location') { $('#dirFrom').val(''); } } function checkEnter(event, LatLng) { if (event.keyCode == 13) { getDirections(LatLng); } } function printDirections() { $('#pl_print').hide(); //$('#zoneReturn').hide(); window.print(); //$('#pl_print').show(); $('#zoneReturn').show(); } //]]>
"); //	var anchor = new google.maps.MVCObject(); //	anchor.set("position", event.latLng); //	bayInfoWindow.open(map, anchor); //	}); //	}); // } // //map.data.setStyle({visible: true}); // //console.log(map.data.getMap()); // if (map.data.getMap() == null) // { //	map.data.setMap(map); // } // //toggleMarkers(false, zonecluster); // } // else /*if(parkingbays !== false)*/ // { // //map.data.setStyle({visible: false}); //	map.data.setMap(null); //	toggleMarkers(true, zonecluster); // } } function toggleLayer(layer) { if (layer == 'epay') { var isChecked = $('#showEpay').is(':checked'); toggleMarkers(isChecked, window.epaycluster); if (isChecked) { $('#epaylinks').css('display', 'block'); } else { $('#epaylinks').css('display', 'none'); } zoomedin() } if (layer == 'zones') { var isChecked = $('#showZones').is(':checked'); toggleMarkers(isChecked, window.zonecluster); if (isChecked) { $('#zonelinks').css('display', 'block'); } else { $('#zonelinks').css('display', 'none'); } zoomedin(); } } function getBayInfo() { if (inprogress === false) { inprogress = true; $.get('?ajax=1&bi=1', function(data) { baysensorinfo = $.parseJSON(data); //console.log(baysensorinfo); var i = 1; map.data.forEach(function(feature) { //	var bayinfo = baysensorinfo[feature.getId()]; //	console.log(bayinfo); var id = 'bay' + feature.getId(); //	console.log(id); //	console.log(typeof baysensorinfo[id]); //	console.log(baysensorinfo[id]['Percentage']); if (typeof baysensorinfo[id] === "object") { //console.log(baysensorinfo.id['Percentage']); restyleBay(feature, baysensorinfo[id]['Percentage']); } else { restyleBay(feature, false);//put type icons on } }); inprogress = false; }); } } function restyleBay(bay, percentage) { //add bay type icons if (bay.getProperty('RESTRICTIO').indexOf('Disabled Bay') !== -1) { addTypeIcon(bay, 'disabled'); } else if (bay.getProperty('RESTRICTIO') == 'Doctor Bay') { addTypeIcon(bay, 'doctor'); } else if (bay.getProperty('RESTRICTIO') == 'Car Club') { addTypeIcon(bay, 'carclub'); } //change availability colour if (percentage) { if (percentage >= 0 && percentage < 85) { map.data.overrideStyle(bay, {strokeColor: 'green'}); } else if (percentage >= 85 && percentage <= 99) { map.data.overrideStyle(bay, {strokeColor: 'darkorange'}); } else if (percentage == 100) { map.data.overrideStyle(bay, {strokeColor: 'red'}); } } } function addTypeIcon(bay, type) { var typeIcon; switch (type) { case 'disabled': typeIcon = {url: "/images/disabledbay.png", size: new google.maps.Size(32, 32), origin: new google.maps.Point(0, 0), scaledSize: new google.maps.Size(32, 32)}; break; case 'doctor': typeIcon = {url: "/images/doctorbay.png", size: new google.maps.Size(32, 32), origin: new google.maps.Point(0, 0), scaledSize: new google.maps.Size(32, 32)}; break; case 'carclub': typeIcon = {url: "/images/carclubbay.png", size: new google.maps.Size(32, 32), origin: new google.maps.Point(0, 0), scaledSize: new google.maps.Size(32, 32)}; break; } var latlngArray = bay.getGeometry().getArray(); var lats = 0; var longs = 0; latlngArray.forEach(function(entry) { lats = lats + entry['k']; longs = longs + entry['A']; }); var avlat = lats / latlngArray.length; var avlong = longs / latlngArray.length; var point = map.data.add({geometry: new google.maps.LatLng(avlat, avlong), id: 'point' + bay.getId()}); point.setProperty('BAYID', bay.getId()); point.setProperty('STREET', bay.getProperty('STREET')); point.setProperty('RESTRICTIO', bay.getProperty('RESTRICTIO')); map.data.overrideStyle(point, {icon: typeIcon, title: bay.getProperty('RESTRICTIO')}); } function toggleMarkers(show, clusterer) { var markers = clusterer.getMarkers(); if (show) { clusterer.setMap(map); } else { clusterer.setMap(hiddenMap); } clusterer.resetViewport(); clusterer.redraw(); //hide markers for (var j = 0; j < markers.length; j++) { markers[j].setVisible(show); } //close any info windows //closeInfoWindow(); } function markerclick(latlng, marker) { markertext = ""; pos = latlng.latLng; id = marker.get('id'); //console.log(id); if (id)//epay { $.get('?ajax=1&epayid=' + id, function(data) { dataArray = $.parseJSON(data); markertext = dataArray['markertext']; position = new google.maps.LatLng(dataArray['lat'],dataArray['lng']); //marker = new google.maps.Marker(pos); infoWindow = new google.maps.InfoWindow({content: markertext, position: position, pixelOffset: new google.maps.Size(0, 0)}); infoWindow.open(map, marker); infoWindowsOpen++; }); } else { sh = marker.get('isSpacehopper'); zone = marker.get('zone'); $.get('?ajax=1&sh=' + sh + '&zoneNo='+ zone +'&lat=' + pos.lat() + '&lon=' + pos.lng(), function(data) { dataArray = $.parseJSON(data); markertext = dataArray['markertext']; position = new google.maps.LatLng(dataArray['lat'],dataArray['lng']); //marker = new google.maps.Marker(pos); infoWindow = new google.maps.InfoWindow({content: markertext, position: position, pixelOffset: new google.maps.Size(0, 0)}); infoWindow.open(map, marker); infoWindowsOpen++; }); } } function manualmarkerclick(lat, lng, epayid, zone) { markertext = ""; pos = new google.maps.LatLng(lat, lng); if (epayid) { //epay $.get('?ajax=1&epayid=' + epayid + '&zone=' + zone, function(data) { if (map.getZoom()<16){ map.setCenter(pos); map.setZoom(16); } dataArray = $.parseJSON(data); markertext = dataArray['markertext']; window.position = new google.maps.LatLng(dataArray['lat'],dataArray['lng']); //marker = new google.maps.Marker(pos); infoWindow = new google.maps.InfoWindow({content: markertext, position: pos, pixelOffset: new google.maps.Size(15, -30)}); infoWindow.open(map); infoWindowsOpen++; window.currentLoc = true; }); } else { $.get('?ajax=1&lat=' + pos.lat() + '&lon=' + pos.lng() + '&zone=' + zone, function(data) { if (map.getZoom()<16){ map.setCenter(pos); map.setZoom(16); } dataArray = $.parseJSON(data); markertext = dataArray['markertext']; window.position = new google.maps.LatLng(dataArray['lat'],dataArray['lng']); //marker = new google.maps.Marker(pos); infoWindow = new google.maps.InfoWindow({content: markertext, position: pos, pixelOffset: new google.maps.Size(15, -30)}); infoWindow.open(map); infoWindowsOpen++; window.currentLoc = true; }); } } function deactivateEpay(epayid) { $.get('?ajax=1&epayid=' + epayid + '&deactivate=true', function(data) { $('#infoMessage').text(data); var markers = epaycluster.getMarkers(); for (var k = 0; k < markers.length; k++) { if (markers[k].get('id') == epayid) { markers[k].setMap(null); markers.splice(k, 1); } } $('#epaylink' + epayid).parent().remove(); }); } function closeInfoWindow() { if (infoWindowsOpen > 0) { infoWindow.close(); infoWindowsOpen--; } } function processSearch(term) { if ((term.length == 4 || term.length == 5) && isNaN(term) == false) { MakeRequest(); } else { coder = new google.maps.Geocoder; coder.geocode({address: term, region: 'uk', componentRestrictions: {administrativeArea: 'Westminster', country: 'UK'}}, function(response) { if(response[0]){ var lat = response[0].geometry.location.lat(); var lon = response[0].geometry.location.lng(); //searchbounds = coder.getViewport() map.setCenter(new google.maps.LatLng(lat, lon)) if (response[0].geometry.viewport) map.fitBounds(response[0].geometry.viewport); } }); } } function loadZone() { if (mapdone && !$('#epaylinks').is(":visible") ){ zone = 8903; manualmarkerclick(51.505421 , -0.14023, 0, 8903); scrollToPos($("#wiw_map"), 2000); //console.log('infoWindowsOpen: '+infoWindowsOpen); }else{ setTimeout(loadZone, 10); } }; $(document).ready(function() { setTimeout(loadZone, 10); }); function loadZone2() { if (mapdone && !$('#epaylinks').is(":visible")){ manualmarkerclick(51.505421 , -0.14023, 0, 8903); scrollToPos($("#wiw_map"), 2000); //console.log('infoWindowsOpen: '+infoWindowsOpen); } }; function goToDetails() { if (mapdone && !$('#epaylinks').is(":visible")){ scrollToPos($("#zoneAnchor"), 2000); } }; //]]>
E1, St James's Place/E1 Westminster City Council
Location Code: 8903
Postcode: SW1A 1NR
SW1A 1NR'); // mark.clickable = true; //map.enableGoogleBar(); } function showInAppControl(appDiv) { var controlUI = document.createElement('div'); controlUI.style.backgroundColor = 'white'; controlUI.style.border = '1px solid #717b87'; controlUI.style.cursor = 'pointer'; controlUI.style.textAlign = 'left'; controlUI.style.margin = '5px'; controlUI.style.padding = '2px'; controlUI.style.boxShadow = '2px 2px 1px #afafaf'; controlUI.title = 'Open this map in your Maps app.'; controlUI.style.verticalalign = 'middle'; appDiv.appendChild(controlUI); // Set CSS for the control interior. var controlText = document.createElement('div'); controlText.style.fontFamily = 'Arial,sans-serif'; controlText.style.fontSize = '12px'; controlText.style.paddingLeft = '4px'; controlText.style.paddingRight = '4px'; controlText.style.verticalalign = 'middle'; controlText.innerHTML = 'Show in Maps App'; controlUI.appendChild(controlText); // Setup the click event listeners: simply set the map to Chicago. google.maps.event.addDomListener(controlUI, 'click', function() { window.location = link; }); } function getDirections(endLatLng) { var lat = position.coords.latitude; var lng = position.coords.longitude; var endLat = endLatLng.lat(); var endLng = endLatLng.lng(); if ($('#dirFrom').val() == 'Current Location') { var start = new google.maps.LatLng(lat, lng); } else { var start = $('#dirFrom').val(); } var end = new google.maps.LatLng('51.505421', '-0.14023'); var request = { origin: start, destination: end, travelMode: google.maps.TravelMode.DRIVING, unitSystem: google.maps.UnitSystem.IMPERIAL, region: 'UK' }; $('#pl_print').show(); //$('#zoneReturn').show(); directionsService.route(request, function(result, status) { if (status == google.maps.DirectionsStatus.OK) { directionsDisplay.setDirections(result); } }); var mapDiv = document.getElementById('www_map'); mapDiv.scrollIntoView(true); } function clearDirFrom() { if ($('#dirFrom').val() == 'Current Location') { $('#dirFrom').val(''); } } function checkEnter(event, LatLng) { if (event.keyCode == 13) { getDirections(LatLng); } } function printDirections() { $('#pl_print').hide(); //$('#zoneReturn').hide(); window.print(); //$('#pl_print').show(); $('#zoneReturn').show(); } //]]>
"); //	var anchor = new google.maps.MVCObject(); //	anchor.set("position", event.latLng); //	bayInfoWindow.open(map, anchor); //	}); //	}); // } // //map.data.setStyle({visible: true}); // //console.log(map.data.getMap()); // if (map.data.getMap() == null) // { //	map.data.setMap(map); // } // //toggleMarkers(false, zonecluster); // } // else /*if(parkingbays !== false)*/ // { // //map.data.setStyle({visible: false}); //	map.data.setMap(null); //	toggleMarkers(true, zonecluster); // } } function toggleLayer(layer) { if (layer == 'epay') { var isChecked = $('#showEpay').is(':checked'); toggleMarkers(isChecked, window.epaycluster); if (isChecked) { $('#epaylinks').css('display', 'block'); } else { $('#epaylinks').css('display', 'none'); } zoomedin() } if (layer == 'zones') { var isChecked = $('#showZones').is(':checked'); toggleMarkers(isChecked, window.zonecluster); if (isChecked) { $('#zonelinks').css('display', 'block'); } else { $('#zonelinks').css('display', 'none'); } zoomedin(); } } function getBayInfo() { if (inprogress === false) { inprogress = true; $.get('?ajax=1&bi=1', function(data) { baysensorinfo = $.parseJSON(data); //console.log(baysensorinfo); var i = 1; map.data.forEach(function(feature) { //	var bayinfo = baysensorinfo[feature.getId()]; //	console.log(bayinfo); var id = 'bay' + feature.getId(); //	console.log(id); //	console.log(typeof baysensorinfo[id]); //	console.log(baysensorinfo[id]['Percentage']); if (typeof baysensorinfo[id] === "object") { //console.log(baysensorinfo.id['Percentage']); restyleBay(feature, baysensorinfo[id]['Percentage']); } else { restyleBay(feature, false);//put type icons on } }); inprogress = false; }); } } function restyleBay(bay, percentage) { //add bay type icons if (bay.getProperty('RESTRICTIO').indexOf('Disabled Bay') !== -1) { addTypeIcon(bay, 'disabled'); } else if (bay.getProperty('RESTRICTIO') == 'Doctor Bay') { addTypeIcon(bay, 'doctor'); } else if (bay.getProperty('RESTRICTIO') == 'Car Club') { addTypeIcon(bay, 'carclub'); } //change availability colour if (percentage) { if (percentage >= 0 && percentage < 85) { map.data.overrideStyle(bay, {strokeColor: 'green'}); } else if (percentage >= 85 && percentage <= 99) { map.data.overrideStyle(bay, {strokeColor: 'darkorange'}); } else if (percentage == 100) { map.data.overrideStyle(bay, {strokeColor: 'red'}); } } } function addTypeIcon(bay, type) { var typeIcon; switch (type) { case 'disabled': typeIcon = {url: "/images/disabledbay.png", size: new google.maps.Size(32, 32), origin: new google.maps.Point(0, 0), scaledSize: new google.maps.Size(32, 32)}; break; case 'doctor': typeIcon = {url: "/images/doctorbay.png", size: new google.maps.Size(32, 32), origin: new google.maps.Point(0, 0), scaledSize: new google.maps.Size(32, 32)}; break; case 'carclub': typeIcon = {url: "/images/carclubbay.png", size: new google
.maps.Size(32, 32), origin: new google.maps.Point(0, 0), scaledSize: new google.maps.Size(32, 32)}; break; } var latlngArray = bay.getGeometry().getArray(); var lats = 0; var longs = 0; latlngArray.forEach(function(entry) { lats = lats + entry['k']; longs = longs + entry['A']; }); var avlat = lats / latlngArray.length; var avlong = longs / latlngArray.length; var point = map.data.add({geometry: new google.maps.LatLng(avlat, avlong), id: 'point' + bay.getId()}); point.setProperty('BAYID', bay.getId()); point.setProperty('STREET', bay.getProperty('STREET')); point.setProperty('RESTRICTIO', bay.getProperty('RESTRICTIO')); map.data.overrideStyle(point, {icon: typeIcon, title: bay.getProperty('RESTRICTIO')}); } function toggleMarkers(show, clusterer) { var markers = clusterer.getMarkers(); if (show) { clusterer.setMap(map); } else { clusterer.setMap(hiddenMap); } clusterer.resetViewport(); clusterer.redraw(); //hide markers for (var j = 0; j < markers.length; j++) { markers[j].setVisible(show); } //close any info windows //closeInfoWindow(); } function markerclick(latlng, marker) { markertext = ""; pos = latlng.latLng; id = marker.get('id'); //console.log(id); if (id)//epay { $.get('?ajax=1&epayid=' + id, function(data) { dataArray = $.parseJSON(data); markertext = dataArray['markertext']; position = new google.maps.LatLng(dataArray['lat'],dataArray['lng']); //marker = new google.maps.Marker(pos); infoWindow = new google.maps.InfoWindow({content: markertext, position: position, pixelOffset: new google.maps.Size(0, 0)}); infoWindow.open(map, marker); infoWindowsOpen++; }); } else { sh = marker.get('isSpacehopper'); zone = marker.get('zone'); $.get('?ajax=1&sh=' + sh + '&zoneNo='+ zone +'&lat=' + pos.lat() + '&lon=' + pos.lng(), function(data) { dataArray = $.parseJSON(data); markertext = dataArray['markertext']; position = new google.maps.LatLng(dataArray['lat'],dataArray['lng']); //marker = new google.maps.Marker(pos); infoWindow = new google.maps.InfoWindow({content: markertext, position: position, pixelOffset: new google.maps.Size(0, 0)}); infoWindow.open(map, marker); infoWindowsOpen++; }); } } function manualmarkerclick(lat, lng, epayid, zone) { markertext = ""; pos = new google.maps.LatLng(lat, lng); if (epayid) { //epay $.get('?ajax=1&epayid=' + epayid + '&zone=' + zone, function(data) { if (map.getZoom()<16){ map.setCenter(pos); map.setZoom(16); } dataArray = $.parseJSON(data); markertext = dataArray['markertext']; window.position = new google.maps.LatLng(dataArray['lat'],dataArray['lng']); //marker = new google.maps.Marker(pos); infoWindow = new google.maps.InfoWindow({content: markertext, position: pos, pixelOffset: new google.maps.Size(15, -30)}); infoWindow.open(map); infoWindowsOpen++; window.currentLoc = true; }); } else { $.get('?ajax=1&lat=' + pos.lat() + '&lon=' + pos.lng() + '&zone=' + zone, function(data) { if (map.getZoom()<16){ map.setCenter(pos); map.setZoom(16); } dataArray = $.parseJSON(data); markertext = dataArray['markertext']; window.position = new google.maps.LatLng(dataArray['lat'],dataArray['lng']); //marker = new google.maps.Marker(pos); infoWindow = new google.maps.InfoWindow({content: markertext, position: pos, pixelOffset: new google.maps.Size(15, -30)}); infoWindow.open(map); infoWindowsOpen++; window.currentLoc = true; }); } } function deactivateEpay(epayid) { $.get('?ajax=1&epayid=' + epayid + '&deactivate=true', function(data) { $('#infoMessage').text(data); var markers = epaycluster.getMarkers(); for (var k = 0; k < markers.length; k++) { if (markers[k].get('id') == epayid) { markers[k].setMap(null); markers.splice(k, 1); } } $('#epaylink' + epayid).parent().remove(); }); } function closeInfoWindow() { if (infoWindowsOpen > 0) { infoWindow.close(); infoWindowsOpen--; } } function processSearch(term) { if ((term.length == 4 || term.length == 5) && isNaN(term) == false) { MakeRequest(); } else { coder = new google.maps.Geocoder; coder.geocode({address: term, region: 'uk', componentRestrictions: {administrativeArea: 'Westminster', country: 'UK'}}, function(response) { if(response[0]){ var lat = response[0].geometry.location.lat(); var lon = response[0].geometry.location.lng(); //searchbounds = coder.getViewport() map.setCenter(new google.maps.LatLng(lat, lon)) if (response[0].geometry.viewport) map.fitBounds(response[0].geometry.viewport); } }); } } function loadZone() { if (mapdone && !$('#epaylinks').is(":visible") ){ zone = 8903; manualmarkerclick(51.505421 , -0.14023, 0, 8903); scrollToPos($("#wiw_map"), 2000); //console.log('infoWindowsOpen: '+infoWindowsOpen); }else{ setTimeout(loadZone, 10); } }; $(document).ready(function() { setTimeout(loadZone, 10); }); function loadZone2() { if (mapdone && !$('#epaylinks').is(":visible")){ manualmarkerclick(51.505421 , -0.14023, 0, 8903); scrollToPos($("#wiw_map"), 2000); //console.log('infoWindowsOpen: '+infoWindowsOpen); } }; function goToDetails() { if (mapdone && !$('#epaylinks').is(":visible")){ scrollToPos($("#zoneAnchor"), 2000); } }; //]]>
E1, St James's Place/E1 Westminster City Council
Location Code: 8903
Postcode: SW1A 1NR