Sapui5 如何替换不推荐使用的jQuery函数?

Sapui5 如何替换不推荐使用的jQuery函数?,sapui5,amd,Sapui5,Amd,我正在尝试使用formatter.js在我的UI5应用程序中显示地图,我需要将地址与地图URL放在一起。 在旧世界中,代码应如下所示: formatMapUrl:函数(sStreet、sZIP、sCity、scontry){ 返回“https://maps.googleapis.com/maps/api/staticmap?zoom=13&size=640x640&markers=" +jQuery.sap.encodeURL(sStreet+,“+sZIP+”,“+sCity+”,“+scon

我正在尝试使用formatter.js在我的UI5应用程序中显示地图,我需要将地址与地图URL放在一起。
在旧世界中,代码应如下所示:

formatMapUrl:函数(sStreet、sZIP、sCity、scontry){
返回“https://maps.googleapis.com/maps/api/staticmap?zoom=13&size=640x640&markers="
+jQuery.sap.encodeURL(sStreet+,“+sZIP+”,“+sCity+”,“+scontry);
},

我应该如何替换不推荐使用的函数?我应该在哪里添加新代码?

如果您查看API文档,您会看到它说明现在要使用模块

文档中的使用示例:

sap.ui.require([“sap/base/security/encodeURL”],函数(encodeURL){
var sEncoded=encodeURL(“a/b?c=d&e”);
console.log(sEncoded);//a%2fb%3fc%3dd%26e
});
formatter.js中的用法:

sap.ui.define([
“sap/base/security/encodeURL”
],函数(编码URL){
“严格使用”;
返回{
formatMapUrl:函数(sStreet、sZIP、sCity、Scontry){
var sBaseUrl=”https://maps.googleapis.com/maps/api/staticmap?zoom=13&size=640x640&markers=";
var sEncodedString=encodeURL(sStreet+,“+sZIP+”,“+sCity+”,“+scontry);
返回sBaseUrl+sEncodedString;
}
};
});