PDA

View Full Version : Map in overlay or in another tab/windows ...



Riddler
24 Nov 2010, 1:24 AM
Hi to all,
I have a list visualized in a panel that contains header, content and footer ...

This lista became from this template


var Tpl = new Ext.XTemplate(
'<tpl for=".">',
'<div class="firstLine">',
'<div class="numberRS">{#}.</div><div class="rsName">{Nome}</div>',
'</div>',
'<div class="secondLine">',
'<div class="rsPhone">{Telefono}</div>',
'</div>',
'<div class="thirdLine">',
'<div class="rsAddress">{Indirizzo}</div><div class="rsDst">{Distanza}</div>',
'</div>',
'</tpl>');
How I cant add a link on a address for view my actual positione and the path to this address?

I have make an exapmle map:



function map() {
var position = new google.maps.LatLng(52.363441,4.889517);

var map = new Ext.Map({
useCurrentLocation: true,
mapOptions: {
navigationControl: true,
streetViewControl: true,
mapTypeControl: true,
center: position,
mapTypeId: google.maps.MapTypeId.ROADMAP,
zoom: 7
}
});

mapPanel = new Ext.Panel({
floating: true,
modal: true,
centered: true,
items: [map],
dockedItems: [{
dock: 'top',
xtype: 'toolbar',
title: 'Ristoranti'
}]
});

var rootPanel = new Ext.Panel({
fullscreen: true,
layout: 'card',
items: [mapPanel]
});

var marker = new google.maps.Marker({
position: position,
map: map.map,
title: 'Ristoranti'
});
}
My Panel:


panel = new Ext.Panel({
fullscreen: true,
scroll: 'vertical',
dockedItems: [
{
dock : 'top',
xtype: 'toolbar',
title: '<span id="#title">TITLE</span>'
},
{
dock : 'bottom',
xtype: 'panel',
items: [
slider
],
style: {
paddingLeft: '0px'
}
},
],

html: 'BODY SENCHA'
});
Where slider is a slider...

thanks

--
Riddler ?

Stuart-SwarmOnline
24 Nov 2010, 3:43 AM
To get directions between two points you'll need to delve into the Google Maps API and use some of their functionality. Don't know it off the top of my head but here's the link to the Docs...

http://code.google.com/apis/maps/documentation/javascript/reference.html

Riddler
25 Nov 2010, 1:45 AM
Thanks for your reply.

There isn't nothing about Ext.Map.Pah(from,to) ? or something else ...
=P~

Stuart-SwarmOnline
25 Nov 2010, 1:50 AM
hehe, sadly not.

Check out these links, might be of use...

http://stiern.com/tutorials/how-to-use-directions-with-google-maps-api-v3#directions

http://code.google.com/apis/maps/documentation/javascript/reference.html#DirectionsService

Riddler
25 Nov 2010, 1:57 AM
Thank you very much for the infos
;-)