POST
|
Unfortunately, they can be points,lines and/or polygons. That sounds like a good approach. I'm going to see if that's doable
... View more
10-04-2013
12:50 PM
|
0
|
0
|
373
|
POST
|
I thought about that but was hoping to avoid paging through multiple features that represented a single record. I really want to be able to show the attributes and all of the associated features at one time. This way the user would see the business data in the popup and the features for that record would be highlighted on the map.
... View more
10-04-2013
12:22 PM
|
0
|
0
|
373
|
POST
|
I'm looking to extend Popup to handle my custom results. The results are not in the format expected by the Popup so the Popup will error out when I try to use them. I've been playing around a little bit with this and can get fairly close except there are a lot of methods on popup that still error out. It is very difficult for me to just overwrite these methods because I like the functionality of the Popup which is why I want to extend it. This was supposed to save me a lot of time by not having to write my own, but it doesn't look that way now. Anyway, the main idea is for the new Popup to behave exactly as the original, only it can accept a different type of results for .setFeatures(). I could pull all of the functionality I need out and just use .show() and .setContent() but I really like the paging controls, etc and so was hoping to use those. My results are actually an array of objects from a database query. Each record has a "features" property that contains the features associated with it. I do it this way because one record can have multiple features and I want to step through the records, not the features. Anyone have any ideas or suggestions? Here's an example of what my results look like:
[
{id:1,
field1:"somevalue",
field2:"somevalue2",
...,
features:[
{id:1,geometry:{}},
{id:2,geometry:{}}
]
}
]
... View more
10-04-2013
09:06 AM
|
0
|
4
|
1095
|
POST
|
Has anyone tried to use a newer version of dgrid with the JS API? I need an event that isn't available until v 0.3.5 that tells me when the dgrid has refreshed. For now, I'm working around the issue with aspect.after on the "_updateNavigation" property which is a little ugly. Also, is there a particular reason that the JS API includes such an old version of the dgrid? Something I should look out for?
... View more
09-30-2013
04:27 PM
|
0
|
2
|
656
|
POST
|
Try this:
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Select</title>
<link rel="stylesheet" type="text/css" href="http://js.arcgis.com/3.7/js/dojo/dojo/resources/dojo.css" />
<link rel="stylesheet" href="http://js.arcgis.com/3.7/js/dojo/dijit/themes/claro/claro.css">
<link rel="stylesheet" href="http://js.arcgis.com/3.7/js/esri/css/esri.css">
<link rel="stylesheet" type="text/css" href="http://js.arcgis.com/3.7/js/dojo/dijit/themes/claro/document.css" />
<style>
html, body, .dijitBorderContainer {
width: 100%;
height: 100%;
margin: 0;
overflow:hidden;
}
</style>
</head>
<body class="claro">
<select id="distSelect" data-dojo-type="dijit/form/FilteringSelect"
data-dojo-props="title:'Find schools in selected district',maxHeight:200, size: 30, labelAttr:'label', searchAttr:'label',autoComplete:false,queryExpr:'*${0}*',placeHolder:'Pick a District'">
</select>
</body>
<script type="text/javascript">
var dojoConfig = {
async: true,
parseOnLoad:true
};
</script>
<script src="http://js.arcgis.com/3.7/"></script>
<script type="text/javascript">
require(["dojo/_base/declare", "dojo/ready", "dijit/registry", "dijit/form/Button", "dijit/form/FilteringSelect", "dojo/store/Memory"],
function (declare, ready, registry, Button, FilteringSelect, Memory) {
//fire when dojo is "ready"
ready(function () {
//create a distric list
var districtList = [
{ label: "District One", value: "Dist 1" },
{ label: "District Two", value: "Dist 2" },
{ label: "District Three", value: "Dist 3" },
{ label: "District Four", value: "Dist 4" }
];
//add a button
var button = new Button({ label: "Populate Select",
onClick: function () {
//get the filteringselect
var select = registry.byId("distSelect");
//set the select's store using the districtlist
select.set("store", new Memory({ data: districtList, idProperty: "value" }));
}
});
button.placeAt(document.body);
});
});
</script>
</html>
... View more
09-27-2013
01:28 PM
|
0
|
0
|
419
|
POST
|
Are labelAttr and searchAttr defined for your select? They should be set to "label" if they are not.
... View more
09-27-2013
12:29 PM
|
0
|
0
|
419
|
POST
|
you need to set idProperty on your Store. new Memory({data:districtList, idProperty:"DIST_CODE"})
... View more
09-27-2013
11:29 AM
|
0
|
0
|
840
|
POST
|
Populate your FilteringSelect with a dojo/store/Memory store. Something like:
new FilteringSelect({ placeHolder: "Sort Results",
value: null,
placeHolder: "Select a Value",
store: new Memory({ data: results.featureSet.features, idProperty: "DIST_CODE" }),
labelAttr: "DIST_NAME",
searchAttr: "DIST_NAME"
});
... View more
09-27-2013
10:40 AM
|
0
|
0
|
840
|
POST
|
I had a similar problem that I've found a workaround for. Still not sure of the root cause. In my case, I had to construct the graphic using the feature, not feature.geometry. Before I did that, I had to set the spatialReference on the feature.geometry. I also had to set the symbol after I constructed the Graphic. Anyway, here's how I'm doing it for now:
arrayUtil.forEach(features, function (f) {
//_highlightLayer.add(f);
var symbol;
if (f.geometry.type === "point" || f.geometry.type === "multipoint") {
symbol = config.highlightSymbols.markerSymbol;
} else if (f.geometry.type === "line" || f.geometry.type === "polyline") {
symbol = config.highlightSymbols.lineSymbol;
}
else {
symbol = config.highlightSymbols.fillSymbol;
}
f.geometry.spatialReference = map.spatialReference;
var g = new Graphic(f, symbol);
g.setSymbol(symbol);
_highlightLayer.add(g);
});
... View more
09-27-2013
09:36 AM
|
0
|
0
|
352
|
POST
|
Here's what I ended up writing. It could use some cleanup, but seems to work well. using System; using System.Collections.Generic; using System.Linq; using System.Web; using Microsoft.SqlServer.Types; using Newtonsoft.Json; namespace api.AGS { public abstract class Geometry { [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] public SpatialReference spatialReference { get; set; } //add methods to convert the geometry to/from WKT abstract public string ToWKT(); } public class Point : Geometry { public double x { get; set; } public double y { get; set; } [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] public double? z { get; set; } [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] public double? m { get; set; } override public string ToWKT() { return "POINT(" + this.x.ToString() + " " + this.y.ToString() + ")"; } } public abstract class MultiplePointGeometry : Geometry { [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] public bool? hasZ { get; set; } [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] public bool? hasM { get; set; } } public class Multipoint : MultiplePointGeometry { public List<List<double>> points { get; set; } public override string ToWKT() { string WKT = "MULTIPOINT("; for (int i = 0; i < this.points.Count; i++) { for (int j = 0; j < this.points.Count; j++) { WKT += this.points .ToString(); if (j < this.points.Count - 1) { WKT += " "; } } if (i < this.points.Count - 1) { WKT += ","; } } WKT += ")"; return WKT; } } public class Polyline : MultiplePointGeometry { public List<List<List<double>>> paths { get; set; } public override string ToWKT() { string points = ""; for (int i = 0; i < this.paths.Count; i++) { points += "("; for (int j = 0; j < this.paths.Count; j++) { for (int k = 0; k < this.paths .Count; k++) { points += this.paths .ToString(); if (k < this.paths .Count - 1) { points += " "; } } if (j < this.paths.Count - 1) { points += ","; } } points += ")"; if (i < this.paths.Count - 1) { points += ","; } } if (this.paths.Count > 1) { return "MULTILINESTRING" + points; } else { return "LINESTRING" + points; } } } public class Polygon : MultiplePointGeometry { public List<List<List<double>>> rings { get; set; } public override string ToWKT() { string ringpts = ""; for (int i = 0; i < this.rings.Count; i++) { ringpts += "("; for (int j = 0; j < this.rings.Count; j++) { for (int k = 0; k < this.rings .Count; k++) { ringpts += this.rings .ToString(); if (k < this.rings .Count - 1) { ringpts += " "; } } if (j < this.rings.Count - 1) { ringpts += ","; } } ringpts += ")"; if (i < this.rings.Count - 1) { ringpts += ","; } } if (this.rings.Count > 1) { return "MULTIPOLYGON" + ringpts; } else { return "POLYGON" + ringpts; } } } public class Envelope : Geometry { public double xmin { get; set; } public double ymin { get; set; } public double xmax { get; set; } public double ymax { get; set; } [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] public double? zmin { get; set; } [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] public double? zmax { get; set; } [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] public double? mmin { get; set; } [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] public double? mmax { get; set; } override public string ToWKT() { return "POLYGON((" + this.xmin.ToString() + " " + this.ymin.ToString() + "," + this.xmin.ToString() + " " + this.ymax.ToString() + "," + this.xmax.ToString() + " " + this.ymax.ToString() + "," + this.xmax.ToString() + " " + this.ymin.ToString() + "," + this.xmin.ToString() + " " + this.ymin.ToString() + "))"; } } public static class GeometryTypes { public const String Point = "esriGeometryPoint"; public const String MultiPoint = "esriGeometryMultipoint"; public const String Polyline = "esriGeometryPolyline"; public const String Polygon = "esriGeometryPolygon"; public const String Envelope = "esriGeometryEnvelope"; } }
... View more
08-29-2013
02:05 PM
|
0
|
0
|
2726
|
POST
|
I just noticed that the JS API does not include dijit/Fieldset. This is just an extension of TitlePane, so for now, I'll get the source from dojo and declare it in my own module. Hopefully this is just an oversight and will be corrected at 3.7
... View more
08-21-2013
11:34 AM
|
0
|
2
|
749
|
POST
|
Anyone have a converter in .NET to go from ArcGIS Geometry JSON to WKT Geometry? I need to use query geometry from a javascript application in SQL.
... View more
08-09-2013
12:38 PM
|
0
|
2
|
11666
|
POST
|
I didn't have the issues you are describing. My issues started with the "site" not being able to update certain services. The log files said that the service version could not be changed from 2 to 5. Once I got rid of those errors, "Create Site" would work correctly but that's when Publishing Tools wouldn't start. I was not able to determine the exact cause for that and did not see any difference in the config files. My best guess is that it had something do with residual settings/files from the prior version. I'd try the upgrade if I were you. Maybe you'll get lucky and it will work. If not, then I definitely suggest uninstalling and then deleting or moving the existing folders before trying a fresh install.
... View more
08-07-2013
02:50 PM
|
0
|
0
|
699
|
Title | Kudos | Posted |
---|---|---|
1 | 07-11-2012 02:08 PM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|