Google maps 如何将映射侦听器添加到映射页面

Google maps 如何将映射侦听器添加到映射页面,google-maps,sencha-touch,Google Maps,Sencha Touch,如何将映射侦听器添加到第一个映射页面? 我看到了许多创建地图并将其放入页面的示例,但在我的代码中,地图本身就是一个页面。 因此,我不知道如何以这种方式添加映射侦听器 Ext.define('myapp.view.Main', { extend: 'Ext.tab.Panel', xtype: 'main', fullscreen: true, requires: [ 'Ext.TitleBar', 'Ext.Video',

如何将映射侦听器添加到第一个映射页面? 我看到了许多创建地图并将其放入页面的示例,但在我的代码中,地图本身就是一个页面。 因此,我不知道如何以这种方式添加映射侦听器

Ext.define('myapp.view.Main', {
    extend: 'Ext.tab.Panel',
    xtype: 'main',
    fullscreen: true,
    requires: [
        'Ext.TitleBar',
        'Ext.Video',
        'Ext.Map',
        'Ext.Panel',
        'Ext.tab.*',
        'Ext.*'
    ],
    config: {
        tabBarPosition: 'bottom',

      items: [
            {
                title: 'WebTrack',
                iconCls:'maps',
                xtype: 'map',
                useCurrentLocation: true,
                store: 'my.store.appleStore',

            }
有人能帮忙吗


非常感谢

最后,我找到了答案

应采取的步骤:

  • 在控制器中创建贴图组件
  • Ext.define('myapp.controller.Noises'{ 扩展:“Ext.app.Controller”, 需要:['Ext.MessageBox'], 配置:{ 参考文献:{ mapComponent:'主地图' }, 控制:{ 地图组件:{ maprender:“onMaprender” } } },

  • 因此,onAppender是您可以开始编写代码的地方

    希望能有帮助


    干杯

    嗨,朋友们~~~欢迎提供任何意见/建议或答案~~请说点什么~~~