Uncaught InvalidValueError: setMap: not an instance of Map

前端 未结 7 1157
萌比男神i
萌比男神i 2021-02-19 12:23

when i used the sencha touch2.2.1,i met a question. In the viewer:

items: [{
    id: \'mapCanvas\',
    xtype:\'map\',
    useCurrentLocation: true,
}]


        
相关标签:
7条回答
  • 2021-02-19 13:15

    map is not an instance of google map .

    var map= Ext.getCmp('mapCanvas').getMap(); // add getMap() here to get the map instance
    console.dir(map);
    var marker= new google.maps.Marker({
        position: new google.maps.LatLng(25,118),
    });
    marker.setMap(map);
    
    0 讨论(0)
提交回复
热议问题