Can you please take a look at this demo and let me know why I am not able to add the simple render / Simple Marker to the map for feature layers
require([
"esri/map",
"esri/layers/FeatureLayer",
"esri/renderers/SimpleRenderer",
"esri/symbols/SimpleMarkerSymbol",
"esri/symbols/SimpleLineSymbol",
"esri/Color",
"dojo/domReady!"
],
function(
Map,
FeatureLayer,
SimpleRenderer,
SimpleMarkerSymbol,
SimpleLineSymbol,
Color,
) {
var map = new Map("map", {
basemap: "streets",
center: [-82.44109, 35.6122],
zoom: 17
});
var featureLayer = new FeatureLayer("https://services.arcgis.com/V6ZHFr6zdgNZuVG0/arcgis/rest/services/Landscape_Trees/FeatureServer/0");
featureLayer.setRenderer( new SimpleMarkerSymbol(SimpleMarkerSymbol.STYLE_SQUARE, 10,
new Color([0,255,0,0.25])));
map.addLayer(featureLayer);
});
Solved! Go to Solution.
Bruce,
require([
"esri/map",
"esri/layers/FeatureLayer",
"esri/renderers/SimpleRenderer",
"esri/symbols/SimpleMarkerSymbol",
"esri/symbols/SimpleLineSymbol",
"esri/Color",
"dojo/domReady!"
],
function(
Map,
FeatureLayer,
SimpleRenderer,
SimpleMarkerSymbol,
SimpleLineSymbol,
Color,
) {
var map = new Map("map", {
basemap: "streets",
center: [-82.44109, 35.6122],
zoom: 17
});
var featureLayer = new FeatureLayer("https://services.arcgis.com/V6ZHFr6zdgNZuVG0/arcgis/rest/services/Landscape_Trees/FeatureServer/0");
featureLayer.setRenderer(new SimpleRenderer(new SimpleMarkerSymbol(SimpleMarkerSymbol.STYLE_SQUARE, 10, new SimpleLineSymbol(), new Color([0, 255, 0, 0.25]))));
map.addLayer(featureLayer);
});
Bruce,
require([
"esri/map",
"esri/layers/FeatureLayer",
"esri/renderers/SimpleRenderer",
"esri/symbols/SimpleMarkerSymbol",
"esri/symbols/SimpleLineSymbol",
"esri/Color",
"dojo/domReady!"
],
function(
Map,
FeatureLayer,
SimpleRenderer,
SimpleMarkerSymbol,
SimpleLineSymbol,
Color,
) {
var map = new Map("map", {
basemap: "streets",
center: [-82.44109, 35.6122],
zoom: 17
});
var featureLayer = new FeatureLayer("https://services.arcgis.com/V6ZHFr6zdgNZuVG0/arcgis/rest/services/Landscape_Trees/FeatureServer/0");
featureLayer.setRenderer(new SimpleRenderer(new SimpleMarkerSymbol(SimpleMarkerSymbol.STYLE_SQUARE, 10, new SimpleLineSymbol(), new Color([0, 255, 0, 0.25]))));
map.addLayer(featureLayer);
});