|
POST
|
Michelle, this might answer your question. https://community.esri.com/thread/42674
... View more
10-10-2014
12:44 PM
|
0
|
0
|
2676
|
|
POST
|
Michael, this is what jake posted earlier, maybe this will help: Edit fiddle - JSFiddle Tim
... View more
10-10-2014
11:07 AM
|
0
|
7
|
2239
|
|
POST
|
Thanks Steven! Ken's suggestions answered my question.
... View more
10-09-2014
12:32 PM
|
0
|
0
|
1637
|
|
POST
|
Thanks Ken, can't believe I missed that, especially since I already have listeners in my app! Tim
... View more
10-09-2014
12:27 PM
|
0
|
0
|
1637
|
|
POST
|
Hey everybody, In my drawing app, I want to add the possibility of buffering a point. I got it to work, but I have one issue. When I run it the first time everything goes ok. User checks the buffer checkbox, types in a buffer distance, selects the point button, clicks on the map and the buffer gets added to the map. When I run it a 2nd time, it looks like it works again like it is supposed to, but this time two identical buffer get added. When I do it a third time 3 identical buffers get added and so on. It seems that geometryService.on("buffer-complete") runs as often as I used the buffer before. Here is the code snipped that is responsible for adding the buffer:
function addToMap(evt) {
Uni();
if ( evt === undefined){
console.log("undefined");
} else {
toolbar.deactivate();
var Testcolor = cp.value;
if (Testcolor == ""){
newColor = newColor;
} else {
docolor();
}
switch (evt.geometry.type) {
case "point":
case "multipoint":
symbol = new SimpleMarkerSymbol(SimpleMarkerSymbol.STYLE_CIRCLE, myNumber,
new SimpleLineSymbol(SimpleLineSymbol.STYLE_SOLID,
new Color(newColor), 1),
new Color(newColor));
break;
case "polyline":
symbol = new SimpleLineSymbol(SimpleLineSymbol.STYLE_SOLID, new Color(newColor), myNumber)
break;
default:
symbol = new SimpleFillSymbol(symbolfill, new SimpleLineSymbol(SimpleLineSymbol.STYLE_SOLID,
new Color(newColor), myNumber), new Color(newColor));
break;
}
graphic = new Graphic(evt.geometry, symbol);
if (dijit.byId("BufferCheckBox").checked && evt.geometry.type == "point" ){
params = new BufferParameters();
params.geometries = [ evt.geometry ];
params.distances = [ dom.byId('BufferText').value ];
params.geodesic = true;
params.bufferSpatialReference = new SpatialReference({wkid: 102100});
params.outSpatialReference = map.spatialReference;
params.unit = Unit_Line;
geometryService.buffer(params);
geometryService.on("buffer-complete", function(evt) {
var Buffsymbol = new SimpleFillSymbol("none", new SimpleLineSymbol(SimpleLineSymbol.STYLE_SOLID, new Color(newColor), 2), new Color(newColor));
Buffgraphic = new Graphic(evt.geometries[0], Buffsymbol);
map.graphics.add(Buffgraphic);
var operation2 = new CustomOperation.Add({
graphicsLayer: map.graphics,
addedGraphic: Buffgraphic
});
undoManager.add(operation2);
});
}
Any help is appreciated! Thanks Tim
... View more
10-09-2014
12:06 PM
|
0
|
4
|
2142
|
|
POST
|
Raluca, are you able to share a link to that service? Or show the code that you are using? Because it should show the symbology you used unless you specify it in your code to use different symbology . Tim
... View more
10-09-2014
08:16 AM
|
0
|
1
|
1754
|
|
POST
|
Riyas, you are just too fast with your answers!!! Tim
... View more
10-08-2014
07:09 AM
|
0
|
2
|
2523
|
|
POST
|
Hab, your issue lies here:
function showselResults(results) {
var featureLayer1Message = results[0].length;
var featureLayer2Message = results[1].length;
var featureLayer3Message = results[2].length;
var count = 0;
for (var i = 0; i < results.length; i++) {
count = count + results.length;
}
dom.byId("messages").innerHTML = "Total features selected: <b>" + count + "</b><br> FeatureLayer1: <b>" + featureLayer1Message + "</b><br> FeatureLayer2: <b>" + featureLayer2Message + "</b><br> FeatureLayer3: " + featureLayer3Message;
}
Your results keep the previous selections. That is also why the count for each feature layer in future selections is wrong, because it will keep showing the count of your first selection. Looking at my screenshot, there should only be 3 arrays, but there are 9 because I did 3 selections.
... View more
10-08-2014
07:08 AM
|
0
|
0
|
2523
|
|
POST
|
Its always a good idea to trim fat. The less the client has to load the quicker loading times will be. It is also a good idea to remove unnecessary vertices. Maybe look into the simplify tools ArcGIS Desktop
... View more
10-08-2014
05:29 AM
|
0
|
0
|
1001
|
|
POST
|
You could do a spatial join with your neighborhood layer and your address point layer. ArcGIS Desktop
... View more
10-07-2014
11:43 AM
|
0
|
1
|
788
|
|
POST
|
Lucas, if you have a hosted route task, you can do something like this: Find routes with barriers and multiple stops | ArcGIS API for JavaScript Instead of the user clicking to points on the map, you can just feed it your points. As you can see in the screenshot, the route result will include drive length/time. Hope this helps! Tim
... View more
10-07-2014
11:31 AM
|
1
|
1
|
3520
|
|
POST
|
var lengths = geodesicUtils.geodesicLengths([singlePathPolyline], Units.KILOMETERS); console.log(lengths); This should have returned the total length of your line. Did it not work? I think I might have a hard time understanding what you actually want to show.
... View more
10-07-2014
10:28 AM
|
0
|
1
|
3520
|
|
POST
|
Lucas, Is it supposed to give you a route between the markers, like driving directions? If so, you might want to look into this directions-amd | API Reference | ArcGIS API for JavaScript Tim
... View more
10-07-2014
10:16 AM
|
0
|
3
|
3520
|
|
POST
|
You could also use the edit toolbar to move a graphic, this might be easier. edit-amd | API Reference | ArcGIS API for JavaScript
... View more
10-06-2014
11:01 AM
|
2
|
3
|
3199
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 07-06-2015 06:58 AM | |
| 1 | 05-04-2016 07:27 AM | |
| 1 | 07-06-2017 08:12 AM | |
| 1 | 10-26-2015 11:51 AM | |
| 1 | 12-12-2014 12:05 PM |
| Online Status |
Offline
|
| Date Last Visited |
11-11-2020
02:23 AM
|