Платформа ЦРНП "Мирокод" для разработки проектов
https://git.mirocod.ru
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
608 B
30 lines
608 B
3 years ago
|
---
|
||
|
layout: tutorial_frame
|
||
|
title: KittenLayer
|
||
|
---
|
||
|
<script type='text/javascript'>
|
||
|
|
||
|
var map = L.map('map', {
|
||
|
crs: L.CRS.Simple,
|
||
|
center: [0, 0],
|
||
|
zoom: 5
|
||
|
});
|
||
|
|
||
|
L.TileLayer.Kitten = L.TileLayer.extend({
|
||
|
getTileUrl: function(coords) {
|
||
|
var i = Math.ceil( Math.random() * 4 );
|
||
|
return "http://placekitten.com/256/256?image=" + i;
|
||
|
},
|
||
|
getAttribution: function() {
|
||
|
return "<a href='http://placekitten.com/attribution.html'>PlaceKitten</a>"
|
||
|
}
|
||
|
});
|
||
|
|
||
|
L.tileLayer.kitten = function() {
|
||
|
return new L.TileLayer.Kitten();
|
||
|
}
|
||
|
|
||
|
map.addLayer( L.tileLayer.kitten() );
|
||
|
|
||
|
</script>
|