|
POST
|
I haven't done this but it looks like using the ArcGIS API for Python is probably the way to go. Updating your hosted feature services with ArcGIS Pro and the ArcGIS API for Python
... View more
02-25-2019
08:13 AM
|
0
|
0
|
2410
|
|
POST
|
I may still be missing something, but a geoprocessing service runs using the current state of the input layer, not a copy of the input layer when it was published. write a stand alone, server side script that references a point feature services/hosted feature class, runs the necessary tasks, and uses the output to update the feature service/ hosted feature class that would be in the viewer Is the "point feature service" you mentioned the same as the feature service in the viewer? Could you describe your goal with more specific names so it's easier to follow?
... View more
02-22-2019
07:22 AM
|
0
|
2
|
2410
|
|
POST
|
It sounds like you've already got a script, can't you just schedule it to run on your server? Python
... View more
02-21-2019
08:08 AM
|
0
|
4
|
2410
|
|
POST
|
We have ArcGIS Web Adaptor configured on the server and use an .ags connection file pointed to the web adaptor on http. You should be able to do it all with https as long as your certificates are all valid. Edit: That is actually for just publishing a geocode service that overwrites the existing service so it doesn't directly relate to your question about starting and stopping services. Here are the basic steps: arcpy.CreateGeocodeSDDraft() arcpy.StageService_server() arcpy.server.UploadServiceDefinition()
... View more
02-19-2019
12:11 PM
|
0
|
0
|
4407
|
|
POST
|
You could watch for a change in the map extent to apply the goTo method with your own options parameter. Watch for changes | ArcGIS API for JavaScript 4.10 Maybe watch the map view extent property for changes and intervene with your own goTo and options.
... View more
12-31-2018
02:13 PM
|
0
|
0
|
1984
|
|
POST
|
I'm not sure exactly what Andres Castillo changed to get his working, but it looks like the myGDB variable is undefined. Try assigning it on line 6 of your script like myGDB = arcpy.GetParameterAsText(0)
... View more
12-20-2018
02:42 PM
|
1
|
0
|
3631
|
|
POST
|
Your psuedo code, example data, and test code all have differences and some of it appears incomplete. It's impossible to accurately determine what exactly your logic needs to be so here are some tips: Ensure you're using the Python interpreter (PYTHON_9.3) in Calculate Field. Use None for null values. Something like if Field5 is None: Use the str.format() method to ensure numbers are properly converted to strings when combining values. Try adding # -*- coding: latin-1 -*- or # -*- coding: utf-8 -*- at the beginning of your script (or the code block if running in ArcToolbox) to handle the special characters. Check if Field1 has an integer or text datatype. If text, you'll need to put quotes around the numbers. You should use == for comparing values.
... View more
12-05-2018
08:35 AM
|
1
|
2
|
5147
|
|
POST
|
We're solving this by setting up the ArcGIS Web Adaptor on the application server and using that for all the service urls in the app. Or you can just host your application on the same server as ArcGIS Enterprise. You can also read through CORS with the API | ArcGIS API for JavaScript 4.9 and https://community.esri.com/community/developers/web-developers/arcgis-api-for-javascript/blog/2018/08/30/cors-and-the-arcgis-api-for-javascript-changes-coming-in-49
... View more
10-23-2018
09:48 AM
|
1
|
0
|
926
|
|
POST
|
Rene Rubalcava Which version of the API allows you to update the symbol of the graphic directly?
... View more
10-18-2018
08:39 AM
|
0
|
1
|
3278
|
|
POST
|
Sorry, I'm not very familiar with the 3.x API and I can't get your code to run (even with the missing closing </div> tag for mainWindow). The Esri Sketch temporary geometries sample is the best example of making a sketch widget in 4.x.
... View more
10-17-2018
12:55 PM
|
2
|
1
|
7296
|
|
POST
|
Here's a quick update I did to the Esri sketch geometry sandbox to include a text graphic button. The Esri icon font graphic example also has a simplified way of displaying a point graphic with textSymbol. <!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no">
<title>Sketch temporary geometries - 4.9</title>
<link rel="stylesheet" href="https://js.arcgis.com/4.9/esri/css/main.css">
<script src="https://js.arcgis.com/4.9/"></script>
<style>
html,
body,
#viewDiv {
padding: 0;
margin: 0;
height: 100%;
width: 100%;
font-family: verdana;
}
#topbar {
background: #fff;
position: absolute;
top: 15px;
right: 15px;
padding: 10px;
}
.action-button {
font-size: 16px;
background-color: transparent;
border: 1px solid #D3D3D3;
color: #6e6e6e;
height: 32px;
width: 32px;
text-align: center;
box-shadow: 0 0 1px rgba(0, 0, 0, 0.3);
}
.action-button:hover,
.action-button:focus {
background: #0079c1;
color: #e4e4e4;
}
.active {
background: #0079c1;
color: #e4e4e4;
}
</style>
<script>
require([
"esri/views/MapView",
"esri/Map",
"esri/widgets/Sketch/SketchViewModel",
"esri/Graphic",
"esri/layers/GraphicsLayer"
], function (
MapView, Map,
SketchViewModel, Graphic, GraphicsLayer
) {
let editGraphic;
// GraphicsLayer to hold graphics created via sketch view model
const graphicsLayer = new GraphicsLayer({
id: "tempGraphics"
});
const map = new Map({
basemap: "gray",
layers: [graphicsLayer]
});
const view = new MapView({
container: "viewDiv",
map: map,
zoom: 3
});
const pointSymbol = {
type: "simple-marker", // autocasts as new SimpleMarkerSymbol()
style: "square",
color: "#8A2BE2",
size: "16px",
outline: { // autocasts as new SimpleLineSymbol()
color: [255, 255, 255],
width: 3
}
};
const polylineSymbol = {
type: "simple-line", // autocasts as new SimpleLineSymbol()
color: "#8A2BE2",
width: "4",
style: "dash"
};
const polygonSymbol = {
type: "simple-fill", // autocasts as new SimpleFillSymbol()
color: "rgba(138,43,226, 0.8)",
style: "solid",
outline: {
color: "white",
width: 1
}
};
const textSymbol = {
type: "text", // autocasts as new TextSymbol()
color: "white",
haloColor: "black",
haloSize: "1px",
text: "",
xoffset: 3,
yoffset: 3,
font: { // autocast as new Font()
size: 12,
family: "sans-serif",
weight: "bold"
}
};
view.when(function () {
// create a new sketch view model
const sketchViewModel = new SketchViewModel({
view,
layer: graphicsLayer,
pointSymbol,
polylineSymbol,
polygonSymbol
});
setUpClickHandler();
// Listen to create-complete event to add a newly created graphic to view
sketchViewModel.on("create-complete", addGraphic);
// Listen the sketchViewModel's update-complete and update-cancel events
sketchViewModel.on("update-complete", updateGraphic);
sketchViewModel.on("update-cancel", updateGraphic);
// called when sketchViewModel's create-complete event is fired.
function addGraphic(event) {
// Create a new graphic and set its geometry to
// `create-complete` event geometry.
let graphicSymbol;
if (document.querySelector("button.active").id === "textButton") {
graphicSymbol = textSymbol;
graphicSymbol.text = prompt("Please enter some text", "Default Text");
} else {
graphicSymbol = sketchViewModel.graphic.symbol;
}
const graphic = new Graphic({
geometry: event.geometry,
symbol: graphicSymbol
});
graphicsLayer.add(graphic);
}
// Runs when sketchViewModel's update-complete or update-cancel
// events are fired.
function updateGraphic(event) {
// Create a new graphic and set its geometry event.geometry
var graphic = new Graphic({
geometry: event.geometry,
symbol: editGraphic.symbol
});
graphicsLayer.add(graphic);
// set the editGraphic to null update is complete or cancelled.
editGraphic = null;
}
// set up logic to handle geometry update and reflect the update on "graphicsLayer"
function setUpClickHandler() {
view.on("click", function (event) {
view.hitTest(event).then(function (response) {
var results = response.results;
if (results.length > 0) {
for (var i = 0; i < results.length; i++) {
// Check if we're already editing a graphic
if (!editGraphic && results[i].graphic.layer.id === "tempGraphics") {
// Save a reference to the graphic we intend to update
editGraphic = results[i].graphic;
// Remove the graphic from the GraphicsLayer
// Sketch will handle displaying the graphic while being updated
graphicsLayer.remove(editGraphic);
sketchViewModel.update(editGraphic);
break;
}
}
}
});
});
}
// activate the sketch to create a point
var drawPointButton = document.getElementById("pointButton");
drawPointButton.onclick = function () {
// set the sketch to create a point geometry
sketchViewModel.create("point");
setActiveButton(this);
};
// activate the sketch to create a polyline
var drawLineButton = document.getElementById("polylineButton");
drawLineButton.onclick = function () {
// set the sketch to create a polyline geometry
sketchViewModel.create("polyline");
setActiveButton(this);
};
// activate the sketch to create a polygon
var drawPolygonButton = document.getElementById("polygonButton");
drawPolygonButton.onclick = function () {
// set the sketch to create a polygon geometry
sketchViewModel.create("polygon");
setActiveButton(this);
};
// activate the sketch to create text
var drawRectangleButton = document.getElementById(
"textButton");
drawRectangleButton.onclick = function () {
// set the sketch to create a polygon geometry
sketchViewModel.create("point");
setActiveButton(this);
};
// reset button
document.getElementById("resetBtn").onclick = function () {
sketchViewModel.reset();
graphicsLayer.removeAll();
setActiveButton();
};
function setActiveButton(selectedButton) {
// focus the view to activate keyboard shortcuts for sketching
view.focus();
var elements = document.getElementsByClassName("active");
for (var i = 0; i < elements.length; i++) {
elements[i].classList.remove("active");
}
if (selectedButton) {
selectedButton.classList.add("active");
}
}
});
});
</script>
</head>
<body>
<div id="viewDiv">
<div id="topbar">
<button class="action-button esri-icon-blank-map-pin" id="pointButton"
type="button" title="Draw point"></button>
<button class="action-button esri-icon-polyline" id="polylineButton" type="button"
title="Draw polyline"></button>
<button class="action-button esri-icon-polygon" id="polygonButton" type="button"
title="Draw polygon"></button>
<button class="action-button esri-icon-comment" id="textButton"
type="button" title="Add Text"></button>
<button class="action-button esri-icon-trash" id="resetBtn" type="button"
title="Clear graphics"></button>
</div>
</div>
</body>
</html>
... View more
10-17-2018
11:07 AM
|
2
|
3
|
7296
|
|
POST
|
You should be able to create a TextSymbol graphic and add it to a GraphicsLayer. As for the interface to do so, you'd have to build that. Probably when they click on the text graphic button, you can get the text from an input element ahead of time or show a prompt(). Then create the graphic with the user's text and add it to the GraphicsLayer with some default styling.
... View more
10-16-2018
04:20 PM
|
0
|
5
|
7296
|
|
POST
|
Maybe iterate over the Map.allLayers and set layer.visible = false
... View more
10-16-2018
09:17 AM
|
2
|
0
|
3544
|
|
POST
|
What about Map.removeAll() It would be helpful to mention your specific needs and what solutions you've already tried.
... View more
10-15-2018
05:03 PM
|
1
|
2
|
3544
|
|
POST
|
Esri Support was able to replicate the issue and created BUG-000117336 : The "returnDistinctValues" parameter is ignored when querying a ArcGIS Server 10.6 service with "resultRecordCount" / "Return Count only" parameter. The development team will be reviewing the bug and will provide us further updates. The issue is not reproducible in the latest release of ArcGIS Server 10.6.1 and can be used as a workaround.
... View more
10-09-2018
01:09 PM
|
0
|
0
|
2500
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | a month ago | |
| 1 | 10-23-2025 03:53 PM | |
| 1 | 04-28-2026 07:25 AM | |
| 1 | 03-19-2026 08:59 AM | |
| 1 | 02-12-2026 01:37 PM |