« Utilisateur:Maxim21/common.js » : différence entre les versions
mAucun résumé des modifications |
m Une matinée entière à faire cette ânerie, et je continue... |
||
| Ligne 13 : | Ligne 13 : | ||
} | } | ||
includeJs('http://nuvapedia.fr/leaflet-0.7.3/ | includeJs('http://nuvapedia.fr/leaflet-0.7.3/leaflet.js'); | ||
includeCss('http://nuvapedia.fr/leaflet-0.7.3/ | includeCss('http://nuvapedia.fr/leaflet-0.7.3/leaflet.css'); | ||
var map = L.map('okotomap', {crs: L.CRS.Simple}).setView([-256, 256], 1); | var map = L.map('okotomap', {crs: L.CRS.Simple}).setView([-256, 256], 1); | ||
L.tileLayer('http://nuvapedia.fr/tilesetokoto/{z}/tile_{x}-{y}.jpg', { | L.tileLayer('http://nuvapedia.fr/tilesetokoto/{z}/tile_{x}-{y}.jpg', { | ||
Version du 31 janvier 2015 à 14:29
function includeJs(path) {
var newJsInclude = document.createElement('script');
newJsInclude.setAttribute('src', path);
document.body.appendChild(newJsInclude);
}
function includeCss(path) {
var newStyleInclude = document.createElement('link');
newStyleInclude.setAttribute('rel', 'stylesheet');
newStyleInclude.setAttribute('type', 'text/css');
newStyleInclude.setAttribute('href', path);
document.getElementsByTagName('head')[0].appendChild(newStyleInclude);
}
includeJs('http://nuvapedia.fr/leaflet-0.7.3/leaflet.js');
includeCss('http://nuvapedia.fr/leaflet-0.7.3/leaflet.css');
var map = L.map('okotomap', {crs: L.CRS.Simple}).setView([-256, 256], 1);
L.tileLayer('http://nuvapedia.fr/tilesetokoto/{z}/tile_{x}-{y}.jpg', {
minZoom: 1,
continuousWorld: true,
noWrap: true,
maxZoom: 4,
reuseTiles: true,
bounds: L.latLngBounds(L.latLng(-1,1),L.latLng(-511,511))
}).addTo(map);