POST
|
I was looking at https://developers.arcgis.com/javascript/latest/sample-code/sandbox/index.html?sample=intro-mapview and changing the basemap code to: var map = new Map({
basemap: "gray-vector"
});
... View more
04-11-2019
10:58 AM
|
0
|
1
|
407
|
POST
|
Is anyone else having issues with zooming into an area in 4.11? I tested the exact same app in 4.10 and 4.11 and I can only zoom in to the extent below. Previous was able to zoom until a house filled most of the screen. Have tried this with a few different apps so I don't think it's a code issue. Is this a known bug? It happens when you switch to a vector basemap in the Javascript samples as well.
... View more
04-11-2019
10:45 AM
|
0
|
4
|
620
|
POST
|
Thanks so much Robert, can't believe I didn't notice that! Everything is working now, appreciate the help.
... View more
03-29-2019
06:02 AM
|
0
|
0
|
328
|
POST
|
Any suggestions on why I can't edit a layer in 4.11? I used the basic code in the Editor widget sample, swapping out a layer from a published service. Below are the settings on ArcGIS server, seems like they should allow for editing. The map and layer loads but the editor widget does not display. Any idea why the Editor widget isn't showing up? <!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no">
<title>Edit test</title>
<link rel="stylesheet" href="https://js.arcgis.com/4.11/esri/css/main.css">
<link rel="stylesheet" href="css/mapstyle.css">
<script src="https://js.arcgis.com/4.11/"></script>
<script>
require([
"esri/Map",
"esri/views/MapView",
"esri/layers/FeatureLayer",
"esri/widgets/Editor",
"esri/widgets/Search",
"esri/widgets/Home",
], function(Map, MapView, FeatureLayer,Editor,Search,Home) {
var map = new Map({
basemap: "gray-vector"
});
var view = new MapView({
container: "viewDiv",
map: map,
center: [-78.491,38.036],
zoom: 12,
padding:{
top:30
}
});
var poleLyr = new FeatureLayer({
url: "SERVERURL/CVPoles/MapServer/0",
title: "Poles",
visible: true
})
map.add(poleLyr)
var editor = new Editor({
view: view
});
view.ui.add(editor,"top-left");
var home = new Home({
view: view
});
view.ui.add(home,"top-left");
//add search
var search = new Search({
view: view,
locationEnabled: false,
maxSuggestions: 4,
popupOpenOnSelect: false,
container: "searchDiv"
});
});
</script>
</head>
<body>
<div id="viewDiv"></div>
<div id="editorDiv"></div>
<div id="searchDiv"></div>
</body>
</html>
... View more
03-28-2019
09:09 PM
|
0
|
2
|
454
|
POST
|
I was able to replicate this error in an Esri sample: ArcGIS API for JavaScript Sandbox So i guess it must be a bug with the hitTest function.
... View more
03-23-2018
08:50 AM
|
0
|
0
|
592
|
POST
|
To add more context to this, it seems it's only happening when i'm near the left border of my map. Very strange.
... View more
03-23-2018
08:43 AM
|
0
|
0
|
592
|
POST
|
Getting a weird error every once in a while for a hitTest function (still using 4.4 to avoid another bug but it happens in 4.6 as well). EDIT: confirmed in Esri samples this a bug with the hitTest function. This seems to be fixed if i test in 4.7. view.then(() => {
view.whenLayerView(nbhdLyr).then(function(lview2){
watchUtils.whenFalse(lview2,"updating",function(){
view.on("pointer-move",eventHandler2);
function eventHandler2(event) {
view.hitTest(event).then(getGraphics2);
}
});
});
}); It then passes to a function that sends attributes to a popup function getGraphics2(response2) {
if (response2.results.length) {
var graphic = response2.results.filter(function(result2) {
return result2.graphic.layer === nbhdLyr;
})[0].graphic;
var attributes = graphic.attributes;
var nbdattr = attributes.NEIGHBOURHOOD;
var poattr = attributes.PREORDERS;
var cusattr = attributes.CUSTOMERS;
var intattr = attributes.INTERESTLEVEL;
var mrkattr = attributes.MARKETPEN;
var addrattr = attributes.PROPERTIES;
var pconvattr = attributes.POCONV;
document.getElementById("info").style.visibility = "visible";
document.getElementById("nbhd").innerHTML = nbdattr;
document.getElementById("preorders").innerHTML = " <b>" + poattr + "</b> preorders";
document.getElementById("customers").innerHTML = " <b>" + cusattr + "</b> customers";
document.getElementById("interest").innerHTML = " <b>" + intattr + "%</b> total interest";
document.getElementById("marketpen").innerHTML = " <b>" + mrkattr + "%</b> market penetration";
document.getElementById("address").innerHTML = " <b>" + addrattr + "</b> addresses";
document.getElementById("poconv").innerHTML = " <b>" + pconvattr + "%</b> preorders converted";
}
} This will sometimes give an error on the hitTest function, saying: Uncaught TypeError: Failed to execute 'elementFromPoint' on 'Document': The provided double value is non-finite. Image is also attached. I'm not sure what's causing this or how to get around it, anyone see this issue or have any thoughts?
... View more
03-22-2018
05:53 PM
|
0
|
2
|
957
|
POST
|
Hi, I'm having an issue with using the new da cursors in Arc 10.1. I have a basic script that uses selected features ("watpoints") and copies them to an abandoned layer (watabdev)
arcpy.MakeFeatureLayer_management(point,"watpoints")
with arcpy.da.InsertCursor(watabdev,("SUBTYPE","SHAPE@XY")) as cur:
with arcpy.da.SearchCursor("watpoints",["SHAPE@XY"]) as cursor:
for row in cursor:
cur.insertRow((1,row[0]))
del cur, row, cursor
I used with cursors and tried deleting the cursors afterwords. But after I run the tool, arcmap gives me an error that the abandoned layer is in a closed state and I cannot access it. Any suggestions? Thanks.
... View more
10-24-2013
01:06 PM
|
0
|
1
|
668
|
POST
|
Hi, I've noticed in the help files for creating application extensions, it is mentioned that tools/buttons can be enabled/disabled based on events such as starting and stopping editing. I have created an application extension with the OnStartEditing and OnStopEditing functions, but I'm not sure what code I would place in them in order to enable and disabled buttons. Any help would be appreciated. Jeremy
... View more
09-23-2013
10:36 AM
|
0
|
0
|
456
|
POST
|
It would the gp.select line. Since I set the workspace, it should select them and copy the features into the pgdb. I have tried gp.copyfeatures as well, and tried changing the output (ie. using the actual path to the pgdb, but I still can't get it to work) The script always fails at the select.
... View more
08-29-2012
09:08 AM
|
0
|
0
|
248
|
POST
|
Hi, I get the following error message: <class 'arcgisscripting.ExecuteError'>: ERROR 000210: Cannot create output WAT_ControlValve Failed to execute (Select) The same thing happens when I try using copy features. I'm trying to copy a selection from the SDE to a new personal geodatabase I created if there is a selection. I didn't include all the code but wtrue is a list of layers I want to check to copy over. I have checked and the script correctly creates the pgdb. Is this a projection issue or some other environment setting problem?
if extype == "Personal Geodatabase":
try:
gp.CreatePersonalGDB(outfolder,gdbname)
except:
pass
gp.WorkSpace = outfolder + os.sep + gdbname
gp.addmessage(gp.Workspace)
elif extype == "Shapefiles":
gp.Workspace = outfolder
for layer in wtrue:
gp.makefeaturelayer(layer,"layer")
selcount = int(gp.GetCount_management("layer").getoutput(0))
totcount = int(gp.GetCount_management(gp.describe("layer").catalogpath).getoutput(0))
if totcount <> selcount:
gp.addmessage(layer + " has " + str(selcount) + " features selected")
gp.select("layer",layer)
else:
gp.addmessage(layer + " has no selection")
... View more
08-29-2012
08:09 AM
|
0
|
3
|
420
|
POST
|
I was just curious if there is a way to get python scripts run out of Arctoolbox to skip the parameter input window for scripts which don't need input parameters. I have several scripts that run updates based on known layers, so they don't need any inputs or outputs. Any ideas? (besides going through VB/other programming language)
... View more
02-01-2012
05:43 AM
|
0
|
8
|
934
|
POST
|
I would use an upate cursor. Something like this might work cur = gp.UpdateCursor(insertnameoffeatureclass)
row = cur.Next()
while row:
if row.Field1 >= 100 and row.Field1 <= 200 and row.Field2 == 11:
row.Field3 = "red"
cur.UpdateRow(row)
row = cur.Next()
del cur, row
... View more
01-27-2012
09:28 AM
|
0
|
0
|
159
|
POST
|
Hi, I'm writing a python script that will automatically add records to an SDE data base from an excel table. I was wondering if there is a way to autopopulate the creation user field based on who is running the script. Basically, is there a way to determine what the username of the person logged into the computer is through python. Thanks, Jeremy
... View more
01-25-2012
06:29 AM
|
1
|
3
|
11321
|
POST
|
I might have a possible solution. For your second option, in the final calculate field, you need to add the layer in the field to copy. Lets say shape1 and shape2 are your shapefiles. gp.CalculateField(shape1,"shape1.field_to_update","[shape2.field_to_copy]","VB") This usually works for me. You might need to make both your shapefiles into layers.
... View more
01-06-2012
06:59 AM
|
0
|
0
|
414
|
Title | Kudos | Posted |
---|---|---|
1 | 01-25-2012 06:29 AM |
Online Status |
Offline
|
Date Last Visited |
08-03-2023
03:06 PM
|