首页 > 解决方案 > 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&quote=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&quote=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>

标签: google-mapskmlcdata

解决方案


您的拼写错误<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>

概念证明


推荐阅读