this.GetFillSelectionSymbol = function (selectionType) { selectionType = selectionType ? selectionType : "selection"; var selectionColor = null; if (selectionType === "selection") { //cyan selectionColor = new dojo.Color([0, 255, 255, 1.0]); } else { //yellow selectionColor = new dojo.Color([255, 255, 0, 1.0]); } var fillSymbol = new esri.symbol.SimpleFillSymbol(); fillSymbol.setStyle(esri.symbol.SimpleFillSymbol.STYLE_NULL); fillSymbol.setColor(selectionColor); fillSymbol.setOutline(new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, selectionColor, 4)); return fillSymbol; } this.GetMarkerSelectionSymbol = function (selectionType, markerSize) { markerSize = markerSize ? markerSize : 25; selectionType = selectionType ? selectionType : "selection"; var markerSymbol = new esri.symbol.SimpleMarkerSymbol(); markerSymbol.setStyle = esri.symbol.SimpleMarkerSymbol.STYLE_CIRCLE; markerSymbol.setSize(markerSize); markerSymbol.setOutline(null); if (selectionType === "selection") { markerSymbol.setColor(new dojo.Color([0, 255, 255, 0.5])); } else { markerSymbol.setColor(new dojo.Color([255, 255, 0, 0.5])); } return markerSymbol; }
var eqOutFields = [equipmentLayerIdFieldName, equipmentLayerTitleFieldName]; // prepare equipment layer var equipmentLayer = new esri.layers.FeatureLayer( gisMapControl.getEquipmentLayerUrl(), { id: "equipmentLayer", index: 20, infoTemplate: eqTemplate, mode: esri.layers.FeatureLayer.MODE_ONDEMAND, // MODE_SNAPSHOT opacity: 1.0, outFields: eqOutFields }); // add equipment layer map.addLayer(equipmentLayer); me.setEquipmentLayer(equipmentLayer); console.log('Equipment layer added...'); // set equipment layer selection symbol var eqSelectionSymbol = new esri.symbol.SimpleMarkerSymbol(esri.symbol.SimpleMarkerSymbol.STYLE_CIRCLE, 12, new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([0,0,0]), 1.0), new dojo.Color([0,0,0,0.35])); equipmentLayer.setSelectionSymbol(eqSelectionSymbol);
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.