-
10 Apr 2012 3:37 AM #1
Hello
Hello
I'm trying to display a marker within a map, in my panel, but it doesn't shows up , here is my code :
Ext.setup(
{
onReady: function(){
var pnl = new Ext.Panel({
layout:'fit',
fullscreen:true,
dockedItems:[
{
dock:'top',
xtype:'toolbar',
title:'Simple map',
}
],
items:[{
xtype:'map',
getLocation:true,
markers: [{
'lat': 42.339641,
'long': -71.094224,
marker: {title: 'Boston Museum of Fine Arts'}
}]
}
]
})
}
});
have you ever try to do the same thing as here?
-
10 Apr 2012 8:25 AM #2
In the future, please remember to post your code using CODE tags.
The following example should work for you. I've usually used the "maprender" listener to add markers after the render of the map.
Code:Ext.setup ({ onReady: function() { var pnl = new Ext.Panel ({ layout:'fit', fullscreen:true, dockedItems: [{ dock:'top', xtype:'toolbar', title:'Simple map', }], items: [{ xtype:'map', mapOptions: { zoom: 12, center: new google.maps.LatLng(42.339641, -71.094224) }, listeners: { maprender: function(mapcomp, map) { var marker = new google.maps.Marker ({ position: new google.maps.LatLng(42.339641, -71.094224), map: map, title: "Boston Museum of Fine Arts" }); } } }] }) } });Daniel Gallo
Sales Engineer EMEA
Sencha UK Ltd
-
10 Apr 2012 9:22 AM #3
Sorry for the code tags, and Thank you very much, now it is working very well !!


Reply With Quote