|
POST
|
Yes, I saw that too, but I also found this Legend | API Reference | ArcGIS API for JavaScript 3.33 where feature layer is also listed. I got the legend to work, I just have to figure out how to only show for 1 layer. I know there is a way, but if all else fails I will just set the unwanted legend div to display:none! 🙂
... View more
09-04-2020
01:22 PM
|
0
|
4
|
1448
|
|
POST
|
is there a property I can set so that only the desired layer will show up?
... View more
09-04-2020
01:07 PM
|
0
|
6
|
2698
|
|
POST
|
Robert, never mind, now both of the operational layers are showing, so that's progress!
... View more
09-04-2020
01:06 PM
|
0
|
7
|
2698
|
|
POST
|
I removed the layerInfos property and the legend still does not show. There is another property called 'layers', however, which now shows an array with 3 layers. 1 is the basemap, 1 is the bathymetry layer that I wish to show in the legend, and the other is a contours layer that I do NOT wish to show in the legend.
... View more
09-04-2020
01:04 PM
|
0
|
8
|
2698
|
|
POST
|
I wish I was getting an error, at least that would give me a direction. All I can see at this point is that if I look under the legend domNode, I should be seeing 2 childnodes, one for the main legend and one for the message, but I only see the message element. That seems to mean that the legend isn't being created (at least the main node), or it isn't creating the node which doesn't make sense. I am wandering if for some reason it can't see the renderer correctly and therefore defaults to the 'No Legend' message. I know it's not a timing issue because I just called the create legend function from within a setTimeout function and set the time until well after the graphics fully loaded, but still no legend.
... View more
09-04-2020
12:37 PM
|
0
|
10
|
2698
|
|
POST
|
Robert, I changed it to this.map and still doesn't load. I redefined this.map to just 'map' because this.map is sometimes undefined depending on scope. Having said that, both seem to be defined correctly so that doesn't seem to be the issue. This one has me stumped. The only thing I can think of is that something is wrong with the layer, but the layer loads and is visible in the map and I don't see anything in the layer properties that would raise any flags.
... View more
09-04-2020
12:12 PM
|
0
|
12
|
2698
|
|
POST
|
I have done this before without issue, but for some reason I cannot get my legend to show up in a div element I created in a widget panel. I have looked a all of the esri documentation to try and figure out what's wrong and cannot find anything, so I need some help to figure out what I am missing. I have a custom widget and I just want to show the bathymetry symbols in a legend for a bathymetry layer. Here is my code: const bathLayer = new FeatureLayer(bathyUrl, {
id: "Lakes Bathymetry",
infoTemplate: depthInfo,
outFields: ["*"]
});
this.map.addLayer(bathLayer);
this.own(bathLayer.on('load', lang.hitch(this, function(evt) {
this._createLegend(bathLayer);
map.setExtent(window.initExt);
loading.style.display = "none";
})));
_createLegend: function(layer) {
var legendParams = {
arrangement: 0,
autoUpdate: true,
map: map,
layerInfos: {
layer: layer,
title: "Lakes Bathymetry"
}
};
var legend = new Legend(legendParams, this.legendDiv);
console.log("legend', legend); ///only 1 childNode, no legend node
legend.startup();
},
<div id="legend-div" data-dojo-attach-point="legendDiv" style="margin-top:5px; display:block; height:250px; width:100%;"></div> I thought maybe it was a css issue, but I made sure the div element is set to display: block with height and width set, so that's not the issue. For some reason the legend isn't loading. I should be seeing two child nodes after logging out the legend, but I am only seeing the 'legend-div_msg' node. The only thing I can think of is that it is a timing/async issue, but I was under the impression that the legend used the layer render to set the legend symbols and if that's the case, the renderer exists since it is being access from the url and so the legend should have access to the symbols. Everything seems to be in order here: I have a feeling I am missing something very obvious, just can't seem to see it. Thanks!!
... View more
09-04-2020
11:23 AM
|
0
|
14
|
4248
|
|
POST
|
I see that you are now able to label the point clusters in JS API 4.x. Will this also be made available for JS API 3.x, and if not is there a way to do this? Thank you!
... View more
08-14-2020
08:24 AM
|
0
|
0
|
810
|
|
POST
|
Scott, I think the issue occurred because I had started the project in arcmap and transitioned to arcpro. I was trying to save the edits in the same gdb. I reopened the project in arcmap and all of the features I created/edited in arcpro showed up, so I didn't loose anything. Next time I need to be sure to use arcpro project gdb and I think that will prevent any compatibility issues.
... View more
08-13-2020
10:24 AM
|
1
|
1
|
1343
|
|
POST
|
Extremely frustrating error message when trying to create a new feature. I first created a new polygon feature class (in a local file gdb), then created a new feature by digitizing a polygon. Pretty simple. When I try and save I get an error. The only solution I have been able to find is to create a new geodatabase and try again. Am I missing something? I have had this issue before, but I still don't know why it is happening and if it is a bug in ArcPro. Thanks for your suggestions.
... View more
08-13-2020
08:14 AM
|
0
|
3
|
1392
|
|
POST
|
I am having a weird issue with the mouse pointer not being able to find the map graphic. I thought at first it was my event code, but I know that is not the case. I noticed that when using Google dev tools to inspect the graphic, the mouse pointer couldn't find a lot of them. Interestingly, some graphics seem to be 'hoverable' and some don't. Here some pics to illustrate: Sorry, print screen won't show the point, but I am hovering the pointer directly over the graphic. My code works as expected here, and I get a popup dialog. In this screen capture, the pointer is hovering directly over the graphic west of Okaloosa but I am unable to isolate the graphic. This is the case for most of the graphics in the layer. Some more background, this is a WAB developer app that was created and exported to our local server. I created another test application using the exact same feature layer, and identical configuration and I don't have this issue! I am using the local layer widget, and connecting the the layer through ArcGIS REST, then adding a custom renderer to the local layer config. The configs for both apps are identical, so I don't think the renderer can be the issue. Also, I tried just rendering the graphics as is from the REST service and am getting the same results, so I am fairly certain the renderer is not the issue. Here is the javascript I am using for the event: let woLayer = this.map.getLayer("Nuisance Wildlife Operator Info");
console.log("nwo layer ", woLayer);
this.map.on("load", function() {
console.log("map loaded");
this.map.graphics.enableMouseEvents();
})
let dialog = new Dialog ({
id: "operator popup",
style: "position: absolute; width: 250px; font: normal normal normal 10pt Helvetica;z-index:100"
});
dialog.startup();
var highlightSymbol = new SimpleFillSymbol(
SimpleFillSymbol.STYLE_SOLID,
new SimpleLineSymbol(
SimpleLineSymbol.STYLE_SOLID,
new Color([255,0,0]), 3
),
new Color([125,125,125,0.35])
);
console.log("highlight symbol ", highlightSymbol);
let map = this.map;
this.own(on(woLayer, "mouse-over", function(evt) {
console.log("mouseover event", evt.graphic);
var highlightGraphic = new Graphic(evt.graphic.geometry,highlightSymbol);
console.log("highlight graphic ", highlightGraphic);
map.graphics.add(highlightGraphic);
console.log("map graphics ", map.graphics);
dialog.setContent("this is a test");
Popup.open({
popup: dialog,
x: evt.pageX,
y: evt.pageY
});
/*
setTimeout(function() {
Popup.close(dialog);
}, 1000);
*/
}));
/*
woLayer.on("mouse-out", function(evt) {
Popup.close(dialog);
console.log("mouse out event", evt);
}); Like I said, the code appears to be working so I don't know if this is a browser issue (I am using Chrome), but the same issue appears in Firefox as well. I am using the same script in another app and it is working just fine. If anyone has had a similar issue and found a fix, please let me know. I think it is probably something to do with the graphics, but I don't know what to look for. Thanks!
... View more
07-31-2020
08:27 AM
|
0
|
0
|
718
|
|
POST
|
I have been trying to figure out how the Attribute table widget gets the data for populating the table. I have a simple app showing a layer pulled into the map using an ajax call to appery.io API, then displayed in the map using the following code: var layerDefinition = {
"geometryType": "esriGeometryPoint",
"fields": fielddefs
//"maxScale": 72223.819286
}
var QueryGraphics = [];
for(var i = 0; i < FormattedResults.data.length; i++) {
var attr = FormattedResults.data;
//Build Graphic
var graphicComp = new esri.geometry.Point(attr["lng"], attr["lat"], new esri.SpatialReference({ wkid: 4326 }))//4326 GCS_WGS_1984
var symbol = new esri.symbol.SimpleMarkerSymbol(esri.symbol.SimpleMarkerSymbol.STYLE_CIRCLE, 10,
new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID,
new dojo.Color([255,255,255]), 1), new dojo.Color([255,0,0]));
var template = new esri.InfoTemplate();
if(window.appInfo.isRunInMobile) {
template.setTitle("Gopher Tortoise Sighting");
} else {
template.setTitle(false);
}
template.setContent(
this.getWindowContent
);
var pointGraphic = new esri.Graphic(graphicComp, symbol, attr, template)
//console.log("photographer: ", pointGraphic.attributes.name)
QueryGraphics.push(pointGraphic);
}
window.featureSet = QueryGraphics;
var QueryfeatureSet = new esri.tasks.FeatureSet();
QueryfeatureSet.features = QueryGraphics;
QueryfeatureSet.geometryType = "esriGeometryPoint";
QueryfeatureSet.spatialReference = new esri.SpatialReference({ wkid: 4326 });
//console.log("query featureset ", QueryfeatureSet);
var featureCollection = {
layerDefinition: layerDefinition,
featureSet: QueryfeatureSet
};
var gtLayer = new esri.layers.FeatureLayer(featureCollection, {
id: "GopherTortoiseQuery",
opacity: 0.6,
infoTemplate: template,
outFields: ["*"]
});
gtLayer.name = "GopherTortoiseQuery";
//console.log("search result ", gtLayer);
//Add Map Render
renderer = new esri.renderer.SimpleRenderer(symbol);
gtLayer.setRenderer(renderer);
gtLayer.capabilities = "Map,Query,Data";
//Add Layer to Map
this._CleanUpGopherTortoise();
this.map.addLayer(gtLayer);
let map = this.map;
gtLayer.on("load", function() {
let gtExt = graphicsUtils.graphicsExtent(gtLayer["_graphicsVal"]);
//console.log("gt layer extent ", gtExt);
gtLayer.initialExtent = gtExt;
gtLayer.fullExtent = gtExt;
map.setExtent(gtExt, true);
//console.log("gopher tortoise layer ", gtLayer);
}) The problem is the Attribute table won't populate. It partially loads and doesn't throw any errors: Also, the div isn't fully loading (the tab is missing) which suggests to me the code is hanging up some place, I just haven't been able to figure out where. When logging the config infos, the url is missing because I am not pulling in the layer from ArcGIS REST, so could that be the issue? If so how can I get the data to load from graphics layer and not from the url? I have been trying to find the correct function that I need to revise to do this, but have been unable to do so. I know the issue has to do with the layer or the url, because I set up a test app with point data referenced from ArcGIS REST and compared the two apps and cannot find any differences in any of the log statements, other than the missing url and the fact that the data is missing from the domNode (innerText) I can provide additional info if needed and thanks ahead for any suggestions. Basically If I know which function I need to be in, I can figure it out!
... View more
04-28-2020
07:00 AM
|
0
|
1
|
802
|
|
POST
|
Yes you are right, that would probably be the best solution as long as the person adding is proficient in GIS. Not sure that will always be the case, but I can add that to my recommendations.
... View more
03-30-2020
08:42 AM
|
0
|
0
|
5064
|
|
POST
|
I never thought of using the search bar, that would work great for adding a few points, thanks!. If they need to add a lot of points, then I think the best solution is the one I am using now, a combination of the 'Add Data' widget and the "Edit" widget.
... View more
03-30-2020
08:40 AM
|
0
|
1
|
5064
|
|
POST
|
I meant not possible to import gps locations (coords) and append to existing layers. The best solution I can find is to use the Add Data widget to import a csv file containing the coordinates and display on the map. I can then using the Edit widget to add new features to the existing layer by placing the new points directly on top of the points added from the csv file. I just surprised this can't be done with one widget. The python solution could potentially work. Theoretically I could see maybe creating a script tool that the biologists could use to add the data, so it's good to know that the option is available to me, just isn't something I have time to do right now.
... View more
03-30-2020
08:33 AM
|
0
|
0
|
5064
|
| Title | Kudos | Posted |
|---|---|---|
| 9 | 10-28-2025 10:15 AM | |
| 2 | 10-14-2025 06:36 AM | |
| 1 | 09-16-2022 09:31 AM | |
| 1 | 06-13-2024 05:45 AM | |
| 1 | 06-26-2025 06:28 AM |
| Online Status |
Offline
|
| Date Last Visited |
12-22-2025
05:46 AM
|