Google Maps API v3 - 自定义多色图标

发布于 2024-09-18 06:37:16 字数 71 浏览 0 评论 0原文

似乎我必须将托管图像 URL 分配给 MarkerImage 对象才能创建自定义图标。有没有办法让用户选择一种颜色来填充该图像?

It seems like I have to assign an hosted image URL to a MarkerImage object to create custom icons. Is there a way to allow the user to pick a color to fill in this image?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

夏日落 2024-09-25 06:37:16

尝试使用 Google Charts API 生成标记 。您可以选择颜色。

Try using the Google Charts API to generate markers. You can choose the colour.

不知所踪 2024-09-25 06:37:16

Google 地图库列表<中查找样式标记/a>.这看起来会有帮助。

我还会考虑使用画布动态生成图像,然后生成数据 URL:

var dataURL = canvas.toDataURL("image/png");

Look for styled markers in a list of Google Maps libraries. This looks like it could help.

I would also look into generating the images on the fly with canvas and then producing a data URL:

var dataURL = canvas.toDataURL("image/png");
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文