POST
|
I got it., I see what you are saying now. The expressions are commented out, i *thought* those were right, looks like those aren't either. 🙂 I am seeing errors on this pen for 'name' and 'length'.
... View more
09-20-2022
08:46 AM
|
0
|
0
|
1580
|
POST
|
I'm not sure that I'm following. Isn't the "if (layer.title ==="xxx), etc." the layer definition?
... View more
09-20-2022
08:32 AM
|
0
|
0
|
1582
|
POST
|
I have an editing app and I am getting a type error thrown. I have layers defined and pointing to a hosted serviuce/map. Editor.js:426 Uncaught TypeError: Cannot read properties of undefined (reading 'layer') at Editor.js:426:139 at Array.find (<anonymous>) at J (Editor.js:426:129) at Editor.js:441:414 at Array.map (<anonymous>) at F.map ((index):64:265) at v.get (Editor.js:441:335) at Object.u [as runTracked] ((index):160:183) at t.getComputed ((index):154:279) at p.get ((index):146:326) (anonymous) @ Editor.js:426 J @ Editor.js:426 (anonymous) @ Editor.js:441 F.map @ (index):64 get @ Editor.js:441 u @ (index):160 t.getComputed @ (index):154 p.get @ (index):146 c @ (index):135 d @ (index):135 (anonymous) @ (index):171 u @ (index):160 t @ (index):205 r @ (index):170 q @ (index):170 n @ (index):178 (anonymous) @ (index):182 code: <html>
<head>
<meta charset="utf-8" />
<meta
name="viewport"
content="initial-scale=1,maximum-scale=1,user-scalable=no"
/>
<title>
Area of roof Calculation based on Slope
</title>
<link
rel="stylesheet"
href="https://js.arcgis.com/4.23/esri/themes/light/main.css"
/>
<script src="https://js.arcgis.com/4.23/"></script>
<style>
html,
body,
#viewDiv {
padding: 0;
margin: 0;
height: 100%;
width: 100%;
}
.esri-editor .esri-item-list__scroller {
max-height: 350px;
}
</style>
<script>
require(["esri/WebMap", "esri/views/MapView", "esri/popup/ExpressionInfo", "esri/widgets/Editor", "esri/widgets/Search", "esri/layers/FeatureLayer"], (
WebMap,
MapView,
ExpressionInfo,
Editor,
Search,
FeatureLayer
) => {
let EntireStructureLayer, DamagedAreasLayer;
// Create a map from the referenced webmap item id
const webmap = new WebMap({
portalItem: {
id: "6a98a932b16142ae9d262e3e48a021a3"
}
});
const view = new MapView({
container: "viewDiv",
map: webmap
});
const featureLayerROE = new FeatureLayer({
url: "https://services.arcgis.com/9MNW08Jq46DD7XQg/arcgis/rest/services/brms_09122022_WFL1/FeatureServer/5",
popuptemplate: {
title: "ROE Number {roeidpk}",
overwriteActions: true
}
});
view.when(() => {
view.map.layers.forEach((layer) => {
if (layer.title === "Entire Structure") {
EntireStructureLayer = {
layer: EntireStructure,
formTemplate: {
// autocasts to FormTemplate
elements: [
{
type: "field",
fieldName: "ROE_IDPK",
label: "ROE Number"
},
{
// autocasts to FieldElement
type: "field",
fieldName: "Area_SQFT",
label: "Area in Square Feet",
// expression defined in expressionInfos
valueExpression: "area"
},
{
type: "field",
fieldName: "Pitch_Slope",
label: "Pitch of Roof"
},
{
type: "field",
fieldName: "Area_pitch_SQFT",
label: "Area based on Pitch (FT)",
// expression defined in expressionInfos
valueExpression: "Pitchft2",
},
{
type: "field",
fieldname: "RoofType",
label: "Type of Roof"
},
],
expressionInfos: [{
name: "area",
title: "Area SQ FT",
expression: "AreaGeodetic($feature,'feet')"
}, {
name: "Pitchft2",
title: "Area based on Pitch (FT)",
expression:' "$feature.Pitch_Slope==1, $feature.Area_SQFT*1.031, $feature.Pitch_Slope==2, $feature.Area_SQFT*1.158, $feature.Pitch_Slope==3, $feature.Area_SQFT*1.414, $feature.Pitch_Slope==4, $feature.Area_SQFT*1.944, $feature.Area_SQFT)"'
}
]
}
};
} else {
if(layer.title === "DamagedAreasmultipatch")
DamagedAreasLayer = {
layer: DamagedAreasmultipatch,
formTemplate: {
// autocasts to FormTemplate
elements: [
{
type: "field",
fieldName: "ROE_IDPK",
label: "ROE Number"
},
{
// autocasts to FieldElement
type: "field",
fieldName: "Area_Ft2",
label: "Area in Square Feet",
// expression defined in expressionInfos
valueExpression: "area1"
},
{
type: "field",
fieldName: "Pitch",
label: "Pitch of Roof"
},
{
type: "field",
fieldName: "Area_pitch_ft2",
label: "Area based on Pitch (FT)",
// expression defined in expressionInfos
valueExpression: "Pitchft2"
},
{
type: "field",
fieldName: "NumPanels",
label: "Number of Plywood Panels Needed"
},
{
type: "field",
fieldName: "Length_rafters_area",
label: "Length of Rafters Needed"
}
],
expressionInfos: [{
name: "area1",
title: "Area SQ FT",
expression: "AreaGeodetic($feature,'feet')"
}, {
name: "Pitchft2",
title: "Area based on Pitch (FT)",
expression:' "$feature.Pitch==1, $feature.Area_Ft2*1.031, $feature.Pitch==2, $feature.Area_Ft2*1.158, $feature.Pitch==3, $feature.Area_Ft2*1.414, $feature.Pitch==4, $feature.Area_Ft2*1.944, $feature.Area_Ft2)"'
}
]
}
};
}
});
const searchWidget = new Search({
view: view,
allPlaceholder: "Search",
includeDefaultSources: false,
sources: [
{
layer: featureLayerROE,
searchFields: ["roeidpk"],
displayField: "ROE IDPK",
exactMatch: true,
outFields: ["roeidpk", "flagroe", "invoicenumber"],
name: "ROE IDPK",
placeholder: "example: 278585"
}
]
});
const editor = new Editor({
layerInfos: [EntireStructureLayer, DamagedAreasLayer],
view: view,
});
// Add the widget to the view
view.ui.add(editor, "top-right");
view.ui.add(searchWidget, "bottom-right")
});
});
</script>
</head>
<body>
<div id="viewDiv"></div>
</body>
</html> Thanks in advance!
... View more
09-19-2022
05:35 PM
|
1
|
4
|
1731
|
POST
|
Is there a sample that you can point me to? Trying to figure out how the Arcade component would fit into this. In my example: A user digitizes a polygon, selects a domain/subtype and then the arcade calculation updates a different field based on math/equation that is applied when the subtype is selected.
... View more
05-09-2022
06:04 PM
|
0
|
0
|
336
|
POST
|
Is there a way to calculate attribute values of a hosted feature class based on a user selected value? Example: A user is editing a parcel or polygon of land use in a web app (widget) and I want the user to select a "value" from a list (type or value or something) or based on some other field (area maybe) in the attribute table based on multiplying/adding a pre-set amount. So, if a user creates a 2 acre parcel and it's agriculture, we multiply that by 3.2 and the value is: 6.4. Whereas if that 2 acre parcel is business, it is multiplied by 1.5, resulting in a value of 3. So, we'd have two values in the attribute table, the created value and the updated/adjusted value. I know the attribute rules component of Pro can do some of this, but that is not available in the web. Thanks in advance
... View more
05-05-2022
12:24 PM
|
0
|
2
|
589
|
POST
|
Yes, you'll need x,y,z information either embedded in the exif of the images - or in a csv someplace that can be pulled. I am not aware that you can import a cloud into any software as the "las"/"cloud" is created from the processing and adjustment of the imagery in the project that is processed by the software.
... View more
09-25-2018
12:11 PM
|
0
|
0
|
400
|
POST
|
I've had this happen when the block is too large to process and the D2M engine overloads the pc resources. I hate to say it but 3,000 images may be suited for 2 projects/blocks. I've had to do this on a few occasions and I run 2 K80 GPU's on a brand new 30k server. So, its not uncommon to have to split the project.
... View more
05-25-2018
05:15 AM
|
0
|
0
|
679
|
POST
|
Last year I took the Public Information Map template and dropped the shared content piece... I was asked yesterday to"dust it off" and I'm having an issue with the Twitter feeds not displaying- but timing out. I don't see any errors - any one else have/had this issue? I even tried using the demo one and that doesn't display twitter either...
... View more
03-06-2012
08:03 AM
|
0
|
0
|
408
|
POST
|
I answered my own question... I didn't have the ougoing rules set up quite right. changed the loaclhost to the IP and it worked fine.
... View more
04-25-2011
06:09 AM
|
0
|
0
|
294
|
POST
|
I just finished installing the new GeoPortal. Here is what I have so far: 1. Virtual Server - Win2k8 R2, Tomcat 6, IIS7, using the ARR in IIS to redirect 8080 to port 80. I have sucessfully got the ARR setup so that when you go to: http://128.172.160.140:8080/geoportal you get redirected to port 80. that works fine. I have the LDAP working so that the user can login and upload metadata to the server. I have several test records in the database that I can search on and the results will display. Here is the issue. Once the search finishes and the record is displayed and the user clicks on it, they have a choice to view the Metadata or the Details. Instead of the IP Address being used here, the link starts out with: http://localhost:8080/geoportal/catalog/search/resource/details.page?uuid=%7B2AE7BB94-3D79-4409-97B4-487F6D90FE3B%7D What is the deal with that? Anyone had that happen? Is there something in the xml config file that needs to be changed, or is this something that I need to do on the ARR outbound/inbound rules? Here is the link i used to create the ARR if you're interested: http://www.iisadmin.co.uk/?p=326&page=1
... View more
04-22-2011
09:54 AM
|
0
|
3
|
403
|
POST
|
Thanks- yes, I used the skeleton of that code to perform the identify. However, I do not want an 'infowindow'. I want the results to be displayed in a tab off of the map (see image). So, I combined the tabbed layout/legend sample and the identify sample. I have the legend showing up, I just can't get the results of the identify operation to show in a "results' tab off the map. a screen-shot is attached
... View more
12-02-2010
11:17 AM
|
0
|
0
|
356
|
POST
|
Hello- I'm realtivly new to the api... I'm using the map layout sample and the identify sample to combine them. I'm trying to allow the user to identify a polygon and then show the results of the identify in a tab next to the legend tab. I'll post my code below. I can get a map, but haven't been able to get the identify working yet - nor display it in the tab instead of the common infowindow. Thanks for the help! I'd be interestested in comments on the code or any samples anyone has that might that might help. Thanks!
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<!--The viewport meta tag is used to improve the presentation and behavior of the samples
on iOS devices-->
<meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no"/>
<title>
</title>
<link rel="stylesheet" type="text/css" href="http://serverapi.arcgisonline.com/jsapi/arcgis/2.1/js/dojo/dijit/themes/claro/claro.css">
<style type="text/css">
html, body {
height: 100%; width: 100%; margin: 0;
}
body{
background-color:white; overflow:hidden;
font-family: "Trebuchet MS";
}
#header {
background-image: url(images/banner.jpg); background-repeat: repeat-x;
margin: 2px;
border: solid 4px #224a54;
color:white; font-size:18pt;
text-align:left; font-weight:bold; height:70px;
}
#subheader {
font-size:small;
color:white;
padding-left:20px;
}
#rightPane{
background-color:white;
color:#3f3f3f;
border: solid 2px #224a54;
width:20%;
}
#leftPane{
margin: 5px;
padding:2px;
background-color:white;
color:#3f3f3f;
border: solid 2px #224a54;
width:20%;
}
#map {
margin: 5px;
border:solid 4px #224a54;
-moz-border-radius: 4px;
}
#footer {
margin: 2px;
border: solid 2px #224a54;
background-color:#ecefe4;color:#3f3f3f;
font-size:10pt; text-align:center; height:40px;
}
.dijitTabInnerDiv{
background-color:#ecefe4;
}
#tabs{
padding:5px;
}
</style>
<script type="text/javascript">
var djConfig = {
parseOnLoad: true
};
</script>
<script type="text/javascript" src="http://serverapi.arcgisonline.com/jsapi/arcgis/?v=2.1">
</script>
<script type="text/javascript">
dojo.require("dijit.dijit"); // optimize: load dijit layer
dojo.require("dijit.layout.BorderContainer");
dojo.require("dijit.layout.ContentPane");
dojo.require("esri.tasks.identify");
dojo.require("esri.map");
dojo.require("dijit.layout.TabContainer");
dojo.require("esri.dijit.Legend");
var map;
function init() {
var initialExtent = new esri.geometry.Extent({ "xmin": -9380000.069899248, "ymin": 4340000.391548632, "xmax": -8330000.0000, "ymax": 4895884.47539039, "spatialReference": { "wkid": 102100} });
map = new esri.Map("map", {
extent: initialExtent
});
dojo.connect(map, 'onLoad', function (map) {
dojo.connect(dijit.byId('map'), 'resize', resizeMap);
});
var basemapUrl = "http://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer";
var dynamicUrl = "http://gis.vcu.edu/ArcGIS/rest/services/Housing/MapServer";
var basemap = new esri.layers.ArcGISTiledMapServiceLayer(basemapUrl, { opacity: 0.55 });
var dynamicLayer = new esri.layers.ArcGISDynamicMapServiceLayer(dynamicUrl, { opacity: 0.8 });
dojo.connect(map, 'onLayersAddResult', function (results) {
//add the legend
var legend = new esri.dijit.Legend({
map: map,
layerInfos: [{ layer: dynamicLayer, title: "Housing"}],
arrangement: esri.dijit.Legend.ALIGN_Left
}, "legendDiv");
legend.startup();
});
map.addLayer(basemap);
map.addLayers([dynamicLayer]);
}
//addedcontent for identify widgit start here WS
function initFunctionality(map) {
dojo.connect(map, "onClick", doIdentify);
identifyTask = new esri.tasks.IdentifyTask("http://gis.vcu.edu/ArcGIS/rest/services/housing/MapServer");
identifyParams = new esri.tasks.IdentifyParameters();
identifyParams.tolerance = 3;
identifyParams.returnGeometry = true;
identifyParams.layerIds = [0];
identifyParams.layerOption = esri.tasks.IdentifyParameters.LAYER_OPTION_ALL;
identifyParams.width = map.width;
identifyParams.height = map.height;
symbol = new esri.symbol.SimpleFillSymbol(esri.symbol.SimpleFillSymbol.STYLE_SOLID, new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([255, 0, 0]), 2), new dojo.Color([255, 255, 0, 0.25]));
}
function doIdentify(evt) {
map.graphics.clear();
identifyParams.geometry = evt.mapPoint;
identifyParams.mapExtent = map.extent;
identifyTask.execute(identifyParams, function (idResults) { addToMap(idResults, evt); });
}
function addToMap(idResults, evt) {
CountyResults = { displayFieldName: null, features: [] };
for (var i = 0, il = idResults.length; i < il; i++) {
var idResult = idResults;
if (idResult.layerId === 0) {
if (!CountyResults.displayFieldName) { CountyResults.displayFieldName = idResult.displayFieldName };
CountyResults.features.push(idResult.feature);
}
}
dijit.byId("ResultsDiv").setContent(layerTabContent(CountyResults, "CountyResults"));
}
function layerTabContent(layerResults, layerName) {
var content = "";
switch (layerName) {
case "CountyResults":
content = "<i>Total features returned: " + layerResults.features.length + "</i>";
content += "<table border='1'><tr><th>ID</th><th>Address</th></tr>";
for (var i = 0, il = layerResults.features.length; i < il; i++) {
content += "<tr><td>" + layerResults.features.attributes['PARCELID'] + " <a href='#' onclick='showFeature(" + layerName + ".features[" + i + "]); return false;'>(show)</a></td>";
content += "<td>" + layerResults.features.attributes['Full Site Address'] + "</td>";
}
content += "</tr></table>";
break;
}
return content;
}
function showFeature(feature) {
map.graphics.clear();
feature.setSymbol(symbol);
map.graphics.add(feature);
}
//end here with added content stuff
function resizeMap() {
//resize the map when the browser resizes - view the 'Resizing and repositioning the map' section in
//the following help topic for more details http://help.esri.com/EN/webapi/javascript/arcgis/help/jshelp_start.htm#jshelp/inside_faq.htm
var resizeTimer;
clearTimeout(resizeTimer);
resizeTimer = setTimeout(function () {
map.resize();
map.reposition();
}, 500);
}
//show map on load
dojo.addOnLoad(init);
</script>
</head>
<body class="claro">
<div id="mainWindow" dojotype="dijit.layout.BorderContainer" design="headline" gutters="false" style="width:100%; height:100%;">
<div id="header" dojotype="dijit.layout.ContentPane" region="top">
This is the header section
<div id="subheader">subheader</div>
</div>
<div dojotype="dijit.layout.ContentPane" id="leftPane" region="left">
<div dojotype="dijit.layout.TabContainer" >
<div dojotype="dijit.layout.ContentPane" title = "Legend" selected="true">
<div id="legendDiv"></div>
</div>
<div dojotype="dijit.layout.ContentPane" title = "Results" selected="false">
<div id="ResultsDiv"></div>
</div>
</div>
</div>
<div id="map" dojotype="dijit.layout.ContentPane" region="center">
</div>
<div id="footer" dojotype="dijit.layout.ContentPane" region="bottom" >
this is the footer section
</div>
</div>
</body>
</html>
... View more
12-02-2010
05:08 AM
|
0
|
3
|
783
|
Title | Kudos | Posted |
---|---|---|
1 | 09-19-2022 05:35 PM |
Online Status |
Offline
|
Date Last Visited |
02-15-2024
09:18 AM
|