PDA

View Full Version : Google Maps



Voles
25 Mar 2011, 12:50 AM
Hello!

I have a MapPanel. When I show the panel, everything is fine, but when I put the panel as an item in a TabPanel. it seems like the map won't show anything.

I hope anyone can help me with this!

This is the code for the MapPanel:


Stick.views.Map = Ext.extend(Ext.Panel,
{
layout: 'fit',

initComponent: function ()
{
// store is ready
if (Stick.storesLoaded)
{
// map
var map = new Ext.Map({
fullscreen: true,
title: 'Map',
getLocation: true,
mapOptions:
{
zoom: 15
},
useCurrentLocation: true
});

Stick.stores.sightstore.each(function (e){
var position = new google.maps.LatLng(e.data.lat, e.data.lon);

var marker = new google.maps.Marker({
map: map.map,
position: position,
icon: Stick.configs.iconUrls + e.data.category_slug + '.' + e.data.category_extention
});

});

// items
this.items = [map];
}

Stick.views.Map.superclass.initComponent.apply(this, arguments);
}
});


And this is the TabPanel:


Stick.views.MainPanel = Ext.extend(Ext.TabPanel, {
ui: 'toolbar',
tabBar: new Ext.TabBar({
dock: 'bottom',
height: 93
}),
items:
[
{
title: 'Kaart',
items: [
new Stick.views.Map()
]
},
{
title: 'Route',
items: [
new Stick.views.RoutePanel()
]
},
{
title: 'Reviews',
badgeText: 1,
items: [
new Stick.views.Map()
]
}
]
});


Thanks a lot!

optiplex
25 Mar 2011, 4:17 AM
hello everyone
after searching i find it but my problem is still please argument on this subject.

Voles
25 Mar 2011, 4:45 AM
I'm sorry, but what do You mean by that?