Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
ehasa-frontend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
WIMMA Lab 2019
Overflow
ehasa-frontend
Commits
7cb10e1e
Commit
7cb10e1e
authored
5 years ago
by
L4929
Browse files
Options
Downloads
Patches
Plain Diff
Tiny changes for the mock-up screenshot
parent
09370453
No related branches found
Branches containing commit
No related tags found
1 merge request
!2
Drawing functions
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/App.js
+0
-4
0 additions, 4 deletions
src/App.js
src/components/DrawTools.js
+13
-7
13 additions, 7 deletions
src/components/DrawTools.js
src/components/UserMap.js
+1
-2
1 addition, 2 deletions
src/components/UserMap.js
with
14 additions
and
13 deletions
src/App.js
+
0
−
4
View file @
7cb10e1e
...
@@ -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
;
This diff is collapsed.
Click to expand it.
src/components/DrawTools.js
+
13
−
7
View file @
7cb10e1e
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
...
...
This diff is collapsed.
Click to expand it.
src/components/UserMap.js
+
1
−
2
View file @
7cb10e1e
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/
tausta
kartta/{z}/{x}/{y}.
j
pg
"
url
=
"
https://tiles.kartat.kapsi.fi/
perus
kartta/{z}/{x}/{y}.p
n
g
"
/>
'
/>
'
<ZoomControl position=
'
topright
'
/>
<ZoomControl position=
'
topright
'
/>
<DrawTools position={this.props.position} />
<DrawTools position={this.props.position} />
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment