我希望向大家请教如何使用JavaScript在Google Maps v3上动态添加每个标记的数字。例如,第一个标记为1,第二个标记为2,以此类推。在这种情况下,我有以下位置数据:
[
new google.maps.LatLng(1.3667, 103.8000),
new google.maps.LatLng(1.3667, 103.8000),
new google.maps.LatLng(1.3667, 103.8000),
new google.maps.LatLng(1.3667, 103.8000),
new google.maps.LatLng(51.0000, 9.0000),
new google.maps.LatLng(51.0000, 9.0000),
new google.maps.LatLng(51.5142, -0.0931),
new google.maps.LatLng(51.5142, -0.0931),
new google.maps.LatLng(54.0000, -2.0000),
new google.maps.LatLng(51.6000, -1.2500),
new google.maps.LatLng(51.7500, -1.2500)
];
但这些数据是动态变化的。因此,对于第一个位置的纬度/经度,我将在第一个标记上给出数字1,第二个标记为数字2,以此类推。并且我已经使用以下图标来标识每个标记:
"http://chart.apis.google.com/chart?chst=d_map_xpin_letter_withshadow&chld=pin_star|%E2%80%A2|CC3300|000000|FF9900"
我需要改变标记图标吗?我真的需要您的建议或示例代码来解决这个问题。请帮忙,非常感谢您的帮助。