将Feature图层加入地图,设定visible为false:
DBSFeature1 = new FeatureLayer("http://192.168.0.143:6080/arcgis/rest/services/BS/MeasureArea_F/MapServer/1", {
mode: FeatureLayer.MODE_ONDEMAND,
id: "计量分区+",
visible: false,
outFields: ["*"],
infoTemplate: infoTemplateDBS
});
map.addLayer(DBSFeature1);
DBSFeature0 = new FeatureLayer("http://192.168.0.143:6080/arcgis/rest/services/BS/MeasureArea_F/MapServer/0", {
mode: FeatureLayer.MODE_ONDEMAND,
id: "计量分区",
visible: false,
outFields: ["*"],
infoTemplate: infoTemplateDBS
});
map.addLayer(DBSFeature0);
显示图层的函数,并找到中心点:
function DBSLineNewNew(tmp) {
DBSFeature1.setDefinitionExpression("MArea_ID = '" + tmp + "'");
DBSFeature