Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
GeoInt_SIDT
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Mario Chirinos Colunga
GeoInt_SIDT
Commits
34c5614e
Commit
34c5614e
authored
Oct 11, 2019
by
Emmanuel René Huchim Puc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
draw square/shift
parent
76f25be1
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
0 deletions
+18
-0
sidtMap.js
catalog/static/catalog/js/sidtMap.js
+17
-0
map.html
catalog/templates/map.html
+1
-0
No files found.
catalog/static/catalog/js/sidtMap.js
View file @
34c5614e
...
...
@@ -182,6 +182,23 @@ sidtMap.prototype.changeInteraction = function() {
this
.
map
.
addInteraction
(
this
.
interaction
);
}
// this shit is really hack hahahahah
sidtMap
.
prototype
.
listenShiftButton
=
function
()
{
inDown
=
(
evt
)
=>
{
if
(
evt
.
key
!=
"Shift"
||
evt
.
keyCode
!=
16
||
this
.
interaction
.
geometryFunction_
.
name
===
"r"
)
return
;
this
.
interaction
.
geometryFunction_
=
new
ol
.
interaction
.
Draw
.
createRegularPolygon
(
4
);
}
inUp
=
(
evt
)
=>
{
if
(
evt
.
key
!=
"Shift"
||
evt
.
keyCode
!=
16
||
this
.
interaction
.
geometryFunction_
.
name
===
"r"
)
return
;
this
.
interaction
.
geometryFunction_
=
new
ol
.
interaction
.
Draw
.
createRegularPolygon
(
4
,
Math
.
PI
/
4
);
};
document
.
addEventListener
(
'keydown'
,
inDown
);
document
.
addEventListener
(
'keyup'
,
inUp
);
}
//------------------------------------------------------------------------------
sidtMap
.
prototype
.
onMousemove
=
function
(
e
)
{
...
...
catalog/templates/map.html
View file @
34c5614e
...
...
@@ -380,6 +380,7 @@
var
osmap
=
new
sidtMap
(
"map"
,
-
89.63873079999999
,
21.0404457
,
7
);
osmap
.
geolocation
();
osmap
.
addInteraction
();
osmap
.
listenShiftButton
();
var
req_url
=
"{% url 'search-submit' %}"
;
// url for requesting polygon data
var
prod_req_url
=
"{% url 'productList' %}"
;
// url for requesting product data
...
...
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