简体   繁体   中英

Coordinates to wkt OpenLayers

Hello friends, I need to convert the coordinates I received in my project with openlayers to wkt, I would appreciate it if you could help me.

Coordinate information I received:

(2) [32.834075024001905, 39.978537003695095]

have a look at https://openlayers.org/en/latest/apidoc/module-ol_format_WKT.html

your solution could look like this

var format = new ol.format.WKT(),
wkt = format.writeGeometry(yourFeature.getGeometry());

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM