|
POST
|
Alex, I have not tried this personally but the normal way would be to listen for the suggest-complete event https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#event-suggest-complete and work with the result property.
... View more
10-20-2020
06:14 AM
|
0
|
0
|
1892
|
|
POST
|
Michael, You are going to find very little info on adding a right click event to WAB as it is a very poor workflow choice. There is no right click on mobile, Apple is not a big supporter of right click, actually Windows is the main platform that uses right click. The few threads I have seen about adding right click to WAB normally they change their mind for a alternate workflow. But if that is your choice then the answer is just add a view click listener and check the button property of the event. https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#event-click
... View more
10-20-2020
05:17 AM
|
2
|
4
|
4464
|
|
POST
|
Ben, See if this helps. I have associated the layer in question with the search widget and have define an actual popup template: <!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.16</title>
<style>
html,
body,
#viewDiv {
padding: 0;
margin: 0;
height: 100%;
width: 100%;
}
</style>
<link rel="stylesheet" href="https://js.arcgis.com/4.16/esri/css/main.css">
<script src="https://js.arcgis.com/4.16/"></script>
<script>
var view, map;
require([
"esri/Map",
"esri/views/MapView",
"esri/widgets/BasemapToggle",
"esri/widgets/Legend",
"esri/layers/TileLayer",
"esri/layers/FeatureLayer",
"esri/widgets/Search",
"esri/widgets/LayerList",
"esri/PopupTemplate",
"dojo/on",
"dojo/domReady!"
], function (
Map,
MapView,
BasemapToggle,
Legend,
TileLayer,
FeatureLayer,
Search,
LayerList,
PopupTemplate,
on
) {
var template = {
// autocasts as new PopupTemplate()
title: "{Cmn_Name} : {Sci_Name}",
content: [
{
// It is also possible to set the fieldInfos outside of the content
// directly in the popupTemplate. If no fieldInfos is specifically set
// in the content, it defaults to whatever may be set within the popupTemplate.
type: "fields",
fieldInfos: [
{
fieldName: "Cmn_Name",
label: "Common Name"
},
{
fieldName: "Sci_Name",
label: "Scientific Name"
},
{
fieldName: "Condition",
label: "Condition",
},
{
fieldName: "Leaf_Area",
label: "Leaf Area",
format: {
digitSeparator: true,
places: 0
}
}
]
}
]
};
var Cyber_Areas = new FeatureLayer({
url: "https://services.arcgis.com/V6ZHFr6zdgNZuVG0/arcgis/rest/services/Landscape_Trees/FeatureServer/0",
outFields: ["*"],
popupTemplate: template
});
map = new Map({
basemap: "osm"
});
map.add(Cyber_Areas);
view = new MapView({
container: "viewDiv",
map: map,
center: [-82.44119304356839, 35.61044834995553], // lon, lat
zoom: 16
});
var searchWidget = new Search({
view: view,
popupOpenOnSelect: false,
sources: [{
layer: Cyber_Areas,
searchFields: ["Cmn_Name"],
displayField: "Cmn_Name",
exactMatch: false,
outFields: ["*"],
name: "Trees",
placeHolder: "example: elm"
}],
includeDefaultSources: false
});
view.ui.add(searchWidget, {
position: "top-left",
index: 0
});
});
</script>
</head>
<body>
<div id="viewDiv"></div>
</body>
</html>
... View more
10-19-2020
07:24 AM
|
1
|
1
|
1729
|
|
POST
|
Michel, but this for the ArcGIS API for JavaScript Which is what WAB is built on. If you are never getting to the showResults function then you have an error in your code. Hard to tell you much more with out seeing your widget code.
... View more
10-19-2020
05:44 AM
|
0
|
0
|
800
|
|
POST
|
Ben, There is nothing in your code that associates your layer with the search widgets result thus the search results does not have a "IN_COUNTRY" field. The search widget does not automatically search layers that are added to the map.
... View more
10-19-2020
05:42 AM
|
0
|
3
|
1729
|
|
POST
|
Michael, https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#popup WAB 3D uses JS API 4.x so you just need to search the JS API space to find your answers sometimes. https://community.esri.com/thread/223665-webscene-how-to-prevent-the-identify-on-click-on-the-scene
... View more
10-19-2020
05:33 AM
|
0
|
6
|
4464
|
|
DOC
|
Laurynas, I could not tell you as I do not use any such file.
... View more
10-16-2020
01:54 PM
|
0
|
0
|
20466
|
|
POST
|
sorry that is a bit beyond the context of this thread.
... View more
10-16-2020
01:33 PM
|
0
|
0
|
6162
|
|
POST
|
if(featureLayer.graphics[0].geometry.type === "point"){
featureLayer.renderer = new SimpleRenderer(new SimpleMarkerSymbol(SimpleMarkerSymbol.STYLE_SQUARE, 10,
new SimpleLineSymbol(SimpleLineSymbol.STYLE_SOLID,
new Color([255,0,0]), 1),
new Color([0,255,0,0.25])));
}else if(featureLayer.graphics[0].geometry.type === "polygon"){
featureLayer.renderer = new SimpleRenderer(new SimpleFillSymbol(SimpleFillSymbol.STYLE_NULL,
new SimpleLineSymbol(SimpleLineSymbol.STYLE_SOLID,
new Color([255,0,0]), 1),
new Color([0,0,0,0])));
}
... View more
10-16-2020
01:21 PM
|
2
|
2
|
6162
|
|
POST
|
I thought you said you were use the dojo dijit/layout/TabContainer ...
... View more
10-16-2020
11:43 AM
|
0
|
1
|
2339
|
|
POST
|
I personally use the jimu.js/dijit/TabContainer. It is a html css tab container.
... View more
10-16-2020
10:08 AM
|
0
|
3
|
2339
|
|
POST
|
Widget life cycle—ArcGIS Web AppBuilder (Developer Edition) | ArcGIS for Developers Creating event handlers in in the onOpen is definitely a bad idea. Unless you are first checking if the event handler exists and then removing it before creation.
... View more
10-16-2020
08:01 AM
|
0
|
1
|
2343
|
|
POST
|
postcreate is probably to early in the widget life cycle for this. I am not sure if all the widgets dom element would be created and rendered inside that function. The controlButton property would be the actual tab in the tab controller.
... View more
10-16-2020
07:16 AM
|
0
|
8
|
2343
|
|
POST
|
See this thread: https://community.esri.com/thread/237619-change-default-symbology-for-add-data-widget-in-dev
... View more
10-16-2020
05:26 AM
|
0
|
0
|
1183
|
|
POST
|
Arne, That tells me that it did not find the contentpane by the id then. What function in your code are you putting this in (i.e. widget lifecycle, Startup, postCreate, etc, etc)?
... View more
10-16-2020
05:22 AM
|
0
|
11
|
2343
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 04-14-2020 11:36 AM | |
| 17 | 05-17-2021 01:51 PM | |
| 1 | 07-06-2020 05:32 AM | |
| 1 | 07-10-2018 05:49 AM | |
| 9 | 01-28-2022 10:58 AM |
| Online Status |
Offline
|
| Date Last Visited |
06-08-2026
06:27 AM
|