|
POST
|
Looks like this GitHub repo might have what you need: GitHub - nickcam/FlareClusterLayer: ArcGIS javascript custom graphics layer. Creates clusters and creates flares for clu… supports both 3.x and 4.x
... View more
04-24-2017
05:25 AM
|
3
|
0
|
736
|
|
POST
|
Thanks for your reply Robert. Unfortunately the error is still being thrown. I added in some console logging and recorded this gif. (Notice it's critical that the mouse is in motion over the map as its loading) view.then(function() {
console.log('view ready');
layer.then(function() {
console.log('layer ready');
... Here's my current "solution": view.on('pointer-move', function(evt){
if (!view.updating && view.ready){ // if view is updating, an error is raised
try {
view.hitTest({x: evt.x, y: evt.y}).then(changeCursor);
} catch (err) {
console.log(err);
}
}
}); The if statement isn't really doing anything -- I was searching for the right properties to watch. The try and catch blocks keep the app responding to mouse events but it seems like there should be a better way.
... View more
04-10-2017
07:57 AM
|
1
|
1
|
2587
|
|
POST
|
I'm trying to change the cursor to a pointer in my application when features are hovered over. But I'm getting "TypeError: Cannot read property 'position' of undefined" when I mouseover the map before features load. Here's a sample I modified: JS Bin - Collaborative JavaScript Debugging If the mouse is moving over the map when the page is being loaded, the error is thrown. If not then it works fine. What's the best way to deal with this? Or is there a better way of changing the cursor to pointer when hovering over features?
... View more
04-06-2017
07:52 AM
|
0
|
4
|
4652
|
|
POST
|
Thanks for confirming Thomas. Looks like I'll have to go with the single point geometry and relate via a field as you suggest. Hopefully this is fixed/supported in the next release.
... View more
03-29-2017
04:14 AM
|
0
|
1
|
1236
|
|
POST
|
At 4.3, view.hitTest() method does not work on a esriGeometryMultipoint service. I set up a demo of the problem, but I couldn't find an ESRI sample service with multipoint geometry, so you'll have to supply your own. My test map service isn't public. Anyway, insert your multipoint geometry map service url and you will see that the cursor stays as the default when hovering over a multipoint feature but works correctly when hovering over a regular point. Or maybe I'm doing something wrong? Rene Rubalcava JS Bin - Collaborative JavaScript Debugging <!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no">
<meta name="description" content="[Get started with MapView - Create a 2D map - 4.3]">
<!--
ArcGIS API for JavaScript, https://js.arcgis.com
For more information about the get-started-mapview sample, read the original sample description at developers.arcgis.com.
https://developers.arcgis.com/javascript/latest/get-started-mapview/index.html
-->
<title>Get started with MapView - Create a 2D map - 4.3</title>
<style>
html,
body,
#viewDiv {
padding: 0;
margin: 0;
height: 100%;
width: 100%;
}
</style>
<link rel="stylesheet" href="https://js.arcgis.com/4.3/esri/css/main.css">
<script src="https://js.arcgis.com/4.3/"></script>
<script>
require([
"esri/Map",
"esri/views/MapView",
"esri/layers/FeatureLayer",
"dojo/domReady!"
], function(Map, MapView, FeatureLayer) {
var map = new Map({
basemap: "streets"
});
var view = new MapView({
container: "viewDiv",
map: map,
center: [-84.511, 39.092],
zoom: 15
});
var points = new FeatureLayer({
url: "https://sampleserver6.arcgisonline.com/arcgis/rest/services/Census/MapServer/0"
});
map.add(points);
//var multipoint = new FeatureLayer({
// url: "INSERT MULTIPOINT GEOMETRY SERVICE HERE /0"
//});
//map.add(multipoint);
view.on('pointer-move', function(evt){
view.hitTest({x: evt.x, y: evt.y}).then(changeCursor);
});
function changeCursor(response){
if (response.results.length > 0){
document.getElementById("viewDiv").style.cursor = "pointer";
} else {
document.getElementById("viewDiv").style.cursor = "default";
}
}
});
</script>
</head>
<body>
<div id="viewDiv"></div>
</body>
</html>
... View more
03-28-2017
09:18 AM
|
4
|
3
|
2614
|
|
POST
|
I'm looking for a way to automate the export of each page in a map series to a png or jpeg. This is possible with data driven pages in ArcMap - but doesn't appear to be possible in Pro (1.4). From the docs: " If you have a map series enabled and export to a format other than PDF (for example, JPG), you'll only generate a single page output file. If you want a JPG file for every page in the map series, you'll need to manually display and export each page." **Insert complaints and griping here** Any workarounds?
... View more
03-23-2017
09:20 AM
|
0
|
0
|
2519
|
|
POST
|
Thanks Robert, I got a sample up and running here: JS Bin - Collaborative JavaScript Debugging Note line 35 where you need to push the domain into corsEnabledServers. Won't work without that. You'll also need to point to the index of the layer you want in the layers array from the response (response.layers[0] in this case). <!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>FeatureLayer On Demand</title>
<link rel="stylesheet" href="https://js.arcgis.com/3.20/dijit/themes/claro/claro.css">
<link rel="stylesheet" href="https://js.arcgis.com/3.20/esri/css/esri.css">
<style>
html, body, #mapDiv {
padding:0;
margin:0;
height:100%;
}
</style>
<script src="https://js.arcgis.com/3.20/"></script>
<script>
var map;
require([
"esri/map", "esri/InfoTemplate", "esri/layers/FeatureLayer", "esri/request",
"dojo/parser", "dojo/domReady!"
], function(
Map, InfoTemplate, FeatureLayer, esriRequest,
parser
) {
parser.parse();
map = new Map("mapDiv", {
center: [-86, 38],
zoom: 8,
basemap: "gray"
});
esri.config.defaults.io.corsEnabledServers.push('kytc.maps.arcgis.com');
map.on("load", initOperationalLayer);
function initOperationalLayer() {
var url = 'http://kytc.maps.arcgis.com/sharing/rest/content/items/9a4710a21eac4a368464eb7bae8c3fb5/data';
var request = esriRequest({
url: url,
content: {f: 'json'},
handleAs: 'json'
}).then(function(response){
console.log(response.layers[0]);
var infoTemplate = new InfoTemplate("${subtype}", "${*}");
var featureLayer = new FeatureLayer(response.layers[0], {
infoTemplate: infoTemplate,
refreshInterval: 1
});
map.addLayer(featureLayer);
}, function(err){
console.log(err);
});
}
});
</script>
</head>
<body class="claro">
<div id="mapDiv">
</div>
</body>
</html>
... View more
03-22-2017
08:50 AM
|
0
|
2
|
2571
|
|
POST
|
What's the best/easiest way to add a feature layer from a portal item id in 3.x? I'd like to add data from someone else's AGOL/Portal item into my application. The data is public. Here's a 4.3 example of what I'm trying to do: https://jsbin.com/pigopevece/edit?html,output I believe the portal item (9a4710a21eac4a368464eb7bae8c3fb5) is a feature collection. Note that I don't need the symbology necessarily, just the data. I will specify my own symbols. Right now my thinking is to make a request to this data url (http://kytc.maps.arcgis.com/sharing/rest/content/items/9a4710a21eac4a368464eb7bae8c3fb5/data ), pull out the feature collection, and create the feature layer from that.
... View more
03-22-2017
07:49 AM
|
0
|
4
|
3895
|
|
POST
|
Setting a SimpleMarkerSymbol size does not work when using a path. To see this go to this sample: ArcGIS API for JavaScript Sandbox and change the citiesRenderer to: var citiesRenderer = new SimpleRenderer({
symbol: new SimpleMarkerSymbol({
size: "10pt",
style: 'path',
path: 'M2,32.578V91l29.719-29.774L61.437,91V32.578L31.719,3L2,32.578z',
color: "#FF4000",
outline: { // autocasts as new SimpleLineSymbol()
color: [255, 64, 0, 0.4], // autocasts as new Color()
width: 7
}
})
}); The symbol stays the same size no matter if you put size: 10, size:"100px", size: "2pt" etc. So is there any way to change the size of the path symbol? Thanks in advance
... View more
02-13-2017
08:54 AM
|
0
|
2
|
1594
|
|
POST
|
Try this: Customize the text if you want: // identiy manager sign in content
esri.bundle.identity.info = "Text Here. ${server} ${resource}"; // ${server} ${resource}" hidden via CSS Hide links: /* sign in dialog */
.serverLink{
display: none;
}
.resLink{
display: none;
}
... View more
02-13-2017
08:43 AM
|
2
|
4
|
2448
|
|
POST
|
I found the problem, in Catalog, the connection to the versioned data was using the default version as the transactional version to automatically connect to. To change this, you need to change the geodatabase connection properties to point to the version you wish to edit by default. It's a little confusing and odd that the default behavior is to edit the parent version of the version you are connected to but whatever. Its working now. I still think the above script should execute without having to edit any geodatabase connection properties. Also see this: BUG-000101529 : The 'Make Feature Layer' geoprocessing tool fails when 64-bit Background Geoprocessing is utilized with ArcGIS 10.4.1. when using a sde database connection. Potentially fixed at 10.5.
... View more
12-19-2016
06:10 AM
|
0
|
0
|
1557
|
|
POST
|
Still having issues 3 years later at 10.4.1. I'm trying to use an update cursor on an sde versioned database. Here's a test script: streetCLInput = r'Database Connections\brandon_edits.sde\oki.sde.StreetCL'
workspace = r'Database Connections\brandon_edits.sde'
import arcpy
arcpy.MakeFeatureLayer_management(streetCLInput, 'streets')
arcpy.ChangeVersion_management("streets", "TRANSACTIONAL", "brandon_edits.brandon")
edit = arcpy.da.Editor(workspace)
edit.startEditing(False, True)
edit.startOperation()
with arcpy.da.UpdateCursor('streets', ['objectid','suffix'], 'objectid = 11040') as cursor:
for row in cursor:
row[1] = ''
cursor.updateRow(row)
edit.stopOperation()
edit.stopEditing(True)
print('Script Complete') The script crashes at line 10, but its because of line 5. Comment out line 5 and the script works, except the edits are made to the default version. Here's another script basically copied and pasted from here : http://pro.arcgis.com/en/pro-app/arcpy/data-access/editor.htm with edits to change the version. import arcpy
fc = r'Database Connections\brandon_edits.sde\oki.sde.StreetCL'
workspace = r'Database Connections\brandon_edits.sde'
arcpy.MakeFeatureLayer_management(fc, 'streets')
#arcpy.ChangeVersion_management("streets", "TRANSACTIONAL", "brandon_edits.brandon")
# Start an edit session. Must provide the workspace.
edit = arcpy.da.Editor(workspace)
# Edit session is started without an undo/redo stack for versioned data
# (for second argument, use False for unversioned data)
edit.startEditing(True, True)
# Start an edit operation
edit.startOperation()
# Insert a row into the table.
with arcpy.da.InsertCursor("streets", ('name')) as icur:
icur.insertRow(['New Test'])
# Stop the edit operation.
edit.stopOperation()
# Stop the edit session and save the changes
edit.stopEditing(True) The script "works" with line 5 commented out except again the edits are made to the default version. With line 5 uncommented, the script fails. So how do you edit an sde versioned dataset with arcpy and not edit the default version? Any help would be much appreciated. (I'm starting to think the versioning is more hassle than its worth.)
... View more
12-15-2016
01:57 PM
|
0
|
1
|
1557
|
|
POST
|
To set transparency for an individual layer, I had to enable support for dynamic layer on the map service in ArcGIS Server, set the image format to PNG32 for the dynamic layer --> layer.setImageFormat('png32');
... View more
07-19-2016
07:38 AM
|
0
|
0
|
1311
|
|
POST
|
To set transparency for an individual layer, I had to enable support for dynamic layer on the map service in ArcGIS Server, set the image format to PNG32 for the dynamic layer --> layer.setImageFormat('png32'); There should be an easier way... The problem with Jake Skinner's answer is that it will cause 2 requests to the map service every time the user pans, zooms, etc. If you have 24 layers with 24 different transparencies, this can quickly overwhelm a service.
... View more
07-19-2016
07:33 AM
|
0
|
0
|
1164
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 04-10-2017 07:57 AM | |
| 1 | 05-27-2015 05:50 AM | |
| 1 | 05-12-2017 07:38 AM | |
| 1 | 02-15-2018 09:17 AM | |
| 1 | 03-27-2019 12:06 PM |
| Online Status |
Offline
|
| Date Last Visited |
11-11-2020
02:24 AM
|