function showMap(mapX, mapY, mapSize, memberId, memberName, memberLevel, winHtml){
var maps = new LTMaps("corpMap");var icon = new LTIcon();icon.setImageUrl('/images/map/centerPoi.gif');maps.centerAndZoom(new LTPoint(mapX,mapY), mapSize);var marker = new LTMarker(new LTPoint(mapX,mapY),icon);var mapText = new LTMapText(marker);
mapText.setLabel(memberName);mapText.setBackgroundColor("#fff5f6");mapText.setFontColor("#ff0000");maps.addOverLay(marker);maps.addOverLay(mapText);LTMarker.setInfoWinWidth(70);LTMarker.setInfoWinHeight(200);LTEvent.bind(marker, "mouseover", marker,openInfoWin(marker,winHtml));var control = new LTStandMapControl();maps.addControl(control);
}
function openInfoWin(object, html) {
return function() {var win = object.openInfoWinElement(html);win.closeInfoWindowWithMouse();};
}
function CorpInfo(id, name, level, address, reviewCount) {
this.id = id;this.name = name;this.level = level;this.address = address;this.reviewCount = reviewCount;this.service = new Array();
}
CorpInfo.prototype.addService = function(_service) {
if (_service) {_service = _service.replace(/(^\s+)|(\s+$)/g, "");if ("" != _service) {this.service.push(_service);}}
}
CorpInfo.prototype.hasService = function(_service) {
if (! _service){return false;}
_service = _service.replace(/(^\s+)|(\s+$)/g, "");
if ("" != _service) {for (var i = 0; i < this.service.length; i ++) {if (_service == this.service[i]) {return true;}}}
return false;
}
CorpInfo.prototype.matchName = function(_name) {
if (! _name) {return false;}_name = _name.replace(/(^\s+)|(\s+$)/g, "");return (("" == _name) ? false : this.name.indexOf(_name) >= 0);
}
CorpInfo.prototype.isLevel = function(_level) {
if (! _level) {return false;}return this.level == _level;
}
function CorpMarker(id, name, level, address, reviewCount, mapX, mapY) {
this.corpInfo = new CorpInfo(id, name, level, address, reviewCount);var icon = new LTIcon();
if (level == 2) {icon.setImageUrl("/images/map/special_map_flag.gif");} else {icon.setImageUrl("/images/map/centerPoi.gif");}
this.marker = new LTMarker(new LTPoint(mapX, mapY), icon);var _mapText = new LTMapText(this.marker);_mapText.setLabel("");_mapText.setBackgroundColor("#FFF5F6");_mapText.setFontColor("#FF0000");this.mapText = _mapText;this.viewable = false;
}
CorpMarker.prototype.disableView = function() {this.viewable = false;}
CorpMarker.prototype.addService = function(_service) {this.corpInfo.addService(_service);}
CorpMarker.prototype.hasService = function(_service) {
if (_service == null || _service == "") {return true;}return this.corpInfo.hasService(_service);}
CorpMarker.prototype.matchName = function(_name) {return this.corpInfo.matchName(_name);}
CorpMarker.prototype.isLevel = function(_level) {if (_level == null || "" == _level) {return true;}return this.corpInfo.isLevel(_level);}
CorpMarker.prototype.markMap = function(map) {map.addOverLay(this.marker);map.addOverLay(this.mapText);this.viewable = true;
LTEvent.bind(this.marker, "mouseover", this.marker, openInfoWin(this.marker, "[<span style=\"color:red;\">" + (this.corpInfo.level == 2 ? "特约服务商" : "普通服务商") + "</span>] <a href=\"/corp.do?method=view&id=" + this.corpInfo.id + "\" target=\"_blank\">" + this.corpInfo.name + "</a><br />地址: " + this.corpInfo.address));
}
CorpMarker.prototype.isMarkedAndInMapBounds = function(map) {return this.viewable && map.getBoundsLatLng().containsPoint(this.mapText.getPoint());}
CorpMarker.prototype.markMapWithName = function(_map, _name) {if (this.matchName(_name)) {this.markMap(_map);}}
CorpMarker.prototype.markMapWithLevelAndService = function(_map, _level, _service) {if (this.isLevel(_level) && this.hasService(_service)) {this.markMap(_map);}}