我正在设置使用页面上的链接来平移和缩放到特定的坐标数组(我已经删除了一个标记,并初始化了gmap3).当我点击链接时,Javascript会触发(我收到警报),但我的地图中没有任何反应.请帮忙.这是我的代码:
$(".phila").click(function(){
alert("hello");
$("#map").gmap3({
action:'panTo',
args:[39.952335, -75.163789]
});
});
Run Code Online (Sandbox Code Playgroud)
编辑:现在我在控制台中收到错误消息"未捕获错误:panTo:latLng必须是LatLng类型"
我使用以下代码获得了一个Unxepected Identifier编辑器.我整天都在排它故障,什么都没有.希望一双新鲜的眼睛可以发现我的错误.我正在尝试使用jQuery UI来设置日期选择器,然后获取并操纵日期.更改选择器上的日期应通过ajax更改与该日期关联的页面上的图像.
$(document).ready(function(){
// Datepicker
$('#datepicker').datepicker({
dateFormat: 'yy-mm-dd',
inline: true,
minDate: new Date(2012, 06 - 1, 1),
maxDate:new Date(2012, 09 - 1, 31),
onSelect: function(){
var day1 = ($("#datepicker").datepicker('getDate').getDate()).toString().replace(/(^.$)/,"0$1");
var month1 = ($("#datepicker").datepicker('getDate').getMonth() + 1).toString().replace(/(^.$)/,"0$1");
var year1 = $("#datepicker").datepicker('getDate').getFullYear();
var fullDate = year1 + "/" + month1 + "/" + day1;
var dashDate = year1 + "-" + month1 + "-" + day1;
var str_output = "<a id=\"single_image\" href=\"http://www.lasalle.edu/150/dayinhistory/" + fullDate + ".jpg\" title=\"\"><img src=\"http://www.lasalle.edu/scripts/timthumb/timthumb.php?src=http://www.lasalle.edu/150/dayinhistory/" + fullDate + ".jpg&w=560&h=350&zc=1&a=t\">"; …Run Code Online (Sandbox Code Playgroud)