openlayers 3 - Show area cover based on lineString -
what trying display area covered someone. example search team walks through field, person see 50m either way. want display polygon width of 100m , length of path has been walked. need both display graphically , in area measurement.
the best idea have implement create line string , create polygon somehow setting points 90 degrees line of point point b. this:
| | | | point +-----------------+ point b | | | |
however, have no idea how angle line in order find coordinates create polygon. know of way this?
i found solution eventually. need use ol.geom.polygon.fromcircle
. if set number of points 2 give horizontal line can rotate heading direction.
var thecircle = new ol.geom.circle(themarker.getcoordinates(), radius); var polycircle = new ol.geom.polygon.fromcircle(thecircle, 2, heading); var polycirclecoords = polycircle.getcoordinates();
Comments
Post a Comment