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
7446daeb
Commit
7446daeb
authored
Oct 09, 2019
by
Emmanuel René Huchim Puc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
draw interaction changed
parent
52c8e359
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
60 additions
and
0 deletions
+60
-0
map.css
catalog/static/catalog/css/map.css
+13
-0
sidtMap.js
catalog/static/catalog/js/sidtMap.js
+41
-0
map.html
catalog/templates/map.html
+6
-0
No files found.
catalog/static/catalog/css/map.css
View file @
7446daeb
...
...
@@ -52,6 +52,19 @@ html, body
}
.drawControl
{
width
:
50px
;
height
:
50px
;
position
:
absolute
;
right
:
20px
;
/*270px*/
bottom
:
75px
;
z-index
:
1000
;
background-color
:
white
;
border-radius
:
5px
;
border
:
none
;
}
.iii
{
color
:
rgba
(
220
,
121
,
40
,
0.404
);
width
:
50px
;
...
...
catalog/static/catalog/js/sidtMap.js
View file @
7446daeb
...
...
@@ -134,6 +134,47 @@ sidtMap.prototype.addInteraction = function()
});
this
.
map
.
addInteraction
(
this
.
interaction
);
$
(
"#drawControl"
).
val
(
"Polygon"
);
}
sidtMap
.
prototype
.
changeInteraction
=
function
()
{
this
.
map
.
removeInteraction
(
this
.
interaction
);
var
self
=
this
;
var
drawValue
=
$
(
"#drawControl"
).
val
();
if
(
drawValue
!==
'Square'
)
{
this
.
interaction
=
new
ol
.
interaction
.
Draw
({
source
:
this
.
vectorLayer
.
getSource
(),
geometryFunction
:
new
ol
.
interaction
.
Draw
.
createRegularPolygon
(
4
),
features
:
this
.
features
,
type
:
"Circle"
});
$
(
"#drawControl"
).
val
(
"Square"
);
}
else
{
this
.
interaction
=
new
ol
.
interaction
.
Draw
({
source
:
this
.
vectorLayer
.
getSource
(),
features
:
this
.
features
,
type
:
"Polygon"
});
$
(
"#drawControl"
).
val
(
"Polygon"
);
}
this
.
interaction
.
on
(
"drawend"
,
function
(
e
){
self
.
showCoords
(
e
.
feature
.
getGeometry
());
let
processTreeview
=
$
(
'li.processTreeview a'
);
let
parentClassList
=
processTreeview
[
0
].
parentElement
.
classList
;
if
(
!
parentClassList
.
contains
(
'menu-open'
)){
processTreeview
.
click
();
}
});
this
.
interaction
.
on
(
"drawstart"
,
function
(
e
){
self
.
removePolygon
();
});
this
.
map
.
addInteraction
(
this
.
interaction
);
}
//------------------------------------------------------------------------------
sidtMap
.
prototype
.
onMousemove
=
function
(
e
)
...
...
catalog/templates/map.html
View file @
7446daeb
...
...
@@ -246,6 +246,12 @@
</div>
<!-- control de version de mapas -->
<!-- control para dibujar el poligono -->
<div
id=
"drawControl"
class=
"drawControl"
onclick=
"osmap.changeInteraction()"
>
<i
class=
"fas fa-draw-polygon fa-2x iii"
></i>
</div>
<!-- control para dibujar el poligono -->
<footer
class=
" page-footer font-small special-color-dark pt-5"
style=
"bottom: 0; position: absolute"
>
<!-- Footer Elements -->
<div
class=
"container"
>
...
...
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