diff --git a/examples/index.html b/examples/index.html new file mode 100644 index 0000000..c1f17b5 --- /dev/null +++ b/examples/index.html @@ -0,0 +1,15 @@ + + + + + + + + + + +
+
+ + + \ No newline at end of file diff --git a/examples/index.js b/examples/index.js new file mode 100644 index 0000000..df8f083 --- /dev/null +++ b/examples/index.js @@ -0,0 +1,16 @@ +var map; + +map = L.map('map', { + center: [0, 0], + crs: L.CRS.Simple, + zoom: 0 +}); + +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); +}