加载完地图之后,调用这个函数:
function mapService() {
L.supermap.mapService(url).getMapInfo(function (serviceResult) {
var result = serviceResult.result;
var innerHTML = "("+resources.text_mapInfoPrint+")" + "<br><br>";
innerHTML += resources.text_mapName+":" + JSON.stringify(result.name, null, 2) + "<br>";
innerHTML += resources.text_center+":" + JSON.stringify(result.center, null, 2) + "<br>";
innerHTML += "Bounds:" + JSON.stringify(result.bounds, null, 2) + "<br>";
innerHTML+="没有了,就这些";
infoWin = L.popup({maxWidth: 400})
.setLatLng(map.getCenter())
.setContent(innerHTML)
.openOn(map);
});
}
但是预想的弹窗并没有出来,经过浏览器调试显示:
TypeError: targetScript is undefined[详细了解] localization.js:122:9
inputScript file:///D:/Start/js/localization.js:122
initializeI18N file:///D:/Start/js/localization.js:43
<anonymous> file:///D:/Start/text4.html:16
ReferenceError: resources is not defined
环境配置方面感觉没什么问题,调用地图也能显示出来,但是就是这个不行,