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.

unable to set maxZoom above 18

See original GitHub issue

Hi, i’m unable to set maxZoom above 18.

My code:

<template>
  <div style="height: 100%; width:100%">
      <v-map style="height: 100%; width:100%" :zoom="zoom" :center="center" :maxZoom="max" :minZoom="min">
        <v-tilelayer :url="url" :attribution="attribution" :maxZoom="max" :minZoom="min"></v-tilelayer>
      </v-map>
  </div>
</template>

<script>
  import Vue2Leaflet from 'vue2-leaflet';

  export default {
    name: 'home',
    components: {
      'v-map': Vue2Leaflet.Map,
      'v-tilelayer' :Vue2Leaflet.TileLayer,
      'v-marker': Vue2Leaflet.Marker
    },
    data () {
      return {
        zoom: 17,
        max: 19,
        min: 13,
        center: L.latLng(6.328400, 8.105166),
        url: 'http://localhost:5000/tiles/{z}/{x}/{y}/',
        attribution: 'Demo'
      }
    }
  }
</script>
<style>
</style>

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5

github_iconTop GitHub Comments

6reactions
hpo14commented, Sep 13, 2018

KoRiGaNs’ example does not work with leaflet 1.3.4

but i found a example works on zoom >= 18 which doesnot use vue2leaflet ~~https://codepen.io/davland7/pen/YpqdJo~~

Only one difference i can see is the place when to add maxZoom/minZoom props.


OK, i’m too noob that take so much times to figured out how to make this work

KoRiGaN says “all components have a property mapObject which is the actual Leaflet object.” on https://github.com/KoRiGaN/Vue2Leaflet/issues/46#issuecomment-303684715

Method 1: add options props

<l-tile-layer :options="{ maxZoom: 19 }" ... > </l-tile-layer>

Method 2: add ref props, and change it with javascript object

<template>
...
<l-tile-layer ref="layer" url="http://{s}.tile.osm.org/{z}/{x}/{y}.png"></l-tile-layer>
...
</template>
<script>
export default {
  async mounted () {
    this.$nextTick(() => {
      this.$refs.layer.mapObject = 19
      // set the level your need, and should ≦ the max level of source
    })
  }
</script>
1reaction
chrisamowcommented, Sep 19, 2020

Hi @CharlesOkwuagwu ,

It works for me. Here is a running example with a maxZoom of 20.

Hi KoRiGaN, I was trying to implement this and noticed even on your jsfiddle when zoomed in to levels 19 and 20 there are no features. Did this solution break since this original issue (was so long ago)?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Increase Leaflet Max Zoom Level above 18 [#3156854] - Drupal
I've been working with the Geolocation Field to set up some custom markers using Leaflet map, and noticed that the maximum zoom level...
Read more >
Unable to Zoom WMS above 20 in Leaflet?
tileLayer has default 18 as maxZoom value and L.tileLayer.wms inherits this value. You have to set option maxZoom to desired value in your...
Read more >
Leaflet how to increase maxZoom - Stack Overflow
But when I zoom more than 18 levels, the map image disappears leaving only a grey plane. Here is the html: <div id="map"></div>....
Read more >
How to set webmap max zoom greater than 19?
I want to make a web map using tiles stored in mapbox. Notice how you can zoom into zoom level 21 in the...
Read more >
zoom level limit - a max zoom out - Google Groups
You can limit zoom levels by setting minZoom and maxZoom properties of ... but i'm unable to implement your code. am i ok...
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