Sha256: 4166cc22858c24f8f0a2771271028d937c90e07831a1aa4606073dcc6cc75a7f
Contents?: true
Size: 682 Bytes
Versions: 3
Compression:
Stored size: 682 Bytes
Contents
--- layout: tutorial_frame title: Grid coordinates --- <script type='text/javascript'> var map = L.map('map', { center: [0, 0], zoom: 0 }); L.GridLayer.DebugCoords = L.GridLayer.extend({ createTile: function (coords, done) { var tile = document.createElement('div'); tile.innerHTML = [coords.x, coords.y, coords.z].join(', '); tile.style.outline = '1px solid red'; setTimeout(function () { done(null, tile); // Syntax is 'done(error, tile)' }, 500 + Math.random() * 1500); return tile; } }); L.gridLayer.debugCoords = function(opts) { return new L.GridLayer.DebugCoords(opts); }; map.addLayer( L.gridLayer.debugCoords() ); </script>
Version data entries
3 entries across 3 versions & 1 rubygems