谷歌地图API标记与地图上的字母 [英] Google map API marker with letter on map

查看:178
本文介绍了谷歌地图API标记与地图上的字母的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法通过谷歌的一封信访问彩色标记?



我只能使用红色字母,如

但我需要一个带有字母的绿色标记,就像我得到的那样来自google的路线API。像这里一样

是有一种方法可以用字母访问彩色标记吗?
还是必须将标记添加到我的图像文件夹?

解决方案

您必须使用:

  http://chart.apis.google.com/chart?chst=d_map_pin_letter&chld=D|00FF00|000000 

chld 参数是您想要在标记中出现的字母。

在管道之后,第一个RGB代码是标记的颜色,第二个是标记的背景颜色。最后一个是可选的。



所以你可以像这样创建你的标记:

  var myPin = new google.maps.MarkerImage(http://chart.apis.google.com/chart?ch=?from=d_map_pin_letter&chld=D|00FF00|000000); 

并像使用它一样使用它!


Is there a way to access the colored markers with a letter from google?

I can only use the red ones with letters like

But I need green markers with a letter like I get it from the directions API from google. Like this one here

Is there a way to access to the colored markers with letter? Or do I have to add the markers to my image folder?

解决方案

You must use :

http://chart.apis.google.com/chart?chst=d_map_pin_letter&chld=D|00FF00|000000

chld parameter is the letter you want to appear in your marker.
After the pipe, the first RGB code is the color of the marker, the second is the background color of the marker. The last one is optional.

So you can create your marker like this :

var myPin= new google.maps.MarkerImage("http://chart.apis.google.com/chart?chst=d_map_pin_letter&chld=D|00FF00|000000");

and use it like you want !

这篇关于谷歌地图API标记与地图上的字母的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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