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
1c8b7bdb
Commit
1c8b7bdb
authored
5 years ago
by
L4929
Browse files
Options
Downloads
Patches
Plain Diff
Button actually looks legit!
parent
6724bca6
No related branches found
Branches containing commit
No related tags found
3 merge requests
!21
Development
,
!15
Get game creation to user-marker-database-interactions
,
!10
Add text
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
src/App.css
+6
-0
6 additions, 0 deletions
src/App.css
src/components/DrawTools.js
+7
-7
7 additions, 7 deletions
src/components/DrawTools.js
src/icons/button-textbox.png
+0
-0
0 additions, 0 deletions
src/icons/button-textbox.png
src/icons/nil.png
+0
-0
0 additions, 0 deletions
src/icons/nil.png
with
13 additions
and
7 deletions
src/App.css
+
6
−
0
View file @
1c8b7bdb
...
@@ -138,3 +138,9 @@ div.login button:hover {
...
@@ -138,3 +138,9 @@ div.login button:hover {
background-color
:
darkblue
;
background-color
:
darkblue
;
cursor
:
pointer
;
cursor
:
pointer
;
}
}
/* Editing text button in the toolbar */
.leaflet-draw-toolbar
.leaflet-draw-draw-textbox
{
background-image
:
url('icons/button-textbox.png')
;
background-size
:
30px
30px
;
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
src/components/DrawTools.js
+
7
−
7
View file @
1c8b7bdb
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
L
from
'
leaflet
'
import
'
leaflet-draw
'
import
{
FeatureGroup
}
from
'
react-leaflet
'
import
{
FeatureGroup
}
from
'
react-leaflet
'
// empty icon for the text field
// empty icon for the text field
...
@@ -19,9 +20,9 @@ L.Draw.MarkerTextBox = L.Draw.Marker.extend({
...
@@ -19,9 +20,9 @@ L.Draw.MarkerTextBox = L.Draw.Marker.extend({
initialize
:
function
(
map
,
options
)
{
initialize
:
function
(
map
,
options
)
{
// important to have a unique type, so that it won't get mixed up with other elements
// important to have a unique type, so that it won't get mixed up with other elements
this
.
type
=
'
textbox
'
;
this
.
type
=
'
textbox
'
;
this
.
featureTypeCode
=
'
textbox
'
;
this
.
featureTypeCode
=
'
textbox
'
;
L
.
Draw
.
Feature
.
prototype
.
initialize
.
call
(
this
,
map
,
options
);
L
.
Draw
.
Feature
.
prototype
.
initialize
.
call
(
this
,
map
,
options
);
}
}
});
});
//Redefinitions d'éléments de DrawToolbar
//Redefinitions d'éléments de DrawToolbar
...
@@ -58,7 +59,7 @@ L.DrawToolbar.include ({
...
@@ -58,7 +59,7 @@ L.DrawToolbar.include ({
handler
:
new
L
.
Draw
.
Marker
(
map
,
this
.
options
.
marker
),
handler
:
new
L
.
Draw
.
Marker
(
map
,
this
.
options
.
marker
),
title
:
L
.
drawLocal
.
draw
.
toolbar
.
buttons
.
marker
title
:
L
.
drawLocal
.
draw
.
toolbar
.
buttons
.
marker
},{
},{
enabled
:
this
.
options
.
marker
,
enabled
:
this
.
options
.
marker
,
handler
:
new
L
.
Draw
.
MarkerTextBox
(
map
,
this
.
options
.
marker
),
handler
:
new
L
.
Draw
.
MarkerTextBox
(
map
,
this
.
options
.
marker
),
title
:
'
Write text
'
title
:
'
Write text
'
}];
}];
...
@@ -72,11 +73,10 @@ class DrawTools extends Component {
...
@@ -72,11 +73,10 @@ class DrawTools extends Component {
e
.
layer
.
remove
();
e
.
layer
.
remove
();
return
;
return
;
}
}
if
(
e
.
layerType
===
'
marker
'
)
{
if
(
e
.
layerType
===
'
textbox
'
)
{
e
.
layer
.
bindTooltip
(
'
say hello to mr. akers
'
);
e
.
layer
.
bindTooltip
(
'
say hello to mr. akers
'
,
{
permanent
:
true
}
);
}
}
let
type
=
e
.
layerType
;
// from the example; isn't used right now, but may be relevant in the future
let
layer
=
e
.
layer
;
let
layer
=
e
.
layer
;
let
geoJSON
=
layer
.
toGeoJSON
();
let
geoJSON
=
layer
.
toGeoJSON
();
console
.
log
(
JSON
.
stringify
(
geoJSON
,
null
,
4
));
// makes the output readable in the console
console
.
log
(
JSON
.
stringify
(
geoJSON
,
null
,
4
));
// makes the output readable in the console
}
}
...
...
This diff is collapsed.
Click to expand it.
src/icons/button-textbox.png
0 → 100644
+
0
−
0
View file @
1c8b7bdb
793 B
This diff is collapsed.
Click to expand it.
src/icons/nil.png
0 → 100644
+
0
−
0
View file @
1c8b7bdb
564 B
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