【发布时间】:2014-04-19 03:22:36
【问题描述】:
我正在使用socket.io 来获取新的纬度/经度。
我有这个 html sn-p 来加载谷歌地图 V3 上的标记
var socket = io.connect();
socket.on('date', function(data){
$('#date').text(data.date);
var locations=[[33.9821000000001,-117.33547],[33.98247,-117.33537],[33.9830000000001,-117.33533]];
var currLatLong = new google.maps.LatLng(33.9821000000001,-117.33547);
var mapOptions = {
zoom: 14,
center: currLatLong
}
var map = new google.maps.Map(document.getElementById('map'), mapOptions);
marker = new google.maps.Marker({
position: new google.maps.LatLng(currLatLong),
map: map,
title:"a",
});
console.log(marker);
});
但是,标记没有加载,控制台没有给出错误或警告。
【问题讨论】:
标签: javascript google-maps google-maps-api-3 socket.io