我将数据从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>
答案 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'>