# Mapillary Vector Tiles are not shown at every zoom levels in a Leaflet map

**URL:** <https://forum.mapillary.com/t/mapillary-vector-tiles-are-not-shown-at-every-zoom-levels-in-a-leaflet-map/447>\
**Category:** Uncategorized\
**Created:** [April 22, 2016, 6:53am UTC](https://forum.mapillary.com/t/mapillary-vector-tiles-are-not-shown-at-every-zoom-levels-in-a-leaflet-map/447 "2016-04-22T06:53:25Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![CesareGerbino](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.mapillary.com/cesaregerbino/32/68264_2.png) [@CesareGerbino](https://forum.mapillary.com/u/CesareGerbino)\
**Post date:** [April 22, 2016, 6:53am UTC](https://forum.mapillary.com/t/mapillary-vector-tiles-are-not-shown-at-every-zoom-levels-in-a-leaflet-map/447/1 "2016-04-22T06:53:25Z")

</div>

I’m trying to load the Mapillary vector tiles layer in a Leaflet map.

I’m using Leaflet.MapboxVectorTile (ref. [GitHub - SpatialServer/Leaflet.MapboxVectorTile: A Leaflet Plugin that renders Mapbox Vector Tiles on HTML5 Canvas.](https://github.com/SpatialServer/Leaflet.MapboxVectorTile)).

Here you are my code …

```
  var map = new L.map('map').setView([44.907852, 7.673789],16);

  L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', {
    attribution: '? OpenStreetMap contributors'
  }).addTo(map);

  var config = {
    url: "https://t2.mapillary.com/tiles/{z}/{x}/{y}.mapbox"
  };

  var mapillarySource = new L.TileLayer.MVTSource(config);
  map.addLayer(mapillarySource);

```

The code is working and I can see the vector tile layer on the map but when I zoom in on my map I can’t see the layer after 14 zoom level.

I’ve tried to use also

```
minzoom = 0
maxzoom = 16

```

in the layer configuration but nothing change.

Trying to use the Mapillary viewer, for example

```
http://www.mapillary.com/map/search/44.90213653940583/7.661219012127532/13

```

I see that the vector layers at every zoom level.

Using Firebug I see that the code is quite similar to my code …

```
      config = {
        url: 'https://t2.mapillary.com/tiles/{z}/{x}/{y}.mapbox?access_token=pk.eyJ1IjoibWFwaWxsYXJ5IiwiYSI6ImZCRUVhYm8ifQ.MwcTuq2Q0KHcJxC_Whra7w',
        zIndex: 1000,
        style: function(feature) {
          var style;
          style = {};
          style.color = 'rgba(53, 175, 109, 0.5)';
          style.size = 3;
          return style;
        }
      };
      mvtSource = new L.TileLayer.MVTSource(config);
      map = mapCtrl.getMap();
      return map.addLayer(mvtSource);

```

For test I’ve tried to change my code using the Mapillary original layer definition above (with and without the access\_token …), but nothing change.

How may I see the Mapillary vector tiles at each zoom level?

Are you using cached vector tiles from lower zoom levels if no tiles are available for the current zoom level??

Any suggestion, example, jsfiddle?

---

<div class="post-metadata">

**Author:** ![Stalfur](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.mapillary.com/stalfur/32/68289_2.png) [@Stalfur](https://forum.mapillary.com/u/Stalfur)\
**Post date:** [May 21, 2016, 1:38am UTC](https://forum.mapillary.com/t/mapillary-vector-tiles-are-not-shown-at-every-zoom-levels-in-a-leaflet-map/447/2 "2016-05-21T01:38:35Z")

</div>

Looks like access control problem - I have the same

XMLHttpRequest cannot load [https://t2.mapillary.com/tiles/15/18955/19119.mapbox](https://t2.mapillary.com/tiles/15/18955/19119.mapbox). No ‘Access-Control-Allow-Origin’ header is present on the requested resource. Origin ‘[http://osm.hlidskjalf.is](http://osm.hlidskjalf.is)’ is therefore not allowed access.  
MVTSource.js:230 xhr error: 0
