S
S
sumrakx2018-06-05 16:12:28
leaflet
sumrakx, 2018-06-05 16:12:28

How to create your own raster layer from tiles?

There is data that needs to be displayed, but I can’t figure out how to display the entire raster layer, it turns out to display only one tile from the layer. How can I do an increment?

<script>
  var map = L.map('map', {
    crs: L.CRS.Simple,
    center: [0, 0],
    zoom: 5
  });

  L.TileLayer.Map = L.TileLayer.extend({
    getTileUrl: function(coords) {
    var z = 100;
    var x = 1+1;
      var y = 1+1;
      var idMap = "%5C%5C%5C%5Cafina%5C%5CVolPrev1%5C%5CMultiScaledMaps%5C%5C1006%5C%5CPreview%5C%5C1006_L30%5C%5CP%3Cl%3E%5C%5CVH%3CbT%3E-%3CbL%3E_%3CbB%3E-%3CbR%3E%5C%5C1006_P%3Cl%3E_L30_VH%3Cr%3E-%3Cc%3E_%3Cr%3E-%3Cc%3E.jpg";
      return "https://localPath/api/ImgTiles/" + z + "/" + x + "/" + y + "?namingRule=" + idMap;
    },
  });
  L.tileLayer.Map = function() {
    return new L.TileLayer.Map();
  }
  map.addLayer( L.tileLayer.Map() );
</script>

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question