【发布时间】:2013-11-18 13:57:57
【问题描述】:
我正在使用 gomap 向地图添加一些标记。 gomap 允许您添加您选择的图标,而不是被相同的旧标记卡住。我有几段这样的代码:
var constants = {
'nflIcon': 'Content/Images/green.png',
'bigBurrito': 'Content/Images/humongousBurrito.png'
};
$(function () {
$("#map").goMap({
latitude: 36.75,
longitude: -100,
maptype: 'ROADMAP',
zoom: 5
});
$.goMap.createMarker({
address: 'Green Bay, Wisconsin',
title: 'Green Bay Packers',
group: 'NFL',
icon: constants.nflIcon,
html: getPackers()
});
$.goMap.createMarker({
address: 'San Francisco, California',
title: 'San Francisco 49ers',
group: 'NFL',
icon: constants.nlfIcon,
html: '<h1>San Francisco 49ers</h1>'
});
...但是 constants.nflIcon 的分配仅适用于一个(使用 Green Bay Packers 标记);所有其他人都使用传统的橙色反向泪珠标记。
为什么?
【问题讨论】:
-
这可能与您的两个示例中的
nfl与nlf有关。 :-) 如有疑问,请将正在工作的那个复制并粘贴到不工作的那个(然后通过抽象调用来消除复制粘贴的需要)。 -
天堂对 Murgatroid!我不是阅读障碍者,但我在互联网上玩过一个。
标签: jquery html jquery-plugins google-maps-markers