google-maps - KML 中地标内的 href 标记未显示
问题描述
我正在创建一个地图,Placemarks
其中有许多描述是以编程方式生成的。HTML 格式有效,我正在使用该CDATA
属性,但由于某种原因href
标签不起作用?
理想情况下,它显示为普通的超链接。比如,
这是 KML 文件中的代码
<a href="https://www.facebook.com/sharer/sharer.php?">Facebook</a><br>
这是怎么回事..?有没有办法来解决这个问题?
例子:
<Placemark>
<name>Dhaba 1376 North Indian cuisine</name>
<description><![CDATA[Address:<br>#04-64 Blk144 Upper Bukit Timah Rd, Beauty World Hawker Centre 588177<br><br>Opening Hours:<br>Open everyday except Monday afternoon, 11am to 10pm<br><br>Shop Recommendations:<br>Mixed Kebab Platter<br><br>Other Details:<br><br><br>Contributor:<br>OldieGoodieHawker<br><br>Share your support for this stall!:<a href="https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fhawker.help"e=I+just+dapaoed+from+Dhaba+1376+North+Indian+cuisine+%40+%2304-64+Blk144+Upper+Bukit+Timah+Rd%2C+Beauty+World+Hawker+Centre%21+Dabao+and+help+the+digitally+disadvantaged+hawkers+near+you+today%21+Find+them+at+https%3A%2F%2Fhawker.help">Facebook</a><br><a href="https://twitter.com/intent/tweet?text=I+just+dapaoed+from+Dhaba+1376+North+Indian+cuisine+%40+%2304-64+Blk144+Upper+Bukit+Timah+Rd%2C+Beauty+World+Hawker+Centre%21+Dabao+and+help+the+digitally+disadvantaged+hawkers+near+you+today%21+Find+them+at+https%3A%2F%2Fhawker.help">Twitter</a><br><br><a href="https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fhawker.help"e=I+just+dapaoed+from+Dhaba+1376+North+Indian+cuisine+%40+%2304-64+Blk144+Upper+Bukit+Timah+Rd%2C+Beauty+World+Hawker+Centre%21+Dabao+and+help+the+digitally+disadvantaged+hawkers+near+you+today%21+Find+them+at+https%3A%2F%2Fhawker.help.%0ABackstory%3A%0Anan">Facebook (With backstory)</a><br><a href="https://twitter.com/intent/tweet?text=I+just+dapaoed+from+Dhaba+1376+North+Indian+cuisine+%40+%2304-64+Blk144+Upper+Bukit+Timah+Rd%2C+Beauty+World+Hawker+Centre%21+Dabao+and+help+the+digitally+disadvantaged+hawkers+near+you+today%21+Find+them+at+https%3A%2F%2Fhawker.help.%0ABackstory%3A%0Anan">Twitter (With backstory)</a><br>]]></description>
<styleUrl>#icon-1577-E65100</styleUrl>
<Point><coordinates>103.7761346,1.3424354,0</coordinates></Point>
</Placemark>
解决方案
您的拼写错误<Placemark>
(网址上缺少结束引号)
<a href="https://www.facebook.com/sharer/sharer.php>Facebook</a>
应该:
<a href="https://www.facebook.com/sharer/sharer.php">Facebook</a>
这个:
<Placemark>
<name>sample point</name>
<description><![CDATA[Address:<br>
this is the address<br><br>
Opening Hours:<br>
Mon-Sat, 5.30am-1.30pm<br><br>
Other Details:<br>
blabbiltiy blabbity bla<br>
Share your support for this stall!:
<a href="https://www.facebook.com/sharer/sharer.php>Facebook</a>]]></description>
<styleUrl>#icon-1577-E65100</styleUrl>
<Point><coordinates>103.8578165,1.306714,0</coordinates></Point>
</Placemark>
应该:
<Placemark>
<name>sample point</name>
<description><![CDATA[Address:<br>this is the address<br><br>
Opening Hours:<br>
Mon-Sat, 5.30am-1.30pm<br><br>
Other Details:<br>
blabbiltiy blabbity bla<br>
Share your support for this stall!:
<a href="https://www.facebook.com/sharer/sharer.php">Facebook</a>]]></description>
<styleUrl>#icon-1577-E65100</styleUrl>
<Point><coordinates>103.8578165,1.306714,0</coordinates></Point>
</Placemark>
推荐阅读
- java - 尝试在组件上使用 FlowLayout.LEFT 时,JPanels 水平不对齐
- python - 如何在TensorFlow中expand_dims未知次数?
- mysql - 通过php将具有3个表的MySQL数据库导出为json格式
- arrays - 创建具有相似键的新数组
- python - 如何将多处理应用于滑动窗口
- python - 如何自动执行 C++ 代码块(最好来自 python)
- python - 在 Python 中解串
- localstack - 如何在 CI/CD 中启动 localstack
- c# - POSTMAN 工作正常时,HttpClient PostAsync() 不起作用
- javascript - WebComponents - 检测父溢出及其大小