Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Eric Duminil
RegionChooser
Commits
174696f3
Commit
174696f3
authored
Oct 10, 2022
by
Eric Duminil
Browse files
copy clipboard info
parent
b4fcbe2a
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/main/resources/eu/simstadt/regionchooser/website/script/simstadt_openlayers.js
View file @
174696f3
...
@@ -271,13 +271,13 @@ var regionChooser = (function(){
...
@@ -271,13 +271,13 @@ var regionChooser = (function(){
var
area
=
Math
.
abs
(
wgs84Sphere
.
geodesicArea
(
coordinates
));
var
area
=
Math
.
abs
(
wgs84Sphere
.
geodesicArea
(
coordinates
));
//NOTE: Could show m², ha or km² depending on magnitude
//NOTE: Could show m², ha or km² depending on magnitude
dataPanel
.
append
(
"
<h3 class='clean'>Area :
"
+
(
area
/
10000
).
toFixed
(
1
)
+
"
ha
\n
"
);
dataPanel
.
append
(
"
<h3 class='clean'>Area :
"
+
(
area
/
10000
).
toFixed
(
1
)
+
"
ha
\n
"
);
dataPanel
.
append
(
'
<button type="button" onclick="regionChooser.copyCoordinatesToClipboard()" id="get_wgs84">Copy coordinates</button><br/>
\n
'
)
dataPanel
.
append
(
'
<div style="visibility:hidden" id="download_region">
'
+
dataPanel
.
append
(
'
<div style="visibility:hidden" id="download_region">
'
+
'
<button type="button" onclick="regionChooser.downloadFromSelectedCityGMLs()" id="download_region_button" disabled>Download Region</button><br/>
\n
'
+
'
<button type="button" onclick="regionChooser.downloadFromSelectedCityGMLs()" id="download_region_button" disabled>Download Region</button><br/>
\n
'
+
'
<a href="#" onclick="regionChooser.checkCityGMLS(true);">(Select All)</a>
\n
'
+
'
<a href="#" onclick="regionChooser.checkCityGMLS(true);">(Select All)</a>
\n
'
+
'
<a href="#" onclick="regionChooser.checkCityGMLS(false);">(Select None)</a>
\n
'
+
'
<a href="#" onclick="regionChooser.checkCityGMLS(false);">(Select None)</a>
\n
'
+
'
</div>
\n
'
);
'
</div>
\n
'
);
findIntersections
();
findIntersections
();
dataPanel
.
append
(
'
<button type="button" onclick="regionChooser.copyCoordinatesToClipboard()" id="get_wgs84">Copy coordinates</button><br/>
\n
'
)
}
}
draw
.
on
(
'
drawend
'
,
function
()
{
draw
.
on
(
'
drawend
'
,
function
()
{
...
@@ -398,7 +398,6 @@ var regionChooser = (function(){
...
@@ -398,7 +398,6 @@ var regionChooser = (function(){
if
(
window
.
clipboardData
&&
window
.
clipboardData
.
setData
)
{
if
(
window
.
clipboardData
&&
window
.
clipboardData
.
setData
)
{
// Internet Explorer-specific code path to prevent textarea being shown while dialog is visible.
// Internet Explorer-specific code path to prevent textarea being shown while dialog is visible.
return
window
.
clipboardData
.
setData
(
"
Text
"
,
text
);
return
window
.
clipboardData
.
setData
(
"
Text
"
,
text
);
}
}
else
if
(
document
.
queryCommandSupported
&&
document
.
queryCommandSupported
(
"
copy
"
))
{
else
if
(
document
.
queryCommandSupported
&&
document
.
queryCommandSupported
(
"
copy
"
))
{
var
textarea
=
document
.
createElement
(
"
textarea
"
);
var
textarea
=
document
.
createElement
(
"
textarea
"
);
...
@@ -407,7 +406,9 @@ var regionChooser = (function(){
...
@@ -407,7 +406,9 @@ var regionChooser = (function(){
document
.
body
.
appendChild
(
textarea
);
document
.
body
.
appendChild
(
textarea
);
textarea
.
select
();
textarea
.
select
();
try
{
try
{
return
document
.
execCommand
(
"
copy
"
);
// Security exception may be thrown by some browsers.
document
.
execCommand
(
"
copy
"
);
// Security exception may be thrown by some browsers.
dataPanel
.
append
(
"
<h2 class='ok'>Coordinates copied to clipboard!</h2><br/>
\n
"
);
return
;
}
}
catch
(
ex
)
{
catch
(
ex
)
{
console
.
warning
(
"
Copy to clipboard failed.
"
,
ex
);
console
.
warning
(
"
Copy to clipboard failed.
"
,
ex
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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