Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
645 changes: 181 additions & 464 deletions dist/index.cjs.js

Large diffs are not rendered by default.

645 changes: 181 additions & 464 deletions dist/index.esm.js

Large diffs are not rendered by default.

13 changes: 8 additions & 5 deletions docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,14 @@ Client applications will need to install these as dependencies (or, possibly,
peer dependencies).

```json
"leaflet": "^1.7.1",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"@react-leaflet/core": "1.0.2",
"react-leaflet": "3.1.0"
"peerDependencies": {
"@react-leaflet/core": "2.0.0",
"leaflet": "^1.8.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-leaflet": "^4.2.1"
}

```

IMPORTANT: Note the exact (and out of date) version specifications for
Expand Down
767 changes: 426 additions & 341 deletions package-lock.json

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"i-pg": "cd playground && npm i",
"i-all": "npm i && cd playground && npm i",
"rei-all": "(rm -rf node_modules ; npm i) && (cd playground && rm -rf node_modules ; npm i)",
"dev": "npm-run-all --parallel build-watch start-playground",
"dev": "npm-run-all --parallel build-watch start-pg",
"start": "react-scripts start",
"test": "react-scripts test",
"eject": "react-scripts eject"
Expand All @@ -49,7 +49,7 @@
},
"devDependencies": {
"@babel/cli": "^7.17.10",
"@babel/core": "^7.18.5",
"@babel/core": "7.18.6",
"@babel/preset-env": "^7.18.2",
"@babel/preset-react": "^7.17.12",
"@rollup/plugin-babel": "^5.3.1",
Expand All @@ -65,6 +65,6 @@
"leaflet": "^1.8.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-leaflet": "4.0.0"
"react-leaflet": "^4.2.1"
}
}
8 changes: 4 additions & 4 deletions playground/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion playground/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>React App</title>
<title>PCIC React Leaflet Components Demo</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
Expand Down
59 changes: 58 additions & 1 deletion playground/src/DemoStaticControl.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { useState } from 'react';
import { Col, Form, Row } from 'react-bootstrap';
import { MapContainer } from 'react-leaflet';
import {MapContainer, Marker, Popup, TileLayer} from 'react-leaflet';

import { StaticControl } from 'pcic-react-leaflet-components';

Expand All @@ -15,6 +15,63 @@ function DemoStaticControl() {
setContent(e.target.value)
};

return (
<React.Fragment>
<Row>
<Col xs={6}>
<Form>
<Form.Group>
<Form.Label>Position</Form.Label>
<Form.Select value={position} onChange={handleChangePosition}>
{
"topleft topright bottomleft bottomright".split(" ").map(
pos => (<option value={pos}>{pos}</option>)
)
}
</Form.Select>
</Form.Group>
</Form>
</Col>
<Col xs={6}>
<Form>
<Form.Group>
<Form.Label>Content</Form.Label>
<Form.Control value={content} onChange={handleChangeContent}/>
</Form.Group>
</Form>
</Col>
</Row>
<Row className={"mt-3"}>
<Col>
Map goes here
<MapContainer center={[51.505, -0.09]} zoom={13} scrollWheelZoom={false}>
<TileLayer
attribution='&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
url="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"
/>
<Marker position={[51.505, -0.09]}>
<Popup>
A pretty CSS3 popup. <br /> Easily customizable.
</Popup>
</Marker>
<StaticControl position={position}>{content}</StaticControl>
</MapContainer>
</Col>
</Row>
</React.Fragment>
)


return (
<>
<div style={{ height: 80, border: "1px solid red" }}>
DemoStaticControl
</div>
</>
)

return "DemoStaticControl"

return (
<React.Fragment>
<Row>
Expand Down
9 changes: 6 additions & 3 deletions playground/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,15 @@ import 'bootstrap/dist/css/bootstrap.min.css';
import './index.css';
import App from './App';
import reportWebVitals from './reportWebVitals';
import {createRoot} from "react-dom/client";

ReactDOM.render(
let container = document.getElementById('root');
const root = createRoot(container);

root.render(
<React.StrictMode>
<App />
</React.StrictMode>,
document.getElementById('root')
</React.StrictMode>
);

// If you want to start measuring performance in your app, pass a function
Expand Down