question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

The maxNativeZoom option of the layer is not being set when using L.esri.basemapLayer

See original GitHub issue

Bug

The maxNativeZoom option of the layer is not being set when using the method L.esri.basemapLayer('Streets') along with the options object. This means that some parts of the map display the “Map data not yet available” when the zoom level is greater than 19.

I’ve tried two different ways of setting the maxZoomLevel, both unsuccessful:

var map = L.map('map');
L.esri.basemapLayer('Imagery', { maxNativeZoom: 19}).addTo(map);
var map = L.map('map');
var layer = L.esri.basemapLayer('Imagery');
layer.options.maxNativeZoom = 19;
layer.addTo(map)

Expected Behavior

The map should be auto-scaled when zooming over the set maxNativeZoom preventing the “Map data not yet available” tiles from being displayed. Using the L.tileLayer Leaflet method with the appropriate Url for Imagery and setting the maxNativeZoom option does result in the expected behavior.

Screenshots

image

Environment Information

  • Version of Leaflet (L.version): 1.6.0
  • Version of Esri Leaflet (L.esri.VERSION): 2.3.2
  • Your OS: Windows 10
  • Browser and Version: Chrome 83.0.4103.116

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:19 (15 by maintainers)

github_iconTop GitHub Comments

2reactions
jwasilgeocommented, Jul 28, 2020

@Diegodlt thanks for opening this issue in the first place. You should be able to control the maxZoom and maxNativeZoom as you wish the next time we publish a release of this library. As for the other items we all discussed and identified, the conversation can continue in #1222.

1reaction
jwasilgeocommented, Jul 23, 2020

Now I want to backtrack a little on what I just said above. I’ve often found myself going back & forth on these different ideas, all of which have merit. 😄

I’m leaning towards reverting #1011 to give the Imagery basemap layer full control over its maxZoom option (and maxNativeZoom option) to allow for those special cases where developers really want to change them. As @patrickarlt mentioned we would then default and cap maxZoom at 19.

I think your enhancements in #1011 are very interesting, useful, and clever, @jgravois. What if we were to put that in the issue backlog and revisit once we understand how to deal with the missing tiles behavior described in https://github.com/Esri/esri-leaflet/issues/1210#issuecomment-662691014, https://github.com/Esri/esri-leaflet/issues/1210#issuecomment-662772699, and https://github.com/Esri/esri-leaflet/issues/1210#issuecomment-663065941?

I’m (clearly) open to being talked into something else if anyone has other thoughts or feelings about this, and then when we settle on our approach I am happy to work on what we agree to. Thanks y’all!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Solved: Esri Leaflete visible map service
I worked with arcgis javascript and the map service visibility it's ... The layer is being added to the map because you are...
Read more >
leaflet - Higher than maxNativeZoom requests tiles
maxZoom and maxNativeZoom are valid constructor options for L.esri.tiledMapLayer because it extends L.GridLayer .
Read more >
L.esri.FeatureLayer | Esri Leaflet - ArcGIS Developers
Function that will be used for creating layers for GeoJSON points. If the option is not specified, simple markers will be created). For...
Read more >
esri-leaflet | Yarn - Package Manager
Leaflet plugins for working with a handful of the most popular ArcGIS Service types. This includes Esri basemaps and feature services, as well...
Read more >
Esri - Bountysource
The maxNativeZoom option of the layer is not being set when using the method L.esri.basemapLayer('Streets') along with the options object.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found