要引入mapbox-gl和@mapbox/mapbox-gl-language这两个包,百度搜索下
import React from 'react';
import mapboxgl from "mapbox-gl";
import MapboxLanguage from "@mapbox/mapbox-gl-language";
// require('https://api.mapbox.com/mapbox-gl-js/v1.12.0/mapbox-gl.js')
mapboxgl.setRTLTextPlugin(
"https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-rtl-text/v0.1.0/mapbox-gl-rtl-text.js"
);
interface IProps {
lat: number;
lon: number;
}
export default class Map extends React