用于URL连接的Javascript语法

时间:2015-01-23 19:51:51

标签: javascript leaflet

我将数据从JSON文件中提取到地图和表单中。我想链接到新标签,其中包含指定位置的路线。我怎么写这个?

打开Yelp链接的工作代码:

<tr><th>Yelp</th><td><a class='url-break' href='" + feature.properties.YelpURL + "' target='_blank'>" + feature.properties.YelpURL + "</a></td></tr>

使用lat long

不能使用Google Directions的代码
<tr><th>Directio</th><td><a class='url-break' href='" + https://www.google.com/maps/dir/ + feature.properties.geo_longitude + feature.properties.geo_latitude + "' target='_blank'>" + Get Directions + "</a></td></tr>

The app in progress

1 个答案:

答案 0 :(得分:0)

报价位置错误,替换

<a class='url-break' href='" + https://www.google.com/maps/dir/ + feature.properties.geo_longitude + feature.properties.geo_latitude + "' target='_blank'>

<a class='url-break' href='https://www.google.com/maps/dir/" + feature.properties.geo_longitude +","+ feature.properties.geo_latitude + "' target='_blank'>
相关问题