PDA

View Full Version : Display map marker problem



myput
27 Oct 2011, 1:22 AM
Hello, i have a problem with my map, i can display a map with this this function:



WPApp.views.CarteButton = Ext.extend(Ext.Panel,{
layout: 'fit',
dockedItems: [WPApp.views.CarteButtonToolbar],
initComponent: function(){
this.map = new Ext.Map ({
useCurrentLocation: true,
mapOptions: {
zoom: 11,
navigationControlOptions: {
style: google.maps.NavigationControlStyle.DEFAULT
}
},
listeners: {
afterrender: function(map){
var geo = new Ext.util.GeoLocation({
accuracy: 1,
autoUpdate: true,
listeners: {
locationupdate: function(geo) {
center = new google.maps.LatLng(geo.latitude, geo.longitude);
zoom = 11;
if(map.rendered){
map.update(center);
}else{
map.on('activate', map.onUpdate, map, {single: true, data: center});
}
}
}
});
geo.updateLocation();
},
}
});
this.items = this.map;
WPApp.views.CarteButton.superclass.initComponent.apply(this, arguments);
}
});




But i would like to give longitude and latitude from list store ....
I don't know the way ...
Have you an idea?



WPApp.views.ResultPanelList = new Ext.List ({
fullscreen: true,
scroll: 'vertical',
itemTpl: loadURL(WPApp.config.host + WPApp.config.SearchTPL + 'SearchDirectoryListPanel.html'),
itemSelector: 'div.SearchDirectoryListPanel',
singleSelect: true,
store: WPApp.stores.ResultPanelListStore,
listeners: {
itemtap: function(view, index) {
var record = WPApp.stores.ResultPanelListStore.getAt(index);
// Data i would like to give is record.data.longitude and latitude
WPApp.views.SearchPanel.setActiveItem(WPApp.views.ResultPanelDetail, {animation: {type:'flip'}});
}
}
});


Thanks for help