1つの問題ではない場合は、別の問題です。私はこれを一日中見てきましたが、ここで何が問題なのかわかりません。ここでも、county レイヤーと msa レイヤーの 2 つのレイヤーを含むマップがあります。ページ 1 には、county と表示されているページと、msa と表示されているリンクが 2 つあります。いずれかのリンクをクリックすると、マップの 1 つのレイヤーがオフになり、正しいレイヤーに表示されます。クリックイベントは次のとおりです。
$('.map-type-link').live('click', function () {
params.display_region_type = parseInt($(this).attr('region_type'));
if (params.display_region_type == 1) {
app.currentFl = app.featureLayers[0];
}
else {
app.currentFl = app.MSAfl;
app.flVis.setVisibility(false);
app.MSAfl.setVisibility(true);
app.currentFl.redraw();
}
});
郡をクリックするだけでなく、app.flvis がまだ表示されています。
ここでは、フィーチャ レイヤーが作成されます。
dojo.forEach(app.layersUrls, function (info, idx) {
app.featureLayers[idx] = new esri.layers.FeatureLayer(
app.layersUrls[idx], {
mode: esri.layers.FeatureLayer.MODE_ONDEMAND,
outFields: app.outFields[idx],
opacity: 0.80
}
);
app.featureLayers[idx].setRenderer(br);
//create min and max scales when layers load
dojo.connect(app.featureLayers[idx], 'onLoad', function () {
app.featureLayers[idx].minScale = app.layerScales[idx].min;
app.featureLayers[idx].maxScale = app.layerScales[idx].max;
});//ends connections
//add THIS feature layer to the map
app.map.addLayer(app.featureLayers[idx]);