我的代码(mapQuestHelper.js)
function initializeMapQuest(key, holderDiv, centerX, centerY) {
L.mapquest.key = key;
var map = L.mapquest.map(holderDiv,
{ center : [ centerX, centerY ],
layers : L.mapquest.tileLayer('map'),
zoom : 6 });
MQA.withModule('shapes', function() {
var line = new MQA.LineOverlay();
line.shapePoints = [ 39.633041, -105.318492, 39.847136, -104.674787 ];
map.addShape(line);
});
return map ;
}
错误
mqa.toolkit.js?key=7¢er=18.582883,73.689473:43
Uncaught TypeError: map.addShape is not a function at mapQuestHelper.js:14 at Au
(mqa.toolkit.js?key=7¢er=18.582883,73.689473:43) at mqa.toolkit.js?key=7¢er=18.582883,73.689473:43
at Object.At [as _moduleLoaded] (mqa.toolkit.js?key=7¢er=18.582883,73.689473:43)
at mqa.module.shapes.js?1523335650918,1:1 at Au (mqa.toolkit.js?key=7¢er=18.582883,73.689473:43)
at mqa.toolkit.js?key=7¢er=18.582883,73.689473:43
at Object.At [as _moduleLoaded] (mqa.toolkit.js?key=7¢er=18.582883,73.689473:43)
at mqa.module.graphics.js?1523335651508,2:72 at Au (mqa.toolkit.js?key=7¢er=18.582883,73.689473:43)