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
15bb7498
Commit
15bb7498
authored
May 24, 2018
by
Renán Sosa Guillen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
polygon list view in map
parent
b4d09df6
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
104 additions
and
31 deletions
+104
-31
body.css
catalog/static/css/body.css
+75
-21
dataRetrieval.js
catalog/static/js/dataRetrieval.js
+21
-2
views.py
catalog/views.py
+8
-8
No files found.
catalog/static/css/body.css
View file @
15bb7498
...
@@ -23,38 +23,92 @@ body
...
@@ -23,38 +23,92 @@ body
background-color
:
#ec5a32
;
background-color
:
#ec5a32
;
}
}
ul
.no-bullet
{
/*--------option list classes--------*/
list-style
:
none
;
text-align
:
left
;
padding
:
0px
;
margin
:
0px
;
}
#option-list
{
#option-list
{
margin-top
:
3px
;
margin-top
:
3px
;
display
:
none
;
display
:
none
;
position
:
absolute
;
position
:
absolute
;
border-radius
:
3px
;
border-radius
:
3px
;
background-color
:
white
;
background-color
:
white
;
width
:
208px
;
/*width: 208px;*/
max-height
:
173px
;
/*max-height: 173px;*/
width
:
400px
;
max-height
:
541px
;
overflow
:
auto
;
overflow
:
auto
;
left
:
26px
;
left
:
26px
;
z-index
:
1
;
z-index
:
1
;
}
}
ul
.no-bullet
{
list-style
:
none
;
text-align
:
left
;
padding
:
0px
;
margin
:
0px
;
}
li
.pol
{
li
.pol
{
font
:
bold
13px
Helvetica
;
/*font: bold 13px Helvetica;*/
/*text-align: center;*/
/*text-decoration: none;*/
/*background-color: #EEEEEE;*/
/*color: #333333;*/
padding
:
5px
;
/*border-radius: 3px;*/
/*border-top: 1px solid #CCCCCC;*/
/*border-right: 1px solid #333333;*/
/*border-bottom: 1px solid #333333;*/
/*border-left: 1px solid #CCCCCC;*/
/*margin: 3px;*/
cursor
:
pointer
;
}
.box-header.with-border
{
border-bottom
:
1px
solid
#dc7828
;
text-align
:
center
;
text-align
:
center
;
text-decoration
:
none
;
}
background-color
:
#EEEEEE
;
color
:
#333333
;
.box.box-solid
{
padding
:
7px
;
border
:
1px
solid
#dc7828
;
}
.box.box-solid.box-warning
>
.box-header
{
color
:
#ffffff
;
background
:
#dc7828
;
background-color
:
#dc7828
}
.box
{
position
:
relative
;
border-radius
:
3px
;
border-radius
:
3px
;
border-top
:
1px
solid
#CCCCCC
;
background
:
#ffffff
;
border-right
:
1px
solid
#333333
;
border-top
:
3px
solid
#d2d6de
;
border-bottom
:
1px
solid
#333333
;
margin-bottom
:
0px
;
border-left
:
1px
solid
#CCCCCC
;
width
:
100%
;
margin
:
3px
;
box-shadow
:
0
1px
1px
rgba
(
0
,
0
,
0
,
0.1
);
cursor
:
pointer
;
}
.box-body
{
/*border-top-left-radius: 0;*/
/*border-top-right-radius: 0;*/
/*border-bottom-right-radius: 3px;*/
/*border-bottom-left-radius:3px;*/
padding-top
:
2px
;
padding-bottom
:
2px
;
padding-left
:
10px
;
}
.pol-title
{
font
:
bold
15px
Helvetica
;
text-decoration
:
none
;
}
.pol-body
{
font
:
11px
Helvetica
;
}
.pol-src
{
font
:
10px
Helvetica
;
font-style
:
italic
;
padding-left
:
280px
;
}
}
/*--------option list classes--------*/
\ No newline at end of file
catalog/static/js/dataRetrieval.js
View file @
15bb7498
...
@@ -62,7 +62,26 @@ var makeRequest = function (value) {
...
@@ -62,7 +62,26 @@ var makeRequest = function (value) {
}
}
data
.
polygonList
.
forEach
(
function
(
polygon
)
{
data
.
polygonList
.
forEach
(
function
(
polygon
)
{
$
(
'#polygon-list'
).
append
(
'<li onclick="drawPolygon(this)" id="'
+
polygon
.
id
+
'" class="pol">'
+
polygon
.
city
+
", "
+
polygon
.
state
+
'</li>'
);
// '<li onclick="drawPolygon(this)" id="'+ polygon.id +'" class="pol">' + polygon.city + ", " + polygon.state + '</li>'
var
html_element
=
'<li id="'
+
polygon
.
id
+
'" onclick="drawPolygon(this)" class="pol">'
+
'<div class="box box-warning box-solid">'
+
'<div class="box-header with-border">'
+
'<span class="pol-title">'
+
polygon
.
city
+
', '
+
polygon
.
state
+
'</span>'
+
'</div>'
+
'<div class="box-body">'
+
'<span class="pol-body">'
+
'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.'
+
'</span><br>'
+
'<div class="pol-src">'
+
'Fuente: INEGI.'
+
'</div>'
+
'</div>'
+
'</div>'
+
'</li>'
;
$
(
'#polygon-list'
).
append
(
html_element
);
});
});
if
(
OPT_LIST_IS_HIDDEN
)
{
if
(
OPT_LIST_IS_HIDDEN
)
{
...
@@ -85,7 +104,7 @@ function drawPolygon(element) {
...
@@ -85,7 +104,7 @@ function drawPolygon(element) {
// get the biggest area
// get the biggest area
var
biggest
=
osmap
.
getBiggestPolygon
(
coords
);
var
biggest
=
osmap
.
getBiggestPolygon
(
coords
);
// draw coords
// draw coords
R
osmap
.
addPolygon
(
biggest
);
osmap
.
addPolygon
(
biggest
);
}
}
})
})
...
...
catalog/views.py
View file @
15bb7498
...
@@ -55,8 +55,8 @@ class SearchSubmitView(View):
...
@@ -55,8 +55,8 @@ class SearchSubmitView(View):
# template = 'search_submit.html'
# template = 'search_submit.html'
state_parser
=
{
state_parser
=
{
'01'
:
"Aguascalientes"
,
'02'
:
"Baja California"
,
'03'
:
"Baja California Sur"
,
'04'
:
"Campeche"
,
'01'
:
"Aguascalientes"
,
'02'
:
"Baja California"
,
'03'
:
"Baja California Sur"
,
'04'
:
"Campeche"
,
'05'
:
"C
hiapas"
,
'06'
:
"Chihuahua"
,
'07'
:
"Ciudad de México"
,
'08'
:
"Coahuil
a"
,
'05'
:
"C
oahuila"
,
'06'
:
"Colima"
,
'07'
:
"Chiapas"
,
'08'
:
"Chihuahu
a"
,
'09'
:
"C
olima"
,
'10'
:
"Durango"
,
'11'
:
"Guanajuato"
,
'12'
:
"Guerrero"
,
'09'
:
"C
iudad de México"
,
'10'
:
"Durango"
,
'11'
:
"Guanajuato"
,
'12'
:
"Guerrero"
,
'13'
:
"Hidalgo"
,
'14'
:
"Jalisco"
,
'15'
:
"México"
,
'16'
:
"Michoacán"
,
'13'
:
"Hidalgo"
,
'14'
:
"Jalisco"
,
'15'
:
"México"
,
'16'
:
"Michoacán"
,
'17'
:
"Morelos"
,
'18'
:
"Nayarit"
,
'19'
:
"Nuevo León"
,
'20'
:
"Oaxaca"
,
'17'
:
"Morelos"
,
'18'
:
"Nayarit"
,
'19'
:
"Nuevo León"
,
'20'
:
"Oaxaca"
,
'21'
:
"Puebla"
,
'22'
:
"Querétaro"
,
'23'
:
"Quintana Roo"
,
'24'
:
"San Luis Potosí"
,
'21'
:
"Puebla"
,
'22'
:
"Querétaro"
,
'23'
:
"Quintana Roo"
,
'24'
:
"San Luis Potosí"
,
...
...
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