为什么在vs2010版本显示正常在vs2012office2010安装中出错错

10:40 提问
为什么在vs2010版本显示正常在vs2012中出错
未经处理的异常,行 1,列 282,在
0x800a138f - Microsoft JScript 运行时错误: 无法获取属性“lng”的值: 对象为 null 或未定义
按赞数排序
一个是将vs2012中的jscript验证关掉,当然是在确认你的js code正确的情况下;
另外一个检查你的js code,应该是哪里编写的不标准,漏掉的些细微之处导致的验证检查失败
代码太乱了,给你格式化一下
var BMapLib = window.BMapLib = BMapLib || {}; (function() {
var b = function(m, l, j) {
var n = m.pointToPixel(l.getNorthEast());
var i = m.pointToPixel(l.getSouthWest());
var h = m.pixelToPoint(n);
var k = m.pixelToPoint(i);
return new BMap.Bounds(k, h)
var d = function(i) {
var k = f(i.getNorthEast().lng, -180, 180);
var h = f(i.getSouthWest().lng, -180, 180);
var j = f(i.getNorthEast().lat, -74, 74);
var l = f(i.getSouthWest().lat, -74, 74);
return new BMap.Bounds(new BMap.Point(h, l), new BMap.Point(k, j))
var f = function(j, k, h) {
k && (j = Math.max(j, k));
h && (j = Math.min(j, h));
var a = function(h) {
return "[object Array]" === Object.prototype.toString.call(h)
var c = function(l, n) {
var j = -1;
if (a(n)) {
if (n.indexOf) {
j = n.indexOf(l)
for (var k = 0,
h = n[k]; k++) {
if (h === l) {
var e = BMapLib.MarkerClusterer = function(l, h) {
this._map =
this._markers = [];
this._clusters = [];
var k = h || {};
this._gridSize = k.gridSize || 60;
this._maxZoom = k.maxZoom || 18;
this._minClusterSize = k.minClusterSize || 2;
this._isAverageCenter =
if (k.isAverageCenter != undefined) {
this._isAverageCenter = k.isAverageCenter
this._styles = k.styles || [];
this._map.addEventListener("zoomend",
function() {
j._redraw()
this._map.addEventListener("moveend",
function() {
j._redraw()
var i = k.
a(i) && this.addMarkers(i)
e.prototype.addMarkers = function(k) {
for (var j = 0,
h = k. j & j++) {
this._pushMarkerTo(k[j])
this._createClusters()
e.prototype._pushMarkerTo = function(h) {
var i = c(h, this._markers);
if (i === -1) {
h.isInCluster =
this._markers.push(h)
e.prototype.addMarker = function(h) {
this._pushMarkerTo(h);
this._createClusters()
e.prototype._createClusters = function() {
var j = this._map.getBounds();
var l = b(this._map, j, this._gridSize);
for (var k = 0,
h = this._markers[k]; k++) {
if (!h.isInCluster && l.containsPoint(h.getPosition())) {
this._addToClosestCluster(h)
e.prototype._addToClosestCluster = function(l) {
var p = 4000000;
var k = l.getPosition();
for (var m = 0,
j = this._clusters[m]; m++) {
var h = j.getCenter();
var o = this._map.getDistance(h, l.getPosition());
if (o & p) {
if (n && n.isMarkerInClusterBounds(l)) {
n.addMarker(l)
var j = new g(this);
j.addMarker(l);
this._clusters.push(j)
e.prototype._clearLastClusters = function() {
for (var j = 0,
h = this._clusters[j]; j++) {
h.remove()
this._clusters = [];
this._removeMarkersFromCluster()
e.prototype._removeMarkersFromCluster = function() {
for (var j = 0,
h = this._markers[j]; j++) {
h.isInCluster = false
e.prototype._removeMarkersFromMap = function() {
for (var j = 0,
h = this._markers[j]; j++) {
h.isInCluster =
this._map.removeOverlay(h)
e.prototype._removeMarker = function(h) {
var i = c(h, this._markers);
if (i === -1) {
return false
this._map.removeOverlay(h);
this._markers.splice(i, 1);
return true
e.prototype.removeMarker = function(h) {
var i = this._removeMarker(h);
this._clearLastClusters();
this._createClusters()
e.prototype.removeMarkers = function(l) {
for (var h = 0; h & l. h++) {
var j = this._removeMarker(l[h]);
k = k || j
this._clearLastClusters();
this._createClusters()
e.prototype.clearMarkers = function() {
this._clearLastClusters();
this._removeMarkersFromMap();
this._markers = []
e.prototype._redraw = function() {
this._clearLastClusters();
this._createClusters()
e.prototype.getGridSize = function() {
return this._gridSize
e.prototype.setGridSize = function(h) {
this._gridSize =
this._redraw()
e.prototype.getMaxZoom = function() {
return this._maxZoom
e.prototype.setMaxZoom = function(h) {
this._maxZoom =
this._redraw()
e.prototype.getStyles = function() {
return this._styles
e.prototype.setStyles = function(h) {
this._styles =
this._redraw()
e.prototype.getMinClusterSize = function() {
return this._minClusterSize
e.prototype.setMinClusterSize = function(h) {
this._minClusterSize =
this._redraw()
e.prototype.isAverageCenter = function() {
return this._isAverageCenter
e.prototype.getMap = function() {
return this._map
e.prototype.getMarkers = function() {
return this._markers
e.prototype.getClustersCount = function() {
var k = 0;
for (var j = 0,
h = this._clusters[j]; j++) {
h.isReal() && k++
function g(h) {
this._markerClusterer =
this._map = h.getMap();
this._minClusterSize = h.getMinClusterSize();
this._isAverageCenter = h.isAverageCenter();
this._center =
this._markers = [];
this._gridBounds =
this._isReal =
this._clusterMarker = new BMapLib.TextIconOverlay(this._center, this._markers.length, {
styles: this._markerClusterer.getStyles()
g.prototype.addMarker = function(k) {
if (this.isMarkerInCluster(k)) {
return false
if (!this._center) {
this._center = k.getPosition();
this.updateGridBounds()
if (this._isAverageCenter) {
var j = this._markers.length + 1;
var o = (this._center.lat * (j - 1) + k.getPosition().lat) /
var m = (this._center.lng * (j - 1) + k.getPosition().lng) /
this._center = new BMap.Point(m, o);
this.updateGridBounds()
k.isInCluster =
this._markers.push(k);
var h = this._markers.
if (h & this._minClusterSize) {
this._map.addOverlay(k);
return true
if (h === this._minClusterSize) {
for (var n = 0; n & n++) {
this._markers[n].getMap() && this._map.removeOverlay(this._markers[n])
this._map.addOverlay(this._clusterMarker);
this._isReal =
this.updateClusterMarker();
return true
g.prototype.isMarkerInCluster = function(j) {
if (this._markers.indexOf) {
return this._markers.indexOf(j) != -1
for (var k = 0,
h = this._markers[k]; k++) {
if (h === j) {
return true
return false
g.prototype.isMarkerInClusterBounds = function(h) {
return this._gridBounds.containsPoint(h.getPosition())
g.prototype.isReal = function(h) {
return this._isReal
g.prototype.updateGridBounds = function() {
var h = new BMap.Bounds(this._center, this._center);
this._gridBounds = b(this._map, h, this._markerClusterer.getGridSize())
g.prototype.updateClusterMarker = function() {
if (this._map.getZoom() & this._markerClusterer.getMaxZoom()) {
this._clusterMarker && this._map.removeOverlay(this._clusterMarker);
for (var l = 0,
j = this._markers[l]; l++) {
this._map.addOverlay(j)
if (this._markers.length & this._minClusterSize) {
this._clusterMarker.hide();
this._clusterMarker.setPosition(this._center);
this._clusterMarker.setText(this._markers.length);
var k = this._
var h = this.getBounds();
this._clusterMarker.addEventListener("click",
function(i) {
k.setViewport(h)
g.prototype.remove = function() {
for (var j = 0,
h = this._markers[j]; j++) {
this._markers[j].getMap() && this._map.removeOverlay(this._markers[j])
this._map.removeOverlay(this._clusterMarker);
this._markers.length = 0;
delete this._markers
g.prototype.getBounds = function() {
var k = new BMap.Bounds(this._center, this._center);
for (var j = 0,
h = this._markers[j]; j++) {
k.extend(h.getPosition())
g.prototype.getCenter = function() {
return this._center
其他相似问题}

我要回帖

更多关于 project2010安装出错 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信