Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

maxZoom in leaflet #104

Open
stefansc1 opened this issue Aug 8, 2018 · 2 comments
Open

maxZoom in leaflet #104

stefansc1 opened this issue Aug 8, 2018 · 2 comments

Comments

@stefansc1
Copy link

maxZoom is a Leaflet option for TileLayers and GridLayers. To disable the heatmap's intensity scaling with zoom, I set maxZoom to the map's minimum zoom level. Now I cannot toggle the heatmap layer in the layer controls any more, because layer.options.maxZoom is checked for that (see https://github.com/Leaflet/Leaflet/blob/86bb4090c1b1b56165e40b62992750a4e7e2f963/src/control/Control.Layers.js#L402 for details).

Leaflet version: latest (1.3.3)
Heatmap version: latest (0.2.0)

@donei34
Copy link

donei34 commented Dec 19, 2018

That way I personally fixed this exact same issue was to manually edit leaflet-heat.js and replace u = void 0 etc. with whatever maxzoom you want. Then in your main script and the options for the heatmap remove the maxzoom declaration

@stefansc1
Copy link
Author

There are two other ways: when editing the leaflet-heat code anyway, you could change this.options.maxZoom to anything that is not used yet, like this.options_maxZoom, so it can still be set but does not interfere with the leaflet option for layers. Or you could overwrite how the layer control works (however, this disables zoom checking for all layers):

L.Control.Layers.include({
	_checkDisabledLayers: function (){
		return;
	}
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants