angular-ui / ui-leaflet

AngularJS directive to embed an interact with maps managed by Leaflet library
http://angular-ui.github.io/ui-leaflet
Other
314 stars 134 forks source link

minZoom and maxZoom not working for overlay layer #108

Open nmccready opened 9 years ago

nmccready commented 9 years ago

From @corymsmith on September 9, 2015 8:58

I have a base layer and a bunch of overlays, each overlay has a min and max zoom but it doesn't appear to be working. Does this structure look correct?

var overlay = {
  name: 'Elevation',
  url: base_url + tile_path,
  type: 'xyz',
  visible: false,
  layerOptions: {
    minZoom: 9,
    maxZoom: 18
  }
};

Copied from original issue: tombatossals/angular-leaflet-directive#928

nmccready commented 9 years ago

From @florentplomb on October 6, 2015 17:21

Hi,

Try with this :

layerParams: { minZoom: 9, maxZoom: 18 }

jernejc commented 9 years ago

Hi,

I have a similar issue. Tried layerParams and layerOptions? I also tried changing the default values dynamically, but it only works the 1st time, no effect after that.

Any ideas?

jernejc commented 8 years ago

Seems to work with layerParams, but had to remove default values.

YonatanKra commented 8 years ago

It doesn't work for me. Here are my defaults:

this.defaults.tileLayer = myUrl;
this.defaults.layerParams = {maxZoom: 11, minZoom: 0};

I've also tried:

this.defaults.tileLayer = myUrl;
this.defaults.maxZoom = 11;

As mentioned in the README. Any ideas why it doesn't work?