Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
V
VIPSLogic
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
VIPS
VIPSLogic
Commits
b33f8b60
Commit
b33f8b60
authored
8 years ago
by
Tor-Einar Skog
Browse files
Options
Downloads
Patches
Plain Diff
Button layout fix
When search text is empty, hide result list
parent
3e60232d
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main/webapp/map_applications/fireblight/index.html
+60
-6
60 additions, 6 deletions
src/main/webapp/map_applications/fireblight/index.html
src/main/webapp/map_applications/fireblight/js/map.js
+19
-1
19 additions, 1 deletion
src/main/webapp/map_applications/fireblight/js/map.js
with
79 additions
and
7 deletions
src/main/webapp/map_applications/fireblight/index.html
+
60
−
6
View file @
b33f8b60
...
...
@@ -15,7 +15,8 @@
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
<link
href=
"/css/3rdparty/ol.css"
rel=
"stylesheet"
media=
"screen"
/>
<link
rel=
"stylesheet"
href=
"/css/3rdparty/font-awesome.min.css"
media=
"screen"
/>
<link
rel=
"stylesheet"
href=
"/css/3rdparty/ol.css"
media=
"screen"
/>
<style
type=
"text/css"
>
html
,
body
,
#map
{
margin
:
0
;
...
...
@@ -59,11 +60,29 @@
{
top
:
auto
;
right
:
0.5em
;
bottom
:
8
.0em
;
bottom
:
10
.0em
;
left
:
auto
;
z-index
:
1000
;
}
#registerButton
{
top
:
auto
;
bottom
:
12.0em
;
right
:
0.5em
;
left
:
auto
;
z-index
:
1000
;
}
#registerButton
button
{
width
:
1.375em
;
height
:
1.375em
;
background-size
:
20px
20px
;
background-repeat
:
no-repeat
;
background-position
:
2px
2px
;
background-color
:
rgba
(
0
,
60
,
136
,
.5
);
border
:
none
;
color
:
white
;
}
.geo-location
button
{
...
...
@@ -135,6 +154,30 @@
#legend
{
display
:
none
;
}
}
@media
(
pointer
:
coarse
)
{
#registerButton
button
,
.geo-location
button
{
width
:
1.8em
;
height
:
1.8em
;
}
#registerButton
{
bottom
:
13.0em
;
}
.geo-location
button
{
bottom
:
8.0em
;
background-position
:
6px
;
}
}
@media
(
max-height
:
500px
)
{
#legend
{
display
:
none
;
}
}
ul
.resultList
...
...
@@ -180,7 +223,12 @@
<body>
<div
id=
"map"
class=
"map"
>
<div
class=
"geo-location ol-unselectable ol-control"
><button
onclick=
"navToLocation();"
title=
"Finn min posisjon"
></button></div>
<div
class=
"geo-location ol-unselectable ol-control"
>
<button
onclick=
"navToLocation();"
title=
"Finn min posisjon"
></button>
</div>
<div
id=
"registerButton"
class=
"ol-unselectable ol-control"
>
<button
type=
"button"
onclick=
"toggleRegistration(this);"
title=
"Registrering er AV"
><i
class=
"fa fa-pencil"
aria-hidden=
"true"
></i></button>
</div>
</div>
<div
id=
"searchFieldContainer"
>
<div
id=
"searchFieldInnerContainer"
>
...
...
@@ -212,9 +260,9 @@
<li
class=
"paere"
>
Pære
</li>
<li
class=
"plante"
>
Annet
</li>
</ul>
</div>
</div>
<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
...
...
@@ -243,9 +291,15 @@
var
phrase
=
inputField
.
value
;
if
(
phrase
.
trim
().
length
>
2
)
{
console
.
log
(
phrase
);
//
console.log(phrase);
$
.
getJSON
(
"
https://ws.geonorge.no/SKWS3Index/ssr/sok?navn=
"
+
phrase
+
"
*&maxAnt=5&tilSosiKoordSyst=4258&fylkeKommuneListe=&eksakteForst=true
"
,
renderResults
);
}
else
if
(
phrase
.
trim
().
length
===
0
)
{
var
searchResultsEl
=
document
.
getElementById
(
"
searchResults
"
);
searchResultsEl
.
innerHTML
=
""
;
searchResultsEl
.
style
.
display
=
"
none
"
;
}
}
var
renderResults
=
function
(
data
)
{
...
...
This diff is collapsed.
Click to expand it.
src/main/webapp/map_applications/fireblight/js/map.js
+
19
−
1
View file @
b33f8b60
...
...
@@ -4,6 +4,9 @@ var map, featureOverlay, newFeatureOverlay;
// Override localization settings for this particular web page
var
hardcodedLanguage
=
"
nb
"
;
// If false, touching map will not create a new item
var
registration
=
false
;
function
initMap
()
{
// OpenStreetMap background layer
...
...
@@ -194,7 +197,7 @@ var styles = {
vectorSource
.
addFeature
(
fakeFeature
);
displayFeature
(
feature
);
}
else
else
if
(
registration
)
{
var
newFeature
=
createFeature
(
map
.
getCoordinateFromPixel
(
evt
.
pixel
));
vectorSource
.
addFeature
(
newFeature
);
...
...
@@ -204,6 +207,21 @@ var styles = {
}
function
toggleRegistration
(
theButton
)
{
if
(
registration
)
{
theButton
.
title
=
"
Registrering er AV
"
;
theButton
.
style
.
color
=
"
white
"
;
}
else
{
theButton
.
title
=
"
Registrering er PÅ
"
;
theButton
.
style
.
color
=
"
red
"
;
}
registration
=
!
registration
;
}
/**
* Creates a new feature
* @param {type} coordinate
...
...
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