Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Eric Duminil
RegionChooser
Commits
1f678d58
Commit
1f678d58
authored
Sep 29, 2022
by
Eric Duminil
Browse files
Just an example with radio buttons
parent
cb90b14b
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/main/resources/eu/simstadt/regionchooser/website/script/simstadt_openlayers.js
View file @
1f678d58
...
...
@@ -9,6 +9,22 @@ var regionChooser = (function(){
$
(
"
html
"
).
addClass
(
"
wait
"
);
}
// Hash function
const
cyrb53
=
(
str
,
seed
=
0
)
=>
{
let
h1
=
0xdeadbeef
^
seed
,
h2
=
0x41c6ce57
^
seed
;
for
(
let
i
=
0
,
ch
;
i
<
str
.
length
;
i
++
)
{
ch
=
str
.
charCodeAt
(
i
);
h1
=
Math
.
imul
(
h1
^
ch
,
2654435761
);
h2
=
Math
.
imul
(
h2
^
ch
,
1597334677
);
}
h1
=
Math
.
imul
(
h1
^
(
h1
>>>
16
),
2246822507
)
^
Math
.
imul
(
h2
^
(
h2
>>>
13
),
3266489909
);
h2
=
Math
.
imul
(
h2
^
(
h2
>>>
16
),
2246822507
)
^
Math
.
imul
(
h1
^
(
h1
>>>
13
),
3266489909
);
return
4294967296
*
(
2097151
&
h2
)
+
(
h1
>>>
0
);
};
var
osm_layer
=
new
ol
.
layer
.
Tile
({
source
:
new
ol
.
source
.
OSM
()
});
...
...
@@ -160,7 +176,8 @@ var regionChooser = (function(){
link
+=
"
<a href=
\"
#
\"
onclick=
\"
regionChooser.downloadRegionFrom
"
+
feature
[
"
source
"
]
+
"
(
"
+
feature
.
getId
()
+
"
);return false;
\"
>
"
+
feature
[
"
name
"
]
+
"
</a>
"
;
}
else
{
link
+=
feature
[
'
name
'
];
h
=
cyrb53
(
feature
[
'
name
'
]);
link
+=
'
<input type="checkbox" id="check
'
+
h
+
'
"><label for="check
'
+
h
+
'
">
'
+
feature
[
'
name
'
]
+
'
</label>
'
;
}
link
+=
"
(
"
+
citygml_percentage
+
"
%
"
;
...
...
src/main/resources/eu/simstadt/regionchooser/website/style/style.css
View file @
1f678d58
...
...
@@ -130,10 +130,6 @@ div#dataPanel li {
line-height
:
1
;
}
div
#side
input
{
width
:
90%
;
}
div
#side
input
.navi
{
font-size
:
18px
;
height
:
30px
;
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment