function readFeatureByWKT(wkt, sourceCode, targetCode) {
try {
var view = map.getView();
if (!wkt) {
return null;
}
var format = new ol.format.WKT();
var feature = format.readFeature(wkt, {
featureProjection: targetCode || view.getProjection(),
dataProjection: sourceCode || view.getProjection(),
});
return feature;
} catch (e) {
return null;
}
}