« Utilisateur:Maxim21/common.js » : différence entre les versions
m Rha. |
mAucun résumé des modifications |
||
| Ligne 1 : | Ligne 1 : | ||
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/leaftlet.js'); | |||
includeCss('http://nuvapedia.fr/leaflet-0.7.3/leaftlet.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); | |||
Version du 31 janvier 2015 à 14:25
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/leaftlet.js');
includeCss('http://nuvapedia.fr/leaflet-0.7.3/leaftlet.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);