我希望使用必应地图实现以下内容。在#content
中,将从JSON显示标记。
15秒后,所有标记应该被删除并重新加载。
地图和标记的加载都很好。也能够删除标记。
只有当没有新标记下载时才起作用!在控制台中,我没有收到错误消息。
有人有什么想法吗?我怀疑当“下载”发生错误时会出现问题?
代码:
function bings_maps(){
$('#content').gmap({
center: new Microsoft.Maps.Location(47.631296,15.830868),
mapTypeId: Microsoft.Maps.MapTypeId.aerial,
zoom: 17,
credentials: 'test',
bounds: null,
showMapTypeSelector: false,
enableSearchLogo: false,
showBreadcrumb: false,
enableClickableLogo: false,
showScalebar: false,
enableSearchLogo: false,
showDashboard: false,
showMapTypeSelector:false,
showScalebar: false,
useInertia: false,
disablePanning: false,
disableZooming: false,
callback: function() {
var self = this;
$.getJSON('inhalt.php', function(data) {
$.each( data.markers, function(i, marker) {
var location = new Microsoft.Maps.Location(marker.latitude,
marker.longitude);
self.addMarker({ 'location': location, 'bounds': false ,
'icon': marker.icon } );
});
});
}});
}
function bings_maps_refresh() {
$('#content').gmap('clear', 'markers');
$('#content').gmap({'callback':function() {
this.addMarker({'location': '47.631296,15.830868', 'bounds': true});
}});