POST
|
Hi guys, Robert Scheitlin, GISP I need to clear hitTest result, because i have PHP modal to see uploaded image on server (file name i get using hitTest) and when i click another feature and click see attached files, first time it shows current clicked feature image an on second click it returns previously clicked feature result. Help please
... View more
07-24-2020
03:36 AM
|
0
|
2
|
638
|
POST
|
Hi Guys, Hope you are all ok. So, i am trying to add hyperlink in my popup, for link i use image directory which is shared folder, so my images link looks like: K:\gwp-gis\operator.jpg; Code for popup i use is this: var Wapopup = {
title: "Holes",
content: "<b>My hole</b><br>" +
"<a href={fotosuraTi}>Images</a>"
};
For internet link it works, but for shared folder it does not. Any help please. Thanks in advance
... View more
06-30-2020
03:13 AM
|
0
|
1
|
539
|
POST
|
Hi guys, I am using default editor widget, what i want is that, when i click another feature (one is already selected) i want to edit it's attributes to be appeared immediately in attributes window. Default action is to hit BACK arrow in widget and select another feature, i do not want this BACK arrow, i want to directly select another feature. Is there any way to do it so? Thanks in advance
... View more
05-15-2020
06:57 AM
|
0
|
0
|
332
|
POST
|
Hi guys, I got problem. I can add new feature without problem, but when i want to select and update feature it does not select to update. I use JS 4.15 Version. Here is a code i use. Help please //Add Regulator
var urduli = new FeatureLayer({url: "http://LocalHost:6080/arcgis/rest/services/test/aragvi_service/FeatureServer/4",
title:"Regulator",
visible: true,
outFields:["*"],
})
map.add(Regulator)
var editor = new Editor({
view: view,
layerInfos: [{
layer: Regulator, // pass in the feature layer
fieldConfig: [ // Specify which fields to configure
{
name: "Comments",
label: "კომენტარი"
}],
enabled: true, // default is true, set to false to disable editing functionality
addEnabled: true, // default is true, set to false to disable the ability to add a new feature
updateEnabled: true, // default is true, set to false to disable the ability to edit an existing feature
deleteEnabled: true // default is true, set to false to disable the ability to delete features
}]
});
view.ui.add(editor, "top-right");
... View more
05-13-2020
04:13 PM
|
0
|
6
|
921
|
POST
|
Hi guys, I have attachments in my popup, but it shows only default image thumbnail, but i want to show attached image thumbnail. i checked it on ESRI but could not find. Any ideas?
... View more
05-06-2020
07:00 AM
|
0
|
1
|
564
|
POST
|
Aaah, i used 4.14 version, switch to 4.15 it works. Thanks my friend
... View more
05-05-2020
05:52 AM
|
0
|
0
|
881
|
POST
|
Robert, I tried but it did not work. But if i do it like i show in this code, it changes ATTACHMENTS color, but title stays same. div.esri-feature__attachments-title {
content: "Blah Blah";
color:#dc2d5e;
text-indent: 0;
display: block;
line-height: initial;
}
.esri-feature__attachments > h2 {
text-indent: -9999px;
line-height: 0;
}
.esri-feature__attachments > h2::after {
content: "Blah Blah";
text-indent: 0;
display: block;
line-height: initial;
}
... View more
05-05-2020
01:34 AM
|
0
|
2
|
881
|
POST
|
Hi all, I want to change Attachment's title (see Pic.) I know how to override CSS defaults, but what to do with DIV elements i do not know. Any help please
... View more
05-01-2020
01:48 AM
|
0
|
4
|
958
|
POST
|
Hi guys, I have layer which has one field "Images" and in this field i have image links from my shared folder (e.g. K:\images\image_1.jpg). How can i open this image in popup or in other window? I tried use <img src='{Images}'>, also make DIV in popupTemplate to have clickable content , but have no success. Any ideas and help please/ Thank you in advance
... View more
04-29-2020
09:20 AM
|
0
|
2
|
611
|
POST
|
Hi guys I am trying to select polygon features using sketchViewModel, using this sample code. I removed CSV layer with FeatureLayer. But now, when i select features, in table i see only OBJECTID, it applies column headers for other fields, but without data. see Pic. for error and Code below. Thank you in advance. <!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta
name="viewport"
content="initial-scale=1,maximum-scale=1,user-scalable=no"
/>
<title>Highlight features by geometry - 4.14</title>
<link
rel="stylesheet"
href="https://js.arcgis.com/4.14/esri/themes/light/main.css"
/>
<script src="https://js.arcgis.com/4.14/"></script>
<style>
html,
body,
#viewDiv {
padding: 0;
margin: 0;
height: 100%;
width: 100%;
overflow: hidden;
}
#info,
#gridDisplay {
position: absolute;
bottom: 0;
left: 0;
height: 35%;
background-color: white;
border-color: grey;
width: 100%;
font-size: 14px;
}
#gridDisplay {
z-index: 80;
}
#info {
z-index: 90;
font-size: 16px;
padding-left: 20px;
}
#info * {
padding-right: 20px;
}
.info {
line-height: 20px;
padding-left: 5px !important;
}
.dgrid-header,
.dgrid-header-row {
background-color: #eee;
color: #57585a;
}
.dgrid-row-even {
background-color: #f7f8f8;
}
.dgrid-row-odd {
background-color: #efefef;
}
.dgrid-selected {
background: #b4daf5;
}
.dgrid-row {
border: none;
}
</style>
<script>
require([
"esri/WebMap",
"esri/views/MapView",
"esri/layers/FeatureLayer",
"esri/layers/GraphicsLayer",
"esri/widgets/Sketch/SketchViewModel",
"esri/Graphic",
"esri/widgets/Legend",
"esri/widgets/Expand",
"esri/widgets/FeatureForm",
"dgrid/OnDemandGrid",
"dgrid/extensions/ColumnHider",
"dojo/store/Memory",
"dstore/legacy/StoreAdapter",
"dgrid/Selection"
], function(
WebMap,
MapView,
FeatureLayer,
GraphicsLayer,
SketchViewModel,
Graphic,
Legend,
Expand,
FeatureForm,
OnDemandGrid,
ColumnHider,
Memory,
StoreAdapter,
Selection
) {
let map,
view,
flLayer,
csvLayerView,
polygonGraphicsLayer,
sketchViewModel,
highlight,
grid;
const gridDiv = document.getElementById("grid");
const infoDiv = document.getElementById("info");
// create new map, view and csvlayer
setupTheView();
// create a new sketchviewmodel, setup it properties
// set up the click event for the select by polygon button
setUpSketchViewModel();
sketchViewModel.on("create", function(event) {
if (event.state === "complete") {
// this polygon will be used to query features that intersect it
polygonGraphicsLayer.remove(event.graphic);
selectFeatures(event.graphic.geometry);
}
});
const gridFields = [
"OBJECTID",
"Req_Code",
"abonentebis_raodenoba",
"dasaxeleba",
"Semqmneli",
"statusi"
];
// create a new datastore for the on demandgrid
// will be used to display attributes of selected features
const dataStore = new StoreAdapter({
objectStore: new Memory({
idProperty: "OBJECTID"
})
});
// create a grid with given columns once the csvlayer is loaded
csvLayer
.when(function() {
// create a grid with columns specified in gridFields variable
createGrid(csvLayer.fields);
// get a reference the csvlayerview when it is ready. It will used to do
// client side queries when user draws polygon to select features
view.whenLayerView(csvLayer).then(function(layerView) {
csvLayerView = layerView;
});
})
.catch(errorCallback);
/****************************************************
* Selects features from the csv layer that intersect
* a polygon that user drew using sketch view model
****************************************************/
function selectFeatures(geometry) {
view.graphics.removeAll();
if (csvLayerView) {
// create a query and set its geometry parameter to the
// polygon that was drawn on the view
const query = {
geometry: geometry,
outFields: ["*"]
};
// query graphics from the csv layer view. Geometry set for the query
// can be polygon for point features and only intersecting geometries are returned
csvLayerView
.queryFeatures(query)
.then(function(results) {
const graphics = results.features;
// if the grid div is displayed while query results does not
// return graphics then hide the grid div and show the instructions div
if (graphics.length > 0) {
// zoom to the extent of the polygon with factor 2
view.goTo(geometry.extent.expand(2));
gridDiv.style.zIndex = 90;
infoDiv.style.zIndex = 80;
document.getElementById("featureCount").innerHTML =
"<b>Showing attributes for " +
graphics.length.toString() +
" features </b>";
} else {
gridDiv.style.zIndex = 80;
infoDiv.style.zIndex = 90;
}
// remove existing highlighted features
if (highlight) {
highlight.remove();
}
// highlight query results
highlight = csvLayerView.highlight(graphics);
// get the attributes to display in the grid
const data = graphics.map(function(feature, i) {
return (
Object.keys(feature.attributes)
.filter(function(key) {
// get fields that exist in the grid
return gridFields.indexOf(key) !== -1;
})
// need to create key value pairs from the feature
// attributes so that info can be displayed in the grid
.reduce(function(obj, key) {
obj[key] = feature.attributes[key];
return obj;
}, {})
);
});
// set the datastore for the grid using the
// attributes we got for the query results
dataStore.objectStore.data = data;
grid.set("collection", dataStore);
})
.catch(errorCallback);
}
}
/************************************************
* fires when user clicks a row in the grid
* get the corresponding graphic and select it
*************************************************/
function selectFeatureFromGrid(event) {
// close view popup if it is open
view.popup.close();
// get the ObjectID value from the clicked row
const row = event.rows[0];
const id = row.data.OBJECTID;
// setup a query by specifying objectIds
const query = {
objectIds: [parseInt(id)],
outFields: ["*"],
returnGeometry: true
};
// query the csvLayerView using the query set above
csvLayerView
.queryFeatures(query)
.then(function(results) {
const graphics = results.features;
// remove all graphics to make sure no selected graphics
view.graphics.removeAll();
// create a new selected graphic
const selectedGraphic = new Graphic({
geometry: graphics[0].geometry,
symbol: {
type: "simple-fill", // autocasts as new SimpleFillSymbol()
color: "yellow",
style: "solid",
outline: {
color: "red",
width: 1
}
}
});
// add the selected graphic to the view
// this graphic corresponds to the row that was clicked
view.graphics.add(selectedGraphic);
})
.catch(errorCallback);
}
/************************************************
* Creates a new grid. Loops through poverty
* csvLayer's fields and creates grid columns
* Grid with selection and columnhider extensions
*************************************************/
function createGrid(fields) {
var columns = fields
.filter(function(field, i) {
if (gridFields.indexOf(field.name) !== -1) {
return field;
}
})
.map(function(field) {
if (field.name === "__OBJECTID") {
return {
field: field.name,
label: field.name,
sortable: true,
hidden: true
};
} else {
return {
field: field.name,
label: field.alias,
sortable: true
};
}
});
// create a new onDemandGrid with its selection and columnhider
// extensions. Set the columns of the grid to display attributes
// the hurricanes cvslayer
grid = new (OnDemandGrid.createSubclass([Selection, ColumnHider]))(
{
columns: columns
},
"grid"
);
// add a row-click listener on the grid. This will be used
// to highlight the corresponding feature on the view
grid.on("dgrid-select", selectFeatureFromGrid);
}
/************************************************************************
* Sets up the sketchViewModel. When user clicks on the select by polygon
* button sketchViewModel.create() method is called with polygon param.
************************************************************************/
function setUpSketchViewModel() {
// polygonGraphicsLayer will be used by the sketchviewmodel
// show the polygon being drawn on the view
polygonGraphicsLayer = new GraphicsLayer();
map.add(polygonGraphicsLayer);
// add the select by polygon button the view
view.ui.add("select-by-polygon", "top-left");
const selectButton = document.getElementById("select-by-polygon");
// click event for the button
selectButton.addEventListener("click", function() {
clearUpSelection();
view.popup.close();
// ready to draw a polygon
sketchViewModel.create("polygon");
});
// create a new sketch view model set its layer
sketchViewModel = new SketchViewModel({
view: view,
layer: polygonGraphicsLayer,
pointSymbol: {
type: "simple-fill", // autocasts as new SimpleFillSymbol()
color: "yellow",
style: "solid",
outline: {
color: "red",
width: 1
}
}
});
}
function clearUpSelection() {
view.graphics.removeAll();
grid.clearSelection();
}
/******************************************************
* Sets up the view. WebMap with winkel III projection
* basemap and hurricanes CsvLayer is added to the view.
******************************************************/
function setupTheView() {
const url =
"http://1ocalhost:6080/arcgis/rest/services/test/Request_Area/FeatureServer/0";
csvLayer = new FeatureLayer({
title: "Hurricanes",
url: url,
copyright: "GWP",
});
map = new WebMap({
// contains a basemap with a Winkel III projection
// the CSVLayer coordinates will re-project client-side
portalItem: {
id: "7d127cef99a44327b79f5185602b8b6b"
},
layers: [csvLayer]
});
view = new MapView({
container: "viewDiv",
map: map,
highlightOptions: {
color: "#2B65EC",
fillOpacity: 0.4
},
padding: {
bottom: infoDiv.clientHeight // Same value as the #infoDiv height in CSS
}
});
const legendExpand = new Expand({
view: view,
content: new Legend({
view: view,
style: "card"
})
});
view.ui.add(legendExpand, "top-left");
view.popup.watch("visible", function(newValue) {
if (newValue) {
clearUpSelection();
}
});
}
function errorCallback(error) {
console.log("error:", error);
}
});
</script>
</head>
<body>
<div id="viewDiv">
<div
id="select-by-polygon"
class="esri-widget esri-widget--button esri-widget esri-interactive"
title="Select features by polygon"
>
<span class="esri-icon-checkbox-unchecked"></span>
</div>
<div id="info" class="esri-widget">
<span class="info"> <b>Instructions</b> </span> <br />
<ul>
<li>
Select features using select by polygon tool. Attributes of selected
features will be displayed here.
</li>
<br />
<li>
Click on a row to select a feature associated with it or click on a
feature to display its popup.
</li>
</ul>
</div>
<div id="gridDisplay">
<span class="info" id="featureCount"></span>
<div id="grid"></div>
</div>
</div>
</body>
</html>
... View more
03-12-2020
05:41 AM
|
0
|
2
|
2184
|
POST
|
Hi Ken, Sorry for late response. You mean delete and add features with modified attributes?
... View more
03-12-2020
05:29 AM
|
0
|
0
|
1136
|
POST
|
Hi Ken, Can you show me a little snipet of code how to start?
... View more
02-24-2020
09:39 PM
|
0
|
2
|
1136
|
POST
|
Hi all, I have created feature table using pure java script CRUD, using hitTest i get my features attributes in table when i click on features on map. Also i did it using fetch, so if have any idea to use fetch URL will be useful. Now i want to update selected features attributes at the same time, like we can on desktop version select column, enter value hit enter or click and update selected features values. I know, i have to use Apply Edits, but how to update multiple features attributes at the same time. Any help appreciated. Thank you
... View more
02-24-2020
03:29 AM
|
0
|
4
|
1263
|
POST
|
Hi Egge-Jan, I use 4.14 version, i tried view.graphics.removeAll(), but it didn't work. It removes for one layer, but when i try to use it for muktuple it doesn't work.
... View more
02-03-2020
08:09 AM
|
0
|
1
|
3503
|
Title | Kudos | Posted |
---|---|---|
1 | 08-22-2022 11:57 PM | |
1 | 08-31-2022 12:41 AM | |
1 | 08-23-2022 02:49 AM | |
1 | 05-10-2022 05:12 AM | |
1 | 01-13-2022 10:03 AM |
Online Status |
Offline
|
Date Last Visited |
Monday
|