Google地图默认图标 [英] Google Maps Default Icons

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

问题描述

我试图获取当前的默认Google地图图标。



我正在制作Google Maps API的程序,并已将我的DirectionsRenderer设置为禁止标记,所以我可以让标记设置特定的图标。



这是我当前的结果:



这是我在抑制默认标记之前所做的:





后来在我的程序中,我将添加航点,所以我想用不同颜色的字母A,B,C等设置上面的标记,(如标记A,它是绿色的) 。

我访问过几个网站,例如: b
https://developers.google.com/maps/documentation/javascript/examples/marker-symbol-predefined



https://www.google.com/fusiontables/DataSource?dsrcid=308519#map:id=3



谷歌地图v3标准图标/影子名称(当量。 G_DEFAULT_ICON在v2中)



这些网站告诉您使用的标记与当前标记看起来不一样。我想知道是否有一种方法可以像融合表中一样调用当前的绿色标记a: b
$ b



如果是这样,怎么办?感谢!

解决方案

当您查看developer-tools的网络标签时,您会看到绿色标记为:

 https://mts.googleapis.com/vt/icon/name=icons/spotlight/spotlight-waypoint-a.png&text =  A &psize = 16&font = fonts / Roboto-Regular.ttf&color = ff333333&ax = 44&ay = 48&scale = 1 
// ---------------- -------------------------------------------------- ------------------ ^

可以通过文本 - 参数



(注意:还有一个颜色 - 参数,this参数用于文本颜色,而不用于标记的背景)


I am trying to get the current default Google Maps Icons.

I am making a program with the Google Maps API and have set my DirectionsRenderer to suppress markers so I can make markers to set the specific icon.

This is my current result:

This is what I had before suppressing the default markers:

Later in my program I will be adding waypoints so I would like to set markers like the ones above with the letter A, B, C, etc. with a different color, (like marker "A", which is green).

I have visited several sites such as:

https://developers.google.com/maps/documentation/javascript/examples/marker-symbol-predefined

https://www.google.com/fusiontables/DataSource?dsrcid=308519#map:id=3

google maps v3 standard icon/shadow names (equiv. of G_DEFAULT_ICON in v2)

The markers these websites tell you to use, do not look the same as the current markers. I am wondering if there is a way to call the current "green marker a" just like in the fusion tables:

If so, how? Thanks!

解决方案

When you take a look at the network-tab of the developer-tools you'll see that the URL for the green marker is:

https://mts.googleapis.com/vt/icon/name=icons/spotlight/spotlight-waypoint-a.png&text=A&psize=16&font=fonts/Roboto-Regular.ttf&color=ff333333&ax=44&ay=48&scale=1
//------------------------------------------------------------------------------------^

The letter may be defined via the text-parameter

(Note: there is also a color-parameter, this parameter is used for the text-color and not for the background of the marker)

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

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