1、创建ArcGISDynamicMapServiceLayer
var demographicsLayerURL = "http://sampleserver6.arcgisonline.com/arcgis/rest/services/Census/MapServer"; var demographicsLayerOptions = { "id": "demographicsLayer", "opacity": 0.8, "showAttribution": false }; var demographicsLayer = new ArcGISDynamicMapServiceLayer(demographicsLayerURL, demographicsLayerOptions); demographicsLayer.setInfoTemplates({ 1: { infoTemplate: _blockGroupInfoTemplate }, 2: { infoTemplate: _countyCensusInfoTemplate } }); demographicsLayer.setVisibleLayers([1, 2]); map.addLayer(demographicsLayer); var oilAndGasLayer = new ArcGISDynamicMapServiceLayer("http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Petroleum/KGS_OilGasFields_Kansas/MapServer", { "id": "oilAndGasLayer", "opacity": 0.75 }); oilAndGasLayer.setInfoTemplates({ 0: { infoTemplate: _oilAndGasInfoTemplate } }); map.addLayer(oilAndGasLayer);
ArcGIS Api for Js基础,布布扣,bubuko.com
时间: 2024-12-14 13:34:47