|
POST
|
@Anonymous User This is what I use to communicate between my Parcel Search widget and My Print widget. //pSearch Widget Sender
//import {appActions} from 'jimu-core'
//widgetStatePropChange parameters
//1. the widgets id
//2. the objects name
//3. the object you are passing
this.props.dispatch(appActions.widgetStatePropChange(this.props.id, 'pSearchData', cTextElements));
//Print Widget reciever
//I define a ExtraProps Interface
interface ExtraProps{
pSearchData: any
}
//I add that interface to my widget class
export default class Widget extends React.PureComponent<AllWidgetProps<IMConfig> & ExtraProps, State>{
static mapExtraStateProps = (state: IMState, ownProps: AllWidgetProps<IMConfig>): ExtraProps => {
let wId: string;
for (const [key, value] of Object.entries(state.widgetsState)) {
if(value.pSearchData){
wId = key;
}
}
return {
pSearchData: state.widgetsState[wId]?.pSearchData
}
}
....
//Then in my code I can just call
this.props.pSearchData Hope this helps.
... View more
08-03-2021
11:34 AM
|
0
|
3
|
4654
|
|
POST
|
@anjelinaponkerat There are many code change you have to do if you are updating from 3.x to 4.x. Sounds like you have some syntax error(s) in your code. Hard to say what. Here is the doc link for 4.x BingMapsLayer. https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BingMapsLayer.html#constructors-summary
... View more
07-26-2021
08:22 AM
|
0
|
0
|
3794
|
|
POST
|
@Anonymous User So did you go through the EB Developer installation/setup instruction (i.e. npm ci on the client and severs folders)? https://developers.arcgis.com/experience-builder/guide/install-guide/
... View more
07-26-2021
08:18 AM
|
0
|
3
|
7526
|
|
POST
|
@Anonymous User When in VS Code you need to open the client folder not any sub folder in the EB directories. That is the only way to get all the typings for VS Code to have intelisense.
... View more
07-24-2021
05:17 PM
|
3
|
0
|
7557
|
|
POST
|
@StephenM01 That article and direction are for WAB Developer not ArcGIS Enterprise which has it's code uglified/minified.
... View more
07-24-2021
05:15 PM
|
0
|
2
|
2291
|
|
POST
|
@LefterisKoumis Strange it render fine for me in Chrome
... View more
07-23-2021
12:50 PM
|
0
|
2
|
5382
|
|
POST
|
@anjelinaponkerat Dojo is not gone, it is just not required. In 4.x you should just use native HTML code to get dom elements. const el = document.getElementById("#pse_meter");
el.addEventListener("change", function () {
... View more
07-22-2021
05:38 AM
|
1
|
2
|
3846
|
|
POST
|
@jbarrmetro It is not uncommon for basemaps to not have a well know id/name. For those basemaps that do not have a well know id you use a PortalItem to set the basemap. let basemap = new Basemap({
portalItem: {
id: "9e557abc61ce41c9b8ec8b15800c20d3" // Firefly Imagery Hybrid
}
}); To determine the portal item ids look at the basemaps portalItem property and then the id property.
... View more
07-16-2021
01:33 PM
|
0
|
0
|
2542
|
|
POST
|
@ChitraKrishnan 3.14 does not have the clone method on the Graphic class so you have to make some code changes: <!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no">
<title>Census Blocks</title>
<link rel="stylesheet" href="https://js.arcgis.com/3.14/dijit/themes/tundra/tundra.css">
<link rel="stylesheet" href="https://js.arcgis.com/3.14/esri/css/esri.css">
<style>
html,
body,
#mapDiv {
padding: 0;
margin: 0;
height: 100%;
}
</style>
<script src="https://js.arcgis.com/3.14/"></script>
<script>
var map, GL, pntsArr;
require([
"esri/map", "esri/tasks/QueryTask", "esri/SpatialReference",
"esri/tasks/query", "esri/geometry/Point", "esri/dijit/PopupTemplate",
"esri/layers/GraphicsLayer", "esri/graphic",
"esri/symbols/SimpleLineSymbol", "esri/symbols/SimpleFillSymbol", "esri/renderers/SimpleRenderer",
"esri/Color", "dojo/domReady!"
], function (
Map, QueryTask, SpatialReference,
Query, Point, PopupTemplate,
GraphicsLayer, Graphic,
SimpleLineSymbol, SimpleFillSymbol, SimpleRenderer,
Color
) {
map = new Map("mapDiv", {
basemap: "streets",
center: [-83.0014423, 39.9593239],
zoom: 14,
slider: false
});
var popupTemplate = new PopupTemplate({
title: "{NAME}",
fieldInfos: [{
fieldName: "BLOCK",
visible: true,
label: "Block: "
},
{
fieldName: "CENTLAT",
visible: true,
label: "Latitude: "
},
{
fieldName: "CENTLON",
visible: true,
label: "Longitude: "
}
]
});
GL = new GraphicsLayer({id: 'mygl', infoTemplate: popupTemplate});
map.addLayer(GL);
var arrayFromDatabase = [[-83.0014423,39.9593239],[-83.0006330,39.9597960],[-83.0019028,39.9617077]];
queryBlocks(arrayFromDatabase);
function queryBlocks(dbArr) {
var q = new Query();
q.outSpatialReference = new SpatialReference(102100);
q.returnGeometry = true;
q.outFields = ["*"];
var qt = new QueryTask("https://tigerweb.geo.census.gov/arcgis/rest/services/TIGERweb/Tracts_Blocks/MapServer/2");
dbArr.map(function (pntData){
var pnt = new Point(pntData);
q.geometry = pnt;
qt.execute(q, function (result) {
result.features.map(function (f) {
var randomColor = '#' + Math.floor(Math.random() * 16777215).toString(16);
var color = new Color(randomColor);
color.a = 0.5;
var gra = new Graphic(f.toJson());
// console.info(gra.attributes);
gra.setSymbol(
new SimpleFillSymbol(SimpleFillSymbol.STYLE_SOLID,
new SimpleLineSymbol(SimpleLineSymbol.STYLE_SOLID, new Color([0,0,0]), 2),
color
)
);
GL.add(gra);
});
});
});
}
});
</script>
</head>
<body>
<div id="mapDiv"></div>
</body>
</html>
... View more
07-16-2021
08:33 AM
|
0
|
1
|
1200
|
|
DOC
|
@PropertiesCurtin version 2.4 is very old and many enhancements have been made since then (think about it that is 16 minor version behind). I pretty sure that you have the layer set to use symbology "from Server". If you change it to "from Defaults" then you will see the light cyan circle you have showing in your image.
... View more
07-16-2021
06:19 AM
|
0
|
0
|
20886
|
|
POST
|
@ChitraKrishnan So this should get you going on the lat and lon array and different colors for blocks. The whole part on color intensity is quite a bit of work to figure that out. <!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no">
<title>Census Blocks</title>
<link rel="stylesheet" href="https://js.arcgis.com/3.37/dijit/themes/tundra/tundra.css">
<link rel="stylesheet" href="https://js.arcgis.com/3.37/esri/css/esri.css">
<style>
html,
body,
#mapDiv {
padding: 0;
margin: 0;
height: 100%;
}
</style>
<script src="https://js.arcgis.com/3.37/"></script>
<script>
var map, GL, pntsArr;
require([
"esri/map", "esri/tasks/QueryTask", "esri/SpatialReference",
"esri/tasks/query", "esri/geometry/Point", "esri/dijit/PopupTemplate",
"esri/layers/GraphicsLayer",
"esri/symbols/SimpleLineSymbol", "esri/symbols/SimpleFillSymbol", "esri/renderers/SimpleRenderer",
"esri/Color", "dojo/domReady!"
], function (
Map, QueryTask, SpatialReference,
Query, Point, PopupTemplate,
GraphicsLayer,
SimpleLineSymbol, SimpleFillSymbol, SimpleRenderer,
Color
) {
map = new Map("mapDiv", {
basemap: "streets",
center: [-83.0014423, 39.9593239],
zoom: 14,
slider: false
});
var popupTemplate = new PopupTemplate({
title: "{NAME}",
fieldInfos: [{
fieldName: "BLOCK",
visible: true,
label: "Block: "
},
{
fieldName: "CENTLAT",
visible: true,
label: "Latitude: "
},
{
fieldName: "CENTLON",
visible: true,
label: "Longitude: "
}
]
});
GL = new GraphicsLayer({id: 'mygl', infoTemplate: popupTemplate});
map.addLayer(GL);
var arrayFromDatabase = [[-83.0014423,39.9593239],[-83.0006330,39.9597960],[-83.0019028,39.9617077]];
queryBlocks(arrayFromDatabase);
function queryBlocks(dbArr) {
var q = new Query();
q.outSpatialReference = new SpatialReference(102100);
q.returnGeometry = true;
q.outFields = ["*"];
var qt = new QueryTask("https://tigerweb.geo.census.gov/arcgis/rest/services/TIGERweb/Tracts_Blocks/MapServer/2");
dbArr.map(function (pntData){
var pnt = new Point(pntData);
q.geometry = pnt;
qt.execute(q, function (result) {
result.features.map(function (f) {
var randomColor = '#' + Math.floor(Math.random() * 16777215).toString(16);
var color = new Color(randomColor);
color.a = 0.5;
var gra = f.clone();
console.info(gra.attributes);
gra.setSymbol(
new SimpleFillSymbol(SimpleFillSymbol.STYLE_SOLID,
new SimpleLineSymbol(SimpleLineSymbol.STYLE_SOLID, new Color([0,0,0]), 1),
color
)
);
GL.add(gra);
});
});
});
}
});
</script>
</head>
<body>
<div id="mapDiv"></div>
</body>
</html>
... View more
07-13-2021
06:59 AM
|
0
|
5
|
5319
|
|
DOC
|
@PropertiesCurtin Sounds like you have an issue with the url path to the picture marker symbol used as the default symbol for points. Do you get any errors in the web console of your browser?
... View more
07-13-2021
05:26 AM
|
0
|
0
|
23668
|
|
POST
|
@victhomas Here is the fix for that. <html>
<head>
<meta charset="utf-8" />
<meta
name="viewport"
content="initial-scale=1,maximum-scale=1,user-scalable=no"
/>
<style>
html,
body,
#viewDiv {
padding: 0;
margin: 0;
height: 100%;
width: 100%;
}
</style>
<link
rel="stylesheet"
href="https://js.arcgis.com/4.20/esri/themes/light/main.css"
/>
<script src="https://js.arcgis.com/4.20/"></script>
<script>
require(["esri/Map", "esri/views/MapView", "esri/layers/FeatureLayer"], (Map, MapView, FeatureLayer) => {
const markerSym = {
type: "simple",
symbol:{
type: "simple-marker",
style: "circle",
color: [108, 199, 143],
size: 11,
outline: {
color: "blue",
width: 1
}
}
};
const brewLayer = new FeatureLayer({
url: "https://services.arcgis.com/V6ZHFr6zdgNZuVG0/ArcGIS/rest/services/BreweriesCA/FeatureServer/0",
renderer: markerSym,
visible: true
})
let map = new Map({
basemap: "topo-vector",
layers: brewLayer
});
let view = new MapView({
container: "viewDiv",
map: map,
zoom: 8,
center: [-116.1118, 33.17233]
});
view.when(() => {
let lastFID = null;
view.on("pointer-move", evt => {
view.hitTest(evt).then(response => {
if (response.results.length > 0 ) {
if(lastFID === response.results[0].graphic.attributes["FID"]){
return;
}
view.graphics.removeAll();
let graphic = response.results[0].graphic;
graphic.symbol = {
type: "simple-marker",
style: "circle",
color: [25, 97, 73],
size: 11,
outline:
{
color: "white",
width: 1
}
}
lastFID = graphic.attributes["FID"];
view.graphics.add(graphic);
}
})
});
})
});
</script>
</head>
<body>
<div id="viewDiv"></div>
</body>
</html>
... View more
07-12-2021
12:42 PM
|
1
|
1
|
2036
|
|
POST
|
@ChitraKrishnan So when the map loads you have an array of lats and longs that you want to query and display the intersecting census blocks with different colors. It also looks like you want the blocks to have a popup template applied to then so when the user clicks them the popup will appear? Can you provide some example lat long array values?
... View more
07-12-2021
11:25 AM
|
0
|
2
|
5328
|
| Title | Kudos | Posted |
|---|---|---|
| 16 | 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 | |
| 1 | 03-28-2022 06:20 AM |
| Online Status |
Offline
|
| Date Last Visited |
Tuesday
|