带有图标的KMZ文件 [英] KMZ File with Icon

查看:72
本文介绍了带有图标的KMZ文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在KMZ文件中放置一个图标,以便用户在单击精确点时可以查看缩略图.我有以下代码-工作正常,但未显示图标/缩略图.我看过Google开发人员,看不出有什么不同.只需再有一双眼睛即可观看.

I'm trying to put an icon in a KMZ file so the user can view a thumbnail when they click on the pinpoint. I have the following code - It's working, but isn't showing the icon/thumbnail. I've looked at the Google Developers and can't see a difference. Just need a second pair of eyes to view it.

<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2">
<Placemark>
<name>Evidence File</name>
<description>SAMSUNG - GT-I9000
2012:10:25 17:36:57
2797 KB
Height: 2448 Pixels
Width:  3264 Pixels
C:\Users\Steve\Desktop\FYP Cases\M2510\IMG_20121025_163656.jpg</description>
<IconStyle><scale>1.1</scale><Icon><href>C:\Users\Steve\Desktop\FYP Cases\M2510\IMG_20121025_163656.jpg</href></Icon></IconStyle>
<Point>
<coordinates>-2.6172222222222223,51.43</coordinates>
</Point>
</Placemark>
</kml>

推荐答案

您在KML文件(C:\ Users \ Steve ...)中具有对该文件的绝对引用.如果图像在您的KMZ内,则应改为引用相对文件位置.另外,文件路径C:...不是有效的URL,如果使用绝对URL,则其格式应为http://或file://.

You have an absolute reference to the file in your KML file (C:\Users\Steve...). If image is inside your KMZ then you should reference the relative file location instead. Also, the file path C:... is not a valid URL which should be of the form http:// or file:// if using an absolute URL.

让我们假设KMZ文件有两个条目(按此顺序):

Let's assume the KMZ file has two entries (in this order):

  • doc.kml
  • IMG_20121025_163656.jpg

doc.kml中的IconStyle应该这样重写:

The IconStyle within the doc.kml should be rewritten like this:

<IconStyle>
    <scale>1.1</scale>
    <Icon>
        <href>IMG_20121025_163656.jpg</href>
    </Icon>
</IconStyle>

这篇关于带有图标的KMZ文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆