Skip to content
Snippets Groups Projects
Commit 7cb10e1e authored by L4929's avatar L4929
Browse files

Tiny changes for the mock-up screenshot

parent 09370453
No related branches found
No related tags found
1 merge request!2Drawing functions
...@@ -25,8 +25,4 @@ class App extends Component { ...@@ -25,8 +25,4 @@ class App extends Component {
} }
} }
function onChange(geojson) {
console.log("geojson changed", geojson);
}
export default App; export default App;
import React, {Component} from 'react'; import React, {Component} from 'react';
import { EditControl } from "react-leaflet-draw" import { EditControl } from "react-leaflet-draw"
import L from 'leaflet';
import { import {
FeatureGroup, FeatureGroup,
GeoJSON,
Marker
} from 'react-leaflet' } from 'react-leaflet'
class DrawTools extends Component { class DrawTools extends Component {
...@@ -12,7 +9,7 @@ class DrawTools extends Component { ...@@ -12,7 +9,7 @@ class DrawTools extends Component {
let type = e.layerType; let type = e.layerType;
let layer = e.layer; let layer = e.layer;
let geoJSON = layer.toGeoJSON(); let geoJSON = layer.toGeoJSON();
console.log(JSON.stringify(geoJSON, null, 4)); console.log(JSON.stringify(geoJSON, null, 4)); // makes the output readable in the console
this._onChange(); this._onChange();
} }
...@@ -25,7 +22,11 @@ class DrawTools extends Component { ...@@ -25,7 +22,11 @@ class DrawTools extends Component {
onCreated={this._onCreated} onCreated={this._onCreated}
draw={{ draw={{
circle: { circle: {
repeatMode: true // allows using the tool again after finishing the previous shape repeatMode: true, // allows using the tool again after finishing the previous shape
shapeOptions: {
color: '#f9f10c',
opacity: 100
}
}, },
rectangle: { rectangle: {
repeatMode: true repeatMode: true
...@@ -38,11 +39,16 @@ class DrawTools extends Component { ...@@ -38,11 +39,16 @@ class DrawTools extends Component {
message: '<strong>Oh snap!<strong> you can\'t draw that!' // Message that will show when intersect message: '<strong>Oh snap!<strong> you can\'t draw that!' // Message that will show when intersect
}, },
shapeOptions: { shapeOptions: {
color: '#97009c' color: '#ed2572',
opacity: 100
} }
}, },
polyline: { polyline: {
repeatMode: true repeatMode: true,
shapeOptions: {
color: '#ed2572',
opacity: 100
}
}, },
marker: { marker: {
repeatMode: true repeatMode: true
......
import React, {Component} from 'react'; import React, {Component} from 'react';
import { import {
GeoJSON,
Map, Map,
TileLayer, TileLayer,
ZoomControl ZoomControl
...@@ -18,7 +17,7 @@ class UserMap extends Component { ...@@ -18,7 +17,7 @@ class UserMap extends Component {
> >
<TileLayer <TileLayer
attribution='Maanmittauslaitoksen kartta' attribution='Maanmittauslaitoksen kartta'
url=" https://tiles.kartat.kapsi.fi/taustakartta/{z}/{x}/{y}.jpg" url=" https://tiles.kartat.kapsi.fi/peruskartta/{z}/{x}/{y}.png"
/>' />'
<ZoomControl position='topright' /> <ZoomControl position='topright' />
<DrawTools position={this.props.position} /> <DrawTools position={this.props.position} />
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment