0

I'm trying to load geojson layers in leaflet map using "leaflet-vectorgrid" plugin. but when ever i hover or click over the loaded layers, we'll get the error that says "min is undefined" from the

Plugins that i used: leaflet nuxt3-leaflet leaflet.vectorgrid Image of the error

Im sure that every thing is ok in pure html css javascript codes that uses leaflet but in nuxt something is different.

Have you ever faced with this error? Please help me to fix this error.

L.value.vectorGrid
  .slicer(window[var_name], {
    maxZoom: 22,
    minNativeZoom: 0,
    rendererFactory: L.value.canvas.tile,
    pane:
      config.app._map_layers["nosazi_layer"]["id"] + "_" + index + "_overlay",
    vectorTileLayerStyles: {
      sliced: function (properties, zoom) {
        if (properties.RenCode != null) {
          return {
            color: `rgb(${cs.getPropertyValue("--rgb-first-light")})`,
            fillColor: `rgb(${cs.getPropertyValue("--rgb-first-light")})`,
            weight: 3,
            opacity: 1,
            fillOpacity: 0.7,
            fill: true,
            interactive: true,
          };
        } else {
          return {
            color: false,
            fillColor: false,
            opacity: 0,
            fillOpacity: 0,
            weight: 0,
            stroke: false,
            fill: false,
            interactive: false,
          };
        }
      },
    },
    interactive: true,
    preferCanvas: false,
    getFeatureId: function (feature) {
      if (feature.properties.RenCode != undefined)
        return feature.properties.RenCode.toString();
    },
  })
  .addTo(map.value)
  .bringToFront();

In non-interactive mode of L.vectorGrid.slicer , it works without issue. But on hovering or clicking on geojson layer in interactive mode, we'll face this error message.

0

Browse other questions tagged or ask your own question.