我的网站上运行的gmap api刚停止显示地图。我不知道发生了什么,我也没有创建由前一位开发人员创建的代码。必须有一个解决方案,请帮助。我提供了由前一位开发人员创建的功能代码。
//XXXX: openInfoWindowHtml
/*--------------------------------------------------*/
/* GOOGLE MAP FUNCTIONS
/*--------------------------------------------------*/
var map, agentMarkers, reoMarkers, officeMarker, currentMarker, bounds, agentIcon, reoIcon, officeIcon;
var infoWindow = new google.maps.InfoWindow();
function initAgentMap(lat, lng) {
lat = isNaN(lat) || lat === null ? 37.4419 : lat;
lng = isNaN(lng) || lat === null ? -122.1419 : lng;
map = new google.maps.Map(document.getElementById("gmap"), {
center : new google.maps.LatLng(lat, lng),
zoom: 13,
mapTypeId: google.maps.MapTypeId.ROADMAP,
zoomControlOptions : {
style : google.maps.ZoomControlStyle.SMALL
}
});
agentMarkers = [];
reoMarkers = [];
currentMarker = null;
bounds = new google.maps.LatLngBounds();
var baseIcon = {
size : new google.maps.Size(29,25),
anchor : new google.maps.Point(15,25),
imageMap : [0, 0, 22, 0, 22, 25, 0, 25]
};
agentIcon = {
size : baseIcon.size,
anchor : baseIcon.anchor,
imageMap : baseIcon.imageMap,
url : "/images/icon_redbook.png"
};
reoIcon = {
size : baseIcon.size,
anchor : baseIcon.anchor,
imageMap : baseIcon.imageMap,
url : "/images/icon_reo.png"
};
officeIcon = {
size : baseIcon.size,
anchor : baseIcon.anchor,
imageMap : baseIcon.imageMap,
url : "/images/icon_office.png"
};
}
function plotAgent(lat, long, text, id) {
var point = new google.maps.LatLng(lat, long);
var marker = new google.maps.Marker({
position : point,
icon : agentIcon,
anchorPoint : new google.maps.Point(12,0),
map : map
});
google.maps.event.addListener(marker, "click", function() {
infoWindow.setContent(text);
infoWindow.open(map, marker);
});
agentMarkers[id] = marker;
bounds.extend(point);
return marker;
}
function plotREO(lat, long, text, id) {
var point = new google.maps.LatLng(lat, long);
var marker = new google.maps.Marker({
position : point,
icon : reoIcon,
anchorPoint : new google.maps.Point(12,0),
map : map
});
google.maps.event.addListener(marker, "click", function () {
infoWindow.setContent(text);
infoWindow.open(map, marker);
});
reoMarkers[id] = marker;
bounds.extend(point);
return marker;
}
function plotOffice(lat, long, text) {
var point = new google.maps.LatLng(lat, long);
var marker = new google.maps.Marker({
position : point,
icon : officeIcon,
anchorPoint : new google.maps.Point(12,0),
map : map
});
google.maps.event.addListener(marker, "click", function () {
infoWindow.setContent(text);
infoWindow.open(map, marker);
});
officeMarker = marker;
bounds.extend(point);
return marker;
}
function showAgent(id) {
if(currentMarker != id){
currentMarker = id;
google.maps.event.trigger(agentMarkers[id], "click");
map.setZoom(11);
pnt = agentMarkers[id].getPosition();
pnt2 = new google.maps.LatLng(pnt.lat() + .02 , pnt.lng());
map.setCenter(pnt2);
}
}
function showREO(id) {
if(currentMarker != id){
currentMarker = id;
google.maps.event.trigger(reoMarkers[id], "click");
map.setZoom(11);
pnt = reoMarkers[id].getPosition();
pnt2 = new google.maps.LatLng(pnt.lat() + .02 , pnt.lng());
map.setCenter(pnt2);
}
}
function showOffice() {
if(currentMarker != 'office'){
currentMarker = 'office';
google.maps.event.trigger(officeMarker, "click");
map.setZoom(11);
pnt = officeMarker.getPosition();
pnt2 = new google.maps.LatLng(pnt.lat() + .02 , pnt.lng());
map.setCenter(pnt2);
}
}

我的网站上运行的gmap api刚停止显示地图。我不知道发生了什么,我也没有创建由前一位开发人员创建的代码。必须有一个解决方案,请帮助。我提供了前一位开发人员创建的功能代码。
答案 0 :(得分:0)
v2 Maps API在2010年已弃用,最终于2013年11月关闭。您将need to migrate转到JS Maps API的v3。不幸的是,这不是一个完全简单的过程。