Google maps 森查触摸酒店;谷歌地图API——如何以列表的形式呈现方向?
全部, 我正在尝试显示来自Google maps 森查触摸酒店;谷歌地图API——如何以列表的形式呈现方向?,google-maps,extjs,sencha-touch,Google Maps,Extjs,Sencha Touch,全部, 我正在尝试显示来自Google.maps.DirectionsService.route()的结果的文本版本。我正在传递DirectionsRenderclass a DOM节点——一个DIV——让它将文本呈现给它,但我得到的是一个空白页。有人知道如何将Ext.Panel传递到DirectionsRenderer并使其进行渲染吗?以下是我目前的尝试: plotDirections: function(directionsResult, status) { if (status
Google.maps.DirectionsService.route()
的结果的文本版本。我正在传递DirectionsRender
class a DOM节点——一个DIV——让它将文本呈现给它,但我得到的是一个空白页。有人知道如何将Ext.Panel传递到DirectionsRenderer
并使其进行渲染吗?以下是我目前的尝试:
plotDirections: function(directionsResult, status) {
if (status != this.ROUTING_STATUS_OK) {
log.debug("routing blew up: " + status);
Ext.Msg.alert('Routing Error', 'Couldn\'t route: ' + status, Ext.emptyFn);
return;
}
var targetListDiv = this.directionsList.getEl().dom;
this.directionsRenderer = new google.maps.DirectionsRenderer({
map:this.nearMeMap.map,
directions:directionsResult,
suppressMarkers:true,
panel:targetListDiv
});
this.showDirectionsList();
log.debug(targetListDiv.outerHTML);
}
谢谢你的帮助
PS:我搜索了Sencha论坛,但是,主啊,它们没用吗。不仅如此,如果我每15秒执行一次以上的搜索,就会收到一条错误消息——我不允许一次执行那么多。怎么了,嘿?而且,你在表格上写的任何帖子都必须得到批准。得到问题的答案是愚蠢的。
我可以通过以下方式获得要渲染的文本:
面板代码:
{
xtype: 'panel',
flex: 1,
html: '<div id="directionsTextHTML"></div>',
id: 'directionsText',
scrollable: true
}
我的解决方法是从路由的分支抓取各个步骤,然后调用
panel.update(steps)
如下:`this.directionsPanel.update(directionsResult.routes[0].legs[0].steps)<代码>。该模板如下所示:var tpl=new Ext.XTemplate(“”,{instructions}{distance.text}’,“”);`。如有其他建议,我们将不胜感激。
directionsService.route(request, function(response, dstatus) {
if (dstatus == google.maps.DirectionsStatus.OK) {
directionsDisplay.setDirections(response);
directionsDisplay.setMap(mapRef.getMap());
directionsDisplay.setPanel(document.getElementById('directionsTextHTML'));
}