我正在使用 javascript 和 v3 的 maps API 从 Fusion Table 中提取一些数据。我已经成功地向某些点添加了一些自定义标记,但现在我试图将我创建的标记“默认”到从我的表格中名为“图标”的列中指定的图标。我没有使用融合表层,而是在数据的 for 循环中创建标记。我表中的图标列包含以下条目:“poi”、“star”等...
有什么方法可以使用名称字符串以某种方式获取像融合表层那样的“默认”图标?或者,有谁知道我在哪里可以找到默认融合表图标(例如 POI 和星号)的绝对位置,以便我可以在脚本中定义它们的路径?
这是一些示例代码。如果有人知道谷歌上图标的绝对 URL,我可以编写一个函数来根据“图标”列中的字符串输入它。
//if there's an image, use it as marker, else use default
if(row[3] != ''){
// Create the marker
var marker = new google.maps.Marker({
map: map,
position: coordinate,
icon: new google.maps.MarkerImage(row[3])
});
} else {
// Create the marker
var marker = new google.maps.Marker({
map: map,
position: coordinate
//icon: row[2] (row[2] is the Icon column.
// I'm assuming I'll just need a conditional to check
// for the name (such as 'poi') and then to put in the absolute URL for each respectively
// the problem is I don't know the absolute URL's for these icons. Thanks.
});
}