« Utilisateur:Maxim21/common.js » : différence entre les versions

mAucun résumé des modifications
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 okotomap = L.map('okotomap', {crs: L.CRS.Simple}).setView([-256, 256], 1);
    var newStyleInclude = document.createElement('link');
  L.tileLayer('http://nuvapedia.fr/tilesetokoto/{z}/tile_{x}-{y}.jpg', {
    newStyleInclude.setAttribute('rel', 'stylesheet');
      minZoom: 1,
    newStyleInclude.setAttribute('type', 'text/css');
      continuousWorld: true,
    newStyleInclude.setAttribute('href', path);
      noWrap: true,
    document.getElementsByTagName('head')[0].appendChild(newStyleInclude);
      maxZoom: 4,
}
      reuseTiles: true,
      bounds: L.latLngBounds(L.latLng(-1,1),L.latLng(-511,511))
  }).addTo(okotomap);


includeJs('http://nuvapedia.fr/leaflet-0.7.3/leaflet.js');
  var okotocgimap = L.map('okotocgimap', {crs: L.CRS.Simple}).setView([-127, 255], 1);
includeCss('http://nuvapedia.fr/leaflet-0.7.3/leaflet.css');
  L.tileLayer('http://nuvapedia.fr/tilesetokotocgi/{z}/{x}-{y}.jpg', {
      minZoom: 1,
      continuousWorld: true,
      noWrap: true,
      maxZoom: 4,
      reuseTiles: true,
      bounds: L.latLngBounds(L.latLng(-1,1),L.latLng(-127,255))
  }).addTo(okotocgimap);