react-leaflet-vectorgrid icon indicating copy to clipboard operation
react-leaflet-vectorgrid copied to clipboard

TypeError: Cannot read property 'protobuf' of undefined

Open 0xmtn opened this issue 4 years ago • 1 comments

Hello,

I'm trying to use react-leaflet-vectorgrid to render .mvt tiles from a remote server but I get the error below:

image

My code is:

import React, { Component } from "react";
import { 
  Path, 
  withLeaflet,                 
  GeoJSON,                     
  LayerGroup,                  
  LayersControl                
} from 'react-leaflet';        
  
import ReactDOM from "react-dom";
import L from "leaflet";
import VectorGridDefault from 'react-leaflet-vectorgrid';
            
import aladag from "./data/adana/aladag.json";
import ceyhan from "./data/adana/ceyhan.json";
const VectorGrid = withLeaflet(VectorGridDefault); 


class AdanaOverlays extends Component {
 
  constructor(){
    super(); 
  }

  render (){
    return (
      <LayersControl>
        <Overlay name="Aladag">
          <VectorGrid type="protobuf" url="http://localhost:8123/aladag/{z}/{x}/{y}.mvt" />
        </Overlay>

        <Overlay name="Ceyhan">
          <VectorGrid type="protobuf" url="http://localhost:8123/ceyhan/{z}/{x}/{y}.mvt" />
        </Overlay>
      </LayersControl>
    )
  }

export default AdanaOverlays;

I don't know if this is my mistake or something went wrong in installation. I deleted node_modules, cleared cache and installed everything from scratch, yet same thing happens.

How do I proceed to solve this?

0xmtn avatar Jun 22 '20 05:06 0xmtn

@mhasbie Do you still maintain this repo?

0xmtn avatar Jul 03 '20 15:07 0xmtn