Skip to content

getMap() is undefined #17

Description

@AnkitDesai11

I have migrated from Google Map api v2 to v3. When I try to call getMap() on gmaappanel to pass to markercluster, I am not getting Map object. I have updated GMapPanel3.js and v3 url. If I don't do clustering of marker than it works fine as I am n't extracting Map object from GmapPanel. Code is as below.

Ext.create('Ext.Viewport', {
id:'viewport',
title: 'Site Register',
layout: 'border',
items: [
{
region: 'west',
title: '',
id:'searchPanel',
split:true,
width:600,
autoScroll:true,
items:[
{
xtype :'panel',
id :'inboxListPanel',
emptyText: 'No records',
title : 'Inbox',
collapsible: true,
draggable: true,
style :'text-align:center',
items : [grid]
}
]
},{
region: 'center',
id: 'mainPanel',
deferredRender: false,
items: [
Ext.create("Ext.tab.Panel", {
region: 'center',
id:'mapPanel',
width:'100%',
activeTab: 0,
items: [{
xtype: 'gmappanel',
title: 'Map',
id : 'gSiteMap',
width:900,
height:850,
zoomLevel: 5,
gmapType: 'map',
mapConfOpts: ['enableScrollWheelZoom','enableDoubleClickZoom','enableDragging'],
mapControls: ['GSmallMapControl','GMapTypeControl','NonExistantControl'],
setCenter: {
geoCodeAddr: '1600 Penn St, Washington DC, DC',
marker:{ title: 'HQ, Washington DC DC'}
}
}]
}]
});

var gmp = Ext.getCmp('gSiteMap');
var gm = gmp.getMap(); <----------------- gm is undefined !

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions