SimpleFillSymbol no longer works with version 4.4
Tom,
This sample and several others shows it working just fine:
Robert,
Thanks for your reply. The only way I am able to get it to work is to change the version back to 4.3 from 4.4. The following is how I am using.
I am actually defining a symbol_pin
//Parcel Outline Symbol.....
var symbol_pin = new SimpleFillSymbol({
color: "white",
style: "none",
outline: {
color: [0,0,255,0.8],
width: 4
}
});
Then use with my search widget
resultSymbol: symbol_pin,
Tom....
Tom,
Can you provide a full sample of code that does not work?
Tom,
OK I have thrown together a sample to demo the bug you are seeing:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no">
<title>Search widget with multiple sources - 4.4</title>
<style>
html,
body,
#viewDiv {
padding: 0;
margin: 0;
height: 100%;
width: 100%;
}
</style>
<link rel="stylesheet" href="https://js.arcgis.com/4.4/esri/css/main.css">
<script src="https://js.arcgis.com/4.4/"></script>
<script>
require([
"esri/Map",
"esri/views/MapView",
"esri/widgets/Search",
"esri/layers/FeatureLayer",
"esri/symbols/PictureMarkerSymbol",
"esri/symbols/SimpleFillSymbol",
"dojo/domReady!"
], function(
Map,
MapView,
Search, FeatureLayer, PictureMarkerSymbol, SimpleFillSymbol) {
var map = new Map({
basemap: "dark-gray"
});
var view = new MapView({
container: "viewDiv",
map: map,
center: [-116.5453, 33.8303], // lon, lat
scale: 10000000
});
//Parcel Outline Symbol.....
var symbol_pin = new SimpleFillSymbol({
color: "white",
style: "none",
outline: {
color: [0, 0, 255, 0.8],
width: 4
}
});
var searchWidget = new Search({
view: view,
allPlaceholder: "Palm Springs Neighborhood",
sources: [{
featureLayer: new FeatureLayer({
url: "https://services.arcgis.com/V6ZHFr6zdgNZuVG0/ArcGIS/rest/services/Palm_Springs_Neighborhoods/Feature...",
popupTemplate: { // autocasts as new popupTemplate()
title: "Name {NAME} </br>{CONTACT}, {EMAIL}",
overwriteActions: true
}
}),
searchFields: ["NAME"],
displayField: "NAME",
exactMatch: false,
outFields: ["*"],
name: "Neighborhoods",
placeholder: "example: Mountain Gate",
resultSymbol: symbol_pin
}]
});
// Add the search widget to the top left corner of the view
view.ui.add(searchWidget, {
position: "top-right"
});
});
</script>
</head>
<body>
<div id="viewDiv"></div>
</body>
</html>
Here is the error in the console:
MapView.js:511 Uncaught TypeError: Cannot read property 'setTransform' of undefined
at Object.n [as drawPoint] (MapView.js:511)
at e.doRender (MapView.js:503)
at e.b.processRender (MapView.js:293)
at b.renderChild (MapView.js:500)
at b.e.renderChildren (MapView.js:290)
at b.e.doRender (MapView.js:286)
at b.processRender (MapView.js:293)
at n.renderChild (MapView.js:427)
at n.e.renderChildren (MapView.js:290)
at n.e.doRender (MapView.js:286)
You should call tech support and file this bug.
Seems like this may be a search widget issue rather than a SFS issue. I can remove any reference to the SFS and I get the same error: JS Bin - Collaborative JavaScript Debugging
Edit: my new best guess is that this is a view.graphics issue.
Hi there,
Thank your for reporting this behavior. I was able to confirm it is an issue related to Search widget when polygon and polyline features are returned as a search result. I created an issue for it.