(function(){"use strict";$(document).ready(function(){var t=$("html").attr("lang"),i=$("#map").data("jobstext"),n;mapboxgl.accessToken="pk.eyJ1IjoiamFiaWxjYXJlZXJzIiwiYSI6ImNraWhqa2lsZDA4MzMyc213d2p4djgzdzMifQ.yNOoD61VhbpSLo3ZxcoREg";n=new mapboxgl.Map({container:"map",style:"mapbox://styles/mapbox/light-v10",zoom:1});n.on("load",function(){function r(n){var u=JSON.parse(n.messages),r=u[t];return"<h4>"+r.city+"<\/h4><p class='btn btn-outline-secondary'><a href='"+r.url+"'>"+n.jobCount+" "+i+"<\/a><\/p>"}n.addSource("clusters",{type:"geojson",data:"/Umbraco/Mapbox/GeoData/GetMarkers/"+t,cluster:!0,clusterMaxZoom:6,clusterRadius:50,clusterProperties:{jobCountSum:["+",["get","jobCount"]]}});n.addLayer({id:"clusters",type:"circle",source:"clusters",paint:{"circle-color":"#003865","circle-radius":["step",["get","jobCountSum"],12,10,20,100,30]},filter:["all",[">","jobCountSum",0]]});n.addLayer({id:"clusters-sum",type:"symbol",source:"clusters",layout:{"text-field":["get","jobCountSum"],"text-font":["DIN Offc Pro Medium","Arial Unicode MS Bold"],"text-size":14},paint:{"text-color":"#ffffff"},filter:["all",["==","cluster",!0],[">","jobCountSum",0]]});n.addLayer({id:"clusters-city-circle",type:"circle",source:"clusters",filter:["!=","cluster",!0],paint:{"circle-color":"#15bef0","circle-radius":14,"circle-stroke-width":1,"circle-stroke-color":"#fff"}});n.addLayer({id:"clusters-city",type:"symbol",source:"clusters",layout:{"text-field":["get","jobCount"],"text-font":["DIN Offc Pro Medium","Arial Unicode MS Bold"],"text-size":14},filter:["!=","cluster",!0]});n.on("click","clusters-city-circle",function(t){for(var i=t.features[0].geometry.coordinates.slice();Math.abs(t.lngLat.lng-i[0])>180;)i[0]+=t.lngLat.lng>i[0]?360:-360;(new mapboxgl.Popup).setLngLat(i).setHTML(r(t.features[0].properties)).addTo(n)});n.addControl(new mapboxgl.NavigationControl);n.on("click","clusters-sum",function(t){n.flyTo({center:t.features[0].geometry.coordinates,zoom:n.getZoom()+1})});n.on("mouseenter","clusters",function(){n.getCanvas().style.cursor="pointer"});n.on("mouseleave","clusters",function(){n.getCanvas().style.cursor=""})})})})()