var $jq = jQuery.noConflict();
'use strict';
$jq(function() {
var mapLoaded1 = false;
$jq(window).on('load scroll', function() {
if($jq(window).scrollTop() + ($jq(window).height() * 0.7) >= $jq('.map1').offset().top && !mapLoaded1) {
interactiveMap1.initMap();
mapLoaded1 = true;
}
});
});
var interactiveMap1 = {
map: '',
infoWindow: '',
currentMarker: '',
initMap: function() {
this.renderMap1();
this.renderHotels1();
},
renderMap1: function() {
var mapOptions = {
center: new google.maps.LatLng(52.049806, -0.801278),
zoom: 6.5,
draggable: true,
disableDefaultUI: true,
minZoom: 3,
mapTypeId: google.maps.MapTypeId.ROADMAP,
mapTypeControlOptions: {
style: google.maps.ZoomControlStyle.SMALL,
position: google.maps.ControlPosition.TOP_RIGHT
},
styles: this.mapStyles
};
this.map = new google.maps.Map($jq('.map1')[0], mapOptions);
},
renderHotels1: function() {
var _this = this;
var popupOpened = false;
// go through every project and create a marker for it with required latitude and longitude
hotels1.forEach(function(hotel1, i) {
var icon = {
url: 'https://eu-images.contentstack.com/v3/assets/bltc68ab8a4d37a1b99/bltd47e3ee9b4fe4268/62fdff26d3efcb30e2177d7e/map-pin.png',
size: new google.maps.Size(58, 77),
scaledSize: new google.maps.Size(58, 77),
origin: new google.maps.Point(0, 0),
anchor: new google.maps.Point(35, 68)
};
var marker = new google.maps.Marker({
position: new google.maps.LatLng(hotel1.geoLtd, hotel1.geoLng),
draggable: false,
animation: google.maps.Animation.DROP,
icon: icon,
map: _this.map
});
_this.infoWindow = new google.maps.InfoWindow({
maxWidth: 360,
pixelOffset: {
width: -198,
height: 0
}
});
google.maps.event.addListener(marker, 'click', function () {
var popupContent = _this.setPopupContent(hotel1.name, hotel1.location, hotel1.price, hotel1.date, hotel1.image, hotel1.sector);
var thisMarker = this;
var topPosition = 0;
if(popupOpened) {
$jq('.intmap__popup').removeClass('intmap__popup--visible');
if(_this.currentMarker === thisMarker) {
setTimeout(function() {
_this.infoWindow.close();
setTimeout(function() {
popupOpened = false;
}, 50);
}, 400);
} else {
setTimeout(function() {
_this.infoWindow.close();
_this.infoWindow.setContent(popupContent);
_this.infoWindow.open(_this.map, thisMarker);
setTimeout(function() {
topPosition = $jq('.intmap__popup').height() - 237;
_this.infoWindow.setOptions({pixelOffset:new google.maps.Size(-199, topPosition)});
$jq('.intmap__popup').addClass('intmap__popup--visible');
popupOpened = true;
}, 50);
}, 400);
}
} else {
_this.infoWindow.setContent(popupContent);
_this.infoWindow.open(_this.map, thisMarker);
setTimeout(function() {
topPosition = $jq('.intmap__popup').height() - 237;
_this.infoWindow.setOptions({pixelOffset:new google.maps.Size(-199, topPosition)});
$jq('.intmap__popup').addClass('intmap__popup--visible');
popupOpened = true;
}, 50);
}
_this.currentMarker = thisMarker;
});
google.maps.event.addListener(_this.map, 'click', function(event) {
if(popupOpened) {
$jq('.intmap__popup').removeClass('intmap__popup--visible');
setTimeout(function() {
_this.infoWindow.close();
setTimeout(function() {
popupOpened = false;
}, 50);
}, 400);
}
});
});
},
setPopupContent: function(name, location, price, date, image, sector) {
var img = '';
if (image == '') {
img = 'no-image';
image = sector + '.png';
}
var color = sector.toLowerCase();
return '
';
},
mapStyles: [
{
"featureType": "administrative",
"elementType": "geometry.stroke",
"stylers": [
{
"visibility": "on"
},
{
"color": "#ffffff"
},
{
"weight": "1"
},
{
"lightness": "20"
},
{
"gamma": "1"
}
]
},
{
"featureType": "administrative",
"elementType": "labels",
"stylers": [
{
"visibility": "off"
}
]
},
{
"featureType": "landscape",
"elementType": "all",
"stylers": [
{
"visibility": "on"
},
{
"color": "#00796D"
}
]
},
{
"featureType": "poi.park",
"elementType": "all",
"stylers": [
{
"color": "#00796D"
}
]
},
{
"featureType": "road",
"elementType": "all",
"stylers": [
{
"visibility": "off"
}
]
},
{
"featureType": "water",
"elementType": "all",
"stylers": [
{
"visibility": "on"
},
{
"color": "#0074B7"
}
]
}
]
};
var hotels1 = [
{
name: 'City Tower, Manchester',
geoLtd: 53.480508,
geoLng: -2.238749,
location: '6.1% of total portfolio value, 25% of joint venture. 610,000 sq ft of office, retail, leisure and hotel accommodation on a three-acre island site in the heart of Manchester.',
price: '£28.5m',
date: 'Jun 14',
image: 'https://eu-images.contentstack.com/v3/assets/bltc68ab8a4d37a1b99/bltbda042fbb15b1829/62fdff26590a39482a752330/city-tower.jpg',
sector: 'Mixed-use office'
},
{
name: 'Stacey Bushes, Milton Keynes',
geoLtd: 52.049806,
geoLng: -0.801278,
location: '11.1% of total portfolio value. 360,000 sq ft multi-let industrial estate comprising 67 units immediately adjacent to the A5 dual carriageway on the west side of Milton Keynes',
price: '£51.8m',
date: 'Aug 14',
image: 'https://eu-images.contentstack.com/v3/assets/bltc68ab8a4d37a1b99/blt62bf3ea8923f1dd5/62fdff2633018c49656b9f19/milton.jpg',
sector: 'Industrial'
},
{
name: 'London, Store Street, University of Law, Bloomsbury, London',
geoLtd: 51.519930,
geoLng: -0.131363,
location: '8.2% of total portfolio value, 50% of joint venture. 85,814 sq ft with a mix of office and D1 (educational) planning use on 0.8-acre freehold site.',
price: '£38.4m',
date: 'Dec 14',
image: 'https://eu-images.contentstack.com/v3/assets/bltc68ab8a4d37a1b99/blt8bc96977ec22f304/62fdff2660a7ec3c875478eb/university-of-law.jpg',
sector: 'Office'
},
{
name: 'Millshaw Industrial Estate, Leeds',
geoLtd: 53.763833,
geoLng: -1.579611,
location: '9.8% of total portfolio value. 460,000 sq ft multi-let industrial estate comprising of 27 units strategically located two miles south of Leeds city centre and adjacent to White Rose Office Park and Shopping Centre',
price: '£45.8m',
date: 'Jul 15',
image: 'https://eu-images.contentstack.com/v3/assets/bltc68ab8a4d37a1b99/bltbbd1bbe348b6d2ae/62fdff26fa717a2fde1c281c/leeds.jpg',
sector: 'Industrial'
},
{
name: 'St Johns Retail Park, Bedford',
geoLtd: 52.130361,
geoLng: -0.462583,
location: '6.8% of total portfolio value. 130,000 sq ft retail warehouse park 1.5 miles from Bedford town centre',
price: '£31.6m',
date: 'May 15',
image: 'https://eu-images.contentstack.com/v3/assets/bltc68ab8a4d37a1b99/blt9abf80e0ab49b290/62fdff26943abd2a54ce1e90/bedford-stjohns.jpg',
sector: 'Retail'
},
{
name: 'Headingley Central, Leeds',
geoLtd: 53.822389,
geoLng: -1.578694,
location: '4.5% of total portfolio value. 125,000 sq ft multi-let hotel, retail, leisure and office property located in a densely populated suburb of Leeds',
price: '£20.9m',
date: 'Jan 14',
image: 'https://eu-images.contentstack.com/v3/assets/bltc68ab8a4d37a1b99/blte30662599b6edc31/62fdff2602d2903a1d4ef623/arnsdale.jpg',
sector: 'Mixed-use'
},
{
name: '106 Oxford Road, Uxbridge',
geoLtd: 51.550139,
geoLng: -0.483139,
location: '2.1% of total portfolio value. 40,000 sq ft office in London submarket with educational use',
price: '£9.7m',
date: 'Jul 04',
image: 'https://eu-images.contentstack.com/v3/assets/bltc68ab8a4d37a1b99/blte5a7818a5085276a/62fdff2671da2831d4ab57f5/uxbridge.jpg',
sector: 'Office'
},
{
name: 'Union Industrial Park, Norwich',
geoLtd: 52.664944,
geoLng: 1.283417,
location: '4.9% of total portfolio value. 170,000 sq ft multi-let industrial estate comprising of 32 units',
price: '£22.9m',
date: 'Jul 04',
image: 'https://eu-images.contentstack.com/v3/assets/bltc68ab8a4d37a1b99/bltea504c44c27ef0c3/62fdff2682bc3e486fd8f03d/norwich1.jpg',
sector: 'Industrial'
},
{
name: 'Cheadle, Stanley Green Trading Estate',
geoLtd: 53.39337782623746,
geoLng: -2.218190501661715,
location: '8.9% of total portfolio value. A trading estate comprising approximately 241,000 sq ft of trade counter, self-storage and warehouse accommodation across 25 units on a 12.4-acre site.',
price: '£41.3m',
date: 'Dec 20',
image: 'https://eu-images.contentstack.com/v3/assets/bltc68ab8a4d37a1b99/blt88946d8f93192d2c/62fdff268f5a073098c3feeb/cheadle.png',
sector: 'Industrial'
},
{
name: 'Chippenham, Langley Park Industrial Estate',
geoLtd: 51.46824532080595,
geoLng: -2.1102858227606505,
location: '5.4% of total portfolio value. Multi-let industrial estate comprising 400,000 sq ft of warehouse and ancillary office accommodation on a 28-acre site.',
date: 'Dec 20',
price: '£25.2m',
image: 'https://eu-images.contentstack.com/v3/assets/bltc68ab8a4d37a1b99/blt0b9dce7bfb612e09/62fdff262ef2243117b45627/chippenham.jpg',
sector: 'Industrial'
},
{
name: 'Horton Park Industrial Park, Telford',
geoLtd: 52.715552173651716,
geoLng: -2.46178483022339255,
location: '3.0% of total portfolio value',
date: 'Jul 04',
price: '£14.0m',
image: 'https://mybrand.schroders.com/m/1cfff023bb682d61/original/Horton-Park-Industrial-Estate-SREIT.jpg',
sector: 'Industrial'
},
{
name: 'St. Ann’s House, Manchester',
geoLtd: 53.48166512402364,
geoLng: -2.2462775167116726,
location: '2.6% of total portfolio value',
date: 'May 22',
price: '£12.0m',
image: 'https://mybrand.schroders.com/m/425391eb622999bc/original/_JSP4803_StAnns-JSP_HighRes.jpg',
sector: 'Mixed-use office'
},
{
name: 'Valley Park Industrial Estate, Birkenhead',
geoLtd: 53.406859775663385,
geoLng: -3.06292690136991,
location: '2.7% of total portfolio value',
date: 'Dec 21',
price: '£12.7m',
image: 'https://mybrand.schroders.com/m/61ca76256c56dbfc/original/Valley-Park.jpg',
sector: 'Industrial'
},
{
name: 'The Tun, Edinburgh',
geoLtd: 55.95104897510608,
geoLng: -3.177614196371161,
location: '2.3% of total portfolio value',
date: 'Aug 18',
price: '£10.8m',
image: 'https://mybrand.schroders.com/m/426a8ca471f7c8b7/original/The-Tun.jpeg',
sector: 'Office'
},
{
name: 'Matalan, Watling Street, Milton Keynes',
geoLtd: 52.0005563104996,
geoLng: -0.7228616232817779,
location: '2.1% of total portfolio value. 54,000 sq ft retail warehouse park comprising of 3 units anchored by Matalan',
date: 'Nov 14',
price: '£9.7m',
image: 'https://mybrand.schroders.com/m/612ca10bc53bab31/original/matalan-mk.png',
sector: 'Retail warehouse'
},
];