sandbox-react/leaflet-js/app/app.jsx

29 lines
618 B
JavaScript

import L from 'leaflet';
import React from 'react';
import 'leaflet/dist/leaflet.css'
import Home from './pages/home';
import './index.css';
export default function App() {
var map = L.map("map").setView([51.505, -0.09], 13);
L.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png", {
attribution:
'&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',
}).addTo(map);
L.marker([51.5, -0.09])
.addTo(map)
.bindPopup("A pretty CSS3 popup.<br> Easily customizable.")
.openPopup();
return (
<div>
<h1>React.js</h1>
<Home />
<map />
</div>
)
}