//加载热力图
DCI.heatmap.Init(map);
var serviceURL = "http://localhost:6080/arcgis/rest/services/dlsde/FeatureServer/0";
var heatmapFeatureLayerOptiOns= {
mode: esri.layers.FeatureLayer.MODE_SNAPSHOT,
outFields: ["NAME", "KIND"]
//infoTemplate: infoTemplate
};
var heatmapFeatureLayer = new esri.layers.FeatureLayer(serviceURL, heatmapFeatureLayerOptions);
heatmapFeatureLayer.id = "heatmap";
var heatmapRenderer = new esri.renderers.HeatmapRenderer({
field: "KIND",
colors: ["rgba(0, 0, 255, 0)", "rgb(0, 0, 255)", "rgb(255, 0, 255)", "rgb(255, 0, 0)"],
blurRadius: 12,
maxPixelIntensity: 250,
minPixelIntensity: 10
});
//监听check点击事件
$("[name = heatmapFeatureLayer]:checkbox").bind("click", function () {
if ($(this).attr("checked")) {
if (DCI.heatmap.map.getLayer("heatmap")) {
DCI.heatmap.map.getLayer("heatmap").show();
} else {
heatmapFeatureLayer.setRenderer(heatmapRenderer);
DCI.heatmap.map.addLayer(heatmapFeatureLayer);
}
}
else {
if (DCI.heatmap.map.getLayer("heatmap"))
DCI.heatmap.map.getLayer("heatmap").hide();
}
})