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
608400b6
Commit
608400b6
authored
Jul 07, 2020
by
Emmanuel René Huchim Puc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
git status
parent
bfe050b4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
4 deletions
+28
-4
dataRetrieval.js
catalog/static/catalog/js/dataRetrieval.js
+3
-4
openLayers4.js
catalog/static/catalog/js/openLayers4.js
+25
-0
No files found.
catalog/static/catalog/js/dataRetrieval.js
View file @
608400b6
...
...
@@ -168,11 +168,10 @@ function drawPolygon(element) {
var
input_text
=
polygon
.
city
;
if
(
polygon
.
geojson
.
properties
.
NOMGEO
!=
"Ciudad de México"
&&
polygon
.
geojson
.
geometry
)
{
var
coords
=
osmap
.
formatCoords
(
polygon
.
geojson
.
geometry
.
coordinates
);
if
(
polygon
.
geojson
.
geometry
)
{
//var coords = osmap.formatCoords(polygon.geojson.geometry.coordinates);
// var biggest = osmap.getBiggestPolygon(coords);
osmap
.
add
Polygon
(
coords
);
osmap
.
add
GeoJson
(
polygon
.
geojson
);
input_text
+=
", "
+
polygon
.
state
}
else
{
osmap
.
addWKTPolygon
(
polygon
.
wkt_polygon
);
...
...
catalog/static/catalog/js/openLayers4.js
View file @
608400b6
...
...
@@ -124,6 +124,31 @@ OpenStreetMapsClass.prototype.addPolygon = function(coords)
this
.
showCoords
(
feature
.
getGeometry
());
}
//------------------------------------------------------------------------------
/**
* Draw a polygon in the map
* @param geojsonObject geojson to draw
*/
OpenStreetMapsClass
.
prototype
.
addGeoJson
=
function
(
geojsonObject
)
{
// create source
var
format
=
new
ol
.
format
.
GeoJSON
({
dataProjection
:
'EPSG:4326'
,
featureProjection
:
"EPSG:3857"
});
// create feature
var
feature
=
format
.
readFeature
(
geojsonObject
);
// fit zoom with animation,
this
.
map
.
getView
().
fit
(
feature
.
getGeometry
(),
{
duration
:
1000
,
padding
:
[
0
,
0
,
70
,
0
]});
// add feature to map
this
.
vectorLayer
.
getSource
().
addFeature
(
feature
);
// show coords
this
.
showCoords
(
feature
.
getGeometry
());
}
//----------
//------------------------------------------------------------------------------
/**
* Draw a polygon in the map
* @param wkt coords int wkt format to draw
...
...
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