Skip to content

Commit

Permalink
Merge pull request #54 from mejackreed/revert-53-twitter-cart
Browse files Browse the repository at this point in the history
Revert "add twitter card md"
  • Loading branch information
mejackreed authored Oct 27, 2016
2 parents a380da7 + 59f9f5e commit 6847eae
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions examples/index.js
Original file line number Diff line number Diff line change
@@ -1,25 +1,16 @@
var map;
var layer;

map = L.map('map', {
center: [0, 0],
crs: L.CRS.Simple,
zoom: 0
});

var url = window.location.search.replace('?url=', '');
var url = window.location.search.replace('?url=', '')

// http://stackoverflow.com/a/18222306
var urlregex = /^(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?$/;

if (urlregex.test(url)) {
layer = L.tileLayer.iiif(url, {}).addTo(map);
}

layer.on('load', function() {
$('head').append(
'<meta name="twitter:card" content="summary_large_image">' +
'<meta name="twitter:site" content="@mejackreed">' +
'<meta name="twitter:image" content="' + url.replace('info.json', 'full/' + layer._imageSizes[1].x + ',/0/default.jpg') + '">'
);
});

0 comments on commit 6847eae

Please sign in to comment.