简体   繁体   English

聚合物 - 使用铁图标为谷歌地图标记图标

[英]Polymer - Using Iron-icons for google-map-marker icon

I'm looking for a way to set the icon for a google-map-marker, ideally I could use the iron-icons as they are already being used elsewhere in my project. 我正在寻找一种方法来设置谷歌地图标记的图标,理想情况下我可以使用铁图标,因为它们已经在我的项目的其他地方使用。 I cannot find a way to set the icon marker properly. 我找不到正确设置图标标记的方法。

Going off of the documentation for iron-icon element, I've tried: 关于iron-icon元素的文档,我尝试过:

<link rel="import" href="../bower_components/iron-icons/iron-icons.html">

<google-map-marker latitude="37.7749295" longitude="-122.41941550000001" icon="favorite">
</google-map-marker>

Custom icons work by setting: icon="someImg.png", but I'd really like to use the iron-icons for this. 自定义图标通过设置工作:icon =“someImg.png”,但我真的很想使用铁图标。 Other icons work on the page within iron-icon tags: 其他图标在iron-icon标签内的页面上工作:

<iron-icon icon="favorite"></iron-icon>

Am I doing something wrong or is there a workaround for this? 我做错了什么或有解决方法吗?

Thanks 谢谢

From Polymer developer: 来自Polymer开发人员:

Right now, it's icon attribute is a simple URL to an image. 现在,它的icon属性是图像的简单URL。 The map marker element would need to be taught how to use the svg images within the iron icon set. 需要教导地图标记元素如何在铁图标集内使用svg图像。 The maps API takes a URL to an image as well: https://github.com/GoogleWebComponents/google-map/blob/master/google-map-marker.html#L236 maps API也会将URL带到图像: https//github.com/GoogleWebComponents/google-map/blob/master/google-map-marker.html#L236

Now a feature request: https://github.com/GoogleWebComponents/google-map/issues/178 现在提供功能请求: https//github.com/GoogleWebComponents/google-map/issues/178

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

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