var iconBase = 'https://maps.swarovskifoundation.org/'; function initMap() { var nest = 'We work with the charity Nest to help promising artisan businesses in fashion and home design become players in the international marketplace.'; var nestimg = 'img/partners/nest.jpg'; var whitechapel = 'We partner with the renowned East London institution to encourage young people from diverse backgrounds to engage with art and discover potential careers in the art world.'; var whitechapelimg = 'img/partners/whitechapel-gallery.jpg'; var superar = 'The Superar program empowers young people from poor backgrounds by encouraging them to make music with choirs and orchestras. The Swarovski Foundation helps to fund Superar, giving participants access to quality music education as a tool to address the challenges in their lives.'; var superarimg = 'img/partners/superar.jpg'; var designmuseum = 'The Design Museum in London is a world-renowned institution devoted to contemporary design. The Foundation was a major donor to its re-launch in 2017, and helped create the new Swarovski Foundation Centre for Learning. This innovative facility attracts 60,000 learners a year, bringing together the worlds of formal education, informal learning, and professional design.'; var designmuseuming = 'img/partners/design-museum.jpg'; var britishredcross = 'The Foundation supports the British Red Cross in Bangladesh, home to the world\'s largest refugee camp since a million people, mostly women and children, fled violence in 2017 in neighbouring Myanmar. The Foundation and the British Red Cross are helping women to develop safe and sustainable water, sanitation and hygiene programmes to prevent disease.'; var britishredcrossimg = 'img/partners/room-to-read.jpg'; var map = new google.maps.Map(document.getElementById('map'), { zoom: 3, center: {lat: 20, lng: 0}, styles: [ { featureType: 'water', elementType: 'geometry', stylers: [{color: '#a4dbf8'}] }, { featureType: 'water', elementType: 'labels.text.fill', stylers: [{color: '#333333'}] }, { featureType: 'water', elementType: 'labels.text.stroke', stylers: [{color: '#3295b4'}] }, { featureType: 'landscape', elementType: 'geometry', stylers: [ { color: '#ffffff' } ] }, { featureType: 'landscape', elementType: 'labels', stylers: [ { visibility: 'off' } ] }, { featureType: 'road', elementType: 'geometry', stylers: [ { visibility: 'off' } ] } ] }); var markers = []; var icons = { general: { icon: iconBase + 'img/pinreverseddarker.png' }, library: { icon: iconBase + 'img/library_maps.png' }, info: { icon: iconBase + 'img/info-i_maps.png' } }; var partners = [ { position: new google.maps.LatLng(15.783471, -90.230759), name: 'Nest', country: 'Guatemala', city: '', type: 'general', pillar: 'culture', description: nest, img: nestimg, url: '/partners/nest' }, { position: new google.maps.LatLng(20.593684, 78.96288), name: 'Nest', country: 'India', city: '', type: 'general', pillar: 'culture', description: nest, img: nestimg, url: '/partners/nest' }, { position: new google.maps.LatLng(-9.189966999999999, -75.015152), name: 'Nest', country: 'Peru', city: '', type: 'general', pillar: 'culture', description: nest, img: nestimg,url: '/partners/nest' }, { position: new google.maps.LatLng(12.879721, 121.774017), name: 'Nest', country: 'Philippines', city: '', type: 'general', pillar: 'culture', description: nest, img: nestimg, url: '/partners/nest' }, { position: new google.maps.LatLng(-9.189966999999999, -75.015152), name: 'Nest', country: 'Peru', city: '', type: 'general', pillar: 'culture', description: nest, img: nestimg, url: '/partners/nest' }, { position: new google.maps.LatLng(-26.522503, 31.465866), name: 'Nest', country: 'Swaziland', city: '', type: 'general', pillar: 'culture', description: nest, img: nestimg, url: '/partners/nest' }, { position: new google.maps.LatLng(-13.133897, 27.849332), name: 'Nest', country: 'Zambia', city: '', type: 'general', pillar: 'culture', description: nest, img: nestimg, url: '/partners/nest' }, { position: new google.maps.LatLng(23.634501, -102.552784), name: 'Nest', country: 'Mexico', city: '', type: 'general', pillar: 'culture', description: nest, img: nestimg, url: '/partners/nest' }, { position: new google.maps.LatLng(35.86166, 104.195397), name: 'Nest', country: 'China', city: '', type: 'general', pillar: 'culture', description: nest, img: nestimg, url: '/partners/nest' }, { position: new google.maps.LatLng(51.5160864, -0.07011479999999999), name: 'The Whitechapel Gallery', country: 'United Kingdom', city: 'London', type: 'general', pillar: 'culture', description: whitechapel, img: whitechapelimg, url: '/partners/the-whitechapel-gallery' }, { position: new google.maps.LatLng(51.4998973, -0.200244), name: 'The Swarovski Foundation Centre for Learning at the Design Museum', country: 'United Kingdom', city: 'London', type: 'general', pillar: 'culture', description: designmuseum, img: designmuseuming, url: '/partners/design-museum' }, { position: new google.maps.LatLng(48.1719495, 16.390434), name: 'Superar', country: 'United Kingdom', city: 'London', type: 'general', pillar: 'culture', description: superar, img: superarimg, url: '/partners/superar' }, { position: new google.maps.LatLng(13.7214719, 100.5687167), name: 'Teach For Thailand', country: 'Thailand', city: 'Bangkok', type: 'general', pillar: 'human', description: 'As a Teach for All partner, Teach for Thailand works to expand educational opportunities for children in Thailand from disadvantaged backgrounds. The Swarovski Foundation supports it in its aim to nurture leaders in the classroom who can help all children to fulfill their potential.', img: 'img/partners/teach-for-thailand.jpg', url: '/partners/teach-for-thailand' }, { position: new google.maps.LatLng(48.3118288, 14.2994376), name: 'Teach For Austria', country: 'Austria', city: '', type: 'general', pillar: 'human', description: 'Teach for Austria is part of the global Teach for All network, which promotes access to education. Teach for All\'s vision is a world in which all children can fulfill their potential, regardless of their circumstances. The Swarovski Foundation is a Gold Partner of the initiative, helping to recruit, select and train university graduates to work with hundreds of disadvantaged children in Austria.', img: 'img/partners/tech-for-austria.jpg', url: '/partners/teach-for-austria' }, { position: new google.maps.LatLng(10.7760624, 9.999194299999999), name: 'Women for Women International', country: 'Nigeria', city: 'Bauchi State', type: 'general', pillar: 'human', description: 'In countries affected by conflict, Women for Women International gives women access to knowledge and economic resources, encouraging them to lead the change towards more peaceful societies. The Swarovski Foundation supports the charity\'s holistic training program in Nigeria, which helps women to transform their lives by teaching them about business skills, their rights and their health and wellbeing, as well as connecting them to support networks.', img: 'img/partners/women-for-women-international.jpg', url: '/partners/women-for-women-international' }, { position: new google.maps.LatLng(0.4478565999999999, 33.2026122), name: 'Mothers2Mothers', country: 'Uganda', city: 'Jinja', type: 'general', pillar: 'human', description: 'mothers2mothers is a non-profit that aims to end paediatric AIDS and create healthy families and communities by training and employing HIV-positive mothers as community healthcare workers. The Swarovski Foundation supports its efforts in Kenya, providing health education to help women protect their babies from HIV and keep their families free from infection.', img: 'img/partners/mothers2mothers.jpg', url: '/partners/mothers2mothers' }, { position: new google.maps.LatLng(14.058324, 108.277199), name: 'Room to Read', country: 'Vietnam', city: '', type: 'general', pillar: 'human', description: 'Room to Read is a leading non-profit that focuses on girls\' education and children\'s literacy in Asia and Africa. The Swarovski Foundation supports its Girls\' Education Program in India, a key initiative addressing gender equality, which ensures that girls complete secondary school and gain the skills they need to make important life decisions.', img: 'img/partners/room-to-read.jpg', url: '/partners/room-to-read' }, { position: new google.maps.LatLng(15.552727, 48.516388), name: 'British Red Cross', country: 'Yemen', city: '', type: 'general', pillar: 'human', description: britishredcross, img: britishredcrossimg, url: '/partners/british-red-cross' }, { position: new google.maps.LatLng(21.4272283, 92.00580739999999), name: 'British Red Cross', country: 'Bangladesh', city: 'Cox\'s Bazar', type: 'general', pillar: 'human', description: britishredcross, img: britishredcrossimg, url: '/partners/british-red-cross' }, { position: new google.maps.LatLng(-33.8688197, 151.2092955), name: 'British Red Cross', country: 'Australia', city: '', type: 'general', pillar: 'human', description: britishredcross, img: britishredcrossimg, url: '/partners/british-red-cross' }, { position: new google.maps.LatLng(51.535737, -0.1244228), name: 'Central Saint Martins', country: 'United Kingdom', city: 'London', type: 'general', pillar: 'culture', description: 'London\'s Central Saint Martins is one of the world\'s leading arts and design colleges. Since 2014, the Swarovski Foundation has provided scholarships for undergraduate students, helping to nurture emerging talent and promote creativity in the fields of fashion and jewelry design.', img: 'img/partners/central-saint-martins.jpg', url: '/partners/central-saint-martins' }, { position: new google.maps.LatLng(-22, -44.75), name: 'The Nature Conservancy', country: 'Brazil', city: 'Mantiqueira Mountains', type: 'general', pillar: 'environment', description: 'The Nature Conservancy is a global conservation organization that works to protect ecologically important land and waters. The Swarovski Foundation supports its project in the Balkans to safeguard the last free-flowing rivers in Europe, and its initiative in Brazil to restore forests in more than a million hectares of the Mantiqueira Mountains by 2030.', img: 'img/partners/the-nature-conservancy.jpg', url: '/partners/the-nature-conservancy' }, { position: new google.maps.LatLng(26.651265, 74.93306199999999), name: 'Barefoot College', country: 'India', city: 'Rajasthan', type: 'general', pillar: 'environment', description: 'Barefoot College is a non-profit organization that connects rural communities to solar power, clean water, educational resources, and advocacy services. The Swarovski Foundation partners with Barefoot College in Brazil to train illiterate and semi-literate women to become solar engineers, and electrify their rural communities.', img: 'img/partners/barefoot-college.jpg', url: '/partners/barefoot-college' }, { position: new google.maps.LatLng(38.4936623, 14.9272044), name: 'Blue Marine Foundation', country: 'Italy', city: 'Italian Aeolian Islands', type: 'general', pillar: 'environment', description: 'The Blue Marine Foundation is dedicated to creating marine reserves and establishing sustainable models for fishing. In the Italian Aeolian Islands, north of Sicily, the Swarovski Foundation supports its education program, taught by local marine biologists and fishermen, as well as a range of underwater monitoring activities. ', img: 'img/partners/blue-marine-foundation.jpg', url: '/partners/blue-marine-foundation' }, { position: new google.maps.LatLng(9.728665999999999, -84.81507809999999), name: 'Conservation International', country: 'Costa Rica', city: 'Gulf of Nicoya', type: 'general', pillar: 'human', description: 'Conservation International uses science and policy to protect nature. The Swarovski Foundation supports its work to combat the depletion of mangroves on the coast of Costa Rica, which are a vital ecosystem as well as a source of income for local people. The project includes the establishment of female-led mangrove nurseries, replanting in degraded areas and training on mangrove cultivation and restoration.', img: 'img/partners/conservation-international.jpg', url: '/partners/conservation-international' }, { position: new google.maps.LatLng(47.3768866, 8.541694), name: 'Jane Goodall Institute', country: 'Switzerland', city: 'Zurich', type: 'general', pillar: 'environment', description: 'This global organization advances the vision and work of primatologist Dr Jane Goodall, by protecting chimpanzees and inspiring people to conserve the natural world. The Swarovski Foundation supports the Institute\'s "Roots and Shoots" environmental education project in Uganda, where young people acquire the knowledge and skills to become compassionate conservation leaders.', img: 'img/partners/jane-goodall-institute.jpg', url: '/partners/jane-goodall-institute' }, { position: new google.maps.LatLng(1.7940835, 31.5826642), name: 'Jane Goodall Institute', country: 'Uganda', city: 'Budongo', type: 'general', pillar: 'environment', description: 'This global organization advances the vision and work of primatologist Dr Jane Goodall, by protecting chimpanzees and inspiring people to conserve the natural world. The Swarovski Foundation supports the Institute\'s "Roots and Shoots" environmental education project in Uganda, where young people acquire the knowledge and skills to become compassionate conservation leaders.', img: 'img/partners/jane-goodall-institute.jpg', url: '/partners/jane-goodall-institute' }, { position: new google.maps.LatLng(37.7749295, -122.4194155), name: 'Sustainable Ocean Alliance', country: 'United States', city: 'San Francisco', type: 'general', pillar: 'environment', description: 'The Sustainable Oceans Alliance empowers the next generation to become leaders in preserving ocean health and sustainability. The Swarovski Foundation supports the Alliance through promoting education, networking, and leadership; implementing river clean-up projects and providing scholarships for Ocean Leaders to attend International Ocean Summits.', img: 'img/partners/sustainable-ocean-alliance.jpg', url: '/partners/sustainable-ocean-alliance' }, { position: new google.maps.LatLng(40.7127753, -74.0059728), name: 'Waterkeeper Alliance', country: 'United States', city: 'New York', type: 'general', pillar: 'environment', description: 'The Waterkeeper Alliance is a global movement dedicated to swimmable, drinkable, fishable water. The Swarovski Foundation supports the scheme\'s work in the US Great Lakes, one of the world\'s great reserves of surface fresh water, where it educates communities about methods to protect water sources, and highlights the critical role of business leaders in combatting pollution. ', img: 'img/partners/waterkeeper-institute.jpg', url: '/partners/waterkeeper-alliance' }, { position: new google.maps.LatLng(31.953949, 35.910635), name: 'Turquoise Mountain', country: 'Jordan', city: 'Amman', type: 'general', pillar: 'culture', description: 'Turquoise Mountain support Jordanian, Syrian and Palestinian refugee artisans, through an intensive jewellery apprenticeship programme. They will acquire craft and business skills and the ability to create high-quality jewellery products for international markets.', img: 'img/partners/turquoise-mountain.jpg', url: '/partners/turquoise-mountain' }, { position: new google.maps.LatLng(15.552727, 48.516388), name: 'United Nations Population Fund: UNFPA', country: 'Yemen', city: 'various regions', type: 'general', pillar: 'human', description: 'UNFPA is the United Nations sexual and reproductive health agency. Their mission is to deliver a world where every pregnancy is wanted, every childbirth is safe and every young person\'s potential is fulfilled.', img: 'img/partners/unfpa.jpg', url: '/partners/united-nations-population-fund-unfpa' }, { position: new google.maps.LatLng(32.379223, -86.307737), name: 'Equal Justice Initiative', country: 'United States', city: 'Montgomery, Alabama', type: 'general', pillar: 'human', description: 'The Equal Justice Initiative (EJI) is committed to ending mass incarceration and excessive punishment in the United States, to challenging racial and economic justices, and to protecting basic human rights for the most vulnerable people in American Society.', img: 'img/partners/eji.jpg', url: '/partners/equal-justice-initiative' }, { position: new google.maps.LatLng(38.907192, -77.036871), name: 'NAACP Legal Defence and Educational Fund', country: 'United States', city: 'Washington, DC', type: 'general', pillar: 'human', description: 'The NAACP Legal Defense and Educational Fund, Inc. is America\'s premier legal organization fighting for racial justice. Through litigation, advocacy, and public education, LDF seeks structural changes to expand democracy, eliminate disparities, and achieve racial justice in a society that fulfills the promise of equality for all Americans.', img: 'img/partners/naacp.jpg', url: '/partners/naacp-legal-defense-and-educational-fund' } ]; // Read any client filters const queryString = window.location.search; const urlParams = new URLSearchParams(queryString); const partner = urlParams.get('partner'); //console.log('parent :' + window.parent.location); var parenturl = window.parent.location + ''; var parameters = parenturl.split('partner='); var parentpartner = parameters[parameters.length-1]; //console.log('partner :' + parentpartner); // Create markers. for (var i = 0; i < partners.length; i++) { if ((partner === "") || (partner === null) || (partner && partner === partners[i].name.toLowerCase().replace(/ /g, '')) || (parentpartner && parentpartner === partners[i].name.toLowerCase().replace(/ /g, ''))) { var marker = new google.maps.Marker({ position: partners[i].position, name: partners[i].name, icon: icons[partners[i].type].icon, city: partners[i].city, country: partners[i].country, type: partners[i].type, pillar: partners[i].pillar, description: partners[i].description, img: partners[i].img, link: partners[i].url, map: map }); marker.addListener('click', function() { var previousZoom = map.getZoom(); if (previousZoom < 7) { map.setZoom(7); } map.setCenter(this.getPosition()); var visibleMarkers = countVisibleMarkers(map, markers); console.log('visibleMarkers = ' + visibleMarkers) if (previousZoom >= 7 || visibleMarkers === 1) { showPopUp(this); } }); // Keep marker instances in a global array markers.push(marker); } } map.addListener('bounds_changed', function() { hidePopUp(); }); map.addListener('click', function() { hidePopUp(); }); // Add some markers to the map. // Note: The code uses the JavaScript Array.prototype.map() method to // create an array of markers based on a given "locations" array. // The map() method here has nothing to do with the Google Maps API. /* var markers = locations.map(function(location, i) { return new google.maps.Marker({ position: location, label: '', icon: icons['general'].icon }); }); */ // Add a marker clusterer to manage the markers. /* var markerCluster = new MarkerClusterer(map, markers, {imagePath: 'https://developers.google.com/maps/documentation/javascript/examples/markerclusterer/m'}); */ } var locations = [ {lat: -31.563910, lng: 147.154312}, {lat: -33.718234, lng: 150.363181}, {lat: -33.727111, lng: 150.371124}, {lat: -33.848588, lng: 151.209834}, {lat: -33.851702, lng: 151.216968}, {lat: -34.671264, lng: 150.863657}, {lat: -35.304724, lng: 148.662905}, {lat: -36.817685, lng: 175.699196}, {lat: -36.828611, lng: 175.790222}, {lat: -37.750000, lng: 145.116667}, {lat: -37.759859, lng: 145.128708}, {lat: -37.765015, lng: 145.133858}, {lat: -37.770104, lng: 145.143299}, {lat: -37.773700, lng: 145.145187}, {lat: -37.774785, lng: 145.137978}, {lat: -37.819616, lng: 144.968119}, {lat: -38.330766, lng: 144.695692}, {lat: -39.927193, lng: 175.053218}, {lat: -41.330162, lng: 174.865694}, {lat: -42.734358, lng: 147.439506}, {lat: -42.734358, lng: 147.501315}, {lat: -42.735258, lng: 147.438000}, {lat: -43.999792, lng: 170.463352} ]; function showPopUp(partner) { //console.log('click: ' + partner.name + ' ' + partner.pillar); var elemDiv = document.createElement('div'); elemDiv.setAttribute("id", "partnerInfo"); //elemDiv.style.cssText = ''; document.querySelector('#map').prepend(elemDiv); var container = document.createElement('div'); container.setAttribute('id', 'container'); var column1 = document.createElement('div'); column1.setAttribute("id", "columnLeft"); var button1 = document.createElement('div'); button1.setAttribute("class", "map-button"); var image1 = document.createElement('img'); var header1 = document.createElement('h1'); var header2 = document.createElement('h2'); var paragraph1 = document.createElement('p'); var image2 = document.createElement('img'); var image3 = document.createElement('img'); var link1 = document.createElement('a'); image1.src = iconBase + 'img/symbol.png'; image1.alt = 'Swarovski Foundation'; image1.setAttribute('id', 'emblem'); header1.textContent = partner.name; if (partner.city !== "") { header2.textContent = partner.city + ", " + partner.country; } else { header2.textContent = partner.country; } paragraph1.textContent = partner.description; image2.src = iconBase + partner.img; image2.alt = 'White Chapel'; image2.setAttribute('id', 'partnerImage'); image3.src = iconBase + 'img/close.svg'; image3.alt = 'Close'; image3.setAttribute('class', 'close'); link1.setAttribute('class', 'link'); link1.href = partner.link; link1.textContent = 'Find out more'; button1.append(link1); column1.append(header1, header2, image2, paragraph1, button1); container.prepend(column1); container.append(image1, image3); image3.addEventListener("click", function () { hidePopUp(); }); elemDiv.append(container); setTimeout(function() { fadeIn(elemDiv); }, 1000); } function hidePopUp() { var elemDiv = document.getElementById("partnerInfo"); if (elemDiv && (elemDiv.style.opacity >= 1)) { fadeOut(elemDiv); setTimeout(function() { while (elemDiv.firstChild) { document.body.removeChild(elemDiv); } }, 1000); } } function fadeOut(element) { var op = 1; // initial opacity var timer = setInterval(function () { if (op <= 0.1){ clearInterval(timer); element.style.display = 'none'; } element.style.opacity = op; element.style.filter = 'alpha(opacity=' + op * 100 + ")"; op -= op * 0.1; }, 50); } function fadeIn(element) { var op = 0.1; // initial opacity element.style.display = 'block'; var timer = setInterval(function () { if (op >= 1){ clearInterval(timer); } element.style.opacity = op; element.style.filter = 'alpha(opacity=' + op * 100 + ")"; op += op * 0.1; }, 10); } function countVisibleMarkers(map, markers) { var bounds = map.getBounds(), count = 0; for (var i = 0; i < markers.length; i++) { var marker = markers[i]; if(bounds.contains(marker.getPosition())===true) { count++; } } return count; } /* * * References: * Markers in bounds - https://jsfiddle.net/glafarge/mbuLw/ * Geocoding - https://developers.google.com/maps/documentation/geocoding/overview * Google maps events - https://developers.google.com/maps/documentation/javascript/events * Google maps styling - https://developers.google.com/maps/documentation/javascript/style-reference * Custom markers - https://developers.google.com/maps/documentation/javascript/custom-markers * Marker clustering - https://developers.google.com/maps/documentation/javascript/marker-clustering * Webflow JS - https://forum.webflow.com/t/webflow-js-and-jquery-plugins/907 * *///97066