简体   繁体   English

Google Maps API 中 KML 层的抗锯齿

[英]Antialising in KML layer in Google Maps API

I have a map created in My Maps, and I wand to embed it in a website, however I'd like to have InfoWindows on marker click instead of the default side panel, and change the description a bit.我在“我的地图”中创建了一张地图,我想将其嵌入到网站中,但是我希望在标记单击时使用 InfoWindows 而不是默认的侧面板,并稍微更改一下描述。 From what I found, the only way to do so is to use a regular Google Maps API and add my data onto it with a KML layer.根据我的发现,唯一的方法是使用常规的 Google Maps API 并使用 KML 图层将我的数据添加到其中。 This is working, however, the icons (the pins) are highly pixelated and look terrible.这是有效的,但是,图标(引脚)高度像素化并且看起来很糟糕。 When using the same map via embed (or simply opening it) they are OK.当通过嵌入(或简单地打开它)使用相同的地图时,它们是可以的。 Would really appreciate any help with the issue.非常感谢您对这个问题的任何帮助。 Probably there is another way of adding a custom map to an API-powered map?可能还有另一种将自定义地图添加到 API 驱动的地图的方法吗?

The answer I've come up with is: no way to achieve what I'm looking for.我想出的答案是:没有办法实现我正在寻找的东西。

When exporting KML layers, Google scales all icons to 32X32 px, and then scales them up (kml file contains scale 1.1 directive).导出 KML 图层时,Google 会将所有图标缩放到 32X32 像素,然后将它们放大(kml 文件包含 scale 1.1 指令)。 Even if you change the scale, the files remain 32X32, so it does not help;即使您更改比例,文件仍为 32X32,因此无济于事; you need to create another files, in other words: the kml exported from Google is not usable if you have custom png icons.您需要创建另一个文件,换句话说:如果您有自定义的 png 图标,则无法使用从 Google 导出的 kml。

I ended up using regular markers instead of KML layer.我最终使用了常规标记而不是 KML 层。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM