Skip to content

Disable zoom-out function after top-most zoom level #4

@IsaacHub

Description

@IsaacHub

@danwild
I would like to disable the zoom-out after top-most zoom level like this: http://jsfiddle.net/gxzhc/3/

I'm unable to achieve this, look at the screenshot. I do not want to display "Map data not yet available", but instead I need to disable the zoom-out level, and of course no repetition of world map.

chrome_2017-03-03_13-42-57

I have done so far: demo.js
var Esri_WorldImagery = L.tileLayer('http://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}', {
attribution: 'Tiles © Esri — Source: Esri, i-cubed, USDA, USGS, ' +
'AEX, GeoEye, Getmapping, Aerogrid, IGN, IGP, UPR-EGP, and the GIS User Community',
noWrap: true
});

var map = L.map('map', {
layers: [ Esri_WorldImagery ],
zoom: 0,
center: [49.009952, 2.548635],
maxBounds: [
[-85.0, -180.0],
[85.0, 180.0]
]
});

What code should I add to achieve the same as the jsfiddle I provided above?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions