MQA.withModule('shapes',function()不起作用

时间:2018-04-10 06:07:39

标签: javascript mapquest

我的代码(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&center=18.582883,73.689473:43
Uncaught TypeError: map.addShape is not a function at mapQuestHelper.js:14 at Au
(mqa.toolkit.js?key=7&center=18.582883,73.689473:43) at mqa.toolkit.js?key=7&center=18.582883,73.689473:43
at Object.At [as _moduleLoaded] (mqa.toolkit.js?key=7&center=18.582883,73.689473:43)
at mqa.module.shapes.js?1523335650918,1:1 at Au (mqa.toolkit.js?key=7&center=18.582883,73.689473:43)
at mqa.toolkit.js?key=7&center=18.582883,73.689473:43
at Object.At [as _moduleLoaded] (mqa.toolkit.js?key=7&center=18.582883,73.689473:43)
at mqa.module.graphics.js?1523335651508,2:72 at Au (mqa.toolkit.js?key=7&center=18.582883,73.689473:43)

0 个答案:

没有答案