text: "use strict";function _toConsumableArray(e){if(Array.isArray(e)){for(var t=0,a=Array(e.length);t<e.length;t++)a[t]=e[t];return a}return Array.from(e)}var map=void 0,heatmap=void 0,serviceData=void 0,types=void 0,serviceTypes=void 0,points=[],markers=[],filters=$(".mdl-layout__drawer .types"),circle={path:google.maps.SymbolPath.CIRCLE,fillColor:"red",fillOpacity:.4,scale:4,strokeWeight:0},source=$("#filter-template").html(),template=Handlebars.compile(source);!function(){$.i18n.init({debug:!1,fallbackLng:"fi",load:"unspecific"},function(){$("html").i18n(),$("a.language."+$.i18n.lng()).addClass("active")}),$.getJSON("http://opendata.navici.com/tampere/opendata/ows?service=WFS&version=2.0.0&request=GetFeature&typeName=opendata:HAMMASHOITOLAT,KIRJASTOT,NEUVOLAT,NUORTEN_TILAT,PAIVAKODIT,TERVEYSASEMAT,UIMAHALLIT,PALVELUKESKUKSET,PAIVAKESKUKSET&outputFormat=json&srsName=EPSG:4326",function(e){serviceTypes=[].concat(_toConsumableArray(new Set(e.features.map(function(e){return e.properties.PALVELU})))),serviceTypes.forEach(function(e){return filters.append(template({type:e,type_i18n:$.t(e)}))}),types=Bacon.$.checkBoxGroupValue($("input"),[]),types.onValue(updatePoints),serviceData=e});var e={zoom:11,center:new google.maps.LatLng(61.493543,23.77951),mapTypeId:google.maps.MapTypeId.ROAD,disableDefaultUI:!0};map=new google.maps.Map(document.getElementById("map"),e),heatmap=new google.maps.visualization.HeatmapLayer({data:points}),heatmap.setMap(map),heatmap.set("opacity",.7),heatmap.set("radius",30),heatmap.set("maxIntensity",5)}();var updatePoints=function(){if(serviceData){markers.forEach(function(e){return e.setMap(null)}),markers=[],points=[];var e=serviceData.features.filter(function(e){return types.get().some(function(t){return t===e.properties.PALVELU})}),t=void 0,a=void 0;e.forEach(function(e){a=new google.maps.LatLng(e.geometry.coordinates[1],e.geometry.coordinates[0]),points.push({location:a,weight:1}),t=new google.maps.Marker({position:a,title:e.properties.NIMI,icon:circle}),markers.push(t),t.setMap(map)}),heatmap.setData(points)}};$("button#all").on("click",function(){$("label").addClass("active"),types.set(serviceTypes)}),$("button#none").on("click",function(){$("label").removeClass("active"),types.set([])}),$("#close").on("click",function(){$("#drawer").removeClass("is-visible")}),$("a.language").on("click",function(e){e.preventDefault();var t=$(this).data("lang");$("a.language.active").removeClass("active"),$(this).addClass("active"),$.i18n.setLng(t),location.reload()}),filters.on("change","input",function(e){$(e.target.parentElement).toggleClass("active")});