PDA

View Full Version : Maps problems



Alessandro.Prandini
13 Jul 2010, 1:36 PM
Hi!
I have 2 big problems with map component:

1-If I open the small map and then I go to big one this is the result:
2143321432

If I open only the big, it's ok. Any ideas?

2- if I use a variable lat/lon as the center, the map doesn't appear, why? what's my fault?


mappopupPanel = new Ext.Panel({
floating: true,
modal: true,
width: 300,
height: 460,
centered: true,
styleHtmlContent: true,
data: null,
layout: 'fit',
cls: 'card',
items: [{
xtype: 'map',
title: 'Mappa',
mapOptions: {
center: new google.maps.LatLng(41.898249, 12.49100),
//center: new google.maps.LatLng(selectedLocale.lat, selectedLocale.lon),
zoom: 15
},
listeners: {
beforeshow: function(el){

var marker=new google.maps.Marker({
map: el.map,
position: new google.maps.LatLng(selectedLocale.lat, selectedLocale.lon)
});

var infowindow = new google.maps.InfoWindow({
content: selectedLocale.nome
})

google.maps.event.addListener(marker, 'click', function() {
infowindow.open(el.map, marker);
});
}
}
}]

});Thanks.

Alessandro.Prandini
14 Jul 2010, 12:22 PM
Anyone can help me?

TommyMaintz
14 Jul 2010, 1:29 PM
You only pasted the source code that opens the small map. This works (like you said). Would it be possible to provide the complete source code that shows the problem?

Alessandro.Prandini
14 Jul 2010, 1:47 PM
The code I have posted gives me a problem for the "center" attribute:
if I use 2 variables for latlong the app crashes, but that variables are right because I use them for the marker (in the listeners->beforeshow event). Why?

This is the panel of the big one, are you asking me that?


mapPanel = new Ext.Panel({
layout: {
type: 'vbox',
pack: 'center'
},
iconCls: "map",
title: "Mappa",
items: [{
xtype: 'map',
title: 'Mappa',
//maskMap: true,
mapOptions: {
center: new google.maps.LatLng(41.898249, 12.49100),
//disableDefaultUI: true,
zoom: 15
}
//getLocation: true
}]
});

Thank you very much!

Alessandro.Prandini
15 Jul 2010, 12:42 PM
If I open the big one (from the main panel, opened by bottom button group) then the popup map seems not good:

21477

Please help me!