Skip to content

Commit

Permalink
修改注释
Browse files Browse the repository at this point in the history
  • Loading branch information
marsprj committed Sep 27, 2016
1 parent 7169a0f commit 11038ca
Show file tree
Hide file tree
Showing 3 changed files with 100 additions and 76 deletions.
68 changes: 46 additions & 22 deletions src/GeoBeans/Feature.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,28 +24,6 @@ GeoBeans.Feature = GeoBeans.Class({
this.geometry = null;
this.values = null;
},


setValue : function(field,value){
var fields = this.featureType.getFields();
for(var i = 0; i < fields.length; ++i){
var f = fields[i];
if(f.name == field){
this.values[i] = value;
return;
}
}
},

getValue : function(field){
var fields = this.featureType.getFields();
for(var i = 0; i < fields.length; ++i){
var f = fields[i];
if(f.name == field){
return this.values[i];
}
}
}
});

/**
Expand All @@ -55,4 +33,50 @@ GeoBeans.Feature = GeoBeans.Class({
*/
GeoBeans.Feature.prototype.getFeatureType = function(){
return this.featureType;
}

/**
* 设置属性值
* @public
* @param {string} field 字段名称
* @param {object} value 属性值
*/
GeoBeans.Feature.prototype.setValue = function(field,value){
var fields = this.featureType.getFields();
for(var i = 0; i < fields.length; ++i){
var f = fields[i];
if(f.name == field){
this.values[i] = value;
return;
}
}
}

/**
* 根据字段名称获得属性值
* @public
* @param {string} field 字段名称
* @return {object} 属性值
*/
GeoBeans.Feature.prototype.getValue = function(field){
var fields = this.featureType.getFields();
for(var i = 0; i < fields.length; ++i){
var f = fields[i];
if(f.name == field){
return this.values[i];
}
}
}

/**
* 根据字段名称获得属性值
* @param {string} index 字段名称
* @return {object} 属性值
*/
GeoBeans.Feature.prototype.getValueByIndex = function(index){
var fields = this.featureType.getFields();
if(index<0||index>=fields.length){
return this.values[index];
}
return null;
}
92 changes: 45 additions & 47 deletions src/GeoBeans/Map.js
Original file line number Diff line number Diff line change
Expand Up @@ -485,30 +485,28 @@ GeoBeans.Map = GeoBeans.Class({
this.overlayLayer.unRegisterOverlayClickEvent();
},

// // 获取查询结果
// getQuerySelection : function(){
// return this.queryLayer.features;
// },


// 获取查询结果
getQuerySelection : function(){
return this.queryLayer.features;
},

//闪烁
setFeatureBlink : function(feature,count){
if(feature == null || count == null){
return;
}
this.queryLayer.setFeatureBlink(feature,count);
},
// //闪烁
// setFeatureBlink : function(feature,count){
// if(feature == null || count == null){
// return;
// }
// this.queryLayer.setFeatureBlink(feature,count);
// },


// 停止查询
endQuery : function(){
this.tracker.end();
this.queryLayer.clearFeatures();
// this.infoWindow.popover("hide");
var infoWindow = this.getInfoWindow();
infoWindow.show(false);
},
// // 停止查询
// endQuery : function(){
// this.tracker.end();
// this.queryLayer.clearFeatures();
// // this.infoWindow.popover("hide");
// var infoWindow = this.getInfoWindow();
// infoWindow.show(false);
// },


openInfoWindow : function(option,point){
Expand Down Expand Up @@ -585,18 +583,18 @@ GeoBeans.Map = GeoBeans.Class({
// },


// @deprecated
getFeatureFilter : function(layerName,filter,maxFeatures,fields,style,callback){
var layer = this.getLayer(layerName);
if(layer == null){
if(callback != null){
callback("this is not layer named " + layername);
}
return;
}
this.queryLayer.setLayer(layer,style);
layer.getFeatureFilter(filter,maxFeatures,null,fields,callback);
},
// // @deprecated
// getFeatureFilter : function(layerName,filter,maxFeatures,fields,style,callback){
// var layer = this.getLayer(layerName);
// if(layer == null){
// if(callback != null){
// callback("this is not layer named " + layername);
// }
// return;
// }
// this.queryLayer.setLayer(layer,style);
// layer.getFeatureFilter(filter,maxFeatures,null,fields,callback);
// },

// 增加全景图
addPanorama : function(point,name,htmlPath,icon){
Expand Down Expand Up @@ -964,22 +962,22 @@ GeoBeans.Map = GeoBeans.Class({
return featureLayer;
},

// KML文件创建featureLayer
// @deprecated
createFeatureLayerByKML : function(name,url){
var kmlReader = new GeoBeans.KMLReader();
var layer = kmlReader.read(name,url);
return layer;
},
// // KML文件创建featureLayer
// // @deprecated
// createFeatureLayerByKML : function(name,url){
// var kmlReader = new GeoBeans.KMLReader();
// var layer = kmlReader.read(name,url);
// return layer;
// },


// GeoJson文件创建featureLayer
// @deprecated
createFeatureLayerByGeoJson : function(name,url){
var geoJsonReader = new GeoBeans.GeoJsonReader();
var layer = geoJsonReader.read(name,url);
return layer;
},
// // GeoJson文件创建featureLayer
// // @deprecated
// createFeatureLayerByGeoJson : function(name,url){
// var geoJsonReader = new GeoBeans.GeoJsonReader();
// var layer = geoJsonReader.read(name,url);
// return layer;
// },

// 动画
addMoveObject : function(moveObject){
Expand Down
16 changes: 9 additions & 7 deletions src/GeoBeans/Widget.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,6 @@ GeoBeans.Widget = GeoBeans.Class({
initialize : function(name){
//GeoBeans.Class.prototype.initialize.apply(this, arguments);
},

/**
* 创建widget的div容器
* @type {函数}
* @return {div element object} 返回创建widget的div容器对象
*/
createContainer : null,

destory : function(){
//GeoBeans.Class.prototype.destory.apply(this, arguments);
Expand Down Expand Up @@ -97,3 +90,12 @@ GeoBeans.Widget.prototype.getPosition = function(){
GeoBeans.Widget.prototype.setPosition = function(pos){
this._pos = pos;
}

/**
* 创建widget的div容器
* @public
* @return {div} widget的div容器
*/
GeoBeans.Widget.prototype.createContainer = function(){
return null;
}

0 comments on commit 11038ca

Please sign in to comment.