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
7ed2e9af
Commit
7ed2e9af
authored
May 25, 2018
by
Emmanuel René Huchim Puc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wkt format added
parent
90d4d639
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
7 deletions
+8
-7
openLayers4.js
catalog/static/js/openLayers4.js
+6
-5
sidtMap.js
catalog/static/js/sidtMap.js
+2
-2
No files found.
catalog/static/js/openLayers4.js
View file @
7ed2e9af
...
...
@@ -99,7 +99,7 @@ OpenStreetMapsClass.prototype.addPolygon = function(coords)
this
.
vectorLayer
.
getSource
().
addFeature
(
feature
);
// show coords
document
.
getElementById
(
"id_polygon"
).
value
=
feature
.
getGeometry
().
clone
().
transform
(
'EPSG:3857'
,
'EPSG:4326'
).
getCoordinates
(
);
this
.
showCoords
(
feature
.
getGeometry
()
);
}
//------------------------------------------------------------------------------
/**
...
...
@@ -153,14 +153,15 @@ OpenStreetMapsClass.prototype.formatCoords = function(coords)
}
//------------------------------------------------------------------------------
/**
* s
et value in input
with wkt format
* s
how values of a polygon
with wkt format
* POLYGON ((30 10, 40 40, 20 40, 10 20, 30 10))
* MULTIPOLYGON (((40 40, 20 45, 45 30, 40 40)),((20 35, 10 30, 10 10, 30 5, 45 20, 20 35),(30 20, 20 15, 20 25, 30 20)))
* @param
coords to draw
* @param
geometry the geometry to show e.g. a polygon
*/
OpenStreetMapsClass
.
prototype
.
s
etPolygonInputValue
=
function
(
coords
)
OpenStreetMapsClass
.
prototype
.
s
howCoords
=
function
(
geometry
)
{
// todo
var
wkt
=
new
ol
.
format
.
WKT
();
document
.
getElementById
(
"id_polygon"
).
value
=
wkt
.
writeGeometry
(
geometry
.
clone
().
transform
(
'EPSG:3857'
,
'EPSG:4326'
));
}
//------------------------------------------------------------------------------
/**
...
...
catalog/static/js/sidtMap.js
View file @
7ed2e9af
...
...
@@ -118,11 +118,11 @@ sidtMap.prototype.addInteraction = function()
});
this
.
interaction
.
on
(
"drawend"
,
function
(
e
){
document
.
getElementById
(
"id_polygon"
).
value
=
e
.
feature
.
getGeometry
().
clone
().
transform
(
'EPSG:3857'
,
'EPSG:4326'
).
getCoordinates
();
self
.
showCoords
(
e
.
feature
.
getGeometry
());
});
this
.
interaction
.
on
(
"drawstart"
,
function
(
e
){
self
.
vectorLayer
.
getSource
().
clear
();
self
.
removePolygon
();
});
this
.
map
.
addInteraction
(
this
.
interaction
);
...
...
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