I am trying to display Google basemap using leaflet.js on web but getting strange results, screenshot is attached
I have also added the code for react component below
import React, { Component } from 'react';
import L from 'leaflet';
class MapEditor extends Component{
state={}
componentDidMount() {
var map = L.map('map', {
center:[30.2541,69.703431],
zoom: 6})
L.tileLayer('http://{s}.google.com/vt/lyrs=m&x={x}&y={y}&z={z}', {
maxZoom: 19,
subdomains:['mt0']
}).addTo(map);
};
render(){
return(
<div id='mapeditor'>
<div id='map'>
</div>
</div>
)
};
}
export default MapEditor;
How can I fix this issue?
Best Answer
Your
L.tileLayer
link works for me. I used it in the minmal sample from LeafletJSCould be an CSS issue or related to React.