Saturday 29 April 2017

openlayers - Creating rectangle on centroid point by map click event ol5


I am trying to develop a web portal using ol5 API where user click on map and then it takes map click event coordinates as centroid of rectangle and create a rectangle of particular height and width.


Here is the code to create square


image: new ol.style.RegularShape({
fill: fill,

points: 4,
radius: 30,
angle: Math.PI / 4
})

But I want to create rectangle with center point, height and width. How to achieve this?




No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...