0

I encountered a problem with the leaflet extension. The extension used to work exactly as it is represented in the code, but after updating packages it stopped working. Can you tell me where I'm going wrong?

Code block with imports:

import leaflet from 'leaflet';
  import CanvasIconLayer from './Leaflet.CanvasIcon/CanvasIconLayer.js';
    import axios from 'axios';
    import L from 'leaflet';
    import {
        LMap,
        LTileLayer,
        LMarker,
        LPopup,
        LPolygon,
        LTooltip,
        LControl,
        LIcon,
    LPolyline,
    LFeatureGroup,
    LCircleMarker
    } from 'vue2-leaflet';
    import {
        Icon
    } from 'leaflet';
    import coord from "./Leaflet.Coordinates/Leaflet.Coordinates-0.1.5.min.js";
    import Graticule from '@/../node_modules/leaflet-graticule/Leaflet.Graticule.js';
    import easyButton from '@/../node_modules/leaflet-easybutton/src/easy-button.js';

The block of code where I use this

mounted () {
    this.$nextTick(() => {
      const vm = this;
            vm.gridApi = vm.gridOptions.api;
            vm.gridColumnApi = vm.gridOptions.columnApi;
      vm.map = this.$refs.nmsMap.mapObject;
      this.ciLayer = new CanvasIconLayer({});

      vm.map.on('popupopen', this.setRequestListener);
      L.control.coordinates({
        useLatLngOrder: true,
        labelFormatterLng: (lng) => {
          return this.positionFormatter(lng, 'E ', 'W ');
        },
        labelFormatterLat: (lat) => {
          return this.positionFormatter(lat, 'N ', 'S ');
        },
      }).addTo(vm.map);
      vm.map.zoomControl.setPosition('bottomright');

      this.grat = L.latlngGraticule({
        opacity: 1,
        showLabel: true,
        weight: 0.8,
        color: '#000',
        fontColor: '#000',
      });

Also, the latlngGraticule extension does not work, although it did before. Gives out exactly the same error

I tried creating these entities through new L.Control.Coordinates, but it didn't work for me. It gives me the error

Leaflet.Coordinates-0.1.5.min.js?3377:100 Uncaught TypeError: Cannot read property 'round' of undefined
    at NewClass._update (Leaflet.Coordinates-0.1.5.min.js?3377:100)
    at NewClass.fire (leaflet-src.js?e11e:605)
    at NewClass._fireDOMEvent (leaflet-src.js?e11e:4564)
    at NewClass._handleDOMEvent (leaflet-src.js?e11e:4513)
    at HTMLDivElement.handler (leaflet-src.js?e11e:2798)
39dv
  • 1

0 Answers0