POST
|
try the intersect method of the geometry task. we don't have any sample applications which call this method, but it would probably be helpful to check out our other geometry service samples here. Thanks that's what I was looking for. Didn't show up on a search. Had to push all of my features into a geometry array for the input: if (identifyResults.length > 0) {
var geometryStack = [];
for (var k = 0; k < identifyResults.length; k++) {
geometryStack.push(identifyResults .feature.geometry);
}
var geoService = new esri.tasks.GeometryService("http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer");
geoService.intersect(geometryStack, geometry, onCompleteFunc, onErrorFunc);
... View more
11-27-2012
07:54 AM
|
0
|
0
|
659
|
POST
|
Hello, I am looking to work out the lengths of polyline (road) intersections on a polygon (user selection). It looks like something the Intersect tool would be perfect for, but I cannot find it for javascript. Is this feature present for the javascript API? If not is there any plans to add it? Can it be emulated using code already in the API, or will I have to write my own? Thanks Tim
... View more
11-27-2012
06:41 AM
|
0
|
4
|
4759
|
POST
|
i think this is do to javascript being asynchronous. centerat fires (but does not complete), so when setlevel fires the map center is still the old one. centerat then completes, and then setlevel does. So the final command is setlevel using the original center. Hence it looks like centerat never fired have you tried the centerAndZoom method? http://help.arcgis.com/EN/webapi/javascript/arcgis/help/jsapi/map.htm#centerAndZoom I am using a dynamic service in this instance, so zooming by a factor is not what I want. Thank you for the help in this though, I don't need any more assistance now that I realise I just had to swap my commands around.
... View more
10-29-2012
03:49 AM
|
0
|
0
|
695
|
POST
|
Hello Hopefully this is an easy question: Are there any events besides OnDrawEnd? More specifically, I am looking to provide immediate feedback on clicking of points as the user starts to create a shape or polyline (eg length of last segment, current area, etc). Is this possible? Thanks.
... View more
10-26-2012
01:26 AM
|
0
|
0
|
439
|
POST
|
Using that code on that page seems to work, something must be wrong with my mapping setup I suppose. I swapped to using self.map.spacialReference instead of creating a new one, but this has not helped. However, I tried carrying out similar commands in the console, and for some reason it works: var coordinates = prompt("Enter coordinates: ", "502982,221818").split(","); var mapControl = Symology.MapMgr.getControl('984604c6-0bd2-4ba5-a990-aa9d6675d1ed'); mapControl.map.centerAt(new esri.geometry.Point(coordinates[0], coordinates[1], mapControl.map.spatialReference)); I was a bit suspicious, so I removed the line that setLevel(10), and now my original code works. Swaping around the commands, so setLevel THEN centerAt, seems to work. However my original, centerAt THEN setLevel seems to override the centerAt command. Thanks for your help!
... View more
10-26-2012
12:59 AM
|
1
|
0
|
695
|
POST
|
The x and y properties of the object passed to the point constructor need to be numbers. Try converting to numbers with parseInt:
var point = new esri.geometry.Point({ "x": parseInt(coordinates[0]), "y": parseInt(coordinates[1]), " spatialReference": { " wkid": 27700} });
This did not resolve the issue, and I'm not sure why it would since its a JSON object. Just to be sure, I changed to standard parameters and this did not work either:
var point = new esri.geometry.Point(parseInt(coordinates[0]), parseInt(coordinates[1]), new esri.SpatialReference({ wkid: 27700 }));
... View more
10-25-2012
08:12 AM
|
0
|
0
|
695
|
POST
|
Hello all, I signed up to ask this question: Does CenterAt work? And if so, what am I doing wrong? I've created a simple function to move to some coordinates: this.goto = function () { var coordinates = prompt("Enter coordinates: ", "502982,221818").split(","); if (coordinates.length != 2) { return; } var point = new esri.geometry.Point({ "x": coordinates[0], "y": coordinates[1], " spatialReference": { " wkid": 27700} }); self.map.centerAt(point); self.map.setLevel(10); } However, only the setLevel seems to happen. I am never centered to the new results. Any help would be appreciated! Thanks.
... View more
10-25-2012
03:33 AM
|
1
|
6
|
3382
|
Title | Kudos | Posted |
---|---|---|
1 | 10-26-2012 12:59 AM | |
1 | 10-25-2012 03:33 AM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:24 AM
|