jonnybarnes.uk/public/assets/js/maps.js
Jonny Barnes cc65b45f91 Squashed commit of the following:
commit bb79d80d284bf22ae17857b37630d3075635057e
Author: Jonny Barnes <jonny@jonnybarnes.uk>
Date:   Mon Dec 5 11:06:53 2016 +0000

    Update changelog regarding Makefile

commit d74d0ac99da0b898d1a08ed270629bb00b492e34
Author: Jonny Barnes <jonny@jonnybarnes.uk>
Date:   Sun Dec 4 19:24:09 2016 +0000

    make output

commit 5c7ad5830ec881a5c22bd737cac1ec3430577eb3
Author: Jonny Barnes <jonny@jonnybarnes.uk>
Date:   Sun Dec 4 19:22:25 2016 +0000

    Remove gulp

commit 160947dcd346d3c0016a15fe3b64d6f194d33bfc
Author: Jonny Barnes <jonny@jonnybarnes.uk>
Date:   Sun Dec 4 19:10:57 2016 +0000

    Updated fetch dependency

commit 25b8f300d93c3e6e129c7ac6ab31e85c12cebc6a
Author: Jonny Barnes <jonny@jonnybarnes.uk>
Date:   Sun Dec 4 18:45:21 2016 +0000

    Copy frontend assets into place

commit 65b02a14e98215899efc4f5673953bdf23f4c942
Author: Jonny Barnes <jonny@jonnybarnes.uk>
Date:   Sun Dec 4 18:40:28 2016 +0000

    Add the target file for `sass`, and set the scss files as the prerequisits

commit 7442df5040ac1459d5f088690390ef043f968852
Author: Jonny Barnes <jonny@jonnybarnes.uk>
Date:   Fri Dec 2 21:44:19 2016 +0000

    Makefile output so far

commit 8580a61aa2fb6326b99f58cb2d0418a45d734054
Author: Jonny Barnes <jonny@jonnybarnes.uk>
Date:   Fri Dec 2 21:42:32 2016 +0000

    Create sourcemaps during js uglification

commit facdbbf81f4907ce394dcb5719b76451fd45e539
Author: Jonny Barnes <jonny@jonnybarnes.uk>
Date:   Fri Dec 2 21:40:48 2016 +0000

    We can now uglify js files and compress all frontend assets

commit 866c4fa0d70377f80061533989c4d8e6d00c818c
Author: Jonny Barnes <jonny@jonnybarnes.uk>
Date:   Thu Dec 1 15:57:49 2016 +0000

    A simple makefile
2016-12-05 11:07:22 +00:00

2 lines
No EOL
1.9 KiB
JavaScript

var mapDivs=document.querySelectorAll(".map");mapboxgl.accessToken="pk.eyJ1Ijoiam9ubnliYXJuZXMiLCJhIjoiY2l2cDhjYW04MDAwcjJ0cG1uZnhqcm82ayJ9.qA2zeVA-nsoMh9IFrd5KQw";for(var i=0;i<mapDivs.length;i++){var mapDiv=mapDivs[i],latitude=mapDiv.dataset.latitude,longitude=mapDiv.dataset.longitude,el=document.createElement("div");el.classList.add("marker");var mapMenu=document.createElement("div");mapMenu.classList.add("map-menu");var streetsInput=document.createElement("input");streetsInput.setAttribute("id","streets"),streetsInput.setAttribute("type","radio"),streetsInput.setAttribute("name","toggle"),streetsInput.setAttribute("value","streets"),streetsInput.setAttribute("checked","checked"),streetsInput.addEventListener("click",function(){map.setStyle("mapbox://styles/mapbox/streets-v9")});var streetsLabel=document.createElement("label");streetsLabel.setAttribute("for","streets"),streetsLabel.appendChild(document.createTextNode("Streets"));var satelliteInput=document.createElement("input");satelliteInput.setAttribute("id","satellite"),satelliteInput.setAttribute("type","radio"),satelliteInput.setAttribute("name","toggle"),satelliteInput.setAttribute("value","streets"),satelliteInput.addEventListener("click",function(){map.setStyle("mapbox://styles/mapbox/satellite-v9")});var satelliteLabel=document.createElement("label");satelliteLabel.setAttribute("for","satellite"),satelliteLabel.appendChild(document.createTextNode("Satellite")),mapMenu.appendChild(streetsInput),mapMenu.appendChild(streetsLabel),mapMenu.appendChild(satelliteInput),mapMenu.appendChild(satelliteLabel);var map=new mapboxgl.Map({container:mapDiv,style:"mapbox://styles/mapbox/streets-v9",center:[longitude,latitude],zoom:15,scrollZoom:!1});map.addControl(new mapboxgl.NavigationControl),new mapboxgl.Marker(el,{offset:[-10,-20]}).setLngLat([longitude,latitude]).addTo(map),mapDiv.appendChild(mapMenu)}
//# sourceMappingURL=public/assets/js/maps.js.map