您好,您那边用openlayer的地图框架用classic的接口构造矢量对象然后序列化? 您这个方式不太友好。建议使用什么地图框架就用该地图框架的构造方式构建要素。原生openlayer方法提供了序列化的方式,第一个是读序列,第二个是将features写成geojson对象
let feas= (new ol.format.GeoJSON()).readFeatures(serviceResult.result.features);
let format=new ol.format.GeoJSON();
console.log(format.writeFeaturesObject(feas)) ;
如果您那边非得使用,可以引入<script type="text/javascript" src="
https://iclient.supermap.io/web/libs/iclient8c/libs/SuperMap-8.1.1-17729.js"></script>,然后用如下代码
var pointFeature = new SuperMap.Feature.Vector(point);
var format=new SuperMap.Format.JSON();
let json= format.write(pointFeature)
console.log(json,'pointFeature')