POST
|
I have received no errors whatsoever. Here is my require and function (its in a custom widget): define([
"dojo/_base/declare", "dojo/dom", "dojo/dom-construct", "dojo/on", "dojo/parser", "dojo/date/stamp",
"esri/lang", "esri/layers/FeatureLayer", "esri/layers/CSVLayer", "esri/layers/GraphicsLayer", "esri/graphic", "esri/Color",
"esri/symbols/SimpleMarkerSymbol", "esri/renderers/ClassBreaksRenderer", "esri/dijit/Search", "esri/tasks/query",
"dijit/popup", "dijit/layout/ContentPane", "dijit/form/Form", "dijit/form/Button", "dijit/form/TextBox", "dijit/form/NumberTextBox", "dijit/form/DateTextBox", "dijit/form/Select",
"dijit/_WidgetBase", "dijit/_TemplatedMixin", "dojo/text!./HonorsForm.html", "dojo/domReady!"
], function(declare, dom, domConstruct, on, parser, Stamp, esriLang, FeatureLayer, CSVLayer, GraphicsLayer, Graphic, Color, SimpleMarkerSymbol, ClassBreaksRenderer, Search, Query, popup,
ContentPane, Form, Button, TextBox, NumberTextBox, DateTextBox, Select,
_WidgetBase, _TemplatedMixin, template){
... View more
07-23-2015
06:07 AM
|
0
|
0
|
316
|
POST
|
I am having unexpected trouble getting my map to display a graphics layer created in the program. It displays a feature layer correctly, and I don't understand why it won't display with graphics layer. I've done extensive console logging: the "layer-add-result" event fires without error and the object contains the correct layer. However, the map object has the same layers and graphics before and after the layer addition (only default layer). There is no change to the map object, but no error either. The graphics layer has the correct features (obtained from a feature set from a query, if that matters). Here's a little of my code (cityArray is an array of arrays, where each sub array has all features in the same city): var cityDisplay = new GraphicsLayer();
for(var idx = 0; idx < cityArray.length; idx++){
var g = new Graphic(cityArray[idx][0].geometry, null, {numOfEvents: cityArray[idx].length, Events: cityArray[idx]});
cityDisplay.add(g);
}
var symbol = new SimpleMarkerSymbol();
symbol.setColor(new Color([150, 150, 150, 0.5]));
var renderer = new ClassBreaksRenderer(symbol, "numOfEvents");
renderer.addBreak(0, 3, new SimpleMarkerSymbol().setColor(new Color([56, 168, 0, 0.5])));
renderer.addBreak(3, 25, new SimpleMarkerSymbol().setColor(new Color([139, 209, 0, 0.5])));
renderer.addBreak(25, 50, new SimpleMarkerSymbol().setColor(new Color([255, 255, 0, 0.5])));
renderer.addBreak(50, 100, new SimpleMarkerSymbol().setColor(new Color([255, 128, 0, 0.5])));
renderer.addBreak(100, Infinity, new SimpleMarkerSymbol().setColor(new Color([255, 0, 0, 0.5])));
cityDisplay.setRenderer(renderer);
map.on("layer-add-result", function(err){
console.log(err);
});
map.addLayer(cityDisplay);
... View more
07-23-2015
05:50 AM
|
0
|
2
|
2212
|
POST
|
Sorry in advance if this is the wrong place to put this, but I'm experiencing problems with the web app builder and I'm not sure where else to post. I've been following the instructions: node js is already on my computer, I downloaded the files, and I have not touched anything. However, attempting to run server.js in node gives this error: throw err; ^ Error: Tried loading "jimu/shared/basePortalUrlUtils" at ../client/stemapp/jimu.js/shared/basePortalUrlUtils.js then tried node's require("jimu/shared/basePortalUrlUtils") and it failed with error: Error: Cannot find module 'jimu/shared/basePortalUrlUtils' I went to the directory in question and the file is there. Thanks for any help.
... View more
06-10-2015
11:30 AM
|
0
|
2
|
2922
|
POST
|
Sorry if I wasn't specific enough, I'm actually looking for a way to use data from the outfields in conditional statements like this: southCarolinaCounties.on("mouse-over", function(evt){
var capitol;
if (${NAME} == "Richland"){
capitol = "Contains capitol";
}
var t = "<b>${NAME}</b><hr><b>2000 Population: </b>${POP2000:NumberFormat}<br>"
+ "<b>2000 Population per Sq. Mi.: </b>${POP00_SQMI:NumberFormat}<br>"
+ "<b>2007 Population: </b>${POP2007:NumberFormat}<br>"
+ "<b>2007 Population per Sq. Mi.: </b>${POP07_SQMI:NumberFormat}<br>"
+ capitol;
var content = esriLang.substitute(evt.graphic.attributes,t);
var highlightGraphic = new Graphic(evt.graphic.geometry,highlightSymbol);
map.graphics.add(highlightGraphic);
dialog.setContent(content);
domStyle.set(dialog.domNode, "opacity", 0.85);
dijitPopup.open({
popup: dialog,
x: evt.pageX,
y: evt.pageY
});
}); However using the syntax ${NAME} crashes the map. What can I use to determine the name of the county that ${NAME} displays in the popup?
... View more
06-05-2015
08:20 AM
|
0
|
1
|
408
|
POST
|
I have been altering this code to learn some basics about FeatureLayers. I want to add a functionality where upon hovering over a certain county, the pop-up displays additional information, however I'm not sure how to access the results of the query. The code the tutorial uses to display the results of the query looks like this: var t = "<b>${NAME}</b><hr><b>" but when I use if (${NAME} == "example"){
//add information
} the viewer won't load. How can I get the information from the out-fields for each county and utilize it in the code?
... View more
06-05-2015
07:52 AM
|
0
|
3
|
3452
|
POST
|
I'm very new to both ArcGIS and vbscript, so any help is appreciated. I'm working on a label making script, and I really want to make helper functions to help process the logic involved. Can I write more functions inside the expression parser? If the parser won't accept multiple functions, is there a way to store these functions in another location and access them in my script?
... View more
05-28-2015
05:47 AM
|
0
|
2
|
5392
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:24 AM
|