I'm trying to use react-leaflet-vectorgrid to render .mvt tiles from a remote server but I get the error below:
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.
Hello,
I'm trying to use react-leaflet-vectorgrid to render .mvt tiles from a remote server but I get the error below:
My code is:
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?