aboutsummaryrefslogtreecommitdiff
path: root/modern/src/MainMap.js
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2018-09-03 22:51:20 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2018-09-03 22:51:20 +1200
commitda578b6ac7ba43b8d437aebbfe36777278370e5e (patch)
tree161d340924de3cc1d67207df441513833181eb3c /modern/src/MainMap.js
parenta4c233a05c9b577fe9ac12b4f6994b26b5d3ae50 (diff)
downloadtrackermap-web-da578b6ac7ba43b8d437aebbfe36777278370e5e.tar.gz
trackermap-web-da578b6ac7ba43b8d437aebbfe36777278370e5e.tar.bz2
trackermap-web-da578b6ac7ba43b8d437aebbfe36777278370e5e.zip
First hacky implementation
Diffstat (limited to 'modern/src/MainMap.js')
-rw-r--r--modern/src/MainMap.js29
1 files changed, 29 insertions, 0 deletions
diff --git a/modern/src/MainMap.js b/modern/src/MainMap.js
new file mode 100644
index 00000000..27c58bca
--- /dev/null
+++ b/modern/src/MainMap.js
@@ -0,0 +1,29 @@
+import React, { Component } from 'react';
+import { Map, TileLayer, Marker, Popup } from 'react-leaflet';
+
+class MainMap extends Component {
+ state = {
+ lat: 51.505,
+ lng: -0.09,
+ zoom: 13,
+ }
+
+ render() {
+ const position = [this.state.lat, this.state.lng]
+ return (
+ <Map style={{height: this.props.height, width: this.props.width}} center={position} zoom={this.state.zoom}>
+ <TileLayer
+ attribution="&amp;copy <a href=&quot;http://osm.org/copyright&quot;>OpenStreetMap</a> contributors"
+ url="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"
+ />
+ <Marker position={position}>
+ <Popup>
+ A pretty CSS3 popup. <br /> Easily customizable.
+ </Popup>
+ </Marker>
+ </Map>
+ )
+ }
+}
+
+export default MainMap;