Sha256: d8b4bd1c09844ca4d1bb2d331bad2751edff66b19b4a1e397a154b990eab03c4

Contents?: true

Size: 1.05 KB

Versions: 2

Compression:

Stored size: 1.05 KB

Contents

// Event page map

$(document).ready(function(){
  var mapDiv = $("#Single-Action-Map")
  console.log(mapDiv)
  var addr = JSON.parse(decodeURIComponent(mapDiv.attr("map_location")));
  var addrLoc = [addr.location.latitude,addr.location.longitude]
  console.log(addr)
  var map = L.map("Single-Action-Map",{
                      center: addrLoc,
                      crs: L.CRS.EPSG3857,
                      zoom: 15,
                      zoomControl: true,
                      preferCanvas: false,
  });
  var OpenStreetMap_Mapnik = L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
	maxZoom: 19,
	attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
  });
  OpenStreetMap_Mapnik.addTo(map);
  var redMarker = new L.Icon({
   iconUrl: '/assets/marker-icon-red.png',
   shadowUrl: '/assets/marker-shadow.png',
   iconSize: [25, 41],
   iconAnchor: [12, 41],
   popupAnchor: [1, -34],
   shadowSize: [41, 41]
  });
  var newMarker = L.marker(addrLoc,{icon: redMarker});
  newMarker.addTo(map);
})

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
jekyll-theme-chaos-0.1.1 assets/js/an-event-page.js
jekyll-theme-chaos-0.1.0 assets/js/an-event-page.js